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
return path;
}
- /** {@inheritDoc} */
@Override
public void execute() throws BuildException {
if (src == null) {
this.force = force;
}
- /** {@inheritDoc} */
@Override
public void execute() throws BuildException {
CheckoutCommand checkout;
this.branch = branch;
}
- /** {@inheritDoc} */
@Override
public void execute() throws BuildException {
log("Cloning repository " + uri);
this.bare = bare;
}
- /** {@inheritDoc} */
@Override
public void execute() throws BuildException {
if (bare) {
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
* 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 {
private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
Collections.<String, Object> emptyMap());
}
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
return applyFormatOptions(out, o);
}
- /** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
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();
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
Collections.<String, Object> emptyMap());
}
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
return tarFormat.createArchiveOutputStream(out, o);
}
- /** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
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();
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
Collections.<String, Object> emptyMap());
}
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
return tarFormat.createArchiveOutputStream(out, o);
}
- /** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
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();
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
Collections.<String, Object> emptyMap());
}
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
return tarFormat.createArchiveOutputStream(out, o);
}
- /** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
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();
private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
Collections.<String, Object> emptyMap());
}
- /** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
return applyFormatOptions(out, o);
}
- /** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
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();
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
* @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
*/
* @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,
/**
* 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
* 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,
* 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 "<keygrip>.key". While
- * this storage organization is an implementation detail of GPG, the way
+ * file under ~/.gnupg/private-keys-v1.d/ with a name "<keygrip>.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.
*/
*
* @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,
*
* @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,
* 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 {
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
* Sets the buffer from which to take the request body
*
* @param buffer
+ * the buffer
*/
public void setBuffer(TemporaryBuffer buffer) {
this.entity = new TemporaryBufferEntity(buffer);
* Constructor for HttpClientConnection.
*
* @param urlStr
+ * url string
* @throws MalformedURLException
+ * if url is malformed
*/
public HttpClientConnection(String urlStr) throws MalformedURLException {
this(urlStr, null);
* Constructor for HttpClientConnection.
*
* @param urlStr
+ * url string
* @param proxy
+ * proxy
* @throws MalformedURLException
+ * if url is malformed
*/
public HttpClientConnection(String urlStr, Proxy proxy)
throws MalformedURLException {
* 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 {
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();
}
}
- /** {@inheritDoc} */
@Override
public Map<String, List<String>> getHeaderFields() {
Map<String, List<String>> ret = new HashMap<>();
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;
}
}
- /** {@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();
return null;
}
- /** {@inheritDoc} */
@Override
public InputStream getInputStream() throws IOException {
execute();
}
// will return only the first field
- /** {@inheritDoc} */
@Override
public String getHeaderField(@NonNull String name) {
Header header = resp.getFirstHeader(name);
.stream().map(Header::getValue).collect(Collectors.toList()));
}
- /** {@inheritDoc} */
@Override
public int getContentLength() {
Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$
}
}
- /** {@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)
entity.setContentLength(contentLength);
}
- /** {@inheritDoc} */
@Override
public OutputStream getOutputStream() throws IOException {
if (entity == null)
return entity.getBuffer();
}
- /** {@inheritDoc} */
@Override
public void setChunkedStreamingMode(int chunklen) {
if (entity == null)
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 {
* content stored in the specified buffer
*
* @param buffer
+ * the buffer
*/
public TemporaryBufferEntity(TemporaryBuffer buffer) {
this.buffer = buffer;
return buffer;
}
- /** {@inheritDoc} */
@Override
public boolean isRepeatable() {
return true;
}
- /** {@inheritDoc} */
@Override
public long getContentLength() {
if (contentLength != null)
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;
* Set the <code>contentLength</code>
*
* @param contentLength
+ * content length
*/
public void setContentLength(int contentLength) {
this.contentLength = Integer.valueOf(contentLength);
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
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 {
throw new IllegalStateException(HttpServerText.get().alreadyInitializedByContainer);
}
- /** {@inheritDoc} */
@Override
public void init(FilterConfig filterConfig) throws ServletException {
super.init(filterConfig);
}
}
- /** {@inheritDoc} */
@Override
protected ServletBinder register(ServletBinder binder) {
if (resolver == null)
gitFilter.addReceivePackFilter(filter);
}
- /** {@inheritDoc} */
@Override
public void init(ServletConfig config) throws ServletException {
gitFilter.init(new FilterConfig() {
class InfoPacksServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
- /** {@inheritDoc} */
@Override
public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
class InfoRefsServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
- /** {@inheritDoc} */
@Override
public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
* 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 {
/** 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 {
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 {
* @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;
* See {@link ReceivePack#receiveWithExceptionPropagation}.
*
* @throws ServiceMayNotContinueException
+ * if transport service cannot continue
* @throws IOException
+ * if an IO error occurred
*/
void receive() throws ServiceMayNotContinueException, IOException;
}
this.handler = handler;
}
- /** {@inheritDoc} */
@Override
public void doPost(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
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)
this.compressStream = compressStream;
}
- /** {@inheritDoc} */
@Override
protected OutputStream overflow() throws IOException {
startedOutput = true;
return out;
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
super.close();
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 {
* @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,
* @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)
this.fileName = name;
}
- /** {@inheritDoc} */
@Override
public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
}
return SC_INTERNAL_SERVER_ERROR;
}
+
/**
* @param req
* The HTTP request
* @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;
* See {@link UploadPack#uploadWithExceptionPropagation}.
*
* @throws ServiceMayNotContinueException
+ * transport service cannot continue
* @throws IOException
+ * if an IO error occurred
*/
void upload() throws ServiceMayNotContinueException, IOException;
}
: this::defaultUploadPackHandler;
}
- /** {@inheritDoc} */
@Override
public void doPost(HttpServletRequest req, HttpServletResponse rsp)
throws IOException {
this.status = status;
}
- /** {@inheritDoc} */
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse rsp)
throws ServletException, IOException {
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) {
};
}
- /** {@inheritDoc} */
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
return filter.serveRegex(expression);
}
- /** {@inheritDoc} */
@Override
public void init(ServletConfig config) throws ServletException {
String name = filter.getClass().getName();
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 {
this.context = context;
}
- /** {@inheritDoc} */
@Override
public String getInitParameter(String name) {
return null;
}
- /** {@inheritDoc} */
@Override
public Enumeration<String> getInitParameterNames() {
return new Enumeration<>() {
};
}
- /** {@inheritDoc} */
@Override
public ServletContext getServletContext() {
return context;
}
- /** {@inheritDoc} */
@Override
public String getFilterName() {
return filterName;
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)
}
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "Pipeline[regex: " + pattern + " ]";
this.filters = new ArrayList<>();
}
- /** {@inheritDoc} */
@Override
public ServletBinder through(Filter filter) {
if (filter == null)
return this;
}
- /** {@inheritDoc} */
@Override
public void with(HttpServlet servlet) {
if (servlet == null)
super.service(new WrappedRequest(req, newPath, newInfo), rsp);
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "Pipeline[ *" + suffix + " ]";
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;
}
}
- /** {@inheritDoc} */
@Override
public ReceivePack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException {
}
}
- /** {@inheritDoc} */
@Override
public UploadPack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException {
failing = false;
}
- /** {@inheritDoc} */
@Override
public RefDatabase getRefDatabase() {
return refs;
private class RefsUnreadableRefDatabase extends MemRefDatabase {
- /** {@inheritDoc} */
@Override
public Ref exactRef(String name) throws IOException {
if (failing) {
return super.exactRef(name);
}
- /** {@inheritDoc} */
@Override
public Map<String, Ref> getRefs(String prefix) throws IOException {
if (failing) {
return super.getRefs(prefix);
}
- /** {@inheritDoc} */
@Override
public List<Ref> getRefsByPrefix(String prefix) throws IOException {
if (failing) {
return super.getRefsByPrefix(prefix);
}
- /** {@inheritDoc} */
@Override
public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes)
throws IOException {
return super.getRefsByPrefixWithExclusions(include, excludes);
}
- /** {@inheritDoc} */
@Override
public Set<Ref> getTipsWithSha1(ObjectId id) throws IOException {
if (failing) {
this.repoName = repoName;
}
- /** {@inheritDoc} */
@Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException, ServiceNotEnabledException {
return responseHeaders != null ? responseHeaders.get(name) : null;
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder b = new StringBuilder();
* Configure basic authentication.
*
* @param ctx
+ * servlet context handler
* @param methods
+ * the methods
* @return servlet context handler
*/
public ServletContextHandler authBasic(ServletContextHandler ctx,
/** 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();
*
* @return the TestRepository
* @throws IOException
+ * if an IO error occurred
*/
protected TestRepository<Repository> createTestRepository()
throws IOException {
* 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);
* 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 {
* Get requests.
*
* @param base
+ * base URI
* @param path
+ * the request path relative to {@code base}
*
* @return list of events
*/
* Get requests.
*
* @param path
+ * request path
*
* @return list of events
*/
* 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 {
* Mirror refs
*
* @param refs
+ * the refs
* @return set of RefSpecs
*/
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 {
* 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) {
* Join a base URIish and a path
*
* @param base
+ * base URI
* @param path
* a relative path
* @return the joined 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,
* 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 {
* 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();
};
}
- /** {@inheritDoc} */
@Override
public String getServletName() {
return "MOCK_SERVLET";
}
- /** {@inheritDoc} */
@Override
public ServletContext getServletContext() {
return null;
* Constructor for <code>RecordingLogger</code>.
*
* @param name
+ * logger name
*/
public RecordingLogger(String name) {
this.name = name;
* Constructor for <code>SimpleHttpServer</code>.
*
* @param repository
+ * the repository
*/
public SimpleHttpServer(Repository repository) {
this(repository, false);
* 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;
* Start the server
*
* @throws Exception
+ * if an error occurred
*/
public void start() throws Exception {
ServletContextHandler sBasic = server.authBasic(smart("/sbasic"));
* Stop the server.
*
* @throws Exception
+ * if an error occurred
*/
public void stop() throws Exception {
server.tearDown();
}
}
- /** {@inheritDoc} */
@Override
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
* @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)
* @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,
* @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();
* Stops the test server.
*
* @throws IOException
+ * if an IO error occurred
*/
public void stop() throws IOException {
executorService.shutdownNow();
* 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 {
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
* Get test resource file.
*
* @param fileName
+ * file name
* @return the test resource file
*/
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 {
* 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 {
* 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,
* 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 {
* Check if file exists
*
* @param db
+ * the repository
* @param name
* name of the file
* @return {@code true} if the file exists
* 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 {
* 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,
* Setup test
*
* @throws Exception
+ * if an error occurred
*/
@Before
public void setUp() throws Exception {
* Tear down the test
*
* @throws Exception
+ * if an error occurred
*/
@After
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 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<>();
* 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);
* 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();
*
* @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);
* 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);
* 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;
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 () -> {
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
public @interface Repeat {
/**
* Number of repetitions
+ *
+ * @return number of repetitions
*/
public abstract int n();
}
}
- /** {@inheritDoc} */
@Override
public Statement apply(Statement statement, Description description) {
Statement result = statement;
* 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 {
* 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 {
* 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)
* 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)
* 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);
* @param name
* file name
* @throws IOException
+ * if an IO error occurred
*/
protected void deleteTrashFile(String name) throws IOException {
JGitTestUtil.deleteTrashFile(db, name);
* 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 {
/** Working directory of {@link #db}. */
protected File trash;
- /** {@inheritDoc} */
@Override
@Before
public void setUp() 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);
}
* 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 {
* @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)
* 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 {
*
* @return list of refs
* @throws IOException
+ * if an IO error occurred
*/
public List<Ref> getRefs() throws IOException {
return db.getRefDatabase().getRefs();
* 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));
* 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)
* 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) {
* Create <code>DirCacheEntry</code>
*
* @param path
+ * file path
* @param mode
+ * file mode
* @return the DirCacheEntry
*/
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,
* 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,
* Create <code>DirCacheEntry</code>
*
* @param path
+ * file path
* @param objectId
+ * of the entry
* @return the DirCacheEntry
*/
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 {
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;
* @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());
* @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());
* 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)
* 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));
* binary file content.
* @return the new, fully parsed blob.
* @throws Exception
+ * if an error occurred
*/
public RevBlob blob(byte[] content) throws Exception {
ObjectId id;
* 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 {
* 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 {
* 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();
* 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 {
* 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 {
* 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);
* 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 {
* 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 {
* 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 {
* 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,
* 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();
* 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());
*
* @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);
* 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());
* 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);
* 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 {
* @param id
* ID of detached head.
* @throws Exception
+ * if an error occurred
* @see #reset(String)
*/
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;
* @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);
* Update the dumb client server info files.
*
* @throws Exception
+ * if an error occurred
*/
public void updateServerInfo() throws Exception {
if (db instanceof FileRepository) {
* parsing of.
* @return {@code object}
* @throws Exception
+ * if an error occurred
*/
public <T extends RevObject> T parseBody(T object) throws Exception {
pool.parseBody(object);
* 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))
* 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 {
* not removed.
*
* @throws Exception
+ * if an error occurred
*/
public void packAndPrune() throws Exception {
if (db.getObjectDatabase() instanceof ObjectDirectory) {
* 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());
* 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);
/**
* Delete this branch.
+ *
* @throws Exception
+ * if an error occurred
* @since 4.4
*/
public void delete() throws Exception {
* parent commit
* @return this commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder parent(RevCommit p) throws Exception {
if (parents.isEmpty()) {
* 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));
* blob for this file
* @return this commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder add(String path, RevBlob id)
throws Exception {
*
* @return child commit builder
* @throws Exception
+ * if an error occurred
*/
public CommitBuilder child() throws Exception {
return new CommitBuilder(this);
now += unit.toMillis(add);
}
- /** {@inheritDoc} */
@Override
public ProposedTimestamp propose() {
long t = now++;
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
* @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;
}
}
}
- /** {@inheritDoc} */
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
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;
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);
}
/**
+ * Get URL of content server
+ *
* @return the url of the content server
* @since 4.11
*/
}
/**
+ * Set the URL of the content server
+ *
* @param url
* the url of the content server
* @since 4.11
private ByteBuffer buffer = ByteBuffer.allocateDirect(8192);
/**
- * <p>Constructor for ObjectDownloadListener.</p>
+ * <p>
+ * Constructor for ObjectDownloadListener.
+ * </p>
*
* @param repository
* the repository storing large objects
* @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,
* @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,
}
}
- /** {@inheritDoc} */
@Override
public void onAllDataRead() throws IOException {
close();
* Close resources held by this listener
*
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected void close() throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
public void onError(Throwable e) {
try {
this.s3Config = config;
}
- /** {@inheritDoc} */
@Override
public Response.Action getDownloadAction(AnyLongObjectId oid) {
URL endpointUrl = getObjectUrl(oid);
return a;
}
- /** {@inheritDoc} */
@Override
public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
cacheObjectMetaData(oid, 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);
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
this.aOut = new AtomicObjectOutputStream(tmpFile.toAbsolutePath());
}
- /** {@inheritDoc} */
@Override
public int run() throws IOException {
try {
* @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)
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$
* 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,
return downloadedPaths;
}
- /** {@inheritDoc} */
@Override
public int run() throws IOException {
try {
* @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 {
* @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);
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();
*
* @return the delegate {@link Config}
* @throws IOException
+ * if an IO error occurred
*/
private Config getDelegate() throws IOException {
if (delegate == null) {
* @return The loaded lfs config
*
* @throws IOException
+ * if an IO error occurred
*/
private Config load() throws IOException {
Config result = null;
*
* @return the config, or <code>null</code>
* @throws IOException
+ * if an IO error occurred
*/
@Nullable
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()
*
* @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 {
* 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,
* @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 {
* 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;
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) {
return new String(b, 0, nibbles);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return abbr.prefixCompare(this) == 0;
}
- /** {@inheritDoc} */
@Override
public final int hashCode() {
return (int) (w1 >> 32);
return other != null ? equals(this, other) : false;
}
- /** {@inheritDoc} */
@Override
public final boolean equals(Object o) {
if (o instanceof AnyLongObjectId) {
dst[o--] = '0';
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return pointer;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walk) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
}
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return false;
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return new LfsPointerFilter();
w4 = src.w4;
}
- /** {@inheritDoc} */
@Override
public LongObjectId toObjectId() {
return this;
}
}
- /** {@inheritDoc} */
@Override
public LongObjectId toObjectId() {
return new LongObjectId(this);
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
private final Console cons = System.console();
- /** {@inheritDoc} */
@Override
protected PasswordAuthentication promptPasswordAuthentication() {
final String realm = formatRealm();
private final Console cons = System.console();
- /** {@inheritDoc} */
@Override
public boolean isInteractive() {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean supports(CredentialItem... items) {
for (CredentialItem i : items) {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
@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)) {
@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());
@Option(name = "--output", aliases = { "-o" }, metaVar = "metaVar_file", usage = "usage_archiveOutput")
private String output;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (tree == null)
/** 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) {
private int maxNameLength;
- /** {@inheritDoc} */
@Override
protected void run() {
try {
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (createBranch) {
@Option(name = "--dryRun", aliases = { "-n" })
private boolean dryRun = false;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
@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)
}
}
- /** {@inheritDoc} */
@Override
public void initializedSubmodules(Collection<String> submodules) {
try {
}
}
- /** {@inheritDoc} */
@Override
public void cloningSubmodule(String path) {
try {
}
}
- /** {@inheritDoc} */
@Override
public void checkingOut(AnyObjectId commit, String path) {
try {
return r;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
@Argument(metaVar = "metaVar_commitPaths", usage = "usage_CommitPaths")
private List<String> paths = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
@Option(name = "--file", aliases = { "-f" }, metaVar = "metaVar_file", usage = "usage_configFile")
private File configFile;
- /** {@inheritDoc} */
@Override
protected void run() {
if (!list) {
"-r" }, usage = "usage_convertRefStorageRefLogs")
private boolean writeLogs = true;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
((FileRepository) db).convertRefStorage(format, writeLogs, backup);
@Argument(required = true, metaVar = "metaVar_directory", usage = "usage_directoriesToExport")
List<File> directory = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
PackConfig packConfig = new PackConfig();
@Option(name = "--abbrev", usage = "usage_Abbrev")
private Integer abbrev;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
// END -- Options shared with Log
- /** {@inheritDoc} */
@Override
protected void init(Repository repository, String gitDir) {
super.init(repository, gitDir);
diffFmt = new DiffFormatter(new BufferedOutputStream(outs));
}
- /** {@inheritDoc} */
@Override
protected void run() {
diffFmt.setRepository(db);
@Option(name = "--", metaVar = "metaVar_path", handler = PathTreeFilterHandler.class)
private TreeFilter pathFilter = TreeFilter.ALL;
- /** {@inheritDoc} */
@Override
protected void run() {
try (TreeWalk walk = new TreeWalk(db)) {
@Argument(index = 1, metaVar = "metaVar_refspec")
private List<RefSpec> toget;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
}
}
- /** {@inheritDoc} */
@Override
public void fetchingSubmodule(String name) {
try {
@Option(name = "--prune-preserved", usage = "usage_PrunePreserved")
private Boolean prunePreserved;
- /** {@inheritDoc} */
@Override
protected void run() {
Git git = Git.wrap(db);
frame.getContentPane().add(world);
}
- /** {@inheritDoc} */
@Override
protected int walkLoop() throws Exception {
graphPane.getCommitList().source(walk);
return graphPane.getCommitList().size();
}
- /** {@inheritDoc} */
@Override
protected void show(RevCommit c) throws Exception {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
protected RevWalk createWalk() {
if (objects)
@Option(name = "--index-version", usage = "usage_indexFileFormatToCreate")
private int indexVersion = -1;
- /** {@inheritDoc} */
@Override
protected void run() {
BufferedInputStream in = new BufferedInputStream(ins);
@Argument(index = 0, metaVar = "metaVar_directory")
private String directory;
- /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() {
InitCommand command = Git.init();
dateFormatter = new GitDateFormatter(Format.DEFAULT);
}
- /** {@inheritDoc} */
@Override
protected void init(Repository repository, String gitDir) {
super.init(repository, gitDir);
diffFmt = new DiffFormatter(new BufferedOutputStream(outs));
}
- /** {@inheritDoc} */
@Override
protected void run() {
config = new GpgConfig(db.getConfig());
NoteMap.read(argWalk.getObjectReader(), notesCommit));
}
- /** {@inheritDoc} */
@Override
protected void show(RevCommit c) throws Exception {
outw.print(CLIText.get().commitLabel);
}
/**
+ * Show notes for given commit
+ *
* @param c
+ * given commit
* @return <code>true</code> if at least one note was printed,
* <code>false</code> otherwise
* @throws IOException
+ * if an IO error occurred
*/
private boolean showNotes(RevCommit c) throws IOException {
if (noteMaps == null)
/**
* @param c
+ * given commit
* @param map
+ * note map
* @param label
+ * label
* @param emptyLine
+ * whether to start with an empty line
* @return <code>true</code> if note was printed, <code>false</code>
* otherwise
* @throws IOException
+ * if an IO error occurred
*/
private boolean showNotes(RevCommit c, NoteMap map, String label,
boolean emptyLine)
@Argument(index = 0, metaVar = "metaVar_uriish", required = true)
private String remote;
- /** {@inheritDoc} */
@Override
protected void run() {
LsRemoteCommand command = Git.lsRemoteRepository().setRemote(remote)
}
}
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
@Option(name = "--", metaVar = "metaVar_paths", handler = StopOptionHandler.class)
private List<String> paths = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() {
try (TreeWalk walk = new TreeWalk(db)) {
* @param argv
* arguments.
* @throws java.lang.Exception
+ * if an error occurred
*/
public static void main(String[] argv) throws Exception {
// make sure built-in filters are registered
* @param argv
* arguments.
* @throws java.lang.Exception
+ * if an error occurred
*/
protected void run(String[] argv) throws Exception {
writer = createErrorWriter();
/**
* @param status
+ * exit status code, nonzero value indicates an error
* @param t
* can be {@code null}
* @throws Exception
+ * if an IO error occurred
*/
void exit(int status, Exception t) throws Exception {
writer.flush();
}
}
- /** {@inheritDoc} */
@Override
protected void run() {
if (squash && ff == FastForwardMode.NO_FF) {
@Argument(index = 1, metaVar = "metaVar_commitish", required = true)
private List<RevCommit> commits = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() {
try {
private boolean shownURI;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
@Argument(index = 0, required = true, metaVar = "metaVar_directory", usage = "usage_RepositoryToReceiveInto")
File dstGitdir;
- /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() {
final org.eclipse.jgit.transport.ReceivePack rp;
@Argument(metaVar = "metaVar_ref")
private String ref;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
@Argument(index = 2, metaVar = "metaVar_uriish")
private String uri;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
}
}
- /** {@inheritDoc} */
@Override
public void printUsage(String message, CmdLineParser clp)
throws IOException {
@Argument(required = true, metaVar = "metaVar_path", usage = "usage_pathToXml")
private String path;
- /** {@inheritDoc} */
@Override
protected void run() {
try {
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
@Command(usage = "usage_RevList")
class RevList extends RevWalkTextBuiltin {
- /** {@inheritDoc} */
@Override
protected void show(RevCommit c) throws Exception {
if (c.has(RevFlag.UNINTERESTING))
outw.println();
}
- /** {@inheritDoc} */
@Override
protected void show(ObjectWalk ow, RevObject obj)
throws Exception {
@Argument(index = 0, metaVar = "metaVar_commitish")
private List<ObjectId> commits = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() {
try {
@Option(name = "--max-count", aliases = "-n", metaVar = "metaVar_n")
private int maxCount = -1;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
walk = createWalk();
*
* @param c
* The current {@link org.eclipse.jgit.revwalk.RevCommit}
- * @throws java.lang.Exception
+ * @throws Exception
+ * if an error occurred
*/
protected abstract void show(RevCommit c) throws Exception;
* {@link #walkLoop()}
* @param currentObject
* The current {@link org.eclipse.jgit.revwalk.RevObject}
- * @throws java.lang.Exception
+ * @throws Exception
+ * if an error occurred
*/
protected void show(final ObjectWalk objectWalk,
final RevObject currentObject) throws Exception {
@Option(name = "--", handler = StopOptionHandler.class)
private List<String> paths = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
protected void init(Repository repository, String gitDir) {
super.init(repository, gitDir);
diffFmt = new DiffFormatter(new BufferedOutputStream(outs));
}
- /** {@inheritDoc} */
@SuppressWarnings("boxing")
@Override
protected void run() {
@Command(usage = "usage_ShowRef")
class ShowRef extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() {
try {
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
protected List<String> filterPaths;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
* Print section header
*
* @param pattern
- * a {@link java.lang.String} object.
+ * a {@link String} object.
* @param arguments
- * a {@link java.lang.Object} object.
- * @throws java.io.IOException
+ * a {@link Object} object.
+ * @throws IOException
+ * if an IO error occurred
*/
protected void printSectionHeader(String pattern, Object... arguments)
throws IOException {
* Print String list
*
* @param list
- * a {@link java.util.Collection} object.
- * @return a int.
- * @throws java.io.IOException
+ * a {@link Collection} object.
+ * @return size of the list
+ * @throws IOException
+ * if an IO error occurred
*/
protected int printList(Collection<String> list) throws IOException {
if (!list.isEmpty()) {
* Print String list
*
* @param status1
- * a {@link java.lang.String} object.
+ * a {@link String} object.
* @param status2
- * a {@link java.lang.String} object.
+ * a {@link String} object.
* @param status3
- * a {@link java.lang.String} object.
+ * a {@link String} object.
* @param list
- * a {@link java.util.Collection} object.
+ * a {@link Collection} object.
* @param set1
- * a {@link java.util.Collection} object.
+ * a {@link Collection} object.
* @param set2
- * a {@link java.util.Collection} object.
+ * a {@link Collection} object.
* @param set3
- * a {@link java.util.Collection} object.
+ * a {@link Collection} object.
* @return a int.
- * @throws java.io.IOException
+ * @throws IOException
+ * if an IO error occurred
*/
protected int printList(String status1, String status2, String status3,
Collection<String> list, Collection<String> set1,
@Argument(index = 1, metaVar = "metaVar_object")
private ObjectId object;
- /** {@inheritDoc} */
@Override
protected void run() {
try (Git git = new Git(db)) {
* @param args
* the arguments supplied on the command line, if any.
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected void parseArguments(String[] args) throws IOException {
final CmdLineParser clp = new CmdLineParser(this);
* @param clp
* a {@link org.eclipse.jgit.pgm.opt.CmdLineParser} object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void printUsageAndExit(CmdLineParser clp) throws IOException {
printUsageAndExit("", clp); //$NON-NLS-1$
* @param clp
* a {@link org.eclipse.jgit.pgm.opt.CmdLineParser} object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void printUsageAndExit(String message, CmdLineParser clp) throws IOException {
printUsage(message, clp);
* @param clp
* parser used to print options
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
protected void printUsage(String message, CmdLineParser clp)
@Argument(index = 0, required = true, metaVar = "metaVar_directory", usage = "usage_RepositoryToReadFrom")
File srcGitdir;
- /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() {
try {
@Command(common = true, usage = "usage_DisplayTheVersionOfJgit")
class Version extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() {
// read the Implementation-Version from Manifest
}
}
- /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
@Argument(index = 1)
private String reftablePath;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
switch (test) {
private ThreadMXBean mxBean;
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
mxBean = ManagementFactory.getThreadMXBean();
String secretKey;
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
AppServer server = new AppServer(port);
@Command(usage = "usage_MakeCacheTree")
class MakeCacheTree extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@Command(usage = "usage_ReadDirCache")
class ReadDirCache extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final int cnt = 100;
@Argument(index = 1, required = false)
private String ref;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (FileInputStream in = new FileInputStream(input);
private Map<ObjectId, ObjectId> rewrites = new HashMap<>();
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (!really && db.getRefDatabase().hasRefs()) {
@Command(usage = "usage_ShowCacheTree")
class ShowCacheTree extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@Option(name = "--pretty", metaVar = "metaVar_commandDetail", usage = "usage_alterTheDetailShown")
private Format pretty = Format.USAGE;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final CommandRef[] list = CommandCatalog.all();
@Option(name = "--millis", aliases = { "-m" }, usage = "usage_showTimeInMilliseconds")
private boolean millis = false;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DateTimeFormatter fmt = DateTimeFormatter
@Argument(index = 0)
private ObjectId objectId;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
ObjectReader reader = db.newObjectReader();
@Option(name = "--repository", aliases = { "-r" }, metaVar = "GIT_DIR", usage = "Repository to scan")
List<File> gitDirs = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (gitDirs.isEmpty()) {
@Argument(index = 1)
private String reftablePath;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
List<Ref> refs = WriteReftable.readRefs(lsRemotePath);
@Command(usage = "usage_WriteDirCache")
class WriteDirCache extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@Argument(index = 1)
private String out;
- /** {@inheritDoc} */
@SuppressWarnings({ "nls", "boxing" })
@Override
protected void run() throws Exception {
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
return 1;
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_treeish;
this.db = repo;
}
- /** {@inheritDoc} */
@Override
public void parseArgument(String... args) throws CmdLineException {
final ArrayList<String> tmp = new ArrayList<>(args.length);
}
}
- /** {@inheritDoc} */
@Override
protected OptionHandler createOptionHandler(OptionDef o, Setter setter) {
if (o instanceof NamedOptionDef) {
}
- /** {@inheritDoc} */
@Override
public void printSingleLineUsage(Writer w, ResourceBundle rb) {
List<OptionHandler> options = getOptions();
super(parser, option, setter);
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String alias = params.getParameter(-1);
super(parser, option, setter);
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
Instant instant = Instant.parse(params.getParameter(0));
return 1;
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_instant;
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
CLIText.format(CLIText.get().notAnObject), name);
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_object;
super(parser, option, setter);
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final List<String> list = new ArrayList<>();
return list.size();
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_values;
super(parser, option, setter);
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final List<PathFilter> filters = new ArrayList<>();
return filters.size();
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_paths;
super(parser, option, setter);
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
setter.addValue(new RefSpec(params.getParameter(0)));
return 1;
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_refspec;
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String name = params.getParameter(0);
setter.addValue(c);
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_commitish;
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
return 1;
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_treeish;
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
return 1;
}
- /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_command;
super(parser, option, setter);
}
- /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String alias = params.getParameter(-1);
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
* set it
* @return -1 on error, otherwise a value >= 0
* @throws LastErrorException
+ * represents non-zero error code for the last error
*/
int fcntl(int fd, int command, int flag) throws LastErrorException;
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
/**
* @param manager
+ * client factory manager
* @param session
+ * the session
* @throws Exception
+ * an error occurred
*/
public JGitClientSession(ClientFactoryManager manager, IoSession session)
throws Exception {
/**
* 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 <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.
* <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
* 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
* <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
* 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>
* 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)
* {@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;
* {@code UserKnownHostsFile} overrides this default.
*
* @param sshDir
+ * directory containing ssh configurations
* @return the possibly empty list of default known host file paths.
*/
@NonNull
* 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
*/
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
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);
return false;
}
- /** {@inheritDoc} */
@Override
public boolean promptPassword(String msg) {
CredentialItem.Password p = new CredentialItem.Password(msg);
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) {
private OpenSshConfig config;
- /** {@inheritDoc} */
@Override
public synchronized RemoteSession getSession(URIish uri,
CredentialsProvider credentialsProvider, FS fs, int tms)
* 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,
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())
return host.getConfig();
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "OpenSshConfig [configFile=" + configFile + ']'; //$NON-NLS-1$
}
/**
- * Check that branch.<name>.pushRemote overrides anything else.
+ * Check that branch.<name>.pushRemote overrides anything else.
*
* @throws Exception
*/
}
/**
- * Check that remote.pushDefault overrides branch.<name>.remote
+ * Check that remote.pushDefault overrides branch.<name>.remote
*
* @throws Exception
*/
}
}
- /** {@inheritDoc} */
@Override
@Before
public void setUp() throws Exception {
TestRepository<FileRepository> repo;
- /** {@inheritDoc} */
@Override
@Before
public void setUp() throws Exception {
import org.junit.Before;
public class FileRepositoryBuilderAfterOpenConfigTest extends FileRepositoryBuilderTest {
- /** {@inheritDoc} */
@Before
@Override
public void setUp() throws Exception {
import org.eclipse.jgit.util.SystemReader;
public class RefDirectoryAfterOpenConfigTest extends RefDirectoryTest {
- /** {@inheritDoc} */
@Override
public void refDirectorySetup() throws Exception {
StoredConfig userConfig = SystemReader.getInstance().getUserConfig();
public class SnapshottingRefDirectoryTest extends RefDirectoryTest {
private RefDirectory originalRefDirectory;
- /** {@inheritDoc} */
@Before
@Override
public void setUp() throws Exception {
/**
* <pre>
* remote:
- * foo <- foofoo <-- branchFoo
- * bar <- barbar <-- branchBar
+ * foo <- foofoo <-- branchFoo
+ * bar <- barbar <-- branchBar
*
* client:
- * foo <-- branchFoo
- * bar <-- branchBar
+ * foo <-- branchFoo
+ * bar <-- branchBar
*
* fetch(branchFoo) should send exactly 1 have (i.e. foo) from branchFoo
* </pre>
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
setDefault(new AwtAuthenticator());
}
- /** {@inheritDoc} */
@Override
protected PasswordAuthentication promptPasswordAuthentication() {
final GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1,
CredentialsProvider.setDefault(cp);
}
- /** {@inheritDoc} */
@Override
public boolean isInteractive() {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean supports(CredentialItem... items) {
for (CredentialItem i : items) {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
return allCommits;
}
- /** {@inheritDoc} */
@Override
public void setModel(TableModel dataModel) {
if (dataModel != null && !(dataModel instanceof CommitTableModel))
super.setModel(dataModel);
}
- /** {@inheritDoc} */
@Override
protected TableModel createDefaultDataModel() {
return new CommitTableModel();
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
super(repo);
}
- /** {@inheritDoc} */
@Override
public Note call() throws GitAPIException {
checkCallable();
/**
* Constructs the command.
*
- * @param local
+ * @param repo
+ * the repository this command will be used on
*/
- ApplyCommand(Repository local) {
- super(local);
- if (local == null) {
+ ApplyCommand(Repository repo) {
+ super(repo);
+ if (repo == null) {
throw new NullPointerException(JGitText.get().repositoryIsRequired);
}
}
}
}
- /** {@inheritDoc} */
@Override
public OutputStream call() throws GitAPIException {
checkCallable();
this.paths = new LinkedList<>();
}
- /** {@inheritDoc} */
@Override
public Ref call() throws GitAPIException, RefAlreadyExistsException,
RefNotFoundException, InvalidRefNameException,
*
* @return this instance
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.api.errors.RefNotFoundException
+ * if {@code Ref} couldn't be resolved
*/
protected CheckoutCommand checkoutPaths() throws IOException,
RefNotFoundException {
return headName;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
}
/**
- * When dryRun is false, deletes the specified path from disk. If dryRun
- * is true, no paths are actually deleted. In both cases, the paths that
- * would have been deleted are added to inFiles and returned.
+ * When dryRun is false, deletes the specified path from disk. If dryRun is
+ * true, no paths are actually deleted. In both cases, the paths that would
+ * have been deleted are added to inFiles and returned.
*
* Paths that are directories are recursively deleted when
- * {@link #directories} is true.
- * Paths that are git repositories are recursively deleted when
- * {@link #directories} and {@link #force} are both true.
+ * {@link #directories} is true. Paths that are git repositories are
+ * recursively deleted when {@link #directories} and {@link #force} are both
+ * true.
*
* @param path
- * The path to be cleaned
+ * The path to be cleaned
* @param inFiles
- * A set of strings representing the files that have been cleaned
- * already, the path to be cleaned will be added to this set
- * before being returned.
+ * A set of strings representing the files that have been cleaned
+ * already, the path to be cleaned will be added to this set
+ * before being returned.
*
* @return a set of strings with the cleaned path added to it
* @throws IOException
+ * if an IO error occurred
*/
private Set<String> cleanPath(String path, Set<String> inFiles)
throws IOException {
super(repo);
}
- /** {@inheritDoc} */
@Override
public Ref call() throws GitAPIException, RefAlreadyExistsException,
RefNotFoundException, InvalidRefNameException {
super(repo);
}
- /** {@inheritDoc} */
@Override
public List<String> call() throws GitAPIException,
NotMergedException, CannotDeleteCurrentBranchException {
super(repo);
}
- /** {@inheritDoc} */
@Override
public List<String> call() throws GitAPIException {
checkCallable();
return this;
}
- /** {@inheritDoc} */
@Override
public Properties call() throws GitAPIException {
checkCallable();
* @return a {@link org.eclipse.jgit.api.Git} object for the existing git
* repository
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static Git open(File dir) throws IOException {
return open(dir, FS.DETECTED);
* @return a {@link org.eclipse.jgit.api.Git} object for the existing git
* repository. Closing this instance will close the repo.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static Git open(File dir, FS fs) throws IOException {
RepositoryCache.FileKey key;
return repo;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "Git[" + repo + "]"; //$NON-NLS-1$//$NON-NLS-2$
super(repo);
}
- /** {@inheritDoc} */
@Override
public List<Ref> call() throws GitAPIException {
checkCallable();
super(repo);
}
- /** {@inheritDoc} */
@Override
public List<Note> call() throws GitAPIException {
checkCallable();
* the specified commit
* @return this command
* @throws IOException
+ * if an IO error occurred
* @throws IncorrectObjectTypeException
+ * if commit has an incorrect object type
* @throws MissingObjectException
+ * if the commit is missing
*
* @since 6.6
*/
return this;
}
- /** {@inheritDoc} */
@Override
public List<Ref> call() throws GitAPIException {
checkCallable();
* </pre>
* <p>
*
- * <p>
* Get commits only for a specific file:
*
* <pre>
* git.log().add(head).addPath("dir/filename.txt").call();
* </pre>
- * <p>
*
* @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-log.html"
* >Git documentation about Log</a>
return base;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
};
}
- /** {@inheritDoc} */
@Override
public Map<ObjectId, String> call() throws GitAPIException {
try {
return true;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* supported options and arguments of this command and a {@link #call()} method
* to finally execute the command. Each instance of this class should only be
* used for one invocation of the command (means: one call to {@link #call()})
- * <p>
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"
/**
* @return the commit if we had to do a commit, otherwise null
* @throws GitAPIException
+ * if JGit API failed
* @throws IOException
+ * if an IO error occurred
*/
private RevCommit continueRebase() throws GitAPIException, IOException {
// if there are still conflicts, we throw a specific Exception
* that can not be parsed as steps
*
* @param numSteps
+ * number of steps to remove
* @throws IOException
+ * if an IO error occurred
*/
private void popSteps(int numSteps) throws IOException {
if (numSteps == 0)
* if we can fast-forward to.
* @return the new head, or null
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.api.errors.GitAPIException
+ * if a JGit API exception occurred
*/
public RevCommit tryFastForward(RevCommit newCommit) throws IOException,
GitAPIException {
* the name of the upstream branch
* @return {@code this}
* @throws org.eclipse.jgit.api.errors.RefNotFoundException
+ * if {@code upstream} Ref couldn't be resolved
*/
public RebaseCommand setUpstream(String upstream)
throws RefNotFoundException {
* Create <code>RebaseResult</code>
*
* @param status
+ * the overall rebase status
* @param commit
* current commit
* @return the RebaseResult
super(repo);
}
- /** {@inheritDoc} */
@Override
public Note call() throws GitAPIException {
checkCallable();
super(repo);
}
- /** {@inheritDoc} */
@Override
public Ref call() throws GitAPIException, RefNotFoundException, InvalidRefNameException,
RefAlreadyExistsException, DetachedHeadException {
repo.writeMergeCommitMsg(null);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
super(repo);
}
- /** {@inheritDoc} */
@Override
public Note call() throws GitAPIException {
checkCallable();
super(repo);
}
- /** {@inheritDoc} */
@Override
public Collection<RevCommit> call() throws GitAPIException,
InvalidRefNameException {
* Set the submodule name
*
* @param name
+ * name of the submodule
* @return this command
* @since 5.1
*/
*
* @return true if submodule exists in index, false otherwise
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected boolean submoduleExists() throws IOException {
TreeFilter filter = PathFilter.create(path);
* Constructor of SubmoduleDeinitCommand
*
* @param repo
+ * repository this command works on
*/
public SubmoduleDeinitCommand(Repository repo) {
super(repo);
/**
* {@inheritDoc}
- * <p>
*
* @return the set of repositories successfully deinitialized.
* @throws NoSuchSubmoduleException
* @param path
* the path to clean
* @throws IOException
+ * if an IO error occurred
*/
private void deinit(String path) throws IOException {
File dir = new File(repo.getWorkTree(), path);
* the parent repo's index or HEAD.
*
* @param revWalk
+ * used to walk commit graph
* @param path
+ * path of the submodule
* @return status of the command
* @throws GitAPIException
+ * if JGit API failed
* @throws IOException
+ * if an IO error occurred
*/
private SubmoduleDeinitStatus checkDirty(RevWalk revWalk, String path)
throws GitAPIException, IOException {
* @return {@code true} if path exists and is a submodule in index,
* {@code false} otherwise
* @throws IOException
+ * if an IO error occurred
*/
private boolean submoduleExists(String path) throws IOException {
TreeFilter filter = PathFilter.create(path);
* else it will refuse to do so.
*
* @param force
+ * execute the command forcefully if there are local modifications
* @return {@code this}
*/
public SubmoduleDeinitCommand setForce(boolean force) {
* @param path
* path of the submodule
* @param status
+ * effect of a SubmoduleDeinitCommand's execution
*/
public SubmoduleDeinitResult(String path,
SubmoduleDeinitCommand.SubmoduleDeinitStatus status) {
return this;
}
- /** {@inheritDoc} */
@Override
public Collection<String> call() throws GitAPIException {
checkCallable();
return this;
}
- /** {@inheritDoc} */
@Override
public Map<String, SubmoduleStatus> call() throws GitAPIException {
checkCallable();
* a {@link org.eclipse.jgit.lib.Repository} object.
* @return shortened branch name, null on failures
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected String getHeadBranch(Repository subRepo) throws IOException {
Ref head = subRepo.exactRef(Constants.HEAD);
return null;
}
- /** {@inheritDoc} */
@Override
public Map<String, String> call() throws GitAPIException {
checkCallable();
* </pre>
* <p>
*
- * <p>
* Create a new unannotated tag for the current commit:
*
* <pre>
* git.tag().setName("v1.0").setAnnotated(false).call();
* </pre>
- * <p>
*
* @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-tag.html"
* >Git documentation about Tag</a>
* {@link org.eclipse.jgit.api.TransportConfigCallback}.
*
* @param <C>
+ * concrete type of this {@code GitCommand}
* @param <T>
+ * the return type of the {@code GitCommand}'s {@code call()} method
*/
public abstract class TransportCommand<C extends GitCommand, T> extends
GitCommand<T> {
* Adds a new conflicting path
*
* @param conflictingPath
+ * the new conflicting path
* @return {@code this}
*/
CheckoutConflictException addConflictingPath(String conflictingPath) {
this(key, State.CUSTOM, value);
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj)
return value;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
- /** {@inheritDoc} */
@Override
public String toString() {
switch (state) {
return true;
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
return buf.toString();
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return map.hashCode();
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj)
* @param treeWalk
* a {@link org.eclipse.jgit.treewalk.TreeWalk}
* @throws java.io.IOException
+ * if an IO error occurred
* @deprecated since 6.1, use {@link #AttributesHandler(TreeWalk, Supplier)}
* instead
*/
* @param attributesTree
* the tree to read .gitattributes from
* @throws java.io.IOException
+ * if an IO error occurred
* @since 6.1
*/
public AttributesHandler(TreeWalk treeWalk,
* current path represented by the
* {@link org.eclipse.jgit.treewalk.TreeWalk}
* @throws java.io.IOException
+ * if an IO error occurred
*/
public Attributes getAttributes() throws IOException {
String entryPath = treeWalk.getPathString();
* @param isDirectory
* true if the target item is a directory.
* @param workingTreeIterator
+ * the working tree iterator
* @param dirCacheIterator
+ * the dircache iterator
* @param otherTree
+ * another tree
* @param result
* that will hold the attributes matching this entry path. This
* method will NOT override any existing entry in attributes.
* @throws IOException
+ * if an IO error occurred
*/
private void mergePerDirectoryEntryAttributes(String entryPath,
int nameRoot, boolean isDirectory,
* </p>
*
* @param treeWalk
+ * used to walk trees
* @param workingTreeIterator
+ * used to walk the working tree
* @param dirCacheIterator
+ * used to walk the dircache
* @param otherTree
+ * another tree
* @return a {@link AttributesNode} of the current entry,
* {@link NullPointerException} otherwise.
* @throws IOException
return match;
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
* the factory responsible for creating
* {@link org.eclipse.jgit.attributes.FilterCommand}s for the
* specified name
- * @return the previous factory associated with <tt>commandName</tt>, or
- * <tt>null</tt> if there was no mapping for <tt>commandName</tt>
+ * @return the previous factory associated with {@code commandName}, or
+ * {@code null} if there was no mapping for {@code commandName}
*/
public static FilterCommandFactory register(String filterCommandName,
FilterCommandFactory factory) {
*
* @param filterCommandName
* the FilterCommandFactory's filter command name
- * @return the previous factory associated with <tt>filterCommandName</tt>,
- * or <tt>null</tt> if there was no mapping for <tt>commandName</tt>
+ * @return the previous factory associated with {@code filterCommandName},
+ * or {@code null} if there was no mapping for {@code commandName}
*/
public static FilterCommandFactory unregister(String filterCommandName) {
return filterCommandRegistry.remove(filterCommandName);
*
* @param filterCommandName
* the name for which the registry should be checked
- * @return <code>true</code> if any factory was registered for the name
+ * @return {@code true} if any factory was registered for the name
*/
public static boolean isRegistered(String filterCommandName) {
return filterCommandRegistry.containsKey(filterCommandName);
* @return the command if a command could be created or <code>null</code> if
* there was no factory registered for that name
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static FilterCommand createFilterCommand(String filterCommandName,
Repository db, InputStream in, OutputStream out)
}
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder r = new StringBuilder();
}
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return head;
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
super(repo);
}
- /** {@inheritDoc} */
@Override
public ReverseCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
return c;
}
- /** {@inheritDoc} */
@Override
protected RevCommit createCommit(AnyObjectId id) {
return new ReverseCommit(id);
/**
* Compare two sequences and identify a list of edits between them.
*
+ * @param <S>
+ * type of sequence being compared.
* @param cmp
* the comparator supplying the element equivalence function.
* @param a
* method, which invokes this method using
* {@link org.eclipse.jgit.diff.Subsequence}s.
*
+ * @param <S>
+ * type of sequence being compared.
* @param cmp
* the comparator supplying the element equivalence function.
* @param a
/**
* Whether the mark tree filter with the specified index matched during scan
* or not, see {@link #scan(TreeWalk, boolean, TreeFilter...)}. Example:
- * <p>
*
* <pre>
* TreeFilter filterA = ...;
return side == Side.OLD ? getOldId() : getNewId();
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* @param b
* the text B which was compared
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void format(EditList edits, RawText a, RawText b)
throws IOException {
* @param line
* the line number within text
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected void writeContextLine(RawText text, int line)
throws IOException {
* @param line
* the line number within text
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected void writeAddedLine(RawText text, int line)
throws IOException {
* @param line
* the line number within text
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected void writeRemovedLine(RawText text, int line)
throws IOException {
* @param bEndLine
* within second source
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected void writeHunkHeader(int aStartLine, int aEndLine,
int bStartLine, int bEndLine) throws IOException {
endB = sEnd;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return beginA ^ endA;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
if (o instanceof Edit) {
return false;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
super(capacity);
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "EditList" + super.toString(); //$NON-NLS-1$
this.hashes = hashes;
}
- /** {@inheritDoc} */
@Override
public int size() {
return base.size();
this.cmp = cmp;
}
- /** {@inheritDoc} */
@Override
public boolean equals(HashedSequence<S> a, int ai, //
HashedSequence<S> b, int bi) {
&& cmp.equals(a.base, ai, b.base, bi);
}
- /** {@inheritDoc} */
@Override
public int hash(HashedSequence<S> seq, int ptr) {
return seq.hashes[ptr];
maxChainLength = maxLen;
}
- /** {@inheritDoc} */
@Override
public <S extends Sequence> void diffNonCommon(EditList edits,
HashedSequenceComparator<S> cmp, HashedSequence<S> a,
* Compares two sequences primarily based upon hash codes.
*/
public abstract class LowLevelDiffAlgorithm extends DiffAlgorithm {
- /** {@inheritDoc} */
@Override
public <S extends Sequence> EditList diffNonCommon(
SequenceComparator<? super S> cmp, S a, S b) {
* method, which invokes this method using
* {@link org.eclipse.jgit.diff.Subsequence}s.
*
+ * @param <S>
+ * type of Sequence compared
* @param edits
* result list to append the region's edits onto.
* @param cmp
return ObjectId.fromRaw(digest.digest());
}
- /** {@inheritDoc} */
@Override
protected void writeHunkHeader(int aStartLine, int aEndLine,
int bStartLine, int bEndLine) throws IOException {
// The hunk header is not taken into account for patch id calculation
}
- /** {@inheritDoc} */
@Override
protected void formatIndexLine(OutputStream o, DiffEntry ent)
throws IOException {
}
/** @return total number of items in the sequence. */
- /** {@inheritDoc} */
@Override
public int size() {
// The line map is always 2 entries larger than the number of lines in
return hashRegion(seq.content, begin, end);
}
- /** {@inheritDoc} */
@Override
public Edit reduceCommonStartEnd(RawText a, RawText b, Edit e) {
// This is a faster exact match based form that tries to improve
/**
* Find the best match by file path for a given DiffEntry from a list of
- * DiffEntrys. The returned DiffEntry will be of the same type as <src>. If
- * no DiffEntry can be found that has the same type, this method will return
- * null.
+ * DiffEntrys. The returned DiffEntry will be of the same type as
+ * <src>. If no DiffEntry can be found that has the same type, this
+ * method will return null.
*
* @param src
* the DiffEntry to try to find a match for
* @param list
* a list of DiffEntrys to search through
- * @return the DiffEntry from <list> who's file path best matches <src>
+ * @return the DiffEntry from <list> who's file path best matches
+ * <src>
*/
private static DiffEntry bestPathMatch(DiffEntry src, List<DiffEntry> list) {
DiffEntry best = null;
/**
* Construct a subsequence around the A region/base sequence.
*
+ * @param <S>
+ * type of returned Sequence
* @param a
* the A sequence.
* @param region
/**
* Construct a subsequence around the B region/base sequence.
*
+ * @param <S>
+ * type of returned Sequence
* @param b
* the B sequence.
* @param region
/**
* Adjust the Edit to reflect positions in the base sequence.
*
+ * @param <S>
+ * type of returned Sequence
* @param e
* edit to adjust in-place. Prior to invocation the indexes are
* in terms of the two subsequences; after invocation the indexes
/**
* Adjust the Edits to reflect positions in the base sequence.
*
+ * @param <S>
+ * type of returned Sequence
* @param edits
* edits to adjust in-place. Prior to invocation the indexes are
* in terms of the two subsequences; after invocation the indexes
this.size = end - begin;
}
- /** {@inheritDoc} */
@Override
public int size() {
return size;
this.cmp = cmp;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Subsequence<S> a, int ai, Subsequence<S> b, int bi) {
return cmp.equals(a.base, ai + a.begin, b.base, bi + b.begin);
}
- /** {@inheritDoc} */
@Override
public int hash(Subsequence<S> seq, int ptr) {
return cmp.hash(seq.base, ptr + seq.begin);
* services to applications.
*/
abstract class BaseDirCacheEditor {
+ @SuppressWarnings("doclint:missing")
/** The cache instance this editor updates during {@link #finish()}. */
protected DirCache cache;
+ @SuppressWarnings("doclint:missing")
/**
* Entry table this builder will eventually replace into {@link #cache}.
* <p>
*/
protected DirCacheEntry[] entries;
- /** Total number of valid entries in {@link #entries}. */
+ /** Total number of valid entries in {@link BaseDirCacheEditor#entries}. */
protected int entryCnt;
/**
public abstract void finish();
/**
- * Update the DirCache with the contents of {@link #entries}.
+ * Update the DirCache with the contents of
+ * {@link BaseDirCacheEditor#entries}.
* <p>
* This method should be invoked only during an implementation of
* {@link #finish()}, and only after {@link #entries} is sorted.
*
* @return {@code true} if the memory state differs from the index file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public boolean isOutdated() throws IOException {
if (liveFile == null || !liveFile.exists())
* Update any smudged entries with information from the working tree.
*
* @throws IOException
+ * if an IO error occurred
*/
private void updateSmudgedEntries() throws IOException {
List<String> paths = new ArrayList<>(128);
builder = p.builder;
}
- /** {@inheritDoc} */
@Override
public AbstractTreeIterator createSubtreeIterator(ObjectReader reader)
throws IncorrectObjectTypeException, IOException {
return new DirCacheBuildIterator(this, currentSubtree);
}
- /** {@inheritDoc} */
@Override
public void skip() throws CorruptObjectException {
if (currentSubtree != null)
next(1);
}
- /** {@inheritDoc} */
@Override
public void stopWalk() {
final int cur = ptr;
builder.keep(cur, cnt - cur);
}
- /** {@inheritDoc} */
@Override
protected boolean needsStopWalk() {
return ptr < cache.getEntryCount();
return e;
}
- /** {@inheritDoc} */
@Override
public void finish() {
if (!sorted)
/**
* @param eolStreamType
+ * how to convert EOL characters during stream conversion
* @param smudgeFilterCommand
+ * command used as smudge filter during checkout
*/
public CheckoutMetadata(EolStreamType eolStreamType,
String smudgeFilterCommand) {
* @param workingTree
* an iterator over the repositories Working Tree
* @throws java.io.IOException
+ * if an IO error occurred
*/
public DirCacheCheckout(Repository repo, ObjectId headCommitTree, DirCache dc,
ObjectId mergeCommitTree, WorkingTreeIterator workingTree)
* @param mergeCommitTree
* the id of the tree we want to fast-forward to
* @throws java.io.IOException
+ * if an IO error occurred
*/
public DirCacheCheckout(Repository repo, ObjectId headCommitTree,
DirCache dc, ObjectId mergeCommitTree) throws IOException {
* @param workingTree
* an iterator over the repositories Working Tree
* @throws java.io.IOException
+ * if an IO error occurred
*/
public DirCacheCheckout(Repository repo, DirCache dc,
ObjectId mergeCommitTree, WorkingTreeIterator workingTree)
* @param mergeCommitTree
* the id of the tree of the
* @throws java.io.IOException
+ * if an IO error occurred
*/
public DirCacheCheckout(Repository repo, DirCache dc,
ObjectId mergeCommitTree) throws IOException {
* operations.
*
* @throws org.eclipse.jgit.errors.CorruptObjectException
+ * if a corrupt object was found
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void preScanTwoTrees() throws CorruptObjectException, IOException {
removed.clear();
* there is no head yet.
*
* @throws org.eclipse.jgit.errors.MissingObjectException
+ * if an object was found missing
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * if an object didn't have the expected type
* @throws org.eclipse.jgit.errors.CorruptObjectException
+ * if an object is corrupt
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void prescanOneTree()
throws MissingObjectException, IncorrectObjectTypeException,
* @param f
* the working tree
* @throws IOException
+ * if an IO error occurred
*/
void processEntry(CanonicalTreeParser m, DirCacheBuildIterator i,
WorkingTreeIterator f) throws IOException {
* successful and the working tree was updated for all other files.
* <code>true</code> is returned when no such problem occurred
* @throws java.io.IOException
+ * if an IO error occurred
*/
public boolean checkout() throws IOException {
try {
* Compares whether two pairs of ObjectId and FileMode are equal.
*
* @param id1
+ * id of first object
* @param mode1
+ * mode of first object
* @param id2
+ * id of second object
* @param mode2
+ * mode of second object
* @return <code>true</code> if FileModes and ObjectIds are equal.
* <code>false</code> otherwise
*/
* @param f
* the file in the working tree
* @throws IOException
+ * if an IO error occurred
*/
void processEntry(CanonicalTreeParser h, CanonicalTreeParser m,
* {@link #failOnConflict} is false
*
* @throws CheckoutConflictException
+ * if a conflict occurred during merge checkout
*/
private void cleanUpConflicts() throws CheckoutConflictException {
// TODO: couldn't we delete unsaved worktree content here?
}
/**
- * Checks whether the subtree starting at a given path differs between Index and
- * workingtree.
+ * Checks whether the subtree starting at a given path differs between Index
+ * and workingtree.
*
* @param path
+ * given subtree path
* @return true if the subtrees differ
* @throws CorruptObjectException
+ * if a corrupt object was found
* @throws IOException
+ * if an IO error occurred
*/
private boolean isModifiedSubtree_IndexWorkingtree(String path)
throws CorruptObjectException, IOException {
}
/**
- * Checks whether the subtree starting at a given path differs between Index and
- * some tree.
+ * Checks whether the subtree starting at a given path differs between Index
+ * and some tree.
*
* @param path
+ * given path
* @param tree
* the tree to compare
* @return true if the subtrees differ
* @throws CorruptObjectException
+ * if a corrupt object was found
* @throws IOException
+ * if an IO error occurred
*/
private boolean isModifiedSubtree_IndexTree(String path, ObjectId tree)
throws CorruptObjectException, IOException {
* @param or
* object reader to use for checkout
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.6
* @deprecated since 5.1, use
* {@link #checkoutEntry(Repository, DirCacheEntry, ObjectReader, boolean, CheckoutMetadata, WorkingTreeOptions)}
* <li>eolStreamType used for stream conversion</li>
* </ul>
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
* @deprecated since 6.3, use
* {@link #checkoutEntry(Repository, DirCacheEntry, ObjectReader, boolean, CheckoutMetadata, WorkingTreeOptions)}
* {@link WorkingTreeOptions} that are effective; if {@code null}
* they are loaded from the repository config
* @throws java.io.IOException
+ * if an IO error occurred
* @since 6.3
*/
public static void checkoutEntry(Repository repo, DirCacheEntry entry,
* the output stream the filtered content is written to. The
* caller is responsible to close the stream.
* @throws IOException
+ * if an IO error occurred
*
* @since 5.7
*/
* the output stream the filtered content is written to. The
* caller is responsible to close the stream.
* @throws IOException
+ * if an IO error occurred
* @since 6.3
*/
public static void getContent(Repository repo, String path,
* have the editor compute the proper entry indexes necessary to perform an
* efficient in-order update of the index records. This can be easier to use
* than {@link org.eclipse.jgit.dircache.DirCacheBuilder}.
- * <p>
*
* @see DirCacheBuilder
*/
edits.add(edit);
}
- /** {@inheritDoc} */
@Override
public boolean commit() throws IOException {
if (edits.isEmpty()) {
return super.commit();
}
- /** {@inheritDoc} */
@Override
public void finish() {
if (!edits.isEmpty()) {
parseEntry();
}
- /** {@inheritDoc} */
@Override
public AbstractTreeIterator createSubtreeIterator(ObjectReader reader)
throws IncorrectObjectTypeException, IOException {
return new DirCacheIterator(this, currentSubtree);
}
- /** {@inheritDoc} */
@Override
public EmptyTreeIterator createEmptyTreeIterator() {
final byte[] n = new byte[Math.max(pathLen + 1, DEFAULT_PATH_SIZE)];
return new EmptyTreeIterator(this, n, pathLen + 1);
}
- /** {@inheritDoc} */
@Override
public boolean hasId() {
if (currentSubtree != null)
return currentEntry != null;
}
- /** {@inheritDoc} */
@Override
public byte[] idBuffer() {
if (currentSubtree != null)
return zeroid;
}
- /** {@inheritDoc} */
@Override
public int idOffset() {
if (currentSubtree != null)
return 0;
}
- /** {@inheritDoc} */
@Override
public void reset() {
if (!first()) {
}
}
- /** {@inheritDoc} */
@Override
public boolean first() {
return ptr == treeStart;
}
- /** {@inheritDoc} */
@Override
public boolean eof() {
return ptr == treeEnd;
}
- /** {@inheritDoc} */
@Override
public void next(int delta) {
while (--delta >= 0) {
}
}
- /** {@inheritDoc} */
@Override
public void back(int delta) {
while (--delta >= 0) {
* @return {@link org.eclipse.jgit.attributes.AttributesNode} for the
* current entry.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.7
*/
public AttributesNode getEntryAttributesNode(ObjectReader reader)
return -1;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return getNameString();
objectId = id.copy();
}
- /** {@inheritDoc} */
@Override
public String getMessage() {
return MessageFormat.format(JGitText.get().largeObjectException,
this.revstr = revstr;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return super.toString() + ":" + revstr; //$NON-NLS-1$
* Describes a change to one or more keys in the configuration.
*/
public class ConfigChangedEvent extends RepositoryEvent<ConfigChangedListener> {
- /** {@inheritDoc} */
@Override
public Class<ConfigChangedListener> getListenerType() {
return ConfigChangedListener.class;
}
- /** {@inheritDoc} */
@Override
public void dispatch(ConfigChangedListener listener) {
listener.onConfigChanged(this);
return internal;
}
- /** {@inheritDoc} */
@Override
public Class<IndexChangedListener> getListenerType() {
return IndexChangedListener.class;
}
- /** {@inheritDoc} */
@Override
public void dispatch(IndexChangedListener listener) {
listener.onIndexChanged(this);
parent.remove(this);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
/**
* Add a listener to the list.
*
+ * @param <T>
+ * type of {@code RepositoryListener}
* @param type
* type of listener being registered.
* @param listener
* Describes a change to one or more references of a repository.
*/
public class RefsChangedEvent extends RepositoryEvent<RefsChangedListener> {
- /** {@inheritDoc} */
@Override
public Class<RefsChangedListener> getListenerType() {
return RefsChangedListener.class;
}
- /** {@inheritDoc} */
@Override
public void dispatch(RefsChangedListener listener) {
listener.onRefsChanged(this);
*/
public abstract void dispatch(T listener);
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return result;
}
- /** {@inheritDoc} */
@Override
public Class<WorkingTreeModifiedListener> getListenerType() {
return WorkingTreeModifiedListener.class;
}
- /** {@inheritDoc} */
@Override
public void dispatch(WorkingTreeModifiedListener listener) {
listener.onWorkingTreeModified(this);
this.newHeads = newHeads;
}
- /** {@inheritDoc} */
@Override
public List<Head> getNextHeads(char c) {
if (matches(c)) {
this.expectedCharacter = expectedCharacter;
}
- /** {@inheritDoc} */
@Override
protected final boolean matches(char c) {
return c == expectedCharacter;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return String.valueOf(expectedCharacter);
}
}
- /** {@inheritDoc} */
@Override
protected final boolean matches(char c) {
for (CharacterPattern pattern : characterClasses) {
// defined because of javadoc and visibility modifier.
}
- /** {@inheritDoc} */
@Override
public List<Head> getNextHeads(char c) {
return FileNameMatcher.EMPTY_HEAD_LIST;
this.excludedCharacter = excludedCharacter;
}
- /** {@inheritDoc} */
@Override
protected final boolean matches(char c) {
return c != excludedCharacter;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return isStar() ? "*" : "?"; //$NON-NLS-1$ //$NON-NLS-2$
super(star);
}
- /** {@inheritDoc} */
@Override
protected final boolean matches(char c) {
return true;
* The relative path to the file to read
* @return the {@code InputStream} of the file.
* @throws GitAPIException
+ * a JGit API exception
* @throws IOException
+ * if an IO error occurred
*/
public InputStream readIncludeFile(String path)
throws GitAPIException, IOException;
* @param inputStream
* a {@link java.io.InputStream} object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void read(InputStream inputStream) throws IOException {
xmlInRead++;
}
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public void startElement(
}
}
- /** {@inheritDoc} */
@Override
public void endElement(
String uri,
}
}
- /** {@inheritDoc} */
@Override
public void endDocument() throws SAXException {
xmlInRead--;
* @return the sha1 of the remote repository, or null if the ref does
* not exist.
* @throws GitAPIException
+ * a JGit API exception
*/
@Nullable
public ObjectId sha1(String uri, String ref) throws GitAPIException;
* The relative path (inside the repo) to the file to read
* @return the file content.
* @throws GitAPIException
+ * If the ref have an invalid or ambiguous name, or it does
+ * not exist in the repository,
* @throws IOException
+ * If the object does not exist or is too large
* @since 3.5
*
* @deprecated Use {@link #readFileWithMode(String, String, String)}
return this;
}
- /** {@inheritDoc} */
@Override
public RevCommit call() throws GitAPIException {
checkCallable();
* Do the copy file action.
*
* @throws IOException
+ * if an IO error occurred
*/
public void copy() throws IOException {
File srcFile = new File(repo.getWorkTree(),
return thatPath.startsWith(getPathWithSlash());
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
if (o instanceof RepoProject) {
return false;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return this.getPathWithSlash().hashCode();
}
- /** {@inheritDoc} */
@Override
public int compareTo(RepoProject that) {
return this.getPathWithSlash().compareTo(that.getPathWithSlash());
super(repo, outputStream, errorStream);
}
- /** {@inheritDoc} */
@Override
public String call() throws IOException, AbortedByHookException {
if (commitMessage == null) {
return getCommitEditMessageFilePath() != null && commitMessage != null;
}
- /** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;
super(repo, outputStream, errorStream);
}
- /** {@inheritDoc} */
@Override
public Void call() throws IOException, AbortedByHookException {
doRun();
return null;
}
- /** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;
super(repo, outputStream, errorStream);
}
- /** {@inheritDoc} */
@Override
public Void call() throws IOException, AbortedByHookException {
doRun();
return null;
}
- /** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;
super(repo, outputStream, errorStream);
}
- /** {@inheritDoc} */
@Override
protected String getStdinArgs() {
return refs;
}
- /** {@inheritDoc} */
@Override
public String call() throws IOException, AbortedByHookException {
if (canRun()) {
return true;
}
- /** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;
return matcher == NO_MATCH;
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj)
return null;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return rules.toString();
this.dirOnly = dirOnly;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return pattern;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return pattern.hashCode();
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj)
"Pattern must have leading asterisk: " + pattern); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public boolean matches(String segment, int startIncl, int endExcl) {
// faster local access, same as in string.indexOf()
}
}
- /** {@inheritDoc} */
@Override
public boolean matches(String path, boolean assumeDirectory,
boolean pathMatch) {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean matches(String segment, int startIncl, int endExcl) {
// faster local access, same as in string.indexOf()
* a boolean.
* @return never null
* @throws org.eclipse.jgit.errors.InvalidPatternException
+ * if pattern is invalid
*/
public static IMatcher createPathMatcher(String pattern,
Character pathSeparator, boolean dirOnly)
}
}
- /** {@inheritDoc} */
@Override
public boolean matches(String path, boolean assumeDirectory,
boolean pathMatch) {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean matches(String segment, int startIncl, int endExcl) {
throw new UnsupportedOperationException(
.compile("\\[\\[[.=]\\w+[.=]\\]\\]"); //$NON-NLS-1$
/**
- * Conversion from glob to Java regex following two sources: <li>
- * http://man7.org/linux/man-pages/man7/glob.7.html <li>
- * org.eclipse.jgit.fnmatch.FileNameMatcher.java Seems that there are
+ * Conversion from glob to Java regex following two sources:
+ * <ul>
+ * <li>http://man7.org/linux/man-pages/man7/glob.7.html
+ * <li>org.eclipse.jgit.fnmatch.FileNameMatcher.java Seems that there are
* various ways to define what "glob" can be.
+ * </ul>
*
* @param pattern
* non null pattern
*
* @return Java regex pattern corresponding to given glob pattern
* @throws InvalidPatternException
+ * if pattern is invalid
*/
static Pattern convertGlob(String pattern) throws InvalidPatternException {
if (UNSUPPORTED.matcher(pattern).find())
/**
* @param buffer
+ * buffer
* @return zero of the buffer is empty, otherwise the last character from
* buffer
*/
}
/**
+ * Lookahead next character after given index in pattern
+ *
* @param pattern
+ * the pattern
* @param i
* current pointer in the pattern
- * @return zero of the index is out of range, otherwise the next character
+ * @return zero if the index is out of range, otherwise the next character
* from given position
*/
private static char lookAhead(String pattern, int i) {
"Pattern must have trailing asterisk: " + pattern); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public boolean matches(String segment, int startIncl, int endExcl) {
// faster local access, same as in string.indexOf()
p = convertGlob(subPattern);
}
- /** {@inheritDoc} */
@Override
public boolean matches(String segment, int startIncl, int endExcl) {
return p.matcher(segment.substring(startIncl, endExcl)).matches();
super(WILDMATCH, dirOnly);
}
- /** {@inheritDoc} */
@Override
public final boolean matches(String path, boolean assumeDirectory,
boolean pathMatch) {
|| (!pathMatch && isSubdirectory(path));
}
- /** {@inheritDoc} */
@Override
public final boolean matches(String segment, int startIncl, int endExcl) {
return true;
* Filter out changes that didn't affect this path.
* @return The subset of changes that affect only the filtered path.
* @throws IOException
+ * if an IO error occurred
*/
public List<DiffEntry> compute(List<DiffEntry> diffs,
PathFilter pathFilter) throws IOException {
* Filter out changes that didn't affect these paths.
* @return The subset of changes that affect only the filtered paths.
* @throws IOException
+ * if an IO error occurred
* @see RenameDetector#compute()
*/
public List<DiffEntry> compute(List<DiffEntry> changes,
* the environment
* @return the execution result
* @throws ToolException
+ * if a tool raised an error
* @throws InterruptedException
+ * if thread was interrupted
* @throws IOException
+ * if an IO error occurred
*/
public ExecutionResult run(String command, File workingDir,
Map<String, String> env)
* the environment
* @return the execution result
* @throws ToolException
+ * if a tool raised an error
* @throws InterruptedException
+ * if thread was interrupted
* @throws IOException
+ * if an IO error occurred
*/
public boolean checkExecutable(String path, File workingDir,
Map<String, String> env)
* the "trust exit code" option
* @return the execution result from tool
* @throws ToolException
+ * when the tool fails
*/
public ExecutionResult compare(FileElement localFile,
FileElement remoteFile, ExternalDiffTool tool,
* path to the node in repository to parse git attributes for
* @return name of the difftool if set
* @throws ToolException
+ * when the tool failed
*/
public Optional<String> getExternalToolFromAttributes(final String path)
throws ToolException {
* the base file (can be null)
* @return the prepared (with replaced variables) command string
* @throws IOException
+ * if an IO error occurred
*/
public static String prepareCommand(String command, FileElement localFile,
FileElement remoteFile, FileElement mergedFile,
* the base file (can be null)
* @return the environment map with variables and values (file paths)
* @throws IOException
+ * if an IO error occurred
*/
public static Map<String, String> prepareEnvironment(File gitDir,
FileElement localFile, FileElement remoteFile,
* config key name for the tool
* @return attribute value for the given tool key if set
* @throws ToolException
+ * if the tool failed
*/
public static Optional<String> getExternalToolFromAttributes(
final Repository repository, final String path,
*
* @return the object stream
* @throws IOException
+ * if an IO error occurred
*/
public File getFile() throws IOException {
// if we have already temp file and no stream
* temporary directory is used
* @return temporary file in directory or in the system temporary directory
* @throws IOException
+ * if an IO error occurred
*/
public File createTempFile(File directory) throws IOException {
if (tempFile == null) {
* the input string
* @return the replaced input string
* @throws IOException
+ * if an IO error occurred
*/
public String replaceVariable(String input) throws IOException {
return input.replace("$" + type.name(), getFile().getPath()); //$NON-NLS-1$
* @param env
* the environment where this element should be added
* @throws IOException
+ * if an IO error occurred
*/
public void addToEnv(Map<String, String> env) throws IOException {
env.put(type.name(), getFile().getPath());
* the selected tool
* @return the execution result from tool
* @throws ToolException
+ * if the tool failed
*/
public ExecutionResult merge(FileElement localFile, FileElement remoteFile,
FileElement mergedFile, FileElement baseFile, File tempDir,
* @return the created temporary directory if (mergetol.writeToTemp == true)
* or null if not configured or false.
* @throws IOException
+ * if an IO error occurred
*/
public File createTempDirectory() throws IOException {
return config.isWriteToTemp()
* path to the node in repository to parse git attributes for
* @return name of the difftool if set
* @throws ToolException
+ * if the tool failed
*/
public Optional<String> getExternalToolFromAttributes(final String path)
throws ToolException {
/**
* @param path
+ * path string
*/
@Override
public void setPath(String path) {
/**
* @param withBase
* not used, because user-defined merge tool can only define one
- * cmd -> it must handle with and without base present (empty)
+ * cmd -> it must handle with and without base present (empty)
* @return the tool command
*/
@Override
this.blockSize = channel.blockSize() > 0 ? channel.blockSize() : 65536;
}
- /** {@inheritDoc} */
@Override
protected void onPackHeader(long objCnt) throws IOException {
if (expectedObjectCount >= 0) {
}
}
- /** {@inheritDoc} */
@Override
protected void onBeginWholeObject(long streamPosition, int type,
long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected void onObjectHeader(Source src, byte[] raw, int pos, int len)
throws IOException {
crc.update(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onObjectData(Source src, byte[] raw, int pos, int len)
throws IOException {
crc.update(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onEndWholeObject(PackedObjectInfo info) throws IOException {
info.setCRC((int) crc.getValue());
}
- /** {@inheritDoc} */
@Override
protected void onBeginOfsDelta(long deltaStreamPosition,
long baseStreamPosition, long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected void onBeginRefDelta(long deltaStreamPosition, AnyObjectId baseId,
long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected UnresolvedDelta onEndDelta() throws IOException {
UnresolvedDelta delta = new UnresolvedDelta();
return delta;
}
- /** {@inheritDoc} */
@Override
protected void onInflatedObjectData(PackedObjectInfo obj, int typeCode,
byte[] data) throws IOException {
// FsckPackParser ignores this event.
}
- /** {@inheritDoc} */
@Override
protected void verifySafeObject(final AnyObjectId id, final int type,
final byte[] data) {
}
}
- /** {@inheritDoc} */
@Override
protected void onPackFooter(byte[] hash) throws IOException {
// Do nothing.
}
- /** {@inheritDoc} */
@Override
protected boolean onAppendBase(int typeCode, byte[] data,
PackedObjectInfo info) throws IOException {
return false;
}
- /** {@inheritDoc} */
@Override
protected void onEndThinPack() throws IOException {
// Do nothing.
}
- /** {@inheritDoc} */
@Override
protected ObjectTypeAndSize seekDatabase(PackedObjectInfo obj,
ObjectTypeAndSize info) throws IOException {
return readObjectHeader(info);
}
- /** {@inheritDoc} */
@Override
protected ObjectTypeAndSize seekDatabase(UnresolvedDelta delta,
ObjectTypeAndSize info) throws IOException {
return readObjectHeader(info);
}
- /** {@inheritDoc} */
@Override
protected int readDatabase(byte[] dst, int pos, int cnt)
throws IOException {
return buf.array();
}
- /** {@inheritDoc} */
@Override
protected boolean checkCRC(int oldCRC) {
return oldCRC == (int) crc.getValue();
}
- /** {@inheritDoc} */
@Override
protected void onStoreStream(byte[] raw, int pos, int len)
throws IOException {
this.bitmap = bitmap;
}
- /** {@inheritDoc} */
@Override
public final boolean include(RevWalk walker, RevCommit cmit) {
Bitmap visitedBitmap;
return false;
}
- /** {@inheritDoc} */
@Override
public final RevFilter clone() {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public final boolean requiresCommitBody() {
return false;
this.bitmap = bitmap;
}
- /** {@inheritDoc} */
@Override
public final boolean include(RevWalk rw, RevCommit c) {
Bitmap visitedBitmap;
return false;
}
- /** {@inheritDoc} */
@Override
public final RevFilter clone() {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public final boolean requiresCommitBody() {
return false;
this.bitmap = bitmap;
}
- /** {@inheritDoc} */
@Override
public final boolean include(RevWalk walker, RevCommit cmit) {
Bitmap visitedBitmap;
return false;
}
- /** {@inheritDoc} */
@Override
public final RevFilter clone() {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public final boolean requiresCommitBody() {
return false;
this.reached = repoBitmaps.newBitmapBuilder();
}
- /** {@inheritDoc} */
@Override
public final boolean include(RevWalk walker, RevCommit cmit) {
Bitmap commitBitmap;
}
}
- /** {@inheritDoc} */
@Override
public final RevFilter clone() {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public final boolean requiresCommitBody() {
return false;
/** Empty {@link CommitGraph} with no results. */
CommitGraph EMPTY = new CommitGraph() {
- /** {@inheritDoc} */
@Override
public int findGraphPosition(AnyObjectId commit) {
return -1;
}
- /** {@inheritDoc} */
@Override
public CommitData getCommitData(int graphPos) {
return null;
}
- /** {@inheritDoc} */
@Override
public ObjectId getObjectId(int graphPos) {
return null;
}
- /** {@inheritDoc} */
@Override
public long getCommitCnt() {
return 0;
/** Mask to make the last edgeValue into position */
static final int GRAPH_EDGE_LAST_MASK = 0x7fffffff;
- /** EdgeValue & GRAPH_LAST_EDGE != 0 means it is the last edgeValue */
+ /** EdgeValue & GRAPH_LAST_EDGE != 0 means it is the last edgeValue */
static final int GRAPH_LAST_EDGE = 0x80000000;
/** EdgeValue == GRAPH_NO_PARENT means it has no parents */
static final int GRAPH_NO_PARENT = 0x70000000;
/**
- * EdgeValue & GRAPH_EXTRA_EDGES_NEEDED != 0 means its other parents are in
- * Chunk Extra Edge List
+ * EdgeValue & GRAPH_EXTRA_EDGES_NEEDED != 0 means its other parents are
+ * in Chunk Extra Edge List
*/
static final int GRAPH_EXTRA_EDGES_NEEDED = 0x80000000;
}
this.commitData = commitData;
}
- /** {@inheritDoc} */
@Override
public int findGraphPosition(AnyObjectId commit) {
return idx.findGraphPosition(commit);
}
- /** {@inheritDoc} */
@Override
public CommitData getCommitData(int graphPos) {
if (graphPos < 0 || graphPos >= getCommitCnt()) {
return commitData.getCommitData(graphPos);
}
- /** {@inheritDoc} */
@Override
public ObjectId getObjectId(int graphPos) {
return idx.getObjectId(graphPos);
}
- /** {@inheritDoc} */
@Override
public long getCommitCnt() {
return idx.getCommitCnt();
* buffered by the caller. The caller is responsible for closing
* the stream.
* @throws IOException
+ * if an error occurred
*/
public void write(@NonNull ProgressMonitor monitor,
@NonNull OutputStream commitGraphStream) throws IOException {
* @return the commits' collection which are used by the commit-graph
* writer. Never null.
* @throws IOException
+ * if an error occurred
*/
public static GraphCommits fromWalk(ProgressMonitor pm,
@NonNull Set<? extends ObjectId> wants, @NonNull RevWalk walk)
return sortedCommits.size();
}
- /** {@inheritDoc} */
@Override
public Iterator<RevCommit> iterator() {
return sortedCommits.iterator();
return pack;
}
- /** {@inheritDoc} */
@Override
public Class<BeforeDfsPackIndexLoadedListener> getListenerType() {
return BeforeDfsPackIndexLoadedListener.class;
}
- /** {@inheritDoc} */
@Override
public void dispatch(BeforeDfsPackIndexLoadedListener listener) {
listener.onBeforeDfsPackIndexLoaded(this);
/**
* @return ReadableChannel
* @throws IOException
+ * if an IO error occurred
*/
ReadableChannel get() throws IOException;
}
return pack.getPackDescription();
}
- /** {@inheritDoc} */
@Override
public long getObjectCount() throws IOException {
return getPackDescription().getObjectCount();
}
- /** {@inheritDoc} */
@Override
public long getDeltaCount() throws IOException {
return getPackDescription().getDeltaCount();
}
- /** {@inheritDoc} */
@Override
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep) {
return ((DfsObjectRepresentation) rep).pack == pack;
* simply clears the config, and saving does nothing.
*/
public final class DfsConfig extends StoredConfig {
- /** {@inheritDoc} */
@Override
public void load() throws IOException, ConfigInvalidException {
clear();
}
- /** {@inheritDoc} */
@Override
public void save() throws IOException {
// TODO actually store this configuration.
this.compression = compression;
}
- /** {@inheritDoc} */
@Override
public DfsPackParser newPackParser(InputStream in) throws IOException {
return new DfsPackParser(db, this, in);
}
- /** {@inheritDoc} */
@Override
public ObjectReader newReader() {
return new Reader();
}
- /** {@inheritDoc} */
@Override
public ObjectId insert(int type, byte[] data, int off, int len)
throws IOException {
return endObject(id, offset);
}
- /** {@inheritDoc} */
@Override
public ObjectId insert(int type, long len, InputStream in)
throws IOException {
return buf;
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
if (packDsc == null)
clear();
}
- /** {@inheritDoc} */
@Override
public void close() {
if (packOut != null) {
this.packComparator = packComparator;
}
- /** {@inheritDoc} */
@Override
public DfsReader newReader() {
return new DfsReader(this);
}
- /** {@inheritDoc} */
@Override
public ObjectInserter newInserter() {
return new DfsInserter(this);
packList.set(NO_PACKS);
}
- /** {@inheritDoc} */
@Override
public void close() {
packList.set(NO_PACKS);
this.pack = pack;
}
- /** {@inheritDoc} */
@Override
public int getFormat() {
return format;
}
- /** {@inheritDoc} */
@Override
public int getWeight() {
return (int) Math.min(length, Integer.MAX_VALUE);
}
- /** {@inheritDoc} */
@Override
public ObjectId getDeltaBase() {
return baseId;
}
- /** {@inheritDoc} */
@Override
public boolean wasDeltaAttempted() {
switch (pack.getPackDescription().getPackSource()) {
setExtendedFlag(FLAG_FOUND);
}
- /** {@inheritDoc} */
@Override
protected void clearReuseAsIs() {
super.clearReuseAsIs();
pack = null;
}
- /** {@inheritDoc} */
@Override
public void select(StoredObjectRepresentation ref) {
DfsObjectRepresentation ptr = (DfsObjectRepresentation) ref;
return 0;
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
write(new byte[] { (byte) b });
}
- /** {@inheritDoc} */
@Override
public abstract void write(byte[] buf, int off, int len) throws IOException;
return this;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return packName.hashCode();
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object b) {
if (b instanceof DfsPackDescription) {
}
}
- /** {@inheritDoc} */
@Override
public String toString() {
return getFileName(PackExt.PACK);
this.packDigest = Constants.newMessageDigest();
}
- /** {@inheritDoc} */
@Override
public PackLock parse(ProgressMonitor receiving, ProgressMonitor resolving)
throws IOException {
return packDsc;
}
- /** {@inheritDoc} */
@Override
protected void onPackHeader(long objectCount) throws IOException {
if (objectCount == 0) {
currBuf = new byte[blockSize];
}
- /** {@inheritDoc} */
@Override
protected void onBeginWholeObject(long streamPosition, int type,
long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected void onEndWholeObject(PackedObjectInfo info) throws IOException {
info.setCRC((int) crc.getValue());
}
- /** {@inheritDoc} */
@Override
protected void onBeginOfsDelta(long streamPosition,
long baseStreamPosition, long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected void onBeginRefDelta(long streamPosition, AnyObjectId baseId,
long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected UnresolvedDelta onEndDelta() throws IOException {
UnresolvedDelta delta = new UnresolvedDelta();
return delta;
}
- /** {@inheritDoc} */
@Override
protected void onInflatedObjectData(PackedObjectInfo obj, int typeCode,
byte[] data) throws IOException {
// DfsPackParser ignores this event.
}
- /** {@inheritDoc} */
@Override
protected void onObjectHeader(Source src, byte[] raw, int pos, int len)
throws IOException {
crc.update(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onObjectData(Source src, byte[] raw, int pos, int len)
throws IOException {
crc.update(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onStoreStream(byte[] raw, int pos, int len)
throws IOException {
return v;
}
- /** {@inheritDoc} */
@Override
protected void onPackFooter(byte[] hash) throws IOException {
// The base class will validate the original hash matches
packHash = hash;
}
- /** {@inheritDoc} */
@Override
protected ObjectTypeAndSize seekDatabase(PackedObjectInfo obj,
ObjectTypeAndSize info) throws IOException {
return readObjectHeader(info);
}
- /** {@inheritDoc} */
@Override
protected ObjectTypeAndSize seekDatabase(UnresolvedDelta delta,
ObjectTypeAndSize info) throws IOException {
return readObjectHeader(info);
}
- /** {@inheritDoc} */
@Override
protected int readDatabase(byte[] dst, int pos, int cnt) throws IOException {
if (cnt == 0)
return (pos / blockSize) * blockSize;
}
- /** {@inheritDoc} */
@Override
protected boolean checkCRC(int oldCRC) {
return oldCRC == (int) crc.getValue();
}
- /** {@inheritDoc} */
@Override
protected boolean onAppendBase(final int typeCode, final byte[] data,
final PackedObjectInfo info) throws IOException {
return true;
}
- /** {@inheritDoc} */
@Override
protected void onEndThinPack() throws IOException {
// Normally when a thin pack is closed the pack header gets
*/
public class DfsPacksChangedEvent
extends RepositoryEvent<DfsPacksChangedListener> {
- /** {@inheritDoc} */
@Override
public Class<DfsPacksChangedListener> getListenerType() {
return DfsPacksChangedListener.class;
}
- /** {@inheritDoc} */
@Override
public void dispatch(DfsPacksChangedListener listener) {
listener.onPacksChanged(this);
return baseCache;
}
- /** {@inheritDoc} */
@Override
public ObjectReader newReader() {
return db.newReader();
}
- /** {@inheritDoc} */
@Override
public void setAvoidUnreachableObjects(boolean avoid) {
avoidUnreachable = avoid;
}
- /** {@inheritDoc} */
@Override
public BitmapIndex getBitmapIndex() throws IOException {
for (DfsPackFile pack : db.getPacks()) {
return null;
}
- /** {@inheritDoc} */
@Override
public Optional<CommitGraph> getCommitGraph() throws IOException {
for (DfsPackFile pack : db.getPacks()) {
return Optional.empty();
}
- /** {@inheritDoc} */
@Override
public Collection<CachedPack> getCachedPacksAndUpdate(
BitmapBuilder needBitmap) throws IOException {
return Collections.emptyList();
}
- /** {@inheritDoc} */
@Override
public Collection<ObjectId> resolve(AbbreviatedObjectId id)
throws IOException {
}
}
- /** {@inheritDoc} */
@Override
public boolean has(AnyObjectId objectId) throws IOException {
if (last != null
return false;
}
- /** {@inheritDoc} */
@Override
public ObjectLoader open(AnyObjectId objectId, int typeHint)
throws MissingObjectException, IncorrectObjectTypeException,
return null;
}
- /** {@inheritDoc} */
@Override
public Set<ObjectId> getShallowCommits() {
return Collections.emptySet();
return avoidUnreachable && pack.isGarbage();
}
- /** {@inheritDoc} */
@Override
public <T extends ObjectId> AsyncObjectLoaderQueue<T> open(
Iterable<T> objectIds, final boolean reportMissing) {
};
}
- /** {@inheritDoc} */
@Override
public <T extends ObjectId> AsyncObjectSizeQueue<T> getObjectSize(
Iterable<T> objectIds, final boolean reportMissing) {
};
}
- /** {@inheritDoc} */
@Override
public long getObjectSize(AnyObjectId objectId, int typeHint)
throws MissingObjectException, IncorrectObjectTypeException,
return -1;
}
- /** {@inheritDoc} */
@Override
public DfsObjectToPack newObjectToPack(AnyObjectId objectId, int type) {
return new DfsObjectToPack(objectId, type);
return tmp;
}
- /** {@inheritDoc} */
@Override
public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp,
boolean validate) throws IOException,
src.pack.copyAsIs(out, src, validate, this);
}
- /** {@inheritDoc} */
@Override
public void writeObjects(PackOutputStream out, List<ObjectToPack> list)
throws IOException {
out.writeObject(otp);
}
- /** {@inheritDoc} */
@Override
public void copyPackAsIs(PackOutputStream out, CachedPack pack)
throws IOException {
return 0 < read().size();
}
- /** {@inheritDoc} */
@Override
public Ref exactRef(String name) throws IOException {
RefCache curr = read();
return ref != null ? resolve(ref, 0, curr.ids) : null;
}
- /** {@inheritDoc} */
@Override
public List<Ref> getAdditionalRefs() {
return Collections.emptyList();
}
- /** {@inheritDoc} */
@Override
public Map<String, Ref> getRefs(String prefix) throws IOException {
RefCache curr = read();
return new SymbolicRef(ref.getName(), dst);
}
- /** {@inheritDoc} */
@Override
public Ref peel(Ref ref) throws IOException {
final Ref oldLeaf = ref.getLeaf();
return leaf;
}
- /** {@inheritDoc} */
@Override
public RefUpdate newUpdate(String refName, boolean detach)
throws IOException {
return update;
}
- /** {@inheritDoc} */
@Override
public RefRename newRename(String fromName, String toName)
throws IOException {
return new DfsRefRename(src, dst);
}
- /** {@inheritDoc} */
@Override
public boolean isNameConflicting(String refName) throws IOException {
RefList<Ref> all = read().ids;
return false;
}
- /** {@inheritDoc} */
@Override
public void create() {
// Nothing to do.
}
- /** {@inheritDoc} */
@Override
public void refresh() {
clearCache();
}
- /** {@inheritDoc} */
@Override
public void close() {
clearCache();
super(src, dst);
}
- /** {@inheritDoc} */
@Override
protected Result doRename() throws IOException {
// TODO Correctly handle renaming foo/bar to foo.
this.refdb = refdb;
}
- /** {@inheritDoc} */
@Override
protected DfsRefDatabase getRefDatabase() {
return refdb;
}
- /** {@inheritDoc} */
@Override
protected DfsRepository getRepository() {
return refdb.getRepository();
}
- /** {@inheritDoc} */
@Override
protected boolean tryLock(boolean deref) throws IOException {
dstRef = getRef();
return true;
}
- /** {@inheritDoc} */
@Override
protected void unlock() {
// No state is held while "locked".
}
- /** {@inheritDoc} */
@Override
public Result update(RevWalk walk) throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
protected Result doUpdate(Result desiredResult) throws IOException {
ObjectIdRef newRef;
return Result.LOCK_FAILURE;
}
- /** {@inheritDoc} */
@Override
protected Result doDelete(Result desiredResult) throws IOException {
if (getRefDatabase().compareAndRemove(dstRef)) {
return Result.LOCK_FAILURE;
}
- /** {@inheritDoc} */
@Override
protected Result doLink(String target) throws IOException {
final SymbolicRef newRef = new SymbolicRef(
stack = null;
}
- /** {@inheritDoc} */
@Override
public boolean hasVersioning() {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean performsAtomicTransactions() {
return true;
}
- /** {@inheritDoc} */
@Override
public BatchRefUpdate newBatchUpdate() {
DfsObjDatabase odb = getRepository().getObjectDatabase();
return reftableDatabase.isNameConflicting(refName, new TreeSet<>(), new HashSet<>());
}
- /** {@inheritDoc} */
@Override
public Ref exactRef(String name) throws IOException {
return reftableDatabase.exactRef(name);
}
- /** {@inheritDoc} */
@Override
public Map<String, Ref> getRefs(String prefix) throws IOException {
List<Ref> refs = reftableDatabase.getRefsByPrefix(prefix);
RefList.emptyList());
}
- /** {@inheritDoc} */
@Override
public List<Ref> getRefsByPrefix(String prefix) throws IOException {
return reftableDatabase.getRefsByPrefix(prefix);
}
- /** {@inheritDoc} */
@Override
public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes)
throws IOException {
return reftableDatabase.getRefsByPrefixWithExclusions(include, excludes);
}
- /** {@inheritDoc} */
@Override
public Set<Ref> getTipsWithSha1(ObjectId id) throws IOException {
if (!getReftableConfig().isIndexObjects()) {
return reftableDatabase.getTipsWithSha1(id);
}
- /** {@inheritDoc} */
@Override
public boolean hasFastTipsWithSha1() throws IOException {
return reftableDatabase.hasFastTipsWithSha1();
}
- /** {@inheritDoc} */
@Override
public Ref peel(Ref ref) throws IOException {
Ref oldLeaf = ref.getLeaf();
}
}
- /** {@inheritDoc} */
@Override
protected boolean compareAndPut(Ref oldRef, @Nullable Ref newRef)
throws IOException {
}
}
- /** {@inheritDoc} */
@Override
protected boolean compareAndRemove(Ref oldRef) throws IOException {
return compareAndPut(oldRef, null);
}
- /** {@inheritDoc} */
@Override
protected RefCache scanAllRefs() throws IOException {
throw new UnsupportedOperationException();
// Unnecessary; DfsReftableBatchRefUpdate calls clearCache().
}
- /** {@inheritDoc} */
@Override
protected void cachePeeledState(Ref oldLeaf, Ref newLeaf) {
// Do not cache peeled state in reftable.
return Collections.unmodifiableList(tables);
}
- /** {@inheritDoc} */
@Override
public void close() {
for (ReftableReader t : tables) {
this.description = builder.getRepositoryDescription();
}
- /** {@inheritDoc} */
@Override
public abstract DfsObjDatabase getObjectDatabase();
return true;
}
- /** {@inheritDoc} */
@Override
public void create(boolean bare) throws IOException {
if (exists())
throw new IOException(result.name());
}
- /** {@inheritDoc} */
@Override
public StoredConfig getConfig() {
return config;
}
- /** {@inheritDoc} */
@Override
public String getIdentifier() {
return getDescription().getRepositoryName();
}
- /** {@inheritDoc} */
@Override
public void scanForRepoChanges() throws IOException {
getRefDatabase().refresh();
getObjectDatabase().clearCache();
}
- /** {@inheritDoc} */
@Override
public void notifyIndexChanged(boolean internal) {
// Do not send notifications.
// There is no index, as there is no working tree.
}
- /** {@inheritDoc} */
@Override
public ReflogReader getReflogReader(String refName) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public AttributesNodeProvider createAttributesNodeProvider() {
// TODO Check if the implementation used in FileRepository can be used
return self();
}
- /** {@inheritDoc} */
@Override
public B setup() throws IllegalArgumentException, IOException {
super.setup();
// We don't support local file IO and thus shouldn't permit these to set.
- /** {@inheritDoc} */
@Override
public B setGitDir(File gitDir) {
if (gitDir != null)
return self();
}
- /** {@inheritDoc} */
@Override
public B setObjectDirectory(File objectDirectory) {
if (objectDirectory != null)
return self();
}
- /** {@inheritDoc} */
@Override
public B addAlternateObjectDirectory(File other) {
throw new UnsupportedOperationException(
JGitText.get().unsupportedAlternates);
}
- /** {@inheritDoc} */
@Override
public B setWorkTree(File workTree) {
if (workTree != null)
return self();
}
- /** {@inheritDoc} */
@Override
public B setIndexFile(File indexFile) {
if (indexFile != null)
return repositoryName;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
if (getRepositoryName() != null)
return System.identityHashCode(this);
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object b) {
if (b instanceof DfsRepositoryDescription){
return false;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
this.packExtPos = ext == null ? 0 : ext.getPosition();
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return hash;
}
- /** {@inheritDoc} */
@Override
public abstract boolean equals(Object o);
- /** {@inheritDoc} */
@SuppressWarnings("boxing")
@Override
public String toString() {
return new MemRefDatabase();
}
- /** {@inheritDoc} */
@Override
public MemObjDatabase getObjectDatabase() {
return objdb;
}
- /** {@inheritDoc} */
@Override
public RefDatabase getRefDatabase() {
return refdb;
refdb.performsAtomicTransactions = atomic;
}
- /** {@inheritDoc} */
@Override
@Nullable
public String getGitwebDescription() {
return gitwebDescription;
}
- /** {@inheritDoc} */
@Override
public void setGitwebDescription(@Nullable String d) {
gitwebDescription = d;
this.db = db;
}
- /** {@inheritDoc} */
@Override
public int getType() {
return type;
}
- /** {@inheritDoc} */
@Override
public long getSize() {
return size;
}
- /** {@inheritDoc} */
@Override
public boolean isLarge() {
return true;
}
- /** {@inheritDoc} */
@Override
public byte[] getCachedBytes() throws LargeObjectException {
throw new LargeObjectException();
}
- /** {@inheritDoc} */
@Override
public ObjectStream openStream() throws MissingObjectException, IOException {
PackInputStream packIn;
ctx.pin(pack, pos);
}
- /** {@inheritDoc} */
@Override
public int read(byte[] b, int off, int len) throws IOException {
int n = ctx.copy(pack, pos, b, off, len);
return n;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
byte[] buf = new byte[1];
return n == 1 ? buf[0] & 0xff : -1;
}
- /** {@inheritDoc} */
@Override
public void close() {
ctx.close();
this.bitmaps = bitmaps;
}
- /** {@inheritDoc} */
@Override
public EWAHCompressedBitmap getBitmap(AnyObjectId objectId) {
StoredBitmap sb = bitmaps.get(objectId);
return packIndex;
}
- /** {@inheritDoc} */
@Override
public CompressedBitmap getBitmap(AnyObjectId objectId) {
EWAHCompressedBitmap compressed = packIndex.getBitmap(objectId);
return new CompressedBitmap(compressed, this);
}
- /** {@inheritDoc} */
@Override
public CompressedBitmapBuilder newBitmapBuilder() {
return new CompressedBitmapBuilder(this);
* Construct compressed bitmap for given bitmap and bitmap index
*
* @param bitmap
+ * the bitmap
* @param bitmapIndex
+ * the bitmap index
*/
public CompressedBitmap(EWAHCompressedBitmap bitmap, BitmapIndexImpl bitmapIndex) {
this.bitmap = bitmap;
array = b;
}
- /** {@inheritDoc} */
@Override
protected int copy(int p, byte[] b, int o, int n) {
n = Math.min(array.length - p, n);
return n;
}
- /** {@inheritDoc} */
@Override
protected int setInput(int pos, Inflater inf)
throws DataFormatException {
buffer = b;
}
- /** {@inheritDoc} */
@Override
protected int copy(int p, byte[] b, int o, int n) {
final ByteBuffer s = buffer.slice();
}
}
- /** {@inheritDoc} */
@Override
protected int setInput(int pos, Inflater inf)
throws DataFormatException {
return m;
}
- /** {@inheritDoc} */
@Override
public void close() {
// Don't close anything.
}
- /** {@inheritDoc} */
@Override
public ObjectDatabase newCachedDatabase() {
return this;
wrapped.resolve(matches, id);
}
- /** {@inheritDoc} */
@Override
public boolean has(AnyObjectId objectId) throws IOException {
return has(objectId, null);
return wrapped.getPacks();
}
- /** {@inheritDoc} */
@Override
public Optional<CommitGraph> getCommitGraph() {
return wrapped.getCommitGraph();
to = comment.substring(p2 + " to ".length(), p3); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public String getFromBranch() {
return from;
}
- /** {@inheritDoc} */
@Override
public String getToBranch() {
return to;
INSERTED, EXISTS_PACKED, EXISTS_LOOSE, FAILURE;
}
- /** {@inheritDoc} */
@Override
public ObjectReader newReader() {
return new WindowCursor(this);
}
- /** {@inheritDoc} */
@Override
public ObjectDirectoryInserter newInserter() {
return new ObjectDirectoryInserter(this, getConfig());
/**
* @param repoDir
+ * the repository's metadata directory
* @return whether the given repo uses reftable for refdb storage.
*/
public static boolean isReftable(File repoDir) {
return new File(repoDir, Constants.REFTABLE).isDirectory();
}
- /** {@inheritDoc} */
@Override
public boolean hasFastTipsWithSha1() throws IOException {
return reftableDatabase.hasFastTipsWithSha1();
return reftableDatabase.getLock();
}
- /** {@inheritDoc} */
@Override
public boolean performsAtomicTransactions() {
return true;
}
- /** {@inheritDoc} */
@NonNull
@Override
public BatchRefUpdate newBatchUpdate() {
return new FileReftableBatchRefUpdate(this, fileRepository);
}
- /** {@inheritDoc} */
@Override
public RefUpdate newUpdate(String refName, boolean detach)
throws IOException {
return update;
}
- /** {@inheritDoc} */
@Override
public Ref exactRef(String name) throws IOException {
return reftableDatabase.exactRef(name);
}
- /** {@inheritDoc} */
@Override
public List<Ref> getRefs() throws IOException {
return super.getRefs();
}
- /** {@inheritDoc} */
@Override
public Map<String, Ref> getRefs(String prefix) throws IOException {
List<Ref> refs = reftableDatabase.getRefsByPrefix(prefix);
RefList.emptyList());
}
- /** {@inheritDoc} */
@Override
public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes)
throws IOException {
return reftableDatabase.getRefsByPrefixWithExclusions(include, excludes);
}
- /** {@inheritDoc} */
@Override
public List<Ref> getAdditionalRefs() throws IOException {
return Collections.emptyList();
}
- /** {@inheritDoc} */
@Override
public Ref peel(Ref ref) throws IOException {
Ref oldLeaf = ref.getLeaf();
}
}
- /** {@inheritDoc} */
@Override
public RefRename newRename(String fromName, String toName)
throws IOException {
return new FileRefRename(src, dst);
}
- /** {@inheritDoc} */
@Override
public boolean isNameConflicting(String name) throws IOException {
return reftableDatabase.isNameConflicting(name, new TreeSet<>(),
new HashSet<>());
}
- /** {@inheritDoc} */
@Override
public void close() {
reftableStack.close();
}
- /** {@inheritDoc} */
@Override
public void create() throws IOException {
FileUtils.mkdir(
* @param w
* writer to use
* @throws IOException
+ * if an IO error occurred
*/
void call(ReftableWriter w) throws IOException;
}
* Calculate an approximate log2.
*
* @param sz
+ * the number to compute an approximate log2 for
* @return log2
*/
static int log(long sz) {
* shape.
*
* @throws IOException
+ * if an IO error occurred
*/
private void autoCompact() throws IOException {
Optional<Segment> cand = autoCompactCandidate(tableSizes());
return objectDatabase.getDirectory();
}
- /** {@inheritDoc} */
@Override
public ObjectDirectory getObjectDatabase() {
return objectDatabase;
}
- /** {@inheritDoc} */
@Override
public RefDatabase getRefDatabase() {
return refs;
}
- /** {@inheritDoc} */
@Override
public String getIdentifier() {
File directory = getDirectory();
throw new IllegalStateException();
}
- /** {@inheritDoc} */
@Override
public FileBasedConfig getConfig() {
try {
return repoConfig;
}
- /** {@inheritDoc} */
@Override
@Nullable
public String getGitwebDescription() throws IOException {
return d;
}
- /** {@inheritDoc} */
@Override
public void setGitwebDescription(@Nullable String description)
throws IOException {
* client trying to push changes avoid pushing more than it needs to.
*
* @throws IOException
+ * if an IO error occurred
*/
@Override
public Set<ObjectId> getAdditionalHaves() throws IOException {
objectDatabase.openPack(pack);
}
- /** {@inheritDoc} */
@Override
public void scanForRepoChanges() throws IOException {
getRefDatabase().getRefs(); // This will look for changes to refs
notifyIndexChanged(false);
}
- /** {@inheritDoc} */
@Override
public void notifyIndexChanged(boolean internal) {
synchronized (snapshotLock) {
fireEvent(new IndexChangedEvent(internal));
}
- /** {@inheritDoc} */
@Override
public ReflogReader getReflogReader(String refName) throws IOException {
if (refs instanceof FileReftableDatabase) {
return new ReflogReaderImpl(this, ref.getName());
}
- /** {@inheritDoc} */
@Override
public AttributesNodeProvider createAttributesNodeProvider() {
return new AttributesNodeProviderImpl(this);
ConfigConstants.CONFIG_KEY_AUTODETACH, true);
}
- /** {@inheritDoc} */
@SuppressWarnings("FutureReturnValueIgnored")
@Override
public void autoGC(ProgressMonitor monitor) {
&& Objects.equals(fileKey, other.fileKey);
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj) {
return equals(other);
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return Objects.hash(lastModified, Long.valueOf(size), fileKey);
return racyThreshold;
}
- /** {@inheritDoc} */
@SuppressWarnings({ "nls", "ReferenceEquality" })
@Override
public String toString() {
* gc.log.
*
* @return the collection of
- * {@link org.eclipse.jgit.internal.storage.file.Pack}'s which
- * are newly created
+ * {@link org.eclipse.jgit.internal.storage.file.Pack}'s which are
+ * newly created
* @throws java.io.IOException
+ * if an IO error occurred
* @throws java.text.ParseException
* If the configuration parameter "gc.pruneexpire" couldn't be
* parsed
* pack files.
*
* @param inserter
+ * used to insert objects
* @param reader
+ * used to read objects
* @param pack
+ * the pack file to loosen objects for
* @param existing
+ * existing objects
* @throws IOException
+ * if an IO error occurred
*/
private void loosen(ObjectDirectoryInserter inserter, ObjectReader reader, Pack pack, HashSet<ObjectId> existing)
throws IOException {
* directory. If an expirationDate is set then pack files which are younger
* than the expirationDate will not be deleted nor preserved.
* <p>
- * If we're not immediately expiring loose objects, loosen any objects
- * in the old pack files which aren't in the new pack files.
+ * If we're not immediately expiring loose objects, loosen any objects in
+ * the old pack files which aren't in the new pack files.
*
* @param oldPacks
+ * old pack files
* @param newPacks
+ * new pack files
* @throws ParseException
+ * if an error occurred during parsing
* @throws IOException
+ * if an IO error occurred
*/
private void deleteOldPacks(Collection<Pack> oldPacks,
Collection<Pack> newPacks) throws ParseException, IOException {
}
/**
- * Deletes old pack file, unless 'preserve-oldpacks' is set, in which case it
- * moves the pack file to the preserved directory
+ * Deletes old pack file, unless 'preserve-oldpacks' is set, in which case
+ * it moves the pack file to the preserved directory
*
* @param packFile
+ * the packfile to delete
* @param deleteOptions
+ * delete option flags
* @throws IOException
+ * if an IO error occurred
*/
private void removeOldPack(PackFile packFile, int deleteOptions)
throws IOException {
* with a ".pack" file without a ".index" file.
*
* @param packFile
+ * the pack file to prune files for
*/
private void prunePack(PackFile packFile) {
try {
* because the filesystem delete operation fails) this is silently ignored.
*
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void prunePacked() throws IOException {
ObjectDirectory objdb = repo.getObjectDatabase();
* @param objectsToKeep
* a set of objects which should explicitly not be pruned
* @throws java.io.IOException
+ * if an IO error occurred
* @throws java.text.ParseException
* If the configuration parameter "gc.pruneexpire" couldn't be
* parsed
* by the given ObjectWalk
*
* @param id2File
+ * mapping objectIds to files
* @param w
+ * used to walk objects
* @throws MissingObjectException
+ * if an object is missing
* @throws IncorrectObjectTypeException
+ * if an object has an unexpected tyoe
* @throws IOException
+ * if an IO error occurred
*/
private void removeReferenced(Map<ObjectId, File> id2File,
ObjectWalk w) throws MissingObjectException,
* is compacted into a single table.
*
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void packRefs() throws IOException {
RefDatabase refDb = repo.getRefDatabase();
* the list of wanted objects, writer walks commits starting at
* these. Must not be {@code null}.
* @throws IOException
+ * if an IO error occurred
*/
void writeCommitGraph(@NonNull Set<? extends ObjectId> wants)
throws IOException {
/**
* @param ref
* the ref which log should be inspected
- * @param minTime only reflog entries not older then this time are processed
+ * @param minTime
+ * only reflog entries not older then this time are processed
* @return the {@link ObjectId}s contained in the reflog
* @throws IOException
+ * if an IO error occurred
*/
private Set<ObjectId> listRefLogObjects(Ref ref, long minTime) throws IOException {
ReflogReader reflogReader = repo.getReflogReader(ref);
*
* @return a collection of refs pointing to live objects.
* @throws IOException
+ * if an IO error occurred
*/
private Collection<Ref> getAllRefs() throws IOException {
RefDatabase refdb = repo.getRefDatabase();
*
* @return a set of ObjectIds of changed objects in the index
* @throws IOException
+ * if an IO error occurred
* @throws CorruptObjectException
+ * if an object is corrupt
* @throws NoWorkTreeException
+ * if the repository has no working directory
*/
private Set<ObjectId> listNonHEADIndexObjects()
throws CorruptObjectException, IOException {
*
* @return information about objects and pack files for a FileRepository
* @throws java.io.IOException
+ * if an IO error occurred
*/
public RepoStatistics getStatistics() throws IOException {
RepoStatistics ret = new RepoStatistics();
* @param content
* The content to write
* @throws IOException
+ * if an IO error occurred
*/
void write(String content) throws IOException {
if (content.length() > 0) {
*
* @return the attributes node
* @throws java.io.IOException
+ * if an IO error occurred
*/
public AttributesNode load() throws IOException {
AttributesNode r = new AttributesNode();
*
* @return the attributes node
* @throws java.io.IOException
+ * if an IO error occurred
*/
public AttributesNode load() throws IOException {
AttributesNode r = new AttributesNode();
this.db = db;
}
- /** {@inheritDoc} */
@Override
public int getType() {
return type;
}
- /** {@inheritDoc} */
@Override
public long getSize() {
return size;
}
- /** {@inheritDoc} */
@Override
public boolean isLarge() {
return true;
}
- /** {@inheritDoc} */
@Override
public byte[] getCachedBytes() throws LargeObjectException {
try {
}
}
- /** {@inheritDoc} */
@Override
public ObjectStream openStream() throws MissingObjectException, IOException {
WindowCursor wc = new WindowCursor(db);
this.src = src;
}
- /** {@inheritDoc} */
@Override
public boolean contains(AnyObjectId objectId) {
if (set == null) {
this.packs = packs.toArray(new Pack[0]);
}
- /** {@inheritDoc} */
@Override
public long getObjectCount() throws IOException {
long cnt = 0;
pack.copyPackAsIs(out, wc);
}
- /** {@inheritDoc} */
@Override
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep) {
try {
private ObjectId baseId;
- /** {@inheritDoc} */
@Override
public int getWeight() {
return (int) Math.min(length, Integer.MAX_VALUE);
}
- /** {@inheritDoc} */
@Override
public ObjectId getDeltaBase() {
if (baseId == null && getFormat() == PACK_DELTA) {
super(src, type);
}
- /** {@inheritDoc} */
@Override
protected void clearReuseAsIs() {
super.clearReuseAsIs();
pack = null;
}
- /** {@inheritDoc} */
@Override
public void select(StoredObjectRepresentation ref) {
LocalObjectRepresentation ptr = (LocalObjectRepresentation) ref;
* Get the lock file corresponding to the given file.
*
* @param file
+ * given file
* @return lock file
*/
static File getLockFile(File file) {
written = false;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
unpackedObjectCache().clear();
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "LooseObjects[" + directory + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
- /** {@inheritDoc} */
@Override
public final File getDirectory() {
return loose.getDirectory();
return preserved.getDirectory();
}
- /** {@inheritDoc} */
@Override
public boolean exists() {
return fs.exists(objects);
}
- /** {@inheritDoc} */
@Override
public void create() throws IOException {
loose.create();
packed.create();
}
- /** {@inheritDoc} */
@Override
public ObjectDirectoryInserter newInserter() {
return new ObjectDirectoryInserter(this, config);
return new PackInserter(this);
}
- /** {@inheritDoc} */
@Override
public void close() {
loose.close();
}
}
- /** {@inheritDoc} */
@Override
public Collection<Pack> getPacks() {
return packed.getPacks();
}
- /** {@inheritDoc} */
@Override
public long getApproximateObjectCount() {
long count = 0;
return count;
}
- /** {@inheritDoc} */
@Override
public Optional<CommitGraph> getCommitGraph() {
if (config.get(CoreConfig.KEY).enableCommitGraph()) {
}
/**
- * {@inheritDoc}
* <p>
* Add a single existing pack to the list of available pack files.
*/
return res;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "ObjectDirectory[" + getDirectory() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
- /** {@inheritDoc} */
@Override
public boolean has(AnyObjectId objectId) {
return loose.hasCached(objectId)
}
}
- /** {@inheritDoc} */
@Override
public ObjectDatabase newCachedDatabase() {
return newCachedFileObjectDatabase();
config = cfg.get(WriteConfig.KEY);
}
- /** {@inheritDoc} */
@Override
public ObjectId insert(int type, byte[] data, int off, int len)
throws IOException {
* ODB.
*
* @param type
+ * object type
* @param data
+ * object data
* @param off
+ * first position within @{code data}
* @param len
+ * length number of bytes to copy
* @param createDuplicate
- * @return ObjectId
+ * whether to insert a duplicate if an object with this id
+ * already exists
+ * @return ObjectId the name of the object
* @throws IOException
+ * if an IO error occurred
*/
private ObjectId insert(
int type, byte[] data, int off, int len, boolean createDuplicate)
return insertOneObject(tmp, id, createDuplicate);
}
- /** {@inheritDoc} */
@Override
public ObjectId insert(int type, long len, InputStream is)
throws IOException {
* ODB.
*
* @param type
+ * object type
* @param len
+ * number of bytes to copy
* @param is
+ * input stream
* @param createDuplicate
- * @return ObjectId
+ * whether to insert a duplicate if an object with this id
+ * already exists
+ * @return ObjectId the name of the object
* @throws IOException
+ * if an IO error occurred
*/
ObjectId insert(int type, long len, InputStream is, boolean createDuplicate)
throws IOException {
.format(JGitText.get().unableToCreateNewObject, dst));
}
- /** {@inheritDoc} */
@Override
public PackParser newPackParser(InputStream in) throws IOException {
return new ObjectDirectoryPackParser(db, in);
}
- /** {@inheritDoc} */
@Override
public ObjectReader newReader() {
return new WindowCursor(db, this);
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
// Do nothing. Loose objects are immediately visible.
}
- /** {@inheritDoc} */
@Override
public void close() {
if (deflate != null) {
return newPack;
}
- /** {@inheritDoc} */
@Override
public long getPackSize() {
if (newPack == null)
return size;
}
- /** {@inheritDoc} */
@Override
public PackLock parse(ProgressMonitor receiving, ProgressMonitor resolving)
throws IOException {
}
}
- /** {@inheritDoc} */
@Override
protected void onPackHeader(long objectCount) throws IOException {
// Ignored, the count is not required.
}
- /** {@inheritDoc} */
@Override
protected void onBeginWholeObject(long streamPosition, int type,
long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected void onEndWholeObject(PackedObjectInfo info) throws IOException {
info.setCRC((int) crc.getValue());
}
- /** {@inheritDoc} */
@Override
protected void onBeginOfsDelta(long streamPosition,
long baseStreamPosition, long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected void onBeginRefDelta(long streamPosition, AnyObjectId baseId,
long inflatedSize) throws IOException {
crc.reset();
}
- /** {@inheritDoc} */
@Override
protected UnresolvedDelta onEndDelta() throws IOException {
UnresolvedDelta delta = new UnresolvedDelta();
return delta;
}
- /** {@inheritDoc} */
@Override
protected void onInflatedObjectData(PackedObjectInfo obj, int typeCode,
byte[] data) throws IOException {
// ObjectDirectory ignores this event.
}
- /** {@inheritDoc} */
@Override
protected void onObjectHeader(Source src, byte[] raw, int pos, int len)
throws IOException {
crc.update(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onObjectData(Source src, byte[] raw, int pos, int len)
throws IOException {
crc.update(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onStoreStream(byte[] raw, int pos, int len)
throws IOException {
out.write(raw, pos, len);
}
- /** {@inheritDoc} */
@Override
protected void onPackFooter(byte[] hash) throws IOException {
packEnd = out.getFilePointer();
packHash = hash;
}
- /** {@inheritDoc} */
@Override
protected ObjectTypeAndSize seekDatabase(UnresolvedDelta delta,
ObjectTypeAndSize info) throws IOException {
return readObjectHeader(info);
}
- /** {@inheritDoc} */
@Override
protected ObjectTypeAndSize seekDatabase(PackedObjectInfo obj,
ObjectTypeAndSize info) throws IOException {
return readObjectHeader(info);
}
- /** {@inheritDoc} */
@Override
protected int readDatabase(byte[] dst, int pos, int cnt) throws IOException {
return out.read(dst, pos, cnt);
}
- /** {@inheritDoc} */
@Override
protected boolean checkCRC(int oldCRC) {
return oldCRC == (int) crc.getValue();
tmpPack.deleteOnExit();
}
- /** {@inheritDoc} */
@Override
protected boolean onAppendBase(final int typeCode, final byte[] data,
final PackedObjectInfo info) throws IOException {
return true;
}
- /** {@inheritDoc} */
@Override
protected void onEndThinPack() throws IOException {
final byte[] buf = buffer();
*
* @return the index for this pack file.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public PackIndex getIndex() throws IOException {
return idx();
/**
* @return result
* @throws IOException
+ * if an IO error occurred
*/
T get() throws IOException;
}
getBitmaps().add(result);
}
- /** {@inheritDoc} */
@Override
public EWAHCompressedBitmap ofObjectType(
EWAHCompressedBitmap bitmap, int type) {
throw new IllegalArgumentException();
}
- /** {@inheritDoc} */
@Override
public int findPosition(AnyObjectId objectId) {
PositionEntry entry = positionEntries.get(objectId);
return entry.offsetPosition;
}
- /** {@inheritDoc} */
@Override
public ObjectId getObject(int position) throws IllegalArgumentException {
ObjectId objectId = byOffset.get(position);
return PackBitmapIndexV1.OPT_FULL;
}
- /** {@inheritDoc} */
@Override
public int getBitmapCount() {
return bitmapsToWriteXorBuffer.size() + bitmapsToWrite.size();
bitmapsToWrite = new ArrayList<>(size);
}
- /** {@inheritDoc} */
@Override
public int getObjectCount() {
return byOffset.size();
oldPackIndex.getObject(pos));
}
- /** {@inheritDoc} */
@Override
public int findPosition(AnyObjectId objectId) {
return newPackIndex.findPosition(objectId);
}
- /** {@inheritDoc} */
@Override
public ObjectId getObject(int position) throws IllegalArgumentException {
return newPackIndex.getObject(position);
}
- /** {@inheritDoc} */
@Override
public int getObjectCount() {
return newPackIndex.getObjectCount();
}
- /** {@inheritDoc} */
@Override
public EWAHCompressedBitmap ofObjectType(
EWAHCompressedBitmap bitmap, int type) {
return newPackIndex.ofObjectType(bitmap, type);
}
- /** {@inheritDoc} */
@Override
public Iterator<Entry> iterator() {
if (oldPackIndex == null)
};
}
- /** {@inheritDoc} */
@Override
public EWAHCompressedBitmap getBitmap(AnyObjectId objectId) {
EWAHCompressedBitmap bitmap = newPackIndex.getBitmap(objectId);
}
}
- /** {@inheritDoc} */
@Override
public int getBitmapCount() {
// The count is only useful for the end index, not the remapper.
this.reverseIndex = computedReverseIndex;
}
- /** {@inheritDoc} */
@Override
public int findPosition(AnyObjectId objectId) {
long offset = packIndex.findOffset(objectId);
return reverseIndex.findPosition(offset);
}
- /** {@inheritDoc} */
@Override
public ObjectId getObject(int position) throws IllegalArgumentException {
ObjectId objectId = reverseIndex.findObjectByPosition(position);
return objectId;
}
- /** {@inheritDoc} */
@Override
public int getObjectCount() {
return (int) packIndex.getObjectCount();
}
- /** {@inheritDoc} */
@Override
public EWAHCompressedBitmap ofObjectType(
EWAHCompressedBitmap bitmap, int type) {
throw new IllegalArgumentException();
}
- /** {@inheritDoc} */
@Override
public int getBitmapCount() {
return bitmaps.size();
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
// TODO(cranger): compare the pack checksum?
return false;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return getPackIndex().hashCode();
return Collections.unmodifiableCollection(Arrays.asList(packs));
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "PackDirectory[" + getDirectory() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
/**
* @param n
* count of consecutive failures
- * @return @{code true} if i is a power of 2
+ * @return {@code true} if i is a power of 2
*/
private boolean doLogExponentialBackoff(int n) {
return (n & (n - 1)) == 0;
this.checksum = checksum;
}
- /** {@inheritDoc} */
@Override
public boolean isModified(File packFile) {
if (!super.isModified(packFile)) {
return findOffset(id) != -1;
}
- /** {@inheritDoc} */
@Override
public boolean contains(AnyObjectId id) {
return findOffset(id) != -1;
IO.readFully(fd, packChecksum, 0, packChecksum.length);
}
- /** {@inheritDoc} */
@Override
public long getObjectCount() {
return objectCnt;
}
- /** {@inheritDoc} */
@Override
public long getOffset64Count() {
long n64 = 0;
return (int) (nthPosition - base);
}
- /** {@inheritDoc} */
@Override
public ObjectId getObjectId(long nthPosition) {
final int levelOne = findLevelOne(nthPosition);
return NB.decodeUInt32(idxdata[levelOne], p);
}
- /** {@inheritDoc} */
@Override
public long findOffset(AnyObjectId objId) {
final int levelOne = objId.getFirstByte();
return (((long) b0) << 24) | (b1 << 16) | (b2 << 8) | (b3);
}
- /** {@inheritDoc} */
@Override
public int findPosition(AnyObjectId objId) {
int levelOne = objId.getFirstByte();
return -1;
}
- /** {@inheritDoc} */
@Override
public long findCRC32(AnyObjectId objId) {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public boolean hasCRC32Support() {
return false;
}
- /** {@inheritDoc} */
@Override
public Iterator<MutableEntry> iterator() {
return new IndexV1Iterator();
}
- /** {@inheritDoc} */
@Override
public void resolve(Set<ObjectId> matches, AbbreviatedObjectId id,
int matchLimit) throws IOException {
IO.readFully(fd, packChecksum, 0, packChecksum.length);
}
- /** {@inheritDoc} */
@Override
public long getObjectCount() {
return objectCnt;
}
- /** {@inheritDoc} */
@Override
public long getOffset64Count() {
return offset64.length / 8;
return (int) (nthPosition - base);
}
- /** {@inheritDoc} */
@Override
public ObjectId getObjectId(long nthPosition) {
final int levelOne = findLevelOne(nthPosition);
return ObjectId.fromRaw(names[levelOne], p4 + p); // p * 5
}
- /** {@inheritDoc} */
@Override
public long getOffset(long nthPosition) {
final int levelOne = findLevelOne(nthPosition);
return getOffset(levelOne, levelTwo);
}
- /** {@inheritDoc} */
@Override
public long findOffset(AnyObjectId objId) {
final int levelOne = objId.getFirstByte();
return getOffset(levelOne, levelTwo);
}
- /** {@inheritDoc} */
@Override
public int findPosition(AnyObjectId objId) {
int levelOne = objId.getFirstByte();
return p;
}
- /** {@inheritDoc} */
@Override
public long findCRC32(AnyObjectId objId) throws MissingObjectException {
final int levelOne = objId.getFirstByte();
return NB.decodeUInt32(crc32[levelOne], levelTwo << 2);
}
- /** {@inheritDoc} */
@Override
public boolean hasCRC32Support() {
return true;
}
- /** {@inheritDoc} */
@Override
public Iterator<MutableEntry> iterator() {
return new EntriesIteratorV2();
}
- /** {@inheritDoc} */
@Override
public void resolve(Set<ObjectId> matches, AbbreviatedObjectId id,
int matchLimit) throws IOException {
super(dst);
}
- /** {@inheritDoc} */
@Override
protected void writeImpl() throws IOException {
writeFanOutTable();
super(dst);
}
- /** {@inheritDoc} */
@Override
protected void writeImpl() throws IOException {
writeTOC(2);
wc.pin(pack, pos);
}
- /** {@inheritDoc} */
@Override
public int read(byte[] b, int off, int len) throws IOException {
int n = wc.copy(pack, pos, b, off, len);
return n;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
byte[] buf = new byte[1];
return n == 1 ? buf[0] & 0xff : -1;
}
- /** {@inheritDoc} */
@Override
public void close() {
wc.close();
return buffer().length;
}
- /** {@inheritDoc} */
@Override
public ObjectId insert(int type, byte[] data, int off, int len)
throws IOException {
return endObject(id, offset);
}
- /** {@inheritDoc} */
@Override
public ObjectId insert(int type, long len, InputStream in)
throws IOException {
return 12;
}
- /** {@inheritDoc} */
@Override
public PackParser newPackParser(InputStream in) {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public ObjectReader newReader() {
return new Reader();
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
if (tmpPack == null) {
return ObjectId.fromRaw(md.digest());
}
- /** {@inheritDoc} */
@Override
public void close() {
try {
*
* Store position (in the main index) to size as parallel arrays.
*
- * <p>Positions in the main index fit well in unsigned 24 bits (16M) for most
+ * <p>
+ * Positions in the main index fit well in unsigned 24 bits (16M) for most
* repositories, but some outliers have even more objects, so we need to
* store also 32 bits positions.
*
- * <p>Sizes are stored as a first array parallel to positions. If a size
+ * <p>
+ * Sizes are stored as a first array parallel to positions. If a size
* doesn't fit in an element of that array, then we encode there a position
* on the next-size array. This "overflow" array doesn't have entries for
* all positions.
*
* positions [10, 500, 1000, 1001]
* sizes (32bits) [15MB, -1, 6MB, -2]
- * ___/ ______/
+ * ___/ ______/
* / /
* sizes (64 bits) [3GB, 6GB]
* </pre>
*
- * <p>For sizes we use 32 bits as the first level and 64 for the rare objects
+ * <p>
+ * For sizes we use 32 bits as the first level and 64 for the rare objects
* over 2GB.
*
- * <p>A 24/32/64 bits hierarchy of arrays saves space if we have a lot of small
- * objects, but wastes space if we have only big ones. The min size to index is
- * controlled by conf and in principle we want to index only rather
- * big objects (e.g. > 10MB). We could support more dynamics read/write of sizes
+ * <p>
+ * A 24/32/64 bits hierarchy of arrays saves space if we have a lot of small
+ * objects, but wastes space if we have only big ones. The min size to index
+ * is controlled by conf and in principle we want to index only rather big
+ * objects (e.g. > 10MB). We could support more dynamics read/write of sizes
* (e.g. 24 only if the threshold will include many of those objects) but it
- * complicates a lot code and spec. If needed it could go for a v2 of the protocol.
- *
- * <p>Format:
+ * complicates a lot code and spec. If needed it could go for a v2 of the
+ * protocol.
*
+ * <p>
+ * Format:
+ * <ul>
* <li>A header with the magic number (4 bytes)
* <li>The index version (1 byte)
* <li>The minimum object size (4 bytes)
* <li>Total count of objects indexed (C, 4 bytes)
+ * </ul>
* (if count == 0, stop here)
- *
+ * <p>
* Blocks of
+ * <ul>
* <li>Size per entry in bits (1 byte, either 24 (0x18) or 32 (0x20))
* <li>Count of entries (4 bytes) (c, as a signed int)
* <li>positions encoded in s bytes each (i.e s*c bytes)
* <li>Count of 64 bit sizes (s64) (or 0 if no more indirections)
* <li>64 bit sizes (s64 * 8 bytes)
* <li>0 (end)
+ * </ul>
*/
static class PackObjectSizeWriterV1 extends PackObjectSizeIndexWriter {
this.shouldLockLooseRefs = shouldLockLooseRefs;
}
- /** {@inheritDoc} */
@Override
public void execute(RevWalk walk, ProgressMonitor monitor,
List<String> options) throws IOException {
return new SnapshottingRefDirectory(this);
}
- /** {@inheritDoc} */
@Override
public void create() throws IOException {
FileUtils.mkdir(refsDir);
newLogWriter(false).create();
}
- /** {@inheritDoc} */
@Override
public void close() {
clearReferences();
packedRefs.set(NO_PACKED_REFS);
}
- /** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
clearReferences();
}
- /** {@inheritDoc} */
@Override
public boolean isNameConflicting(String name) throws IOException {
// Cannot be nested within an existing reference.
}
}
- /** {@inheritDoc} */
@Override
public Ref exactRef(String name) throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
@NonNull
public Map<String, Ref> exactRef(String... refs) throws IOException {
}
}
- /** {@inheritDoc} */
@Override
@Nullable
public Ref firstExactRef(String... refs) throws IOException {
}
}
- /** {@inheritDoc} */
@Override
public Map<String, Ref> getRefs(String prefix) throws IOException {
final RefList<LooseRef> oldLoose = looseRefs.get();
return new RefMap(prefix, packed, upcast(loose), symbolic.toRefList());
}
- /** {@inheritDoc} */
@Override
public List<Ref> getAdditionalRefs() throws IOException {
List<Ref> ret = new LinkedList<>();
}
}
- /** {@inheritDoc} */
@Override
public Ref peel(Ref ref) throws IOException {
final Ref leaf = ref.getLeaf();
fireRefsChanged();
}
- /** {@inheritDoc} */
@Override
public RefDirectoryUpdate newUpdate(String name, boolean detach)
throws IOException {
return new RefDirectoryUpdate(this, ref);
}
- /** {@inheritDoc} */
@Override
public RefDirectoryRename newRename(String fromName, String toName)
throws IOException {
return new RefDirectoryRename(from, to);
}
- /** {@inheritDoc} */
@Override
public PackedBatchRefUpdate newBatchUpdate() {
return new PackedBatchRefUpdate(this);
return new PackedBatchRefUpdate(this, shouldLockLooseRefs);
}
- /** {@inheritDoc} */
@Override
public boolean performsAtomicTransactions() {
return true;
* @param refs
* the refs to be added. Must be fully qualified.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void pack(List<String> refs) throws IOException {
pack(refs, Collections.emptyMap());
* has this attributes simply return it. Otherwise create a new peeled
* {@link ObjectIdRef} where Storage is set to PACKED.
*
- * @param f
+ * @param ref
+ * given ref
* @return a ref for Storage PACKED having the same name, id, peeledId as f
* @throws MissingObjectException
+ * if an object is missing
* @throws IOException
+ * if an IO error occurred
*/
- private Ref peeledPackedRef(Ref f)
+ private Ref peeledPackedRef(Ref ref)
throws MissingObjectException, IOException {
- if (f.getStorage().isPacked() && f.isPeeled()) {
- return f;
+ if (ref.getStorage().isPacked() && ref.isPeeled()) {
+ return ref;
}
- if (!f.isPeeled()) {
- f = peel(f);
+ if (!ref.isPeeled()) {
+ ref = peel(ref);
}
- ObjectId peeledObjectId = f.getPeeledObjectId();
+ ObjectId peeledObjectId = ref.getPeeledObjectId();
if (peeledObjectId != null) {
- return new ObjectIdRef.PeeledTag(PACKED, f.getName(),
- f.getObjectId(), peeledObjectId);
+ return new ObjectIdRef.PeeledTag(PACKED, ref.getName(),
+ ref.getObjectId(), peeledObjectId);
}
- return new ObjectIdRef.PeeledNonTag(PACKED, f.getName(),
- f.getObjectId());
+ return new ObjectIdRef.PeeledNonTag(PACKED, ref.getName(),
+ ref.getObjectId());
}
void log(boolean force, RefUpdate update, String msg, boolean deref)
*
* @return {@code true} if we are currently cloning a repository
* @throws IOException
+ * if an IO error occurred
*/
boolean isInClone() throws IOException {
return hasDanglingHead() && !packedRefsFile.exists() && !hasLooseRef();
return refdb;
}
- /** {@inheritDoc} */
@Override
protected Result doRename() throws IOException {
if (source.getRef().isSymbolic())
database = r;
}
- /** {@inheritDoc} */
@Override
protected RefDirectory getRefDatabase() {
return database;
}
- /** {@inheritDoc} */
@Override
protected Repository getRepository() {
return database.getRepository();
}
- /** {@inheritDoc} */
@Override
protected boolean tryLock(boolean deref) throws IOException {
shouldDeref = deref;
return false;
}
- /** {@inheritDoc} */
@Override
protected void unlock() {
if (lock != null) {
}
}
- /** {@inheritDoc} */
@Override
protected Result doUpdate(Result status) throws IOException {
WriteConfig wc = database.getRepository().getConfig()
}
}
- /** {@inheritDoc} */
@Override
protected Result doDelete(Result status) throws IOException {
if (getRef().getStorage() != Ref.Storage.NEW)
return status;
}
- /** {@inheritDoc} */
@Override
protected Result doLink(String target) throws IOException {
WriteConfig wc = database.getRepository().getConfig()
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getOldId()
*/
- /** {@inheritDoc} */
@Override
public ObjectId getOldId() {
return oldId;
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getNewId()
*/
- /** {@inheritDoc} */
@Override
public ObjectId getNewId() {
return newId;
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getWho()
*/
- /** {@inheritDoc} */
@Override
public PersonIdent getWho() {
return who;
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getComment()
*/
- /** {@inheritDoc} */
@Override
public String getComment() {
return comment;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogEntry#parseCheckout()
*/
- /** {@inheritDoc} */
@Override
public CheckoutEntry parseCheckout() {
if (getComment().startsWith(CheckoutEntryImpl.CHECKOUT_MOVING_FROM)) {
/**
* @param db
+ * repository to read reflogs from
* @param refname
+ * {@code Ref} name
*/
ReflogReaderImpl(Repository db, String refname) {
logName = new File(db.getDirectory(), Constants.LOGS + '/' + refname);
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getLastEntry()
*/
- /** {@inheritDoc} */
@Override
public ReflogEntry getLastEntry() throws IOException {
return getReverseEntry(0);
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getReverseEntries()
*/
- /** {@inheritDoc} */
@Override
public List<ReflogEntry> getReverseEntries() throws IOException {
return getReverseEntries(Integer.MAX_VALUE);
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getReverseEntry(int)
*/
- /** {@inheritDoc} */
@Override
public ReflogEntry getReverseEntry(int number) throws IOException {
if (number < 0)
/* (non-Javadoc)
* @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getReverseEntries(int)
*/
- /** {@inheritDoc} */
@Override
public List<ReflogEntry> getReverseEntries(int max) throws IOException {
final byte[] log;
* Create the log directories.
*
* @throws java.io.IOException
+ * if an IO error occurred
* @return this writer.
*/
public ReflogWriter create() throws IOException {
* a {@link org.eclipse.jgit.lib.ReflogEntry} object.
* @return this writer
* @throws java.io.IOException
+ * if an IO error occurred
*/
public ReflogWriter log(String refName, ReflogEntry entry)
throws IOException {
* reflog message
* @return this writer
* @throws java.io.IOException
+ * if an IO error occurred
*/
public ReflogWriter log(String refName, ObjectId oldId,
ObjectId newId, PersonIdent ident, String message) throws IOException {
* whether to dereference symbolic refs
* @return this writer
* @throws java.io.IOException
+ * if an IO error occurred
*/
public ReflogWriter log(RefUpdate update, String msg,
boolean deref) throws IOException {
this.fd = fd;
}
- /** {@inheritDoc} */
@Override
public int readInt() throws IOException {
readFully(buf, 0, 4);
return NB.decodeInt32(buf, 0);
}
- /** {@inheritDoc} */
@Override
public long readLong() throws IOException {
readFully(buf, 0, 8);
return NB.decodeUInt32(buf, 0);
}
- /** {@inheritDoc} */
@Override
public void readFully(byte[] b) throws IOException {
readFully(b, 0, b.length);
}
- /** {@inheritDoc} */
@Override
public void readFully(byte[] b, int off, int len) throws IOException {
IO.readFully(fd, b, off, len);
}
- /** {@inheritDoc} */
@Override
public int skipBytes(int n) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public boolean readBoolean() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public byte readByte() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public int readUnsignedByte() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public short readShort() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public int readUnsignedShort() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public char readChar() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public float readFloat() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public double readDouble() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public String readLine() throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public String readUTF() throws IOException {
throw new UnsupportedOperationException();
this.fd = fd;
}
- /** {@inheritDoc} */
@Override
public void writeShort(int v) throws IOException {
NB.encodeInt16(buf, 0, v);
fd.write(buf, 0, 2);
}
- /** {@inheritDoc} */
@Override
public void writeInt(int v) throws IOException {
NB.encodeInt32(buf, 0, v);
fd.write(buf, 0, 4);
}
- /** {@inheritDoc} */
@Override
public void writeLong(long v) throws IOException {
NB.encodeInt64(buf, 0, v);
fd.write(buf, 0, 8);
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b, int off, int len) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeBoolean(boolean v) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeByte(int v) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeChar(int v) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeFloat(float v) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeDouble(double v) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeBytes(String s) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeChars(String s) throws IOException {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public void writeUTF(String s) throws IOException {
throw new UnsupportedOperationException();
return packedRefs.get();
}
- /** {@inheritDoc} */
@Override
void delete(RefDirectoryUpdate update) throws IOException {
refreshSnapshot();
super.delete(update);
}
- /** {@inheritDoc} */
@Override
public RefDirectoryUpdate newUpdate(String name, boolean detach)
throws IOException {
return super.newUpdate(name, detach);
}
- /** {@inheritDoc} */
@Override
public PackedBatchRefUpdate newBatchUpdate() {
return new SnapshotPackedBatchRefUpdate(this);
}
- /** {@inheritDoc} */
@Override
public PackedBatchRefUpdate newBatchUpdate(boolean shouldLockLooseRefs) {
return new SnapshotPackedBatchRefUpdate(this, shouldLockLooseRefs);
}
- /** {@inheritDoc} */
@Override
RefDirectoryUpdate newTemporaryUpdate() throws IOException {
refreshSnapshot();
* threads use this snapshot.
*
* @throws IOException
+ * if an IO error occurred
*/
private synchronized void refreshSnapshot() throws IOException {
compareAndSetPackedRefs(packedRefs.get(), refDb.getPackedRefs());
return baseCache;
}
- /** {@inheritDoc} */
@Override
public ObjectReader newReader() {
return new WindowCursor(db);
}
- /** {@inheritDoc} */
@Override
public BitmapIndex getBitmapIndex() throws IOException {
for (Pack pack : db.getPacks()) {
return null;
}
- /** {@inheritDoc} */
@Override
public Optional<CommitGraph> getCommitGraph() {
return db.getCommitGraph();
}
- /** {@inheritDoc} */
@Override
public Collection<CachedPack> getCachedPacksAndUpdate(
BitmapBuilder needBitmap) throws IOException {
return Collections.emptyList();
}
- /** {@inheritDoc} */
@Override
public Collection<ObjectId> resolve(AbbreviatedObjectId id)
throws IOException {
return matches;
}
- /** {@inheritDoc} */
@Override
public boolean has(AnyObjectId objectId) throws IOException {
return db.has(objectId);
}
- /** {@inheritDoc} */
@Override
public ObjectLoader open(AnyObjectId objectId, int typeHint)
throws MissingObjectException, IncorrectObjectTypeException,
return ldr;
}
- /** {@inheritDoc} */
@Override
public Set<ObjectId> getShallowCommits() throws IOException {
return db.getShallowCommits();
}
- /** {@inheritDoc} */
@Override
public long getObjectSize(AnyObjectId objectId, int typeHint)
throws MissingObjectException, IncorrectObjectTypeException,
return sz;
}
- /** {@inheritDoc} */
@Override
public LocalObjectToPack newObjectToPack(AnyObjectId objectId, int type) {
return new LocalObjectToPack(objectId, type);
}
- /** {@inheritDoc} */
@Override
public void selectObjectRepresentation(PackWriter packer,
ProgressMonitor monitor, Iterable<ObjectToPack> objects)
}
}
- /** {@inheritDoc} */
@Override
public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp,
boolean validate) throws IOException,
src.pack.copyAsIs(out, src, validate, this);
}
- /** {@inheritDoc} */
@Override
public void writeObjects(PackOutputStream out, List<ObjectToPack> list)
throws IOException {
return cnt - need;
}
- /** {@inheritDoc} */
@Override
public void copyPackAsIs(PackOutputStream out, CachedPack pack)
throws IOException {
}
}
- /** {@inheritDoc} */
@Override
@Nullable
public ObjectInserter getCreatedFromInserter() {
// Do nothing by default.
}
- /** {@inheritDoc} */
@Override
public abstract void close();
}
return count;
}
- /** {@inheritDoc} */
@Override
public final void write(int b) throws IOException {
if (checkCancelAt <= count) {
count++;
}
- /** {@inheritDoc} */
@Override
public final void write(byte[] b, int off, int len) throws IOException {
while (0 < len) {
}
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
out.flush();
* Find the key which is the longest prefix of the given query string.
*
* @param query
+ * the query string
* @return the key which is the longest prefix of the given query string or
* {@code null} if none exists.
*/
return start - resPtr;
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("nls")
public String toString() {
slices.add(s);
}
- /** {@inheritDoc} */
@Override
public Object call() throws Exception {
or = block.templateReader.newReader();
return 1 < getOffset(); // markWantWrite sets 1.
}
- /** {@inheritDoc} */
@Override
public final int getType() {
return (flags >> TYPE_SHIFT) & 0x7;
// Empty by default.
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return String.format(".%s_tmp", ext); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public String toString() {
return String.format("PackExt[%s, bit=0x%s]", getExtension(), //$NON-NLS-1$
/**
* Determines if the object should be omitted from the pack as a result of
- * its depth (probably because of the tree:<depth> filter).
+ * its depth (probably because of the tree:<depth> filter).
* <p>
* Causes {@code walker} to skip traversing the current tree, which ought to
* have just started traversal, assuming this method is called as soon as a
/** Empty {@link LogCursor} with no results. */
class EmptyLogCursor extends LogCursor {
- /** {@inheritDoc} */
@Override
public boolean next() throws IOException {
return false;
}
- /** {@inheritDoc} */
@Override
public String getRefName() {
return null;
}
- /** {@inheritDoc} */
@Override
public long getUpdateIndex() {
return 0;
}
- /** {@inheritDoc} */
@Override
public ReflogEntry getReflogEntry() {
return null;
}
- /** {@inheritDoc} */
@Override
public void close() {
// Do nothing.
@Nullable
public abstract ReflogEntry getReflogEntry();
- /** {@inheritDoc} */
@Override
public abstract void close();
}
/**
* Initialize a merged table reader.
- * <p>
*
* @param tableStack
* stack of tables to read from. The base of the stack is at
return minUpdateIndex;
}
- /** {@inheritDoc} */
@Override
public boolean hasObjectMap() throws IOException {
boolean has = true;
return has;
}
- /** {@inheritDoc} */
@Override
public RefCursor allRefs() throws IOException {
MergedRefCursor m = new MergedRefCursor();
return m;
}
- /** {@inheritDoc} */
@Override
public RefCursor seekRef(String name) throws IOException {
MergedRefCursor m = new MergedRefCursor();
return m;
}
- /** {@inheritDoc} */
@Override
public RefCursor seekRefsWithPrefix(String prefix) throws IOException {
MergedRefCursor m = new MergedRefCursor();
return m;
}
- /** {@inheritDoc} */
@Override
public RefCursor byObjectId(AnyObjectId name) throws IOException {
MergedRefCursor m = new FilteringMergedRefCursor(name);
return m;
}
- /** {@inheritDoc} */
@Override
public LogCursor allLogs() throws IOException {
MergedLogCursor m = new MergedLogCursor();
return m;
}
- /** {@inheritDoc} */
@Override
public LogCursor seekLog(String refName, long updateIdx)
throws IOException {
return r.getStorage() == Ref.Storage.NEW && r.getObjectId() == null;
}
- /** {@inheritDoc} */
@Override
public abstract void close();
}
public abstract RefCursor byObjectId(AnyObjectId id) throws IOException;
/**
- * @return whether this reftable can do a fast SHA1 => ref lookup.
+ * @return whether this reftable can do a fast SHA1 => ref lookup.
* @throws IOException on I/O problems.
*/
public abstract boolean hasObjectMap() throws IOException;
this.repository = repository;
}
- /** {@inheritDoc} */
@Override
public void execute(RevWalk rw, ProgressMonitor pm, List<String> options) {
List<ReceiveCommand> pending = getPending();
blockSize = bs;
}
- /** {@inheritDoc} */
@Override
public void write(int b) {
ensureBytesAvailableInBlockBuf(1);
blockBuf[cur++] = (byte) b;
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b, int off, int cnt) {
ensureBytesAvailableInBlockBuf(cnt);
return maxUpdateIndex;
}
- /** {@inheritDoc} */
@Override
public RefCursor allRefs() throws IOException {
if (blockSize == -1) {
return i;
}
- /** {@inheritDoc} */
@Override
public RefCursor seekRef(String refName) throws IOException {
initRefIndex();
return i;
}
- /** {@inheritDoc} */
@Override
public RefCursor seekRefsWithPrefix(String prefix) throws IOException {
initRefIndex();
return i;
}
- /** {@inheritDoc} */
@Override
public RefCursor byObjectId(AnyObjectId id) throws IOException {
initObjIndex();
return i;
}
- /** {@inheritDoc} */
@Override
public LogCursor allLogs() throws IOException {
initLogIndex();
return new EmptyLogCursor();
}
- /** {@inheritDoc} */
@Override
public LogCursor seekLog(String refName, long updateIndex)
throws IOException {
return src.size();
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
src.close();
this.refname = refname;
}
- /** {@inheritDoc} */
@Override
public ReflogEntry getLastEntry() throws IOException {
lock.lock();
}
}
- /** {@inheritDoc} */
@Override
public List<ReflogEntry> getReverseEntries() throws IOException {
return getReverseEntries(Integer.MAX_VALUE);
}
- /** {@inheritDoc} */
@Override
public ReflogEntry getReverseEntry(int number) throws IOException {
lock.lock();
}
}
- /** {@inheritDoc} */
@Override
public List<ReflogEntry> getReverseEntries(int max) throws IOException {
lock.lock();
* @param message
* Description of the problem
* @param fsckMessageId
- * Error identifier, following the git fsck fsck.<msg-id>
- * format
+ * Error identifier, following the git fsck
+ * fsck.<msg-id> format
*/
SubmoduleValidationException(String message,
ObjectChecker.ErrorType fsckMessageId) {
}
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("nls")
public String toString() {
/**
* Git configuration option <a
- * href=https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreabbrev">
+ * href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreabbrev">
* core.abbrev</a>
*
* @since 6.1
* object names to stay unique for some time.
*
* @param repo
+ * the repository the AbbrevConfig shall be computed for
* @return appropriate value computed based on the approximate number of
* packed objects in a repository
*/
private int abbrev;
/**
+ * Create an {@code AbbrevConfig}
+ *
* @param abbrev
+ * abbreviation length
*/
private AbbrevConfig(int abbrev) {
this.abbrev = capAbbrev(abbrev);
return mask(nibbles, word, v);
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return w1;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
if (o instanceof AbbreviatedObjectId) {
return new String(b, 0, nibbles);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return abbr.prefixCompare(this) == 0;
}
- /** {@inheritDoc} */
@Override
public final int hashCode() {
return w2;
return other != null ? isEqual(this, other) : false;
}
- /** {@inheritDoc} */
@Override
public final boolean equals(Object o) {
if (o instanceof AnyObjectId) {
dst[o--] = '0';
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
: isForceRefLog();
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder r = new StringBuilder();
delayStartUnit = unit;
}
- /** {@inheritDoc} */
@Override
public void start(int totalTasks) {
// Ignore the number of tasks.
}
- /** {@inheritDoc} */
@Override
public void beginTask(String title, int work) {
endTask();
task.delay(delayStartTime, delayStartUnit);
}
- /** {@inheritDoc} */
@Override
public void update(int completed) {
if (task != null)
task.update(this, completed);
}
- /** {@inheritDoc} */
@Override
public void endTask() {
if (task != null) {
}
}
- /** {@inheritDoc} */
@Override
public boolean isCancelled() {
return false;
* the local branch
* @return the tracking status, or null if it is not known
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static BranchTrackingStatus of(Repository repository, String branchName)
throws IOException {
return build();
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
/**
* Parse an enumeration from the configuration.
*
+ * @param <T>
+ * type of the returned enum
* @param section
* section the key is grouped within.
* @param subsection
/**
* Parse an enumeration from the configuration.
*
+ * @param <T>
+ * type of the returned enum
* @param all
* all possible values in the enumeration which should be
* recognized. Typically {@code EnumType.values()}.
* responsible for issuing {@link #fireConfigChangedEvent()} calls
* themselves.
*
- * @return <code></code>
+ * @return whether to issue change events for transient changes
*/
protected boolean notifyUponTransientChanges() {
return true;
* name = value
* </pre>
*
+ * @param <T>
+ * type of the enum to set
* @param section
* section name, e.g "branch"
* @param subsection
public static final String CONFIG_KEY_PROMPT = "prompt";
/**
- * The "trustExitCode" key within "difftool" or "mergetool.<name>." section
+ * The "trustExitCode" key within "difftool" or "mergetool.<name>."
+ * section
*
* @since 6.1
*/
return a.equals(b);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
public static final String GIT_CONFIG_NOSYSTEM_KEY = "GIT_CONFIG_NOSYSTEM";
/**
- * The key of the XDG_CONFIG_HOME directory defined in the XDG base
- * directory specification, see
- * {@link "https://wiki.archlinux.org/index.php/XDG_Base_Directory"}
+ * The key of the XDG_CONFIG_HOME directory defined in the
+ * <a href="https://wiki.archlinux.org/index.php/XDG_Base_Directory">
+ * XDG Base Directory specification</a>.
*
* @since 5.5.2
*/
*/
public class DefaultTypedConfigGetter implements TypedConfigGetter {
- /** {@inheritDoc} */
@Override
public boolean getBoolean(Config config, String section, String subsection,
String name, boolean defaultValue) {
}
}
- /** {@inheritDoc} */
@Override
public <T extends Enum<?>> T getEnum(Config config, T[] all, String section,
String subsection, String name, T defaultValue) {
JGitText.get().enumValueNotSupported2, section, name, value));
}
- /** {@inheritDoc} */
@Override
public int getInt(Config config, String section, String subsection,
String name, int defaultValue) {
.format(JGitText.get().integerValueOutOfRange, section, name));
}
- /** {@inheritDoc} */
@Override
public int getIntInRange(Config config, String section, String subsection,
String name, int minValue, int maxValue, int defaultValue) {
Integer.valueOf(minValue), Integer.valueOf(maxValue)));
}
- /** {@inheritDoc} */
@Override
public long getLong(Config config, String section, String subsection,
String name, long defaultValue) {
}
}
- /** {@inheritDoc} */
@Override
public long getTimeUnit(Config config, String section, String subsection,
String name, long defaultValue, TimeUnit wantUnit) {
section, name, valueString));
}
- /** {@inheritDoc} */
@Override
@NonNull
public List<RefSpec> getRefSpecs(Config config, String section,
*/
public abstract class EmptyProgressMonitor implements ProgressMonitor {
- /** {@inheritDoc} */
@Override
public void start(int totalTasks) {
// empty
}
- /** {@inheritDoc} */
@Override
public void beginTask(String title, int totalWork) {
// empty
}
- /** {@inheritDoc} */
@Override
public void update(int completed) {
// empty
}
- /** {@inheritDoc} */
@Override
public void endTask() {
// empty
}
- /** {@inheritDoc} */
@Override
public boolean isCancelled() {
return false;
return new String(signature, US_ASCII);
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("nls")
public String toString() {
* @param workingTreeIterator
* iterator for working directory
* @throws java.io.IOException
+ * if an IO error occurred
*/
public IndexDiff(Repository repository, String revstr,
WorkingTreeIterator workingTreeIterator) throws IOException {
* @param workingTreeIterator
* iterator for working directory
* @throws java.io.IOException
+ * if an IO error occurred
*/
public IndexDiff(Repository repository, ObjectId objectId,
WorkingTreeIterator workingTreeIterator) throws IOException {
* Allows higher layers to set the factory for WorkingTreeIterators.
*
* @param wTreeIt
+ * working tree iterator factory
* @since 3.6
*/
public void setWorkingTreeItFactory(WorkingTreeIteratorFactory wTreeIt) {
*
* @return if anything is different between index, tree, and workdir
* @throws java.io.IOException
+ * if an IO error occurred
*/
public boolean diff() throws IOException {
return diff(null);
* {@link RepositoryBuilder}.
* @return if anything is different between index, tree, and workdir
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.6
*/
public boolean diff(RepositoryBuilderFactory factory)
* number or estimated files in the working tree
* @param estIndexSize
* number of estimated entries in the cache
- * @param title a {@link java.lang.String} object.
+ * @param title
+ * a {@link java.lang.String} object.
* @return if anything is different between index, tree, and workdir
* @throws java.io.IOException
+ * if an IO error occurred
*/
public boolean diff(final ProgressMonitor monitor, int estWorkTreeSize,
int estIndexSize, final String title)
* {@link RepositoryBuilder}.
* @return if anything is different between index, tree, and workdir
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.6
*/
public boolean diff(ProgressMonitor monitor, int estWorkTreeSize,
}
}
- /** {@inheritDoc} */
@Override
public ObjectId toObjectId() {
return new ObjectId(this);
// Do not let others instantiate
}
- /** {@inheritDoc} */
@Override
public void start(int totalTasks) {
// Do not report.
}
- /** {@inheritDoc} */
@Override
public void beginTask(String title, int totalWork) {
// Do not report.
}
- /** {@inheritDoc} */
@Override
public void update(int completed) {
// Do not report.
}
- /** {@inheritDoc} */
@Override
public boolean isCancelled() {
return false;
}
- /** {@inheritDoc} */
@Override
public void endTask() {
// Do not report.
* <li>create {@link GpgSignature} from payload</li>
* <li>set {@link GpgSignature}</li>
* </ol>
- * </p>
*
* @param gpgSignature
* the signature to set or {@code null} to unset
*
* @return true if the filename in buf could be a ".gitmodules" file
* @throws CorruptObjectException
+ * if an object is corrupt
*/
private boolean isGitmodules(byte[] buf, int start, int end, @Nullable AnyObjectId id)
throws CorruptObjectException {
w5 = src.w5;
}
- /** {@inheritDoc} */
@Override
public ObjectId toObjectId() {
return this;
* <p>
* An existing mapping for <b>must not</b> be in this map. Callers must
* first call {@link #get(AnyObjectId)} to verify there is no current
- * mapping prior to adding a new mapping, or use {@link #addIfAbsent(Entry)}.
+ * mapping prior to adding a new mapping, or use
+ * {@link #addIfAbsent(Entry)}.
*
+ * @param <Q>
+ * type of values
* @param newValue
* the object to store.
*/
* boolean wasNew = map.addIfAbsent(obj) == obj;
* </pre>
*
+ * @param <Q>
+ * type of values
* @param newValue
* the object to store.
* @return {@code newValue} if stored, or the prior value already stored and
return size == 0;
}
- /** {@inheritDoc} */
@Override
public Iterator<V> iterator() {
return new Iterator<>() {
this.updateIndex = updateIndex;
}
- /** {@inheritDoc} */
@Override
@NonNull
public String getName() {
return name;
}
- /** {@inheritDoc} */
@Override
public boolean isSymbolic() {
return false;
}
- /** {@inheritDoc} */
@Override
@NonNull
public Ref getLeaf() {
return this;
}
- /** {@inheritDoc} */
@Override
@NonNull
public Ref getTarget() {
return this;
}
- /** {@inheritDoc} */
@Override
@Nullable
public ObjectId getObjectId() {
return objectId;
}
- /** {@inheritDoc} */
@Override
@NonNull
public Storage getStorage() {
return updateIndex;
}
- /** {@inheritDoc} */
@NonNull
@Override
public String toString() {
* mapping prior to adding a new mapping, or use
* {@link #addIfAbsent(ObjectId)}.
*
+ * @param <Q>
+ * type of values
* @param newValue
* the object to store.
*/
* boolean wasNew = map.addIfAbsent(obj) == obj;
* </pre>
*
+ * @param <Q>
+ * type of values
* @param newValue
* the object to store.
* @return {@code newValue} if stored, or the prior value already stored and
return size == 0;
}
- /** {@inheritDoc} */
@Override
public Iterator<V> iterator() {
return new Iterator<>() {
*
* @return IDs of shallow commits
* @throws java.io.IOException
+ * if an error occurred
*/
public abstract Set<ObjectId> getShallowCommits() throws IOException;
/**
* Asynchronous object opening.
*
+ * @param <T>
+ * type of {@code ObjectId}
* @param objectIds
* objects to open from the object store. The supplied collection
* must not be modified until the queue has finished.
/**
* Asynchronous object size lookup.
*
+ * @param <T>
+ * type of {@code ObjectId}
* @param objectIds
* objects to get the size of from the object store. The supplied
* collection must not be modified until the queue has finished.
return hc;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
if (o instanceof PersonIdent) {
return r.toString();
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("nls")
public String toString() {
* <code>true</code> if also comments should be reported
* @return the list of steps
* @throws java.io.IOException
+ * if an IO error occurred
*/
public List<RebaseTodoLine> readRebaseTodo(String path,
boolean includeComments) throws IOException {
* Skip leading space, tab, CR and LF characters
*
* @param buf
+ * byte buffer
* @param tokenBegin
+ * index of token begin
* @param lineEnd
+ * index of line end
* @return the token within the range of the given {@code buf} that doesn't
* need to be skipped, {@code -1} if no such token found within the
* range (i.e. empty line)
* @param append
* whether to append to an existing file or to write a new file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeRebaseTodoFile(String path, List<RebaseTodoLine> steps,
boolean append) throws IOException {
/**
* @param token
+ * token to parse
* @return the Action
*/
public static Action parse(String token) {
return comment;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
/** Singleton instance of RefComparator */
public static final RefComparator INSTANCE = new RefComparator();
- /** {@inheritDoc} */
@Override
public int compare(Ref o1, Ref o2) {
return compareTo(o1, o2);
* with the passed ref name; empty collection when there are no
* conflicts
* @throws java.io.IOException
+ * if an error occurred
* @since 2.3
* @see #isNameConflicting(String)
*/
*
* @return the result of the new ref update
* @throws java.io.IOException
+ * if an IO error occurred
*/
public Result rename() throws IOException {
try {
*
* @return the result of the rename operation.
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected abstract Result doRename() throws IOException;
/**
* The ref was renamed from another name
- * <p>
*/
RENAMED,
* a {@link org.eclipse.jgit.lib.RefUpdate.Result} object.
* @return {@code result}
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected abstract Result doUpdate(Result desiredResult) throws IOException;
* a {@link org.eclipse.jgit.lib.RefUpdate.Result} object.
* @return {@code result}
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected abstract Result doDelete(Result desiredResult) throws IOException;
* a {@link java.lang.String} object.
* @return {@link org.eclipse.jgit.lib.RefUpdate.Result#NEW} on success.
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected abstract Result doLink(String target) throws IOException;
*
* @return the result status of the delete.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public Result delete() throws IOException {
try (RevWalk rw = new RevWalk(getRepository())) {
* the merge test. The walk will be reset to perform the test.
* @return the result status of the delete.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public Result delete(RevWalk walk) throws IOException {
final String myName = detachingSymbolicRef
* @return {@link org.eclipse.jgit.lib.RefUpdate.Result#NEW} or
* {@link org.eclipse.jgit.lib.RefUpdate.Result#FORCED} on success.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public Result link(String target) throws IOException {
if (!target.startsWith(Constants.R_REFS))
* @param content
* byte content of file to be written.
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected abstract void writeFile(String file, byte[] content)
throws IOException;
*
* @return the latest reflog entry, or null if no log
* @throws java.io.IOException
+ * if an IO error occurred
*/
ReflogEntry getLastEntry() throws IOException;
*
* @return all reflog entries in reverse order
* @throws java.io.IOException
+ * if an IO error occurred
*/
List<ReflogEntry> getReverseEntries() throws IOException;
* Get specific entry in the reflog relative to the last entry which is
* considered entry zero.
*
- * @param number a int.
+ * @param number
+ * a int.
* @return reflog entry or null if not found
* @throws java.io.IOException
+ * if an IO error occurred
*/
ReflogEntry getReverseEntry(int number) throws IOException;
* max number of entries to read
* @return all reflog entries in reverse order
* @throws java.io.IOException
+ * if an IO error occurred
*/
List<ReflogEntry> getReverseEntries(int max) throws IOException;
}
* the same as {@code create(false)}.
*
* @throws java.io.IOException
+ * if an IO error occurred
* @see #create(boolean)
*/
public void create() throws IOException {
* Thus this method can be used to process an expression to a method that
* expects a branch or revision id.
*
- * @param revstr a {@link java.lang.String} object.
+ * @param revstr
+ * a {@link java.lang.String} object.
* @return object id or ref name from resolved expression or {@code null} if
* given expression cannot be resolved
* @throws org.eclipse.jgit.errors.AmbiguousObjectException
+ * if a shortened ObjectId was ambiguous
* @throws java.io.IOException
+ * if an IO error occurred
*/
@Nullable
public String simplify(String revstr)
getRefDatabase().close();
}
- /** {@inheritDoc} */
@Override
@NonNull
public String toString() {
* {@code null} if the repository is corrupt and has no HEAD
* reference.
* @throws java.io.IOException
+ * if an IO error occurred
*/
@Nullable
public String getFullBranch() throws IOException {
* in hex format if the current branch is detached, or {@code null}
* if the repository is corrupt and has no HEAD reference.
* @throws java.io.IOException
+ * if an IO error occurred
*/
@Nullable
public String getBranch() throws IOException {
*
* @return unmodifiable collection of other known objects.
* @throws IOException
+ * if an IO error occurred
*/
@NonNull
public Set<ObjectId> getAdditionalHaves() throws IOException {
* Get a ref by name.
*
* @param name
- * the name of the ref to lookup. Must not be a short-hand
- * form; e.g., "master" is not automatically expanded to
+ * the name of the ref to lookup. Must not be a short-hand form;
+ * e.g., "master" is not automatically expanded to
* "refs/heads/master".
* @return the Ref with the given name, or {@code null} if it does not exist
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
@Nullable
* "refs/heads/master" if "refs/heads/master" already exists.
* @return the Ref with the given name, or {@code null} if it does not exist
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
@Nullable
*
* @return a map with all objects referenced by a peeled ref.
* @throws IOException
+ * if an IO error occurred
*/
@NonNull
public Map<AnyObjectId, Set<Ref>> getAllRefsByPeeledObjectId()
* changes are detected.
*
* @throws java.io.IOException
+ * if an IO error occurred
*/
public abstract void scanForRepoChanges() throws IOException;
* @return a {@link org.eclipse.jgit.lib.ReflogReader} for the supplied ref,
* or {@code null} if the ref does not exist.
* @throws IOException
+ * if an IO error occurred
* @since 5.13.2
*/
public @Nullable ReflogReader getReflogReader(@NonNull Ref ref)
* @return a String containing the content of the MERGE_MSG file or
* {@code null} if this file doesn't exist
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* the message which should be written or <code>null</code> to
* delete the file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeMergeCommitMsg(String msg) throws IOException {
File mergeMsgFile = new File(gitDir, Constants.MERGE_MSG);
* @return a String containing the content of the COMMIT_EDITMSG file or
* {@code null} if this file doesn't exist
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* the message which should be written or {@code null} to delete
* the file
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.0
*/
public void writeCommitEditMsg(String msg) throws IOException {
* {@code null} if this file doesn't exist. Also if the file exists
* but is empty {@code null} will be returned
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* a list of commits which IDs should be written to
* $GIT_DIR/MERGE_HEAD or <code>null</code> to delete the file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeMergeHeads(List<? extends ObjectId> heads) throws IOException {
writeHeadsFile(heads, Constants.MERGE_HEAD);
* doesn't exist. Also if the file exists but is empty {@code null}
* will be returned
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* doesn't exist. Also if the file exists but is empty {@code null}
* will be returned
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* an object id of the cherry commit or <code>null</code> to
* delete the file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeCherryPickHead(ObjectId head) throws IOException {
List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
* an object id of the revert commit or <code>null</code> to
* delete the file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeRevertHead(ObjectId head) throws IOException {
List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
* an object id of the original HEAD commit or <code>null</code>
* to delete the file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeOrigHead(ObjectId head) throws IOException {
List<ObjectId> heads = head != null ? Collections.singletonList(head)
* doesn't exist. Also if the file exists but is empty {@code null}
* will be returned
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* @return a String containing the content of the SQUASH_MSG file or
* {@code null} if this file doesn't exist
* @throws java.io.IOException
+ * if an IO error occurred
* @throws NoWorkTreeException
* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
* the message which should be written or <code>null</code> to
* delete the file
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void writeSquashCommitMsg(String msg) throws IOException {
File squashMsgFile = new File(gitDir, Constants.SQUASH_MSG);
* Read a file from the git directory.
*
* @param filename
+ * the file to read
* @return the raw contents or {@code null} if the file doesn't exist or is
* empty
* @throws IOException
+ * if an IO error occurred
*/
private byte[] readGitDirectoryFile(String filename) throws IOException {
File file = new File(getDirectory(), filename);
* a list of object ids to write or null if the file should be
* deleted.
* @param filename
+ * name of the file to write heads to
* @throws FileNotFoundException
+ * if the heads file couldn't be found
* @throws IOException
+ * if an IO error occurred
*/
private void writeHeadsFile(List<? extends ObjectId> heads, String filename)
throws FileNotFoundException, IOException {
* <code>true</code> if also comments should be reported
* @return the list of steps
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.2
*/
@NonNull
* @param append
* whether to append to an existing file or to write a new file
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.2
*/
public void writeRebaseTodoFile(String path, List<RebaseTodoLine> steps,
*/
public abstract void save() throws IOException;
- /** {@inheritDoc} */
@Override
public void clear() {
super.clear();
this.updateIndex = updateIndex;
}
- /** {@inheritDoc} */
@Override
@NonNull
public String getName() {
return name;
}
- /** {@inheritDoc} */
@Override
public boolean isSymbolic() {
return true;
}
- /** {@inheritDoc} */
@Override
@NonNull
public Ref getLeaf() {
return dst;
}
- /** {@inheritDoc} */
@Override
@NonNull
public Ref getTarget() {
return target;
}
- /** {@inheritDoc} */
@Override
@Nullable
public ObjectId getObjectId() {
return getLeaf().getObjectId();
}
- /** {@inheritDoc} */
@Override
@NonNull
public Storage getStorage() {
return Storage.LOOSE;
}
- /** {@inheritDoc} */
@Override
@Nullable
public ObjectId getPeeledObjectId() {
return getLeaf().getPeeledObjectId();
}
- /** {@inheritDoc} */
@Override
public boolean isPeeled() {
return getLeaf().isPeeled();
return updateIndex;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
}
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
this.write = true;
}
- /** {@inheritDoc} */
@Override
protected void onUpdate(String taskName, int workCurr, Duration duration) {
StringBuilder s = new StringBuilder();
send(s);
}
- /** {@inheritDoc} */
@Override
protected void onEndTask(String taskName, int workCurr, Duration duration) {
StringBuilder s = new StringBuilder();
appendDuration(s, duration);
}
- /** {@inheritDoc} */
@Override
protected void onUpdate(String taskName, int cmp, int totalWork, int pcnt,
Duration duration) {
send(s);
}
- /** {@inheritDoc} */
@Override
protected void onEndTask(String taskName, int cmp, int totalWork, int pcnt,
Duration duration) {
this.process = new Semaphore(0);
}
- /** {@inheritDoc} */
@Override
public void start(int totalTasks) {
if (!isMainThread())
pm.start(totalTasks);
}
- /** {@inheritDoc} */
@Override
public void beginTask(String title, int totalWork) {
if (!isMainThread())
pm.update(cnt);
}
- /** {@inheritDoc} */
@Override
public void update(int completed) {
if (0 == pendingUpdates.getAndAdd(completed))
process.release();
}
- /** {@inheritDoc} */
@Override
public boolean isCancelled() {
lock.lock();
}
}
- /** {@inheritDoc} */
@Override
public void endTask() {
if (!isMainThread())
}
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
/**
* Parse an enumeration from a git {@link Config}.
*
+ * @param <T>
+ * type of the enum
* @param config
* to get the value from
* @param all
return bol;
}
- /** {@inheritDoc} */
@Override
public void write(int val) throws IOException {
out.write(val);
bol = (val == '\n');
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf, int pos, int cnt) throws IOException {
if (cnt > 0) {
/**
* Does the three way merge between a common base and two sequences.
*
- * @param cmp comparison method for this execution.
- * @param base the common base sequence
- * @param ours the first sequence to be merged
- * @param theirs the second sequence to be merged
+ * @param <S>
+ * type of the sequences
+ * @param cmp
+ * comparison method for this execution.
+ * @param base
+ * the common base sequence
+ * @param ours
+ * the first sequence to be merged
+ * @param theirs
+ * the second sequence to be merged
* @return the resulting content
*/
public <S extends Sequence> MergeResult<S> merge(
* the name of the character set used when writing conflict
* metadata
* @throws java.io.IOException
+ * if an IO error occurred
* @deprecated Use
* {@link #formatMerge(OutputStream, MergeResult, List, Charset)}
* instead.
* @param charset
* the character set used when writing conflict metadata
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.2
*/
public void formatMerge(OutputStream out, MergeResult<RawText> res,
* the name of the character set used when writing conflict
* metadata
* @throws java.io.IOException
+ * if an IO error occurred
* @deprecated use
* {@link #formatMerge(OutputStream, MergeResult, String, String, String, Charset)}
* instead.
* @param charset
* the character set used when writing conflict metadata
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.2
*/
@SuppressWarnings("unchecked")
static final ConflictState[] states = ConflictState.values();
- /** {@inheritDoc} */
@Override
public Iterator<MergeChunk> iterator() {
return new Iterator<>() {
* synthetic merge base this commit is visible only the merger's
* RevWalk and will not be in the repository.
* @throws java.io.IOException
+ * if an IO error occurred
* @throws IncorrectObjectTypeException
* one of the input objects is not a commit.
* @throws NoMergeBaseException
* the list of parent commits
* @return a new commit visible only within this merger's RevWalk.
* @throws IOException
+ * if an IO error occurred
*/
private RevCommit createCommitForTree(ObjectId tree, List<RevCommit> parents)
throws IOException {
/**
* Detects if CRLF conversion has been configured.
* <p>
- * </p>
* See {@link EolStreamTypeUtil#detectStreamType} for more info.
*
* @param attributes
: strategy;
}
- /** {@inheritDoc} */
@Override
protected boolean mergeImpl() throws IOException {
return mergeTrees(mergeBase(), sourceTrees[0], sourceTrees[1],
* adds a new path with the specified stage to the index builder
*
* @param path
+ * the new path
* @param p
+ * canonical tree parser
* @param stage
- * @param lastMod
+ * the stage
+ * @param lastModified
+ * lastModified attribute of the file
* @param len
+ * file length
* @return the entry which was added to the index
*/
private DirCacheEntry add(byte[] path, CanonicalTreeParser p, int stage,
- Instant lastMod, long len) {
+ Instant lastModified, long len) {
if (p != null && !p.getEntryFileMode().equals(FileMode.TREE)) {
return workTreeUpdater.addExistingToIndex(p.getEntryObjectId(), path,
p.getEntryFileMode(), stage,
- lastMod, (int) len);
+ lastModified, (int) len);
}
return null;
}
* didn't match ours or the working-dir file was dirty and a
* conflict occurred
* @throws java.io.IOException
+ * if an IO error occurred
* @since 6.1
*/
protected boolean processEntry(CanonicalTreeParser base,
* specified as <code>null</code> then an empty text will be used instead.
*
* @param base
+ * used to parse base tree
* @param ours
+ * used to parse ours tree
* @param theirs
+ * used to parse theirs tree
* @param attributes
+ * attributes for the different stages
* @param strategy
+ * merge strategy
*
* @return the result of the content merge
* @throws BinaryBlobException
* if any of the blobs looks like a binary blob
* @throws IOException
+ * if an IO error occurred
*/
private MergeResult<RawText> contentMerge(CanonicalTreeParser base,
CanonicalTreeParser ours, CanonicalTreeParser theirs,
* correct stages to the index.
*
* @param base
+ * used to parse base tree
* @param ours
+ * used to parse ours tree
* @param theirs
+ * used to parse theirs tree
* @param result
+ * merge result
* @param attributes
+ * the file's attributes
* @throws IOException
+ * if an IO error occurred
*/
private void updateIndex(CanonicalTreeParser base,
CanonicalTreeParser ours, CanonicalTreeParser theirs,
* the files .gitattributes entries
* @return the working tree file to which the merged content was written.
* @throws IOException
+ * if an IO error occurred
*/
private File writeMergedFile(TemporaryBuffer rawMerged,
Attributes attributes)
return FileMode.GITLINK.equals(mode);
}
- /** {@inheritDoc} */
@Override
public ObjectId getResultTreeId() {
return (resultTree == null) ? null : resultTree.toObjectId();
* content-merge conflicts.
* @return whether the trees merged cleanly
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.5
*/
protected boolean mergeTrees(AbstractTreeIterator baseTree,
* {@link org.eclipse.jgit.merge.ResolveMerger#mergeTrees(AbstractTreeIterator, RevTree, RevTree, boolean)}
* @return Whether the trees merged cleanly.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.5
*/
protected boolean mergeTreeWalk(TreeWalk treeWalk, boolean ignoreConflicts)
treeIndex = index;
}
- /** {@inheritDoc} */
@Override
public String getName() {
return strategyName;
}
- /** {@inheritDoc} */
@Override
public Merger newMerger(Repository db) {
return new OneSide(db, treeIndex);
}
- /** {@inheritDoc} */
@Override
public Merger newMerger(Repository db, boolean inCore) {
return new OneSide(db, treeIndex);
}
- /** {@inheritDoc} */
@Override
public Merger newMerger(ObjectInserter inserter, Config config) {
return new OneSide(inserter, treeIndex);
*/
public class StrategyRecursive extends StrategyResolve {
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(Repository db) {
return new RecursiveMerger(db, false);
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(Repository db, boolean inCore) {
return new RecursiveMerger(db, inCore);
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(ObjectInserter inserter, Config config) {
return new RecursiveMerger(inserter, config);
}
- /** {@inheritDoc} */
@Override
public String getName() {
return "recursive"; //$NON-NLS-1$
*/
public class StrategyResolve extends ThreeWayMergeStrategy {
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(Repository db) {
return new ResolveMerger(db, false);
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(Repository db, boolean inCore) {
return new ResolveMerger(db, inCore);
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(ObjectInserter inserter, Config config) {
return new ResolveMerger(inserter, config);
}
- /** {@inheritDoc} */
@Override
public String getName() {
return "resolve"; //$NON-NLS-1$
//
}
- /** {@inheritDoc} */
@Override
public String getName() {
return "simple-two-way-in-core"; //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(Repository db) {
return new InCoreMerger(db);
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(Repository db, boolean inCore) {
// This class is always inCore, so ignore the parameter
return newMerger(db);
}
- /** {@inheritDoc} */
@Override
public ThreeWayMerger newMerger(ObjectInserter inserter, Config config) {
return new InCoreMerger(inserter);
* A merge strategy to merge 2 trees, using a common base ancestor tree.
*/
public abstract class ThreeWayMergeStrategy extends MergeStrategy {
- /** {@inheritDoc} */
@Override
public abstract ThreeWayMerger newMerger(Repository db);
- /** {@inheritDoc} */
@Override
public abstract ThreeWayMerger newMerger(Repository db, boolean inCore);
}
}
}
- /** {@inheritDoc} */
@Override
public boolean merge(AnyObjectId... tips) throws IOException {
if (tips.length != 2)
return super.merge(tips);
}
- /** {@inheritDoc} */
@Override
public ObjectId getBaseCommitId() {
return baseCommitId;
* @return an iterator over the caller-specified merge base, or the natural
* merge base of the two input commits.
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected AbstractTreeIterator mergeBase() throws IOException {
if (baseTree != null) {
* injected as described in the
* {@link org.eclipse.jgit.nls.TranslationBundle}.
*
+ * @param <T>
+ * type of the translation bundle
* @param type
* required bundle type
* @return an instance of the required bundle type
*/
public class DefaultNoteMerger implements NoteMerger {
- /** {@inheritDoc} */
@Override
public Note merge(Note base, Note ours, Note theirs, ObjectReader reader,
ObjectInserter inserter) throws IOException {
data = newData;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
this.reader = reader;
}
- /** {@inheritDoc} */
@Override
public Iterator<Note> iterator() {
try {
* theirs version of the note tree
* @return merge result as a new NoteMap
* @throws java.io.IOException
+ * if an IO error occurred
*/
public NoteMap merge(NoteMap base, NoteMap ours, NoteMap theirs)
throws IOException {
* between base, ours and theirs.
*
* @param treeDepth
+ * depth of the tree
* @param base
+ * base version
* @param ours
+ * ours version
* @param theirs
+ * theirs version
* @return merge result as an InMemoryBucket
* @throws IOException
+ * if an IO error occurred
*/
private InMemoryNoteBucket merge(int treeDepth, InMemoryNoteBucket base,
InMemoryNoteBucket ours, InMemoryNoteBucket theirs)
super(b, offset);
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public List<? extends CombinedHunkHeader> getHunks() {
}
/**
- * {@inheritDoc}
- * <p>
- *
* @return number of ancestor revisions mentioned in this diff.
*/
@Override
/**
* {@inheritDoc}
- * <p>
+ *
* @return get the file mode of the first parent.
*/
@Override
/**
* {@inheritDoc}
- * <p>
*
* @return get the object id of the first parent.
*/
return oldIds[nthParent];
}
- /** {@inheritDoc} */
@Override
public String getScriptText(Charset ocs, Charset ncs) {
final Charset[] cs = new Charset[getParentCount() + 1];
return getScriptText(cs);
}
- /**
- * {@inheritDoc}
- * <p>
- * Convert the patch script for this file into a string.
- */
@Override
public String getScriptText(Charset[] charsetGuess) {
return super.getScriptText(charsetGuess);
return ptr;
}
- /** {@inheritDoc} */
@Override
protected void parseIndexLine(int ptr, int eol) {
// "index $asha1,$bsha1..$csha1"
oldModes = new FileMode[oldIds.length];
}
- /** {@inheritDoc} */
@Override
protected void parseNewFileMode(int ptr, int eol) {
for (int i = 0; i < oldModes.length; i++)
}
}
- /** {@inheritDoc} */
@Override
public CombinedFileHeader getFileHeader() {
return (CombinedFileHeader) super.getFileHeader();
}
- /** {@inheritDoc} */
@Override
public OldImage getOldImage() {
return getOldImage(0);
return getScriptText(new Charset[] { oldCharset, newCharset });
}
+ /**
+ * Convert the patch script for this file into a string.
+ *
+ * @param charsetGuess
+ * hint which charset is used
+ * @return the patch script, as a Unicode string.
+ */
String getScriptText(Charset[] charsetGuess) {
if (getHunks().isEmpty()) {
// If we have no hunks then we can safely assume the entire
return RawParseUtils.decode(UTF_8, buf, offset, eol);
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder r = new StringBuilder();
offsets[fileIdx] = end < 0 ? s.length() : end + 1;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* the patch to apply.
* @return the result of the patch
* @throws IOException
+ * if an IO error occurred
* @since 6.6
*/
public Result applyPatch(Patch p) throws IOException {
* @param result
* The patch application result.
* @throws IOException
+ * if an IO error occurred
*/
private void apply(String pathWithOriginalContent, DirCache dirCache,
DirCacheBuilder dirCacheBuilder, @Nullable File f, FileHeader fh, Result result)
* The patch application result
* @return a loader for the new content, or null if invalid.
* @throws IOException
+ * if an IO error occurred
* @throws UnsupportedOperationException
+ * if an operation isn't supported
*/
private @Nullable ContentStreamLoader applyBinary(String path, File f, FileHeader fh,
StreamSupplier inputSupplier, ObjectId id, Result result)
return (L) lane;
}
- /** {@inheritDoc} */
@Override
public void reset() {
forkingOffLanes = NO_LANES;
private final HashMap<PlotLane, Integer> laneLength = new HashMap<>(
32);
- /** {@inheritDoc} */
@Override
public void clear() {
super.clear();
laneLength.clear();
}
- /** {@inheritDoc} */
@Override
public void source(RevWalk w) {
if (!(w instanceof PlotWalk))
result.add((L) p);
}
- /** {@inheritDoc} */
@SuppressWarnings("ReferenceEquality")
@Override
protected void enter(int index, PlotCommit<L> currCommit) {
* @param index
* the index of <code>currCommit</code> in the list
* @param currCommit
+ * the current commit
* @param childOnLane
* the direct child on the same lane as <code>currCommit</code>,
* may be null if <code>currCommit</code> is the first commit on
* All blockades on the lane must be resolved before calling this method.
*
* @param commitIndex
+ * commit index
* @param child
+ * child to connect
* @param laneToContinue
+ * lane to continue
*/
@SuppressWarnings("ReferenceEquality")
private void drawLaneToChild(final int commitIndex, PlotCommit child,
private Repository repository;
- /** {@inheritDoc} */
@Override
public void dispose() {
super.dispose();
* @param refs
* additional refs
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void addAdditionalRefs(Iterable<Ref> refs) throws IOException {
for (Ref ref : refs) {
}
}
- /** {@inheritDoc} */
@Override
public void sort(RevSort s, boolean use) {
if (s == RevSort.TOPO && !use)
super.sort(s, use);
}
- /** {@inheritDoc} */
@Override
protected RevCommit createCommit(AnyObjectId id) {
return new PlotCommit(id);
}
- /** {@inheritDoc} */
@Override
public RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
}
/**
- * {@inheritDoc}
- * <p>
* Remove the first commit from the queue.
*/
@Override
}
/**
- * {@inheritDoc}
- * <p>
* Reconfigure this queue to share the same free list as another.
* <p>
* Multiple revision queues can be connected to the same free list, making
* <p>
* Free lists are not thread-safe. Applications must ensure that all queues
* sharing the same free list are doing so from only a single thread.
+ *
+ * @param q
+ * another FIFO queue that wants to share our queue's free list.
+ *
+ * @see Generator#shareFreeList
*/
@Override
public void shareFreeList(BlockRevQueue q) {
}
}
- /** {@inheritDoc} */
@Override
public void add(RevCommit c) {
sinceLastIndex++;
}
}
- /** {@inheritDoc} */
@Override
public RevCommit next() {
final Entry q = head;
return head != null ? head.commit : null;
}
- /** {@inheritDoc} */
@Override
public void clear() {
head = null;
return outputType | SORT_COMMIT_TIME_DESC;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
/**
* @param w
- * @param s Parent generator
+ * walk used for depth filtering
+ * @param s
+ * Parent generator
* @throws MissingObjectException
+ * if an object is missing
* @throws IncorrectObjectTypeException
+ * if an object has an unexpected type
* @throws IOException
+ * if an IO error occurred
*/
DepthGenerator(DepthWalk w, Generator s) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
* @param c
* Commit to mark
* @throws IOException
+ * if an IO error occurred
* @throws IncorrectObjectTypeException
+ * if object has an unexpected type
* @throws MissingObjectException
+ * if object is missing
*/
public void markRoot(RevCommit c) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
* @param o
* Commit to mark
* @throws IOException
+ * if an IO error occurred
* @throws IncorrectObjectTypeException
+ * if object has an unexpected type
* @throws MissingObjectException
+ * if object is missing
*/
public void markRoot(RevObject o) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
* @param c
* Commit to mark
* @throws MissingObjectException
+ * if object is missing
* @throws IncorrectObjectTypeException
+ * if object has an unexpected type
* @throws IOException
+ * if an IO error occurred
*/
public void markUnshallow(RevObject c) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
super(s);
}
- /** {@inheritDoc} */
@Override
public void add(RevCommit c) {
Block b = tail;
head = b;
}
- /** {@inheritDoc} */
@Override
public RevCommit next() {
final Block b = head;
return c;
}
- /** {@inheritDoc} */
@Override
public void clear() {
head = null;
}
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
return path.getPath();
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walker)
throws MissingObjectException, IncorrectObjectTypeException,
return path.include(walker) && ANY_DIFF.include(walker);
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return path.shouldBeRecursive() || ANY_DIFF.shouldBeRecursive();
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return new FollowFilter(path.clone(), cfg);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return name;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
return RawParseUtils.decode(enc, buffer, lt, gt - 1);
}
- /** {@inheritDoc} */
@Override
public String toString() {
return getKey() + ": " + getValue(); //$NON-NLS-1$
*
* @return next available commit; null if no more are to be returned.
* @throws MissingObjectException
+ * if an object is missing
* @throws IncorrectObjectTypeException
+ * if an object has an unexpected type
* @throws IOException
+ * if an IO error occurred
*/
abstract RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException;
super(s);
}
- /** {@inheritDoc} */
@Override
public void add(RevCommit c) {
Block b = head;
b.unpop(c);
}
- /** {@inheritDoc} */
@Override
public RevCommit next() {
final Block b = head;
return c;
}
- /** {@inheritDoc} */
@Override
public void clear() {
head = null;
return false;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
addObject(o);
}
- /** {@inheritDoc} */
@Override
public void sort(RevSort s) {
super.sort(s);
boundary = hasRevSort(RevSort.BOUNDARY);
}
- /** {@inheritDoc} */
@Override
public void sort(RevSort s, boolean use) {
super.sort(s, use);
visitationPolicy = requireNonNull(policy);
}
- /** {@inheritDoc} */
@Override
public RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
pathBuf = newBuf;
}
- /** {@inheritDoc} */
@Override
public void dispose() {
super.dispose();
freeVisit = null;
}
- /** {@inheritDoc} */
@Override
protected void reset(int retainFlags) {
super.reset(retainFlags);
super(id);
}
- /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_BLOB;
flags |= PARSED;
}
- /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_COMMIT;
buffer = null;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
this.graphPosition = graphPosition;
}
- /** {@inheritDoc} */
@Override
void parseCanonical(RevWalk walk, byte[] raw) throws IOException {
if (walk.isRetainBody()) {
parseInGraph(walk);
}
- /** {@inheritDoc} */
@Override
void parseHeaders(RevWalk walk) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
flags |= PARSED;
}
- /** {@inheritDoc} */
@Override
int getGeneration() {
return generation;
public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
private RevWalk walker;
- /** {@inheritDoc} */
@Override
public void clear() {
super.clear();
* walker specified by {@link #source(RevWalk)} is pumped until the
* specified commit is loaded. Callers can test the final size of the list
* by {@link #size()} to determine if the high water mark specified was met.
- * <p>
*
* @param commitToLoad
* commit the caller wants this list to contain when the fill
return walker;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return name;
flags &= ~set.mask;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
// Initialized above.
}
- /** {@inheritDoc} */
@Override
public void add(int index, E element) {
if (index != size)
size++;
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public E set(int index, E element) {
return (E) old;
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public E get(int index) {
return s != null ? (E) s.contents[index] : null;
}
- /** {@inheritDoc} */
@Override
public int size() {
return size;
}
- /** {@inheritDoc} */
@Override
public void clear() {
contents = new Block(0);
flags |= PARSED;
}
- /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_TAG;
super(id);
}
- /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_TREE;
/**
* Create a new revision walker for a given repository.
- * <p>
*
* @param or
* the reader the walker will obtain data from. The reader is not
* <p>
* A commit is merged into a ref if we can find a path of commits that leads
* from that specific ref and ends at <code>commit</code>.
- * <p>
*
* @param commit
* commit the caller thinks is reachable from <code>refs</code>.
* <p>
* A commit is merged into a ref if we can find a path of commits that leads
* from that specific ref and ends at <code>commit</code>.
- * <p>
*
* @param commit
* commit the caller thinks is reachable from <code>refs</code>.
/**
* Asynchronous object parsing.
*
+ * @param <T>
+ * Type of returned {@code ObjectId}
* @param objectIds
* objects to open from the object store. The supplied collection
* must not be modified until the queue has finished.
* should be done until there are no more commits
* @return the number of commits
* @throws org.eclipse.jgit.errors.MissingObjectException
+ * if object is missing
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * if object has unexpected type
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static int count(final RevWalk walk, final RevCommit start,
final RevCommit end) throws MissingObjectException,
* should be done until there are no more commits
* @return the commits found
* @throws org.eclipse.jgit.errors.MissingObjectException
+ * if object is missing
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * if object has unexpected type
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static List<RevCommit> find(final RevWalk walk,
final RevCommit start, final RevCommit end)
* the set of branches we want to see reachability from
* @return the list of branches a given commit is reachable from
* @throws org.eclipse.jgit.errors.MissingObjectException
+ * if object is missing
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * if object has unexpected type
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static List<Ref> findBranchesReachableFrom(RevCommit commit,
RevWalk revWalk, Collection<Ref> refs)
* the callback for progress and cancellation
* @return the list of branches a given commit is reachable from
* @throws org.eclipse.jgit.errors.MissingObjectException
+ * if object is missing
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * if object has unexpected type
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.4
*/
public static List<Ref> findBranchesReachableFrom(RevCommit commit,
* of this commit by the previous {@link PendingGenerator}.
*
* @param c
+ * given commit
* @throws MissingObjectException
+ * if an object is missing
* @throws IncorrectObjectTypeException
+ * if an object has an unexpected type
* @throws IOException
+ * if an IO error occurred
*/
private void applyFilterToParents(RevCommit c)
throws MissingObjectException, IncorrectObjectTypeException,
* @param s
* generator to pull all commits out of, and into this buffer.
* @throws MissingObjectException
+ * if an object is missing
* @throws IncorrectObjectTypeException
+ * if an object has an unexpected type
* @throws IOException
+ * if an IO error occurred
*/
TopoNonIntermixSortGenerator(Generator s) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
* @param s
* generator to pull all commits out of, and into this buffer.
* @throws MissingObjectException
+ * if an object is missing
* @throws IncorrectObjectTypeException
+ * if an object has an unexpected type
* @throws IOException
+ * if an IO error occurred
*/
TopoSortGenerator(Generator s) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
this.rewriteFlag = rewriteFlag;
}
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit c)
throws StopWalkException, MissingObjectException,
return false;
}
- /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return false;
when = (int) (ts / 1000);
}
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
return this;
}
- /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return false;
this.maxCount = maxCount;
}
- /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
return true;
}
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
return new MaxCountRevFilter(maxCount);
a = one;
}
- /** {@inheritDoc} */
@Override
public RevFilter negate() {
return a;
}
- /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit c)
throws MissingObjectException, IncorrectObjectTypeException,
return !a.include(walker, c);
}
- /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return a.requiresCommitBody();
}
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
return new NotRevFilter(a.clone());
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "NOT " + a.toString(); //$NON-NLS-1$
@Override
public abstract RevFilter clone();
- /** {@inheritDoc} */
@Override
public String toString() {
String n = getClass().getName();
flags = m;
}
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
return this;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return super.toString() + flags;
this.skip = skip;
}
- /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
return true;
}
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
return new SkipRevFilter(skip);
pattern = new RawSubStringPattern(patternText);
}
- /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws MissingObjectException, IncorrectObjectTypeException,
return pattern.match(text(cmit)) >= 0;
}
- /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return true;
*/
protected abstract RawCharSequence text(RevCommit cmit);
- /** {@inheritDoc} */
@Override
public RevFilter clone() {
return this; // Typically we are actually thread-safe.
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
this.hash = ObjectId.zeroId();
}
- /** {@inheritDoc} */
@Override
protected boolean notifyUponTransientChanges() {
// we will notify listeners upon save()
fireConfigChangedEvent();
}
- /** {@inheritDoc} */
@Override
public void clear() {
hash = hash(new byte[0]);
return ObjectId.fromRaw(Constants.newMessageDigest().digest(rawText));
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
public static final int DEFAULT_MIN_BYTES_FOR_OBJ_SIZE_INDEX = -1;
/**
- * Default max time to spend during the search for reuse phase. This
- * optimization is disabled by default: {@value}
+ * Default max time to spend during the search for reuse phase.
+ *
+ * This optimization is disabled by default: {@link Integer#MAX_VALUE} seconds.
*
* @see #setSearchForReuseTimeout(Duration)
* @since 5.13
/**
* Get the max time to spend during the search for reuse phase.
*
- * Default setting: {@value #DEFAULT_SEARCH_FOR_REUSE_TIMEOUT}
+ * Default setting: {@link #DEFAULT_SEARCH_FOR_REUSE_TIMEOUT}
*
* @return the maximum time to spend during the search for reuse phase.
* @since 5.13
/**
* Set the age in days that marks a branch as "inactive".
*
- * Default setting: {@value #DEFAULT_BITMAP_INACTIVE_BRANCH_AGE_IN_DAYS}
+ * Default setting: {@link #DEFAULT_BITMAP_INACTIVE_BRANCH_AGE_IN_DAYS}
*
* @param ageInDays
* the age in days that marks a branch as "inactive"
* @param timeout
* max time allowed during the search for reuse phase
*
- * Default setting: {@value #DEFAULT_SEARCH_FOR_REUSE_TIMEOUT}
+ * Default setting: {@link #DEFAULT_SEARCH_FOR_REUSE_TIMEOUT}
* @since 5.13
*/
public void setSearchForReuseTimeout(Duration timeout) {
CONFIG_KEY_PRUNE_PRESERVED, DEFAULT_PRUNE_PRESERVED));
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder b = new StringBuilder();
private final ObjectId objectId;
/**
- * Create a SubmoduleConflict for the given submodule object id
- * @param objectId
- */
+ * Create a SubmoduleConflict for the given submodule object id
+ *
+ * @param objectId
+ * the id of the object to create a submodule conflict for
+ */
public SubmoduleConflict(ObjectId objectId) {
super();
this.objectId = objectId;
* @return generator over submodule index entries. The caller is responsible
* for calling {@link #close()}.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static SubmoduleWalk forIndex(Repository repository)
throws IOException {
* @return generator at given path. The caller is responsible for calling
* {@link #close()}. Null if no submodule at given path.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static SubmoduleWalk forPath(Repository repository,
AnyObjectId treeId, String path) throws IOException {
* @return generator at given path. The caller is responsible for calling
* {@link #close()}. Null if no submodule at given path.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static SubmoduleWalk forPath(Repository repository,
AbstractTreeIterator iterator, String path) throws IOException {
* submodule path
* @return repository or null if repository doesn't exist
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static Repository getSubmoduleRepository(final Repository parent,
final String path) throws IOException {
* submodule path
* @return repository or null if repository doesn't exist
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static Repository getSubmoduleRepository(final File parent,
final String path) throws IOException {
* abstraction
*
* @param parent
+ * {@link Repository} that contains the submodule
* @param path
+ * of the working tree of the submodule
* @param fs
* the file system abstraction to be used
* @return repository or null if repository doesn't exist
* @throws IOException
+ * if an IO error occurred
* @since 4.10
*/
public static Repository getSubmoduleRepository(final File parent,
* @return the {@link Repository} of the submodule, or {@code null} if it
* doesn't exist
* @throws IOException
- * on errors
+ * if an IO error occurred
* @since 5.6
*/
public static Repository getSubmoduleRepository(File parent, String path,
* absolute or relative URL of the submodule repository
* @return resolved URL
* @throws java.io.IOException
+ * if an IO error occurred
*/
public static String getSubmoduleRemoteUrl(final Repository parent,
final String url) throws IOException {
* @param repository
* the {@link org.eclipse.jgit.lib.Repository}.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public SubmoduleWalk(Repository repository) throws IOException {
this.repository = repository;
* The root tree is not read until the first submodule is encountered by the
* walk.
* <p>
- * This method need only be called if constructing a walk manually instead of
- * with one of the static factory methods above.
+ * This method need only be called if constructing a walk manually instead
+ * of with one of the static factory methods above.
*
* @param id
* ID of a tree containing .gitmodules
* @return this generator
* @throws java.io.IOException
+ * if an IO error occurred
*/
public SubmoduleWalk setRootTree(AnyObjectId id) throws IOException {
final CanonicalTreeParser p = new CanonicalTreeParser();
* @throws java.io.IOException
* if an error occurred, or if the repository is bare
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
*/
public SubmoduleWalk loadModulesConfig() throws IOException, ConfigInvalidException {
if (rootTree == null) {
*
* @param repository
* the repository to check
- * @return <code>true</code> if the working tree contains a .gitmodules file,
- * <code>false</code> otherwise. Always returns <code>false</code>
- * for bare repositories.
+ * @return <code>true</code> if the working tree contains a .gitmodules
+ * file, <code>false</code> otherwise. Always returns
+ * <code>false</code> for bare repositories.
* @throws java.io.IOException
- * @throws CorruptObjectException if any.
+ * if an IO error occurred
+ * @throws CorruptObjectException
+ * if a corrupt object was found
* @since 3.6
*/
public static boolean containsGitModulesFile(Repository repository)
* object.
* @return this generator
* @throws org.eclipse.jgit.errors.CorruptObjectException
+ * if a corrupt object was found
*/
public SubmoduleWalk setTree(AbstractTreeIterator iterator)
throws CorruptObjectException {
* an {@link org.eclipse.jgit.lib.AnyObjectId} object.
* @return this generator
* @throws java.io.IOException
+ * if an IO error occurred
* @throws IncorrectObjectTypeException
- * if any.
+ * if object has unexpected type
* @throws MissingObjectException
- * if any.
+ * if object is missing
*/
public SubmoduleWalk setTree(AnyObjectId treeId) throws IOException {
walk.addTree(treeId);
*
* @return true if entry found, false otherwise
* @throws java.io.IOException
+ * if an IO error occurred
*/
public boolean next() throws IOException {
while (walk.next()) {
* name of .git/config)
*
* @since 4.10
- * @return name
+ * @return name of the submodule
* @throws ConfigInvalidException
+ * if the .gitmodules config is invalid
* @throws IOException
+ * if an IO error occurred
*/
public String getModuleName() throws IOException, ConfigInvalidException {
lazyLoadModulesConfig();
*
* @return configured path
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
* @throws java.io.IOException
+ * if an IO error occurred
*/
public String getModulesPath() throws IOException, ConfigInvalidException {
lazyLoadModulesConfig();
*
* @return configured URL
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
* @throws java.io.IOException
+ * if an IO error occurred
*/
public String getConfigUrl() throws IOException, ConfigInvalidException {
return repoConfig.getString(ConfigConstants.CONFIG_SUBMODULE_SECTION,
*
* @return configured URL
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
* @throws java.io.IOException
+ * if an IO error occurred
*/
public String getModulesUrl() throws IOException, ConfigInvalidException {
lazyLoadModulesConfig();
*
* @return update value
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
* @throws java.io.IOException
+ * if an IO error occurred
*/
public String getConfigUpdate() throws IOException, ConfigInvalidException {
return repoConfig.getString(ConfigConstants.CONFIG_SUBMODULE_SECTION,
*
* @return update value
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
* @throws java.io.IOException
+ * if an IO error occurred
*/
public String getModulesUpdate() throws IOException, ConfigInvalidException {
lazyLoadModulesConfig();
*
* @return ignore value
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.6
*/
public IgnoreSubmoduleMode getModulesIgnore() throws IOException,
*
* @return repository or null if non-existent
* @throws java.io.IOException
+ * if an IO error occurred
*/
public Repository getRepository() throws IOException {
return getSubmoduleRepository(repository.getWorkTree(), path,
*
* @return object id of HEAD reference
* @throws java.io.IOException
+ * if an IO error occurred
*/
public ObjectId getHead() throws IOException {
try (Repository subRepo = getRepository()) {
*
* @return ref name, null on failures
* @throws java.io.IOException
+ * if an IO error occurred
*/
public String getHeadRef() throws IOException {
try (Repository subRepo = getRepository()) {
*
* @return resolved remote URL
* @throws java.io.IOException
+ * if an IO error occurred
* @throws org.eclipse.jgit.errors.ConfigInvalidException
+ * if .gitmodules config is invalid
*/
public String getRemoteUrl() throws IOException, ConfigInvalidException {
String url = getModulesUrl();
* @since 2.0
*/
public abstract class AbstractAdvertiseRefsHook implements AdvertiseRefsHook {
- /** {@inheritDoc} */
@Override
public void advertiseRefs(UploadPack uploadPack)
throws ServiceMayNotContinueException {
}
/**
- * {@inheritDoc}
*/
@Override
public void advertiseRefs(ReceivePack receivePack)
* @throws org.eclipse.jgit.transport.ServiceMayNotContinueException
* abort; the message will be sent to the user.
* @throws IOException
+ * if an IO error occurred
* @since 5.6
*/
void advertiseRefs(ReceivePack receivePack)
}
}
- /**
- * {@inheritDoc}
- */
@Override
public void advertiseRefs(ReceivePack rp)
throws IOException {
hooks[i].advertiseRefs(rp);
}
- /** {@inheritDoc} */
@Override
public void advertiseRefs(UploadPack rp)
throws ServiceMayNotContinueException {
private Writer messageWriter;
- /** {@inheritDoc} */
@Override
public Map<String, Ref> getRefsMap() {
return advertisedRefs;
}
- /** {@inheritDoc} */
@Override
public final Collection<Ref> getRefs() {
return advertisedRefs.values();
}
- /** {@inheritDoc} */
@Override
public final Ref getRef(String name) {
return advertisedRefs.get(name);
}
- /** {@inheritDoc} */
@Override
public String getMessages() {
return messageWriter != null ? messageWriter.toString() : ""; //$NON-NLS-1$
peerUserAgent = agent;
}
- /** {@inheritDoc} */
@Override
public abstract void close();
*/
abstract class BaseFetchConnection extends BaseConnection implements
FetchConnection {
- /** {@inheritDoc} */
@Override
public final void fetch(final ProgressMonitor monitor,
final Collection<Ref> want, final Set<ObjectId> have)
fetch(monitor, want, have, null);
}
- /** {@inheritDoc} */
@Override
public final void fetch(final ProgressMonitor monitor,
final Collection<Ref> want, final Set<ObjectId> have,
*/
abstract class BasePackConnection extends BaseConnection {
+ /** The capability prefix for a symlink */
protected static final String CAPABILITY_SYMREF_PREFIX = "symref="; //$NON-NLS-1$
/** The repository this transport fetches into, or pushes out of. */
/** Remote repository location. */
protected final URIish uri;
- /** A transport connected to {@link #uri}. */
+ /** A transport connected to {@link BasePackConnection#uri}. */
protected final Transport transport;
/** Low-level input stream, if a timeout was configured. */
/** Low-level output stream, if a timeout was configured. */
protected TimeoutOutputStream timeoutOut;
- /** Timer to manage {@link #timeoutIn} and {@link #timeoutOut}. */
+ /**
+ * Timer to manage {@link #timeoutIn} and
+ * {@link BasePackConnection#timeoutOut}.
+ */
private InterruptTimer myTimer;
/** Input stream reading from the remote. */
/** Output stream sending to the remote. */
protected OutputStream out;
- /** Packet line decoder around {@link #in}. */
+ /** Packet line decoder around {@link BasePackConnection#in}. */
protected PacketLineIn pckIn;
- /** Packet line encoder around {@link #out}. */
+ /** Packet line encoder around {@link BasePackConnection#out}. */
protected PacketLineOut pckOut;
- /** Send {@link PacketLineOut#end()} before closing {@link #out}? */
+ /**
+ * Send {@link PacketLineOut#end()} before closing
+ * {@link BasePackConnection#out}?
+ */
protected boolean outNeedsEnd;
/** True if this is a stateless RPC connection. */
* <p>
* If refMap already contains an entry for symRef.key, it is replaced.
* </p>
- * </p>
* <p>
* For example, given:
* </p>
}
}
- /** {@inheritDoc} */
@Override
public String getPeerUserAgent() {
String agent = remoteCapabilities.get(OPTION_AGENT);
return new PackProtocolException(uri, MessageFormat.format(JGitText.get().invalidRefAdvertisementLine, line));
}
- /** {@inheritDoc} */
@Override
public void close() {
if (out != null) {
}
}
- /** {@inheritDoc} */
@Override
public final void fetch(final ProgressMonitor monitor,
final Collection<Ref> want, final Set<ObjectId> have)
fetch(monitor, want, have, null);
}
- /** {@inheritDoc} */
@Override
public final void fetch(final ProgressMonitor monitor,
final Collection<Ref> want, final Set<ObjectId> have,
doFetch(monitor, want, have, outputStream);
}
- /** {@inheritDoc} */
@Override
public boolean didFetchIncludeTags() {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean didFetchTestConnectivity() {
return false;
}
- /** {@inheritDoc} */
@Override
public void setPackLockMessage(String message) {
lockMessage = message;
}
- /** {@inheritDoc} */
@Override
public Collection<PackLock> getPackLocks() {
if (packLock != null)
return gotReady;
}
- /** {@inheritDoc} */
@Override
public void close() {
if (walk != null)
useBitmaps = transport.isPushUseBitmaps();
}
- /** {@inheritDoc} */
@Override
public void push(final ProgressMonitor monitor,
final Map<String, RemoteRefUpdate> refUpdates)
push(monitor, refUpdates, null);
}
- /** {@inheritDoc} */
@Override
public void push(final ProgressMonitor monitor,
final Map<String, RemoteRefUpdate> refUpdates, OutputStream outputStream)
doPush(monitor, refUpdates, outputStream);
}
- /** {@inheritDoc} */
@Override
protected TransportException noRepository(Throwable cause) {
// Sadly we cannot tell the "invalid URI" case from "push not allowed".
return line.toString();
}
- /** {@inheritDoc} */
@Override
public boolean didFetchTestConnectivity() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void doFetch(final ProgressMonitor monitor,
final Collection<Ref> want, final Set<ObjectId> have)
}
}
- /** {@inheritDoc} */
@Override
public void setPackLockMessage(String message) {
lockMessage = message;
}
- /** {@inheritDoc} */
@Override
public Collection<PackLock> getPackLocks() {
if (packLock != null)
}
}
- /** {@inheritDoc} */
@Override
public void close() {
if (bin != null) {
Arrays.asList(providers));
}
- /** {@inheritDoc} */
@Override
public boolean isInteractive() {
for (CredentialsProvider p : credentialProviders)
return false;
}
- /** {@inheritDoc} */
@Override
public boolean supports(CredentialItem... items) {
for (CredentialsProvider p : credentialProviders)
}
/**
- *
* @param newValue
+ * the new value
*/
public void setValue(String newValue) {
value = newValue;
* Set the new value.
*
* @param newValue
+ * the new value
*/
public void setValue(boolean newValue) {
value = newValue;
return val.testBit(type);
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ObjectTypes)) {
return other.val.equals(val);
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return val.hashCode();
* @param unit
* of the {@code timeout}
* @throws IOException
+ * if an IO error occurred
*/
void connect(int timeout, TimeUnit unit) throws IOException;
/**
* @return the current remote directory path
* @throws IOException
+ * if an IO error occurred
*/
String pwd() throws IOException;
* of the directory to list
* @return the directory entries
* @throws IOException
+ * if an IO error occurred
*/
Collection<DirEntry> ls(String path) throws IOException;
* @param path
* to delete
* @throws IOException
+ * if an IO error occurred
*/
void rmdir(String path) throws IOException;
* @param path
* to create
* @throws IOException
+ * if an IO error occurred
*/
void mkdir(String path) throws IOException;
*
* @return the stream to read from
* @throws IOException
+ * if an IO error occurred
*/
InputStream get(String path) throws IOException;
*
* @return the stream to read from
* @throws IOException
+ * if an IO error occurred
*/
OutputStream put(String path) throws IOException;
* @param to
* new name of the file
* @throws IOException
+ * if an IO error occurred
* @see <a href=
* "http://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html">stdio.h:
* rename()</a>
*
* @param seed
* seed the generator
- * @throws java.lang.IllegalStateException
*/
- public HMACSHA1NonceGenerator(String seed) throws IllegalStateException {
+ public HMACSHA1NonceGenerator(String seed) {
try {
byte[] keyBytes = seed.getBytes(ISO_8859_1);
SecretKeySpec signingKey = new SecretKeySpec(keyBytes, "HmacSHA1"); //$NON-NLS-1$
}
}
- /** {@inheritDoc} */
@Override
- public synchronized String createNonce(Repository repo, long timestamp)
- throws IllegalStateException {
+ public synchronized String createNonce(Repository repo, long timestamp) {
String input = repo.getIdentifier() + ":" + String.valueOf(timestamp); //$NON-NLS-1$
byte[] rawHmac = mac.doFinal(input.getBytes(UTF_8));
return Long.toString(timestamp) + "-" + toHex(rawHmac); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public NonceStatus verify(String received, String sent,
Repository db, boolean allowSlop, int slop) {
* Update this method with the given username and password pair.
*
* @param user
+ * username
* @param pass
+ * password
*/
abstract void authorize(String user, String pass);
* Update connection properties based on this authentication method.
*
* @param conn
+ * the connection to configure
* @throws IOException
+ * if an IO error occurred
*/
abstract void configureRequest(HttpConnection conn) throws IOException;
readAdvertisedRefs();
}
- /** {@inheritDoc} */
@Override
public void close() {
super.close();
readAdvertisedRefs();
}
- /** {@inheritDoc} */
@Override
public void close() {
super.close();
/**
* @param value
+ * ref prefix values
* @return the Builder
*/
public Builder setRefPrefixes(List<String> value) {
/**
* @param value
+ * of symrefs
* @return the Builder
*/
public Builder setSymrefs(boolean value) {
/**
* @param value
+ * of peel
* @return the Builder
*/
public Builder setPeel(boolean value) {
return this;
}
- /** @return LsRefsV2Request */
+ /**
+ * Builds the request
+ *
+ * @return LsRefsV2Request the request
+ */
public LsRefsV2Request build() {
return new LsRefsV2Request(
Collections.unmodifiableList(refPrefixes), symrefs, peel,
CredentialsProvider.setDefault(new NetRCCredentialsProvider());
}
- /** {@inheritDoc} */
@Override
public boolean supports(CredentialItem... items) {
for (CredentialItem i : items) {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
return !isAnyNull(items);
}
- /** {@inheritDoc} */
@Override
public boolean isInteractive() {
return false;
* @param timestamp
* The current time in seconds.
* @return The nonce to be signed by the pusher
- * @throws java.lang.IllegalStateException
*/
- String createNonce(Repository db, long timestamp)
- throws IllegalStateException;
+ String createNonce(Repository db, long timestamp);
/**
* Verify trustworthiness of the received nonce.
/**
* @param value
+ * of objectIds
* @return the Builder
*/
public Builder setObjectIDs(List<ObjectId> value) {
return this;
}
- /** @return ObjectInfoRequest */
+ /**
+ * Build the request
+ *
+ * @return ObjectInfoRequest the request
+ */
public ObjectInfoRequest build() {
return new ObjectInfoRequest(
Collections.unmodifiableList(objectIDs));
* @param data
* raw content of the object.
* @throws org.eclipse.jgit.errors.CorruptObjectException
+ * if a corrupt object was found
* @since 4.9
*/
protected void verifySafeObject(final AnyObjectId id, final int type,
* Size in storage
*
* @param sizeBeforeInflating
+ * size before inflating
*/
void setSize(long sizeBeforeInflating) {
this.sizeBeforeInflating = sizeBeforeInflating;
}
}
- /** {@inheritDoc} */
@Override
public void onPostReceive(ReceivePack rp,
Collection<ReceiveCommand> commands) {
}
}
- /** {@inheritDoc} */
@Override
public void onPostUpload(PackStatistics stats) {
for (PostUploadHook hook : hooks) {
}
}
- /** {@inheritDoc} */
@Override
public void onPreReceive(ReceivePack rp,
Collection<ReceiveCommand> commands) {
}
}
- /** {@inheritDoc} */
@Override
public void onBeginNegotiateRound(UploadPack up,
Collection<? extends ObjectId> wants, int cntOffered)
}
}
- /** {@inheritDoc} */
@Override
public void onEndNegotiateRound(UploadPack up,
Collection<? extends ObjectId> wants, int cntCommon,
}
}
- /** {@inheritDoc} */
@Override
public void onSendPack(UploadPack up,
Collection<? extends ObjectId> wants,
* incoming lines. This method will read until an END line.
* @return a FetchV0Request with the data received in the wire.
* @throws PackProtocolException
+ * if a protocol occurred
* @throws IOException
+ * if an IO error occurred
*/
FetchV0Request recvWants(PacketLineIn pckIn)
throws PackProtocolException, IOException {
return sb;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return signature.hashCode();
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
if (!(o instanceof PushCertificate)) {
return true;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return getClass().getSimpleName() + '['
return tzOffset;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object o) {
return (o instanceof PushCertificateIdent)
&& raw.equals(((PushCertificateIdent) o).raw);
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
return raw.hashCode();
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* and sending objects that remote repository need to have a consistent
* objects graph from new refs.
* <p>
- * <p>
* Only one call per connection is allowed. Subsequent calls will result in
* {@link org.eclipse.jgit.errors.TransportException}.
- * </p>
* <p>
* Implementation may use local repository to send a minimum set of objects
* needed by remote repository in efficient way.
* {@link org.eclipse.jgit.transport.Transport#isPushThin()} should be
* honored if applicable. refUpdates should be filled with information about
* status of each update.
- * </p>
*
* @param monitor
* progress monitor to update the end-user about the amount of
* and sending objects that remote repository need to have a consistent
* objects graph from new refs.
* <p>
- * <p>
* Only one call per connection is allowed. Subsequent calls will result in
* {@link org.eclipse.jgit.errors.TransportException}.
- * </p>
* <p>
* Implementation may use local repository to send a minimum set of objects
* needed by remote repository in efficient way.
* {@link org.eclipse.jgit.transport.Transport#isPushThin()} should be
* honored if applicable. refUpdates should be filled with information about
* status of each update.
- * </p>
*
* @param monitor
* progress monitor to update the end-user about the amount of
* {@link PrePushHook} to run after the remote advertisement has
* been gotten
* @throws TransportException
+ * if a protocol error occurred during push/fetch
*/
PushProcess(Transport transport, Collection<RemoteRefUpdate> toPush,
PrePushHook prePush) throws TransportException {
* @param out
* OutputStream to write messages to
* @throws TransportException
+ * if a protocol error occurred during push/fetch
*/
PushProcess(Transport transport, Collection<RemoteRefUpdate> toPush,
PrePushHook prePush, OutputStream out) throws TransportException {
* {@link ObjectId}Â of the new commit
* @return {@code true} if the update fast-forwards, {@code false} otherwise
* @throws TransportException
+ * if a protocol error occurred during push/fetch
*/
private boolean isFastForward(ObjectId oldOid, ObjectId newOid)
throws TransportException {
JGitText.get().lockError, err.getMessage()));
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* null, assumes the default set of additional haves from the
* repository.
* @throws IOException
+ * if an IO error occurred
*/
public void setAdvertisedRefs(Map<String, Ref> allRefs,
Set<ObjectId> additionalHaves) throws IOException {
* Set an error handler for {@link ReceiveCommand}.
*
* @param receiveCommandErrorHandler
+ * the error handler
* @since 5.7
*/
public void setReceiveCommandErrorHandler(
*
* @return advertised refs, or the default if not explicitly advertised.
* @throws IOException
+ * if an IO error occurred
*/
private Map<String, Ref> getAdvertisedOrDefaultRefs() throws IOException {
if (refs == null)
/**
* Receive a list of commands from the input.
*
- * @throws java.io.IOException
+ * @throws IOException
+ * if an IO error occurred
*/
private void recvCommands() throws IOException {
PacketLineIn pck = maxCommandBytes > 0
/**
* Close and flush (if necessary) the underlying streams.
*
- * @throws java.io.IOException
+ * @throws IOException
+ * if an IO error occurred
*/
private void close() throws IOException {
if (sideBand) {
* standard error channel of the command execution. For most
* other network connections this should be null.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void receive(final InputStream input, final OutputStream output,
final OutputStream messages) throws IOException {
* standard error channel of the command execution. For most
* other network connections this should be null.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.7
*/
public void receiveWithExceptionPropagation(InputStream input,
/**
* Toggle tag peeling.
* <p>
- * <p>
+ *
* This method must be invoked prior to any of the following:
* <ul>
* <li>{@link #send(Map)}</li>
return expected;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder r = new StringBuilder();
return true;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
int hc = 0;
return hc;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (!(obj instanceof RefSpec))
&& Objects.equals(getDestination(), b.getDestination());
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder r = new StringBuilder();
trackingRefUpdate.setResult(localUpdate.update(walk));
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
out = outputStream;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
needDataPacket();
return rawIn.read();
}
- /** {@inheritDoc} */
@Override
public int read(byte[] b, int off, int len) throws IOException {
int r = 0;
writeBuffer();
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
flushBuffer();
out.flush();
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b, int off, int len) throws IOException {
while (0 < len) {
}
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
if (cnt == buffer.length)
write = true;
}
- /** {@inheritDoc} */
@Override
protected void onUpdate(String taskName, int workCurr, Duration duration) {
StringBuilder s = new StringBuilder();
send(s);
}
- /** {@inheritDoc} */
@Override
protected void onEndTask(String taskName, int workCurr, Duration duration) {
StringBuilder s = new StringBuilder();
appendDuration(s, duration);
}
- /** {@inheritDoc} */
@Override
protected void onUpdate(String taskName, int cmp, int totalWork, int pcnt,
Duration duration) {
send(s);
}
- /** {@inheritDoc} */
@Override
protected void onEndTask(String taskName, int cmp, int totalWork, int pcnt,
Duration duration) {
* {@link SshConstants#CONNECTION_ATTEMPTS}, fill those values with defaults
* from the arguments:
* <table>
+ * <caption>Description of arguments</caption>
* <tr>
* <th>ssh config key</th>
* <th>value from argument</th>
* Comma-separated list of jump hosts, defining a jump host chain <em>in
* reverse order</em>. Each jump host is a SSH URI or "[user@]host[:port]".
* <p>
- * Reverse order means: to connect A->B->target, one can do in
- * {@code ~/.ssh/config} either of:
+ * Reverse order means: to connect {@literal A -> B -> target}, one can do
+ * in {@code ~/.ssh/config} either of:
* </p>
*
* <pre>
return sock;
}
- /** {@inheritDoc} */
@Override
public void close() {
if (sock != null) {
this.handles = new HashMap<>();
}
- /** {@inheritDoc} */
@Override
public String getName() {
return JGitText.get().transportProtoTest;
}
- /** {@inheritDoc} */
@Override
public Set<String> getSchemes() {
return Collections.singleton(SCHEME);
}
- /** {@inheritDoc} */
@Override
public Transport open(URIish uri, Repository local, String remoteName)
throws NotSupportedException, TransportException {
return new TransportInternal(local, uri, h);
}
- /** {@inheritDoc} */
@Override
public Set<URIishField> getRequiredFields() {
return EnumSet.of(URIishField.HOST, URIishField.PATH);
}
- /** {@inheritDoc} */
@Override
public Set<URIishField> getOptionalFields() {
return Collections.emptySet();
}
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* Note that the resulting transport instance can not be used for fetching
* or pushing, but only for reading remote refs.
*
- * @param uri a {@link org.eclipse.jgit.transport.URIish} object.
+ * @param uri
+ * a {@link org.eclipse.jgit.transport.URIish} object.
* @return new Transport instance
* @throws org.eclipse.jgit.errors.NotSupportedException
+ * case that is not supported by JGit
* @throws org.eclipse.jgit.errors.TransportException
+ * if transport failed
*/
public static Transport open(URIish uri) throws NotSupportedException, TransportException {
for (WeakReference<TransportProtocol> ref : protocols) {
}
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException {
final DatabaseS3 c = new DatabaseS3(bucket, keyPrefix + "/objects"); //$NON-NLS-1$
return r;
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws TransportException {
final DatabaseS3 c = new DatabaseS3(bucket, keyPrefix + "/objects"); //$NON-NLS-1$
return r;
}
- /** {@inheritDoc} */
@Override
public void close() {
// No explicit connections are maintained.
bundle = bundlePath;
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws NotSupportedException,
TransportException {
return new BundleFetchConnection(this, src);
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws NotSupportedException {
throw new NotSupportedException(
JGitText.get().pushIsNotSupportedForBundleTransport);
}
- /** {@inheritDoc} */
@Override
public void close() {
// Resources must be established per-connection.
src = in;
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException {
if (src == null)
}
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws NotSupportedException {
throw new NotSupportedException(
JGitText.get().pushIsNotSupportedForBundleTransport);
}
- /** {@inheritDoc} */
@Override
public void close() {
if (src != null) {
super(uri);
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException {
return new TcpFetchConnection();
return new TcpFetchConnection(refSpecs, additionalPatterns);
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws TransportException {
return new TcpPushConnection();
}
- /** {@inheritDoc} */
@Override
public void close() {
// Resources must be established per-connection.
}
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException {
return new SshFetchConnection();
return new SshFetchConnection(refSpecs, additionalPatterns);
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws TransportException {
return new SshPushConnection();
* @param uri
* a {@link org.eclipse.jgit.transport.URIish} object.
* @throws org.eclipse.jgit.errors.NotSupportedException
+ * if URI is not supported by JGit
* @since 4.9
*/
protected void setURI(URIish uri) throws NotSupportedException {
* Create a minimal HTTP transport with default configuration values.
*
* @param uri
+ * URI to create a HTTP transport for
* @throws NotSupportedException
+ * if URI is not supported by JGit
*/
TransportHttp(URIish uri) throws NotSupportedException {
super(uri);
}
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException,
NotSupportedException {
return new BufferedReader(new InputStreamReader(in, UTF_8));
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws NotSupportedException,
TransportException {
return p;
}
- /** {@inheritDoc} */
@Override
public void close() {
if (gitSession != null) {
/**
* Trust the server for all git operations from this repository; may be
* {@code null} if the transport was created via
- * {@link #TransportHttp(URIish)}.
+ * {@link TransportHttp#TransportHttp(URIish)}.
*/
CredentialItem.YesNoType forRepo;
/**
* Open an HTTP connection.
*
- * @param method HTTP request method
- * @param u url of the HTTP connection
- * @param acceptEncoding accept-encoding header option
+ * @param method
+ * HTTP request method
+ * @param u
+ * url of the HTTP connection
+ * @param acceptEncoding
+ * accept-encoding header option
* @return the HTTP connection
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.6
*/
protected HttpConnection httpOpen(String method, URL u,
}
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException {
return openFetch(Collections.emptyList());
return new InternalFetchConnection<>(this, upf, null, openRepo());
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws TransportException {
final String rp = getOptionReceivePack();
return new InternalPushConnection<>(this, rpf, null, openRepo());
}
- /** {@inheritDoc} */
@Override
public void close() {
// Resources must be established per-connection.
* a {@link org.eclipse.jgit.transport.URIish} object.
* @return new Transport
* @throws org.eclipse.jgit.errors.NotSupportedException
+ * this protocol does not support the URI.
* @throws org.eclipse.jgit.errors.TransportException
+ * the transport cannot open this URI.
*/
public Transport open(URIish uri)
throws NotSupportedException, TransportException {
super(local, uri);
}
- /** {@inheritDoc} */
@Override
public FetchConnection openFetch() throws TransportException {
final SftpObjectDB c = new SftpObjectDB(uri.getPath());
return r;
}
- /** {@inheritDoc} */
@Override
public PushConnection openPush() throws TransportException {
final SftpObjectDB c = new SftpObjectDB(uri.getPath());
private static final long serialVersionUID = 1L;
/**
- * A pattern matching standard URI: </br>
+ * A pattern matching standard URI: <br>
* <code>scheme "://" user_password? hostname? portnumber? path</code>
*/
private static final Pattern FULL_URI = Pattern.compile("^" // //$NON-NLS-1$
* @param s
* a {@link java.lang.String} object.
* @throws java.net.URISyntaxException
+ * if {@code s} was null or couldn't be parsed
*/
public URIish(String s) throws URISyntaxException {
if (StringUtils.isEmptyOrNull(s)) {
* the new value for path.
* @return a new URI with the updated value.
* @throws java.net.URISyntaxException
+ * if URI couldn't be parsed from String
*/
public URIish setRawPath(String n) throws URISyntaxException {
final URIish r = new URIish(this);
return r;
}
- /** {@inheritDoc} */
@Override
public int hashCode() {
int hc = 0;
return hc;
}
- /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (!(obj instanceof URIish))
return format(true, false);
}
- /** {@inheritDoc} */
@Override
public String toString() {
return format(false, false);
/**
* Get the "humanish" part of the path. Some examples of a 'humanish' part
* for a full path:
- * <table summary="path vs humanish path" border="1">
+ * <table border="1">
+ * <caption>path vs. humanish path</caption>
* <tr>
* <th>Path</th>
* <th>Humanish part</th>
* its own error handling mechanism.
*
* @param input
+ * input stream
* @param output
+ * output stream
* @param messages
+ * stream for messages
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void upload(InputStream input, OutputStream output,
@Nullable OutputStream messages) throws IOException {
* request in process
* @param allTags
* refs to search for annotated tags to include in the pack if
- * the {@link #OPTION_INCLUDE_TAG} capability was requested.
+ * the {@link GitProtocolConstants#OPTION_INCLUDE_TAG} capability
+ * was requested.
* @param unshallowCommits
* shallow commits on the client that are now becoming unshallow
* @param deepenNots
* where to write statistics about the content of the pack.
* @param allTags
* refs to search for annotated tags to include in the pack if
- * the {@link #OPTION_INCLUDE_TAG} capability was requested.
+ * the {@link GitProtocolConstants#OPTION_INCLUDE_TAG} capability
+ * was requested.
* @param unshallowCommits
* shallow commits on the client that are now becoming unshallow
* @param deepenNots
/**
*
* @param options
+ * options
* @param transportAgent
+ * name of transport agent
* @return The transport agent.
- * @deprecated Capabilities with <key>=<value> shape are now parsed
- * alongside other capabilities in the ReceivePack flow.
+ * @deprecated Capabilities with <key>=<value> shape are now
+ * parsed alongside other capabilities in the ReceivePack flow.
*/
@Deprecated
static String getAgent(Set<String> options, String transportAgent) {
/**
*
* @param options
+ * options
* @return True if the transport agent is set. False otherwise.
- * @deprecated Capabilities with <key>=<value> shape are now parsed
- * alongside other capabilities in the ReceivePack flow.
+ * @deprecated Capabilities with <key>=<value> shape are now
+ * parsed alongside other capabilities in the ReceivePack flow.
*/
@Deprecated
static boolean hasAgent(Set<String> options) {
this.password = password;
}
- /** {@inheritDoc} */
@Override
public boolean isInteractive() {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean supports(CredentialItem... items) {
for (CredentialItem i : items) {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
* EncryptionUtil.java</a>
* <p>
* Note: EncryptionUtil is inadequate:
+ * <ul>
* <li>EncryptionUtil.isCipherAvailableForUse checks encryption only which
* "always works", but in JetS3t both encryption and decryption use non-IV
* aware algorithm parameters for all PBE specs, which breaks in case of AES
* JetS3t, such as PBEWithMD5AndDES and PBEWithSHAAndTwofish-CBC
* <li>any AES based algorithms such as "PBE...With...And...AES" will not
* work, since they need proper IV setup
+ * </ul>
*/
static class JetS3tV2 extends WalkEncryption {
* Encryption factory.
*
* @param props
- * @return instance
+ * configuration properties
+ * @return instance this object
* @throws GeneralSecurityException
+ * if generic security failure occurred
*/
static WalkEncryption instance(Properties props)
throws GeneralSecurityException {
workQueue = new LinkedList<>();
}
- /** {@inheritDoc} */
@Override
public boolean didFetchTestConnectivity() {
return true;
}
- /** {@inheritDoc} */
@Override
protected void doFetch(final ProgressMonitor monitor,
final Collection<Ref> want, final Set<ObjectId> have)
}
}
- /** {@inheritDoc} */
@Override
public Collection<PackLock> getPackLocks() {
return packLocks;
}
- /** {@inheritDoc} */
@Override
public void setPackLockMessage(String message) {
lockMessage = message;
}
- /** {@inheritDoc} */
@Override
public void close() {
inserter.close();
dest = w;
}
- /** {@inheritDoc} */
@Override
public void push(final ProgressMonitor monitor,
final Map<String, RemoteRefUpdate> refUpdates)
push(monitor, refUpdates, null);
}
- /** {@inheritDoc} */
@Override
public void push(final ProgressMonitor monitor,
final Map<String, RemoteRefUpdate> refUpdates, OutputStream out)
}
}
- /** {@inheritDoc} */
@Override
public void close() {
dest.close();
* @see HttpURLConnection#getResponseCode()
* @return the HTTP Status-Code, or -1
* @throws java.io.IOException
+ * if an IO error occurred
*/
int getResponseCode() throws IOException;
* @see HttpURLConnection#getResponseMessage()
* @return the HTTP response message, or <code>null</code>
* @throws java.io.IOException
+ * if an IO error occurred
*/
String getResponseMessage() throws IOException;
* @exception IOException
* if an I/O error occurs while creating the input stream.
* @throws java.io.IOException
- * if any.
+ * if an IO error occurred
*/
InputStream getInputStream() throws IOException;
/**
* Get header field. According to
- * {@link <a href="https://tools.ietf.org/html/rfc2616#section-4.2">RFC
- * 2616</a>} header field names are case insensitive. Header fields defined
+ * <a href="https://tools.ietf.org/html/rfc2616#section-4.2">RFC 2616</a>
+ * header field names are case insensitive. Header fields defined
* as a comma separated list can have multiple header fields with the same
* field name. This method only returns one of these header fields. If you
* want the union of all values of all multiple header fields with the same
/**
* Get all values of given header field. According to
- * {@link <a href="https://tools.ietf.org/html/rfc2616#section-4.2">RFC
- * 2616</a>} header field names are case insensitive. Header fields defined
+ * <a href="https://tools.ietf.org/html/rfc2616#section-4.2">RFC 2616</a>
+ * header field names are case insensitive. Header fields defined
* as a comma separated list can have multiple header fields with the same
* field name. This method does not validate if the given header field is
* defined as a comma separated list.
* @see HttpURLConnection#getOutputStream()
* @return an output stream that writes to this connection.
* @throws java.io.IOException
+ * if an IO error occurred
*/
OutputStream getOutputStream() throws IOException;
*
* @see HttpURLConnection#connect()
* @throws java.io.IOException
+ * if an IO error occurred
*/
void connect() throws IOException;
* the source of randomness for this generator or null. See
* {@link javax.net.ssl.SSLContext#init(KeyManager[], TrustManager[], SecureRandom)}
* @throws java.security.NoSuchAlgorithmException
+ * if algorithm isn't available
* @throws java.security.KeyManagementException
+ * if key management failed
*/
void configure(KeyManager[] km, TrustManager[] tm,
SecureRandom random) throws NoSuchAlgorithmException,
* @param hostnameverifier
* a {@link javax.net.ssl.HostnameVerifier} object.
* @throws java.security.NoSuchAlgorithmException
+ * if algorithm isn't available
* @throws java.security.KeyManagementException
+ * if key management failed
*/
void setHostnameVerifier(HostnameVerifier hostnameverifier)
throws NoSuchAlgorithmException, KeyManagementException;
* a {@link java.net.URL} object.
* @return a {@link org.eclipse.jgit.transport.http.HttpConnection}
* @throws java.io.IOException
+ * if an IO error occurred
*/
HttpConnection create(URL url) throws IOException;
* the proxy to be used
* @return a {@link org.eclipse.jgit.transport.http.HttpConnection}
* @throws java.io.IOException
+ * if an IO error occurred
*/
HttpConnection create(URL url, Proxy proxy)
throws IOException;
* {@link HttpConnectionFactory} instance
* @param sslVerify
* whether SSL is to be verified
- * @return the configured {@connection}
+ * @return the configured {@code connection}
* @throws IOException
* if the connection cannot be configured
* @throws GeneralSecurityException
* @param url
* a {@link java.net.URL} object.
* @throws java.net.MalformedURLException
+ * if URL is malformed
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected JDKHttpConnection(URL url)
throws MalformedURLException,
* @param proxy
* a {@link java.net.Proxy} object.
* @throws java.net.MalformedURLException
+ * if URL is malformed
* @throws java.io.IOException
+ * if an IO error occurred
*/
protected JDKHttpConnection(URL url, Proxy proxy)
throws MalformedURLException, IOException {
.openConnection(proxy);
}
- /** {@inheritDoc} */
@Override
public int getResponseCode() throws IOException {
return wrappedUrlConnection.getResponseCode();
}
- /** {@inheritDoc} */
@Override
public URL getURL() {
return wrappedUrlConnection.getURL();
}
- /** {@inheritDoc} */
@Override
public String getResponseMessage() throws IOException {
return wrappedUrlConnection.getResponseMessage();
}
- /** {@inheritDoc} */
@Override
public Map<String, List<String>> getHeaderFields() {
return wrappedUrlConnection.getHeaderFields();
}
- /** {@inheritDoc} */
@Override
public void setRequestProperty(String key, String value) {
wrappedUrlConnection.setRequestProperty(key, value);
}
- /** {@inheritDoc} */
@Override
public void setRequestMethod(String method) throws ProtocolException {
wrappedUrlConnection.setRequestMethod(method);
}
- /** {@inheritDoc} */
@Override
public void setUseCaches(boolean usecaches) {
wrappedUrlConnection.setUseCaches(usecaches);
}
- /** {@inheritDoc} */
@Override
public void setConnectTimeout(int timeout) {
wrappedUrlConnection.setConnectTimeout(timeout);
}
- /** {@inheritDoc} */
@Override
public void setReadTimeout(int timeout) {
wrappedUrlConnection.setReadTimeout(timeout);
}
- /** {@inheritDoc} */
@Override
public String getContentType() {
return wrappedUrlConnection.getContentType();
}
- /** {@inheritDoc} */
@Override
public InputStream getInputStream() throws IOException {
return wrappedUrlConnection.getInputStream();
}
- /** {@inheritDoc} */
@Override
public String getHeaderField(@NonNull String name) {
return wrappedUrlConnection.getHeaderField(name);
return fields;
}
- /** {@inheritDoc} */
@Override
public int getContentLength() {
return wrappedUrlConnection.getContentLength();
}
- /** {@inheritDoc} */
@Override
public void setInstanceFollowRedirects(boolean followRedirects) {
wrappedUrlConnection.setInstanceFollowRedirects(followRedirects);
}
- /** {@inheritDoc} */
@Override
public void setDoOutput(boolean dooutput) {
wrappedUrlConnection.setDoOutput(dooutput);
}
- /** {@inheritDoc} */
@Override
public void setFixedLengthStreamingMode(int contentLength) {
wrappedUrlConnection.setFixedLengthStreamingMode(contentLength);
}
- /** {@inheritDoc} */
@Override
public OutputStream getOutputStream() throws IOException {
return wrappedUrlConnection.getOutputStream();
}
- /** {@inheritDoc} */
@Override
public void setChunkedStreamingMode(int chunklen) {
wrappedUrlConnection.setChunkedStreamingMode(chunklen);
}
- /** {@inheritDoc} */
@Override
public String getRequestMethod() {
return wrappedUrlConnection.getRequestMethod();
}
- /** {@inheritDoc} */
@Override
public boolean usingProxy() {
return wrappedUrlConnection.usingProxy();
}
- /** {@inheritDoc} */
@Override
public void connect() throws IOException {
wrappedUrlConnection.connect();
}
- /** {@inheritDoc} */
@Override
public void setHostnameVerifier(HostnameVerifier hostnameverifier) {
((HttpsURLConnection) wrappedUrlConnection)
.setHostnameVerifier(hostnameverifier);
}
- /** {@inheritDoc} */
@Override
public void configure(KeyManager[] km, TrustManager[] tm,
SecureRandom random) throws NoSuchAlgorithmException,
setExportAll(exportAll);
}
- /** {@inheritDoc} */
@Override
public Repository open(C req, String name)
throws RepositoryNotFoundException, ServiceNotEnabledException {
System.arraycopy(path, pathOffset, buffer, offset, pathLen - pathOffset);
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
reset(reader.open(id, OBJ_TREE).getCachedBytes());
}
- /** {@inheritDoc} */
@Override
public CanonicalTreeParser createSubtreeIterator(final ObjectReader reader,
final MutableObjectId idBuffer)
return p;
}
- /** {@inheritDoc} */
@Override
public CanonicalTreeParser createSubtreeIterator(ObjectReader reader)
throws IncorrectObjectTypeException, IOException {
return createSubtreeIterator(reader, new MutableObjectId());
}
- /** {@inheritDoc} */
@Override
public boolean hasId() {
return true;
}
- /** {@inheritDoc} */
@Override
public byte[] idBuffer() {
return raw;
}
- /** {@inheritDoc} */
@Override
public int idOffset() {
return nextPtr - OBJECT_ID_LENGTH;
}
- /** {@inheritDoc} */
@Override
public void reset() {
if (!first())
reset(raw);
}
- /** {@inheritDoc} */
@Override
public boolean first() {
return currPtr == 0;
}
- /** {@inheritDoc} */
@Override
public boolean eof() {
return currPtr == raw.length;
}
- /** {@inheritDoc} */
@Override
public void next(int delta) {
if (delta == 1) {
parseEntry();
}
- /** {@inheritDoc} */
@Override
public void back(int delta) {
if (delta == 1 && 0 <= prevPtr) {
* @return {@link org.eclipse.jgit.attributes.AttributesNode} for the
* current entry.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
public AttributesNode getEntryAttributesNode(ObjectReader reader)
pathLen = childPathOffset - 1;
}
- /** {@inheritDoc} */
@Override
public AbstractTreeIterator createSubtreeIterator(ObjectReader reader)
throws IncorrectObjectTypeException, IOException {
return new EmptyTreeIterator(this);
}
- /** {@inheritDoc} */
@Override
public boolean hasId() {
return false;
}
- /** {@inheritDoc} */
@Override
public ObjectId getEntryObjectId() {
return ObjectId.zeroId();
}
- /** {@inheritDoc} */
@Override
public byte[] idBuffer() {
return zeroid;
}
- /** {@inheritDoc} */
@Override
public int idOffset() {
return 0;
}
- /** {@inheritDoc} */
@Override
public void reset() {
// Do nothing.
}
- /** {@inheritDoc} */
@Override
public boolean first() {
return true;
}
- /** {@inheritDoc} */
@Override
public boolean eof() {
return true;
}
- /** {@inheritDoc} */
@Override
public void next(int delta) throws CorruptObjectException {
// Do nothing.
}
- /** {@inheritDoc} */
@Override
public void back(int delta) throws CorruptObjectException {
// Do nothing.
}
- /** {@inheritDoc} */
@Override
public void stopWalk() {
if (parent != null)
parent.stopWalk();
}
- /** {@inheritDoc} */
@Override
protected boolean needsStopWalk() {
return parent != null && parent.needsStopWalk();
init(entries());
}
- /** {@inheritDoc} */
@Override
public AbstractTreeIterator createSubtreeIterator(ObjectReader reader)
throws IncorrectObjectTypeException, IOException {
return ((FileEntry) current()).getFile();
}
- /** {@inheritDoc} */
@Override
protected byte[] idSubmodule(Entry e) {
return idSubmodule(getDirectory(), e);
}
- /** {@inheritDoc} */
@Override
protected String readSymlinkTarget(Entry entry) throws IOException {
return fs.readSymLink(getEntryFile());
* <p>
* Retrieve the git attributes for the current entry.
*
- * <h3>Git attribute computation</h3>
+ * <h4>Git attribute computation</h4>
*
* <ul>
* <li>Get the attributes matching the current path entry from the info file
* <li>In the end, completes the list of matching attributes using the
* global attribute file define in the configuration (see
* {@link AttributesNodeProvider#getGlobalAttributesNode()})</li>
- *
* </ul>
*
*
- * <h3>Iterator constraints</h3>
+ * <h4>Iterator constraints</h4>
*
* <p>
* In order to have a correct list of attributes for the current entry, this
* iterators to manage only one list of items, with the diving handled by
* recursive trees.
*
+ * @param <T>
+ * Type of returned {@code AbstractTreeIterator}
* @param nth
* tree to obtain the current iterator of.
* @param clazz
}
/**
- * Returns an AbstractTreeIterator from {@code trees} with the smallest name, and sets its
- * {@code matches} field. This may clobber {@code matches} in other {@code tree}s. Other iterators
- * at the same name will have their {@code matches} pointing to the same {@code min()} value.
+ * Returns an AbstractTreeIterator from {@code trees} with the smallest
+ * name, and sets its {@code matches} field. This may clobber
+ * {@code matches} in other {@code tree}s. Other iterators at the same name
+ * will have their {@code matches} pointing to the same {@code min()} value.
*
* @return the smallest tree iterator available.
* @throws CorruptObjectException
+ * if an object is corrupt
*/
@SuppressWarnings("unused")
AbstractTreeIterator min() throws CorruptObjectException {
* {{@link #getSmudgeCommand(int)} instead.
* @return a filter command
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
public String getFilterCommand(String filterCommandType)
* of the tree the item to be smudged is in
* @return a filter command
* @throws java.io.IOException
+ * if an IO error occurred
* @since 6.1
*/
public String getSmudgeCommand(int index)
* to use
* @return a filter command
* @throws java.io.IOException
+ * if an IO error occurred
* @since 6.1
*/
public String getSmudgeCommand(Attributes attributes) throws IOException {
return state.walkIgnored;
}
- /** {@inheritDoc} */
@Override
public boolean hasId() {
if (contentIdFromPtr == ptr)
return (mode & FileMode.TYPE_MASK) == FileMode.TYPE_FILE;
}
- /** {@inheritDoc} */
@Override
public byte[] idBuffer() {
if (contentIdFromPtr == ptr)
return zeroid;
}
- /** {@inheritDoc} */
@Override
public boolean isWorkTree() {
return true;
return repository;
}
- /** {@inheritDoc} */
@Override
public int idOffset() {
return contentIdOffset;
}
- /** {@inheritDoc} */
@Override
public void reset() {
if (!first()) {
}
}
- /** {@inheritDoc} */
@Override
public boolean first() {
return ptr == 0;
}
- /** {@inheritDoc} */
@Override
public boolean eof() {
return ptr == entryCnt;
}
- /** {@inheritDoc} */
@Override
public void next(int delta) throws CorruptObjectException {
ptr += delta;
}
}
- /** {@inheritDoc} */
@Override
public void back(int delta) throws CorruptObjectException {
ptr -= delta;
*
* @return size of the content, in bytes
* @throws java.io.IOException
+ * if an IO error occurred
*/
public long getEntryContentLength() throws IOException {
if (canonLen == -1) {
* @return the {@link org.eclipse.jgit.attributes.AttributesNode} for the
* current entry.
* @throws IOException
+ * if an IO error occurred
*/
public AttributesNode getEntryAttributesNode() throws IOException {
if (attributesNode instanceof PerDirectoryAttributesNode)
* access to repository objects if necessary. Should not be null.
* @return true if content is most likely different.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.3
*/
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck,
* @return <code>true</code> if the content doesn't match,
* <code>false</code> if it matches
* @throws IOException
+ * if an IO error occurred
*/
private boolean contentCheck(DirCacheEntry entry, ObjectReader reader)
throws IOException {
* @return the clean filter command for the current entry or
* <code>null</code> if no such command is defined
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
public String getCleanFilterCommand() throws IOException {
* {@link org.eclipse.jgit.treewalk.TreeWalk} is not based on a
* {@link org.eclipse.jgit.lib.Repository} then null is returned.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.3
*/
public EolStreamType getEolStreamType() throws IOException {
* {@link TreeWalk} is not based on a {@link Repository} then null
* is returned.
* @throws IOException
+ * if an IO error occurred
*/
private EolStreamType getEolStreamType(OperationType opType)
throws IOException {
* Create an empty set.
*
* @param capacity
+ * initial capacity of the set
*/
ByteArraySet(int capacity) {
initTable(1 << Integer.highestOneBit((capacity * 2) - 1));
table = new byte[sz][];
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
this.honorIgnores = honorIgnores;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk tw) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
return tw.getTree(workingTree, WorkingTreeIterator.class);
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
// We cannot compare subtrees in the working tree, so encourage
return true;
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return this;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "INDEX_DIFF_FILTER"; //$NON-NLS-1$
*/
public static final TreeFilter INSTANCE = new InterIndexDiffFilter();
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walker) {
final int n = walker.getTreeCount();
return false;
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return false;
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return this;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "INTERINDEX_DIFF"; //$NON-NLS-1$
this.index = workdirTreeIndex;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk tw) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
return i == null || !i.isEntryIgnored();
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return false;
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
// immutable
return this;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
a = one;
}
- /** {@inheritDoc} */
@Override
public TreeFilter negate() {
return a;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walker)
throws MissingObjectException, IncorrectObjectTypeException,
return matchFilter(walker) == 0;
}
- /** {@inheritDoc} */
@Override
public int matchFilter(TreeWalk walker)
throws MissingObjectException, IncorrectObjectTypeException,
return -1;
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return a.shouldBeRecursive();
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
final TreeFilter n = a.clone();
return n == a ? this : new NotTreeFilter(n);
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "NOT " + a.toString(); //$NON-NLS-1$
return pathStr;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walker) {
return matchFilter(walker) <= 0;
}
- /** {@inheritDoc} */
@Override
public int matchFilter(TreeWalk walker) {
return walker.isPathMatch(pathRaw, pathRaw.length);
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
for (byte b : pathRaw)
return false;
}
- /** {@inheritDoc} */
@Override
public PathFilter clone() {
return this;
}
- /** {@inheritDoc} */
@Override
@SuppressWarnings("nls")
public String toString() {
pathRaw = Constants.encode(pathStr);
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return this;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walker) throws MissingObjectException,
IncorrectObjectTypeException, IOException {
return super.matchFilter(walker);
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return true;
this.treeIdx = treeIdx;
}
- /** {@inheritDoc} */
@Override
public boolean include(TreeWalk walker) {
DirCacheIterator i = walker.getTree(treeIdx, DirCacheIterator.class);
return e == null || !e.isSkipWorkTree();
}
- /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return false;
}
- /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return this;
}
- /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
@Override
public abstract TreeFilter clone();
- /** {@inheritDoc} */
@Override
public String toString() {
String n = getClass().getName();
tailBlock = directory[0];
}
- /** {@inheritDoc} */
@Override
public int size() {
return size;
}
- /** {@inheritDoc} */
@Override
public void clear() {
for (T[] block : directory) {
tailBlock = directory[0];
}
- /** {@inheritDoc} */
@Override
public T get(int index) {
if (index < 0 || size <= index)
return directory[toDirectoryIndex(index)][toBlockIndex(index)];
}
- /** {@inheritDoc} */
@Override
public T set(int index, T element) {
if (index < 0 || size <= index)
}
}
- /** {@inheritDoc} */
@Override
public boolean add(T element) {
int i = tailBlkIdx;
return true;
}
- /** {@inheritDoc} */
@Override
public void add(int index, T element) {
if (index == size) {
}
}
- /** {@inheritDoc} */
@Override
public T remove(int index) {
if (index == size - 1) {
tailBlock = directory[tailDirIdx];
}
- /** {@inheritDoc} */
@Override
public Iterator<T> iterator() {
return new MyIterator();
cached.add(ca);
}
- /** {@inheritDoc} */
@Override
protected final PasswordAuthentication getPasswordAuthentication() {
final String host = getRequestingHost();
/**
* Equality utilities.
*
- * @since: 6.2
+ * @since 6.2
*/
public class Equality {
/**
- * Compare by reference
- *
- * @param a
- * First object to compare
- * @param b
- * Second object to compare
- * @return {@code true} if the objects are identical, {@code false}
- * otherwise
- *
- * @since 6.2
- */
+ * Compare by reference
+ *
+ * @param <T>
+ * type of the objects to compare
+ * @param a
+ * First object to compare
+ * @param b
+ * Second object to compare
+ * @return {@code true} if the objects are identical, {@code false}
+ * otherwise
+ *
+ * @since 6.2
+ */
@SuppressWarnings("ReferenceEquality")
public static <T> boolean isSameInstance(T a, T b) {
return a == b;
* Detect the file system
*
* @param cygwinUsed
+ * whether cygwin is used
* @return FS instance
*/
public FS detect(Boolean cygwinUsed) {
/**
* @param stdout
+ * stdout stream
* @param stderr
+ * stderr stream
* @param rc
+ * return code
*/
public ExecutionResult(TemporaryBuffer stdout, TemporaryBuffer stderr,
int rc) {
* timestamp resolution
*
* @param fsTimestampResolution
+ * resolution of filesystem timestamps
*/
public FileStoreAttributes(
@NonNull Duration fsTimestampResolution) {
* a {@link java.io.File} object.
* @return last modified time of f
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
* @deprecated use {@link #lastModifiedInstant(Path)} instead
*/
* @param time
* last modified time
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
* @deprecated use {@link #setLastModified(Path, Instant)} instead
*/
* @param time
* last modified time
* @throws java.io.IOException
+ * if an IO error occurred
* @since 5.1.9
*/
public void setLastModified(Path p, Instant time) throws IOException {
* a {@link java.io.File} object.
* @return length of a file
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public long length(File path) throws IOException {
* @param f
* a {@link java.io.File} object.
* @throws java.io.IOException
- * this may be a Java7 subclass with detailed information
+ * if an IO error occurred
* @since 3.3
*/
public void delete(File f) throws IOException {
* Return all the attributes of a file, without following symbolic links.
*
* @param file
+ * the file
* @return {@link BasicFileAttributes} of the file
- * @throws IOException in case of any I/O errors accessing the file
+ * @throws IOException
+ * in case of any I/O errors accessing the file
*
* @since 4.5.6
*/
* a {@link java.io.File} object.
* @return target of link or null
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public String readSymLink(File path) throws IOException {
* a {@link java.io.File} object.
* @return true if the path is a symbolic link (and we support these)
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public boolean isSymLink(File path) throws IOException {
* @return true if path is hidden, either starts with . on unix or has the
* hidden attribute in windows
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public boolean isHidden(File path) throws IOException {
* @param hidden
* whether to set the file hidden
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public void setHidden(File path, boolean hidden) throws IOException {
* @param target
* target path of the symlink
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public void createSymLink(File path, String target) throws IOException {
* @return <code>true</code> if the file was created, <code>false</code> if
* the file already existed
* @throws java.io.IOException
+ * if an IO error occurred
* @deprecated use {@link #createNewFileAtomic(File)} instead
* @since 4.5
*/
* @return LockToken this token must be closed after the created file was
* deleted
* @throws IOException
+ * if an IO error occurred
* @since 4.7
*/
public LockToken createNewFileAtomic(File path) throws IOException {
* The standard input stream passed to the process
* @return The result of the executed command
* @throws java.lang.InterruptedException
+ * if thread was interrupted
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
public ExecutionResult execute(ProcessBuilder pb, InputStream in)
* Constructor when there are issues with reading. All attributes except
* given will be set to the default values.
*
- * @param fs
* @param path
+ * file path
+ * @param fs
+ * FS to use
*/
public Attributes(File path, FS fs) {
this(fs, path, false, false, false, false, false, 0L, EPOCH, 0L);
* @return LockToken this lock token must be held until the file is no
* longer needed
* @throws IOException
+ * if an IO error occurred
* @since 5.0
*/
@Override
super(src);
}
- /** {@inheritDoc} */
@Override
public FS newInstance() {
return new FS_Win32(this);
}
- /** {@inheritDoc} */
@Override
public boolean supportsExecute() {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean canExecute(File f) {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean setExecute(File f, boolean canExec) {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean isCaseSensitive() {
return false;
}
- /** {@inheritDoc} */
@Override
public boolean retryFailedLockFileCommit() {
return true;
}
- /** {@inheritDoc} */
@Override
public Entry[] list(File directory, FileModeStrategy fileModeStrategy) {
if (!Files.isDirectory(directory.toPath(), LinkOption.NOFOLLOW_LINKS)) {
return result.toArray(new Entry[0]);
}
- /** {@inheritDoc} */
@Override
protected File discoverGitExe() {
String path = SystemReader.getInstance().getenv("PATH"); //$NON-NLS-1$
return gitExe;
}
- /** {@inheritDoc} */
@Override
protected File userHomeImpl() {
String home = SystemReader.getInstance().getenv("HOME"); //$NON-NLS-1$
return super.userHomeImpl();
}
- /** {@inheritDoc} */
@Override
public ProcessBuilder runInShell(String cmd, String[] args) {
List<String> argv = new ArrayList<>(3 + args.length);
return proc;
}
- /** {@inheritDoc} */
@Override
public Attributes getAttributes(File path) {
return FileUtils.getFileAttributesBasic(this, path);
super(src);
}
- /** {@inheritDoc} */
@Override
public FS newInstance() {
return new FS_Win32_Cygwin(this);
}
- /** {@inheritDoc} */
@Override
public File resolve(File dir, String pn) {
String useCygPath = System.getProperty("jgit.usecygpath"); //$NON-NLS-1$
return super.resolve(dir, pn);
}
- /** {@inheritDoc} */
@Override
protected File userHomeImpl() {
final String home = AccessController.doPrivileged(
return resolve(new File("."), home); //$NON-NLS-1$
}
- /** {@inheritDoc} */
@Override
public ProcessBuilder runInShell(String cmd, String[] args) {
List<String> argv = new ArrayList<>(4 + args.length);
return QuotedString.BOURNE.quote(cmd.replace(File.separatorChar, '/'));
}
- /** {@inheritDoc} */
@Override
public String relativize(String base, String other) {
final String relativized = super.relativize(base, other);
return relativized.replace(File.separatorChar, '/');
}
- /** {@inheritDoc} */
@Override
public ProcessResult runHookIfPresent(Repository repository, String hookName,
String[] args, OutputStream outRedirect, OutputStream errRedirect,
* @throws java.nio.file.AtomicMoveNotSupportedException
* if file cannot be moved as an atomic file system operation
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.1
*/
public static void rename(final File src, final File dst,
* the target of the symbolic link
* @return the path to the symbolic link
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.2
*/
public static Path createSymLink(File path, String target)
* a {@link java.io.File} object.
* @return target path of the symlink, or null if it is not a symbolic link
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.0
*/
public static String readSymLink(File path) throws IOException {
* The parent dir, can be null to use system default temp dir.
* @return the temp dir created.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 3.4
*/
public static File createTempDir(String prefix, String suffix, File dir)
}
/**
+ * Check if file is a symlink
+ *
* @param file
+ * the file to be checked if it is a symbolic link
* @return {@code true} if the passed file is a symbolic link
*/
static boolean isSymlink(File file) {
}
/**
+ * Get the lastModified attribute for a given file
+ *
* @param file
+ * the file
* @return lastModified attribute for given file, not following symbolic
* links
* @throws IOException
+ * if an IO error occurred
* @deprecated use {@link #lastModifiedInstant(Path)} instead which returns
* FileTime
*/
}
/**
+ * Get last modified timestamp of a file
+ *
* @param path
+ * file path
* @return lastModified attribute for given file, not following symbolic
* links
*/
* Return all the attributes of a file, without following symbolic links.
*
* @param file
+ * the file
* @return {@link BasicFileAttributes} of the file
- * @throws IOException in case of any I/O errors accessing the file
+ * @throws IOException
+ * in case of any I/O errors accessing the file
*
* @since 4.5.6
*/
* Set the last modified time of a file system object.
*
* @param file
+ * the file
* @param time
+ * last modified timestamp
* @throws IOException
+ * if an IO error occurred
*/
@Deprecated
static void setLastModified(File file, long time) throws IOException {
* Set the last modified time of a file system object.
*
* @param path
+ * file path
* @param time
+ * last modified timestamp of the file
* @throws IOException
+ * if an IO error occurred
*/
static void setLastModified(Path path, Instant time)
throws IOException {
/**
* @param file
+ * the file
* @return {@code true} if the given file exists, not following symbolic
* links
*/
}
/**
+ * Check if file is hidden (on Windows)
+ *
* @param file
+ * the file
* @return {@code true} if the given file is hidden
* @throws IOException
+ * if an IO error occurred
*/
static boolean isHidden(File file) throws IOException {
return Files.isHidden(toPath(file));
* @param hidden
* a boolean.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.1
*/
public static void setHidden(File file, boolean hidden) throws IOException {
* a {@link java.io.File}.
* @return length of the given file
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.1
*/
public static long getLength(File file) throws IOException {
}
/**
+ * Check if file is directory
+ *
* @param file
+ * the file
* @return {@code true} if the given file is a directory, not following
* symbolic links
*/
}
/**
+ * Check if File is a file
+ *
* @param file
+ * the file
* @return {@code true} if the given file is a file, not following symbolic
* links
*/
/**
* @param fs
+ * a {@link org.eclipse.jgit.util.FS} object.
* @param file
+ * the file
* @return non null attributes object
*/
static Attributes getFileAttributesBasic(FS fs, File file) {
* @param f
* the file to touch
* @throws IOException
+ * if an IO error occurred
* @since 5.1.8
*/
public static void touch(Path f) throws IOException {
* a {@link org.eclipse.jgit.transport.http.HttpConnection}
* object.
* @throws java.io.IOException
+ * if an IO error occurred
* @since 4.3
*/
public static void disableSslVerify(HttpConnection conn)
* that have all available protocols enabled already, up to the one
* specified.
* <p>
+ * <br>
* <table>
+ * <caption>TLS versions</caption>
* <tr>
* <td>SSLContext.getInstance()</td>
* <td>OpenJDK</td>
* </tr>
* <tr>
* <td>"TLS"</td>
- * <td>Supported: TLSv1, TLSV1.1, TLSv1.2 (+ TLSv1.3)<br />
+ * <td>Supported: TLSv1, TLSV1.1, TLSv1.2 (+ TLSv1.3)<br>
* Enabled: TLSv1, TLSV1.1, TLSv1.2 (+ TLSv1.3)</td>
- * <td>Supported: TLSv1, TLSV1.1, TLSv1.2<br />
+ * <td>Supported: TLSv1, TLSV1.1, TLSv1.2<br>
* Enabled: TLSv1</td>
* </tr>
* <tr>
* <td>"TLSv1.2"</td>
- * <td>Supported: TLSv1, TLSV1.1, TLSv1.2<br />
+ * <td>Supported: TLSv1, TLSV1.1, TLSv1.2<br>
* Enabled: TLSv1, TLSV1.1, TLSv1.2</td>
- * <td>Supported: TLSv1, TLSV1.1, TLSv1.2<br />
+ * <td>Supported: TLSv1, TLSV1.1, TLSv1.2<br>
* Enabled: TLSv1.2</td>
* </tr>
* </table>
entries = n;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder r = new StringBuilder();
* the first int to compare
* @param second
* the second int to compare
- * @return a negative number if first < second, 0 if first == second, or
- * a positive number if first > second
+ * @return a negative number if first < second, 0 if first == second, or
+ * a positive number if first > second
*/
int compare(int first, int second);
}
* @return a loader for the actual data of a blob, or the original loader in
* case LFS is not applicable.
* @throws IOException
+ * if an IO error occurred
*/
public ObjectLoader applySmudgeFilter(Repository db,
ObjectLoader loader, Attribute attribute) throws IOException {
* @param repo
* the {@link Repository} the hook is applied to.
* @param outputStream
+ * output stream
* @return a {@link PrePushHook} implementation or <code>null</code>
*/
@Nullable
* @param repo
* the {@link Repository} the hook is applied to.
* @param outputStream
+ * output stream
* @param errorStream
+ * error stream
* @return a {@link PrePushHook} implementation or <code>null</code>
* @since 5.6
*/
entries = n;
}
- /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder r = new StringBuilder();
endPtr = end;
}
- /** {@inheritDoc} */
@Override
public char charAt(int index) {
return (char) (buffer[startPtr + index] & 0xff);
}
- /** {@inheritDoc} */
@Override
public int length() {
return endPtr - startPtr;
}
- /** {@inheritDoc} */
@Override
public CharSequence subSequence(int start, int end) {
return new RawCharSequence(buffer, startPtr + start, startPtr + end);
}
- /** {@inheritDoc} */
@Override
public String toString() {
final int n = length();
return needleString;
}
- /** {@inheritDoc} */
@Override
public String toString() {
return pattern();
/**
* Create an empty unmodifiable reference list.
*
+ * @param <T>
+ * type of reference being stored.
* @return an empty unmodifiable reference list.
*/
@SuppressWarnings("unchecked")
this.cnt = src.cnt;
}
- /** {@inheritDoc} */
@Override
public Iterator<Ref> iterator() {
return new Iterator<>() {
return add(idx, ref);
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder r = new StringBuilder();
/**
* Create a {@link Collector} for {@link Ref}.
*
+ * @param <T>
+ * type of reference being stored.
* @param mergeFunction
* if specified the result will be sorted and deduped.
* @return {@link Collector} for {@link Ref}
* after additions are complete using {@link #sort()}.
*
* @param ref
+ * reference to add
*/
public void add(T ref) {
if (list.length == size) {
* Add all items from another builder.
*
* @param other
+ * another builder
* @since 5.4
*/
public void addAll(Builder other) {
* Dedupe the refs in place. Must be called after {@link #sort}.
*
* @param mergeFunction
+ * function used for de-duplication
*/
@SuppressWarnings("unchecked")
void dedupe(BinaryOperator<T> mergeFunction) {
this.resolved = (RefList<Ref>) resolved;
}
- /** {@inheritDoc} */
@Override
public boolean containsKey(Object name) {
return get(name) != null;
}
- /** {@inheritDoc} */
@Override
public Ref get(Object key) {
String name = toRefName((String) key);
return ref;
}
- /** {@inheritDoc} */
@Override
public Ref put(String keyName, Ref value) {
String name = toRefName(keyName);
return prior;
}
- /** {@inheritDoc} */
@Override
public Ref remove(Object key) {
String name = toRefName((String) key);
return res;
}
- /** {@inheritDoc} */
@Override
public boolean isEmpty() {
return entrySet().isEmpty();
}
- /** {@inheritDoc} */
@Override
public Set<Entry<String, Ref>> entrySet() {
if (entrySet == null) {
return entrySet;
}
- /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder r = new StringBuilder();
* Create a {@link Collector} for {@link Ref}.
*
* @param mergeFunction
+ * merge function
* @return {@link Collector} for {@link Ref}
* @since 5.4
*/
* cases.
* @return The entire output read from stdout.
* @throws IOException
+ * if an IO error occurred
* @throws CommandFailedException
* if the ssh command execution failed, error message contains
* the content of stderr.
*
* @param stringValue
* the string to parse.
- * @return the boolean interpretation of {@code value}.
+ * @return the boolean interpretation of {@code stringValue}.
* @throws java.lang.IllegalArgumentException
- * if {@code value} is not recognized as one of the standard
+ * if {@code stringValue} is not recognized as one of the standard
* boolean names.
*/
public static boolean toBoolean(String stringValue) {
* allow negative numbers, too
* @return the value parsed
* @throws NumberFormatException
- * if the {@value} is not parseable, or beyond the range of
+ * if the {@code value} is not parseable, or beyond the range of
* {@link Long}
* @throws StringIndexOutOfBoundsException
* if the string is empty or contains only whitespace, or
* allow negative numbers, too
* @return the value parsed
* @throws NumberFormatException
- * if the {@value} is not parseable or beyond the range of
+ * if the {@code value} is not parseable or beyond the range of
* {@link Integer}
* @throws StringIndexOutOfBoundsException
* if the string is empty or contains only whitespace, or
this.detectBinary = detectBinary;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
final int read = read(single, 0, 1);
return read == 1 ? single[0] & 0xff : -1;
}
- /** {@inheritDoc} */
@Override
public int read(byte[] bs, int off, int len) throws IOException {
if (len == 0)
return n;
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
in.close();
this.detectBinary = detectBinary;
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
onebytebuf[0] = (byte) b;
write(onebytebuf, 0, 1);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b) throws IOException {
int overflow = buffer(b, 0, b.length);
write(b, b.length - overflow, overflow);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b, int startOff, int startLen)
throws IOException {
write(binbuf, 0, cachedLen);
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
if (binbufcnt <= binbuf.length) {
out.flush();
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
flush();
this.forCheckout = false;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
final int read = read(single, 0, 1);
return read == 1 ? single[0] & 0xff : -1;
}
- /** {@inheritDoc} */
@Override
public int read(byte[] bs, int off, int len)
throws IOException {
return isBinary;
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
in.close();
this.detectBinary = detectBinary;
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
onebytebuf[0] = (byte) b;
write(onebytebuf, 0, 1);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b) throws IOException {
int overflow = buffer(b, 0, b.length);
}
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b, int startOff, int startLen)
throws IOException {
write(binbuf, 0, cachedLen);
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
if (binbufcnt <= binbuf.length) {
out.flush();
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
flush();
return cnt;
}
- /** {@inheritDoc} */
@Override
public void write(int val) throws IOException {
out.write(val);
cnt++;
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf, int off, int len) throws IOException {
out.write(buf, off, len);
cnt += len;
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
out.flush();
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
out.close();
// more than one instance from being created.
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
// We shouldn't be writing output at this stage, there
new ArrayBlockingQueue<>(1), new NamedThreadFactory());
}
- /** {@inheritDoc} */
@Override
public void write(int ch) throws IOException {
write(new byte[] { (byte) ch }, 0, 1);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf, int pos, int cnt)
throws IOException {
});
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
checkClosed();
});
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
if (!copier.isShutdown()) {
this.limit = limit;
}
- /** {@inheritDoc} */
@Override
public int available() throws IOException {
return (int) Math.min(in.available(), left);
}
// it's okay to mark even if mark isn't supported, as reset won't work
- /** {@inheritDoc} */
@Override
public synchronized void mark(int readLimit) {
in.mark(readLimit);
mark = left;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
if (left == 0) {
return result;
}
- /** {@inheritDoc} */
@Override
public int read(byte[] b, int off, int len) throws IOException {
if (left == 0) {
return result;
}
- /** {@inheritDoc} */
@Override
public synchronized void reset() throws IOException {
if (!in.markSupported())
left = mark;
}
- /** {@inheritDoc} */
@Override
public long skip(long n) throws IOException {
n = Math.min(n, left);
enc = new OutputStreamWriter(getRawStream(), UTF_8);
}
- /** {@inheritDoc} */
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
synchronized (buf) {
return buf;
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
// Do nothing, we are buffered with no resources.
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
// Do nothing, we are buffered with no resources.
}
/** @return string version of all buffered data. */
- /** {@inheritDoc} */
@Override
public String toString() {
return RawParseUtils.decode(buf.toByteArray());
}
}
- /** {@inheritDoc} */
@Override
public void run() {
try {
this.dst = dst;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
byte[] b = skipBuffer();
return n == 1 ? b[0] & 0xff : -1;
}
- /** {@inheritDoc} */
@Override
public long skip(long count) throws IOException {
long skipped = 0;
return skipped;
}
- /** {@inheritDoc} */
@Override
public int read(byte[] b, int off, int len) throws IOException {
if (len == 0)
return n;
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
byte[] b = skipBuffer();
this.stream2 = stream2;
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf) throws IOException {
this.stream1.write(buf);
this.stream2.write(buf);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf, int off, int len) throws IOException {
this.stream1.write(buf, off, len);
this.stream2.write(buf, off, len);
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
this.stream1.write(b);
this.stream2.write(b);
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
this.stream1.flush();
this.stream2.flush();
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
try {
);
}
- /** {@inheritDoc} */
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
out.write(cbuf, off, len);
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
out.flush();
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
out.close();
/**
* Print a string and terminate with a line feed.
*
- * @param s a {@link java.lang.String} object.
+ * @param s
+ * a {@link java.lang.String} object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void println(String s) throws IOException {
print(s + LF);
* Print a platform dependent new line
*
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void println() throws IOException {
print(LF);
/**
* Print a char
*
- * @param value a char.
+ * @param value
+ * a char.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void print(char value) throws IOException {
print(String.valueOf(value));
* @param value
* an int.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void print(int value) throws IOException {
print(String.valueOf(value));
/**
* Print a long as string
*
- * @param value a long.
+ * @param value
+ * a long.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void print(long value) throws IOException {
print(String.valueOf(value));
/**
* Print a short as string
*
- * @param value a short.
+ * @param value
+ * a short.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void print(short value) throws IOException {
print(String.valueOf(value));
* @param args
* objects.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void format(String fmt, Object... args) throws IOException {
print(String.format(fmt, args));
* @param any
* an object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public void print(Object any) throws IOException {
out.write(String.valueOf(any));
timeout = millis;
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
public int read(byte[] buf) throws IOException {
return read(buf, 0, buf.length);
}
- /** {@inheritDoc} */
@Override
public int read(byte[] buf, int off, int cnt) throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
public long skip(long cnt) throws IOException {
try {
timeout = millis;
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf) throws IOException {
write(buf, 0, buf.length);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] buf, int off, int len) throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
public void flush() throws IOException {
try {
}
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
try {
return streams.isEmpty();
}
- /** {@inheritDoc} */
@Override
public int read() throws IOException {
for (;;) {
}
}
- /** {@inheritDoc} */
@Override
public int read(byte[] b, int off, int len) throws IOException {
if (len == 0)
}
}
- /** {@inheritDoc} */
@Override
public int available() throws IOException {
return head().available();
}
- /** {@inheritDoc} */
@Override
public long skip(long count) throws IOException {
long skipped = 0;
return skipped;
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
IOException err = null;
* <p>
* Implementations not supporting collision detection always return
* {@code false}.
- * <p>
*
* @return {@code true} if a likely collision was detected.
*/
}
}
- /** {@inheritDoc} */
@Override
public ProposedTimestamp propose() {
final long u = nowMicros();
// Do nothing by default.
}
- /** {@inheritDoc} */
@Override
public String toString() {
return instant().toString();
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
- <additionalJOption>-Xdoclint:-missing</additionalJOption>
+ <!-- We check javadoc when compiling with ecj (option -Pecj) and configurations
+ set in .settings/org.eclipse.jdt.core.prefs. This allows more fine grained
+ configuration and fails the build on missing javadoc for protected and
+ public but not for private classes, methods and fields. We don't want
+ to check javadoc on tests. We can reconsider to configure this on javadoc
+ when it starts supporting access specifiers so that we can set
+ -Xdoclint:all,-missing/private -->
+ <additionalJOption>-Xdoclint:none</additionalJOption>-->
<encoding>${project.build.sourceEncoding}</encoding>
<quiet>true</quiet>
+ <failOnWarnings>true</failOnWarnings>
<excludePackageNames>org.eclipse.jgit.http.test</excludePackageNames>
<links>
<link>https://docs.oracle.com/en/java/javase/11/docs/api</link>
</links>
+ <tags>
+ <tag>
+ <name>apiNote</name>
+ <placement>a</placement>
+ <head>API Note:</head>
+ </tag>
+ <tag>
+ <name>implSpec</name>
+ <placement>a</placement>
+ <head>Implementation Requirements:</head>
+ </tag>
+ <tag>
+ <name>implNote</name>
+ <placement>a</placement>
+ <head>Implementation Note:</head>
+ </tag>
+ </tags>
</configuration>
<executions>
<execution>
</reportSet>
</reportSets>
<configuration>
- <additionalJOption>-Xdoclint:-missing</additionalJOption>
+ <failOnWarnings>true</failOnWarnings>
</configuration>
</plugin>
<plugin>