Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for git client plugin 2.0.0 coexistence #296

Merged
merged 1 commit into from Aug 17, 2016

Conversation

Projects
None yet
2 participants
@MarkEWaite
Copy link
Contributor

commented Aug 14, 2016

The git client plugin 2.0.0 release will switch from delivering JGit 3
to JGit 4. JGit 4 requires Java 7 and provides Closeable implementations
of its methods that open external resources (like files). JGit 4 removes
certain methods (like release()) because they are superseded by the JGit
4 Closeable implementation.

The gerrit trigger plugin depends on the git client plugin implementation
of JGit. It correctly assumes the JGit provided by the git client plugin
is JGit 3. If no changes are made to the plugins which depend on the
JGit provided by the git client plugin, those plugins will be broken by
the upgrade from JGit 3 to JGit 4. They will report NoSuchMethodError
exceptions at run time or may report LinkageError exceptions during
class loading on some JVM implementations.

This change adapts the plugin to run with either git client plugin 1.x
(JGit 3) to git client plugin 2.x (JGit 4).

This is a temporary change until the plugin depends on git client
plugin 2.0. Once it depends on git client plugin 2.0 (and JDK 7),
this change can be reverted.

Uses reflection to find the close method of RevWalk if needed.
When RevWalk and TreeWalk from JGit 3 are loaded, their release()
methods are called. When RevWalk and TreeWalk from JGit 4 are loaded,
their close() methods are called.

Prepare for git client plugin 2.0.0 coexistence
The git client plugin 2.0.0 release will switch from delivering JGit 3
to JGit 4.  JGit 4 requires Java 7 and provides Closeable implementations
of its methods that open external resources (like files).  JGit 4 removes
certain methods (like release()) because they are superseded by the JGit
4 Closeable implementation.

The gerrit trigger plugin depends on the git client plugin implementation
of JGit.  It correctly assumes the JGit provided by the git client plugin
is JGit 3.  If no changes are made to the plugins which depend on the
JGit provided by the git client plugin, those plugins will be broken by
the upgrade from JGit 3 to JGit 4.  They will report NoSuchMethodError
exceptions at run time or may report LinkageError exceptions during
class loading on some JVM implementations.

This change adapts the plugin to run with either git client plugin 1.x
(JGit 3) to git client plugin 2.x (JGit 4).

This is a temporary change until the plugin depends on git client
plugin 2.0.  Once it depends on git client plugin 2.0 (and JDK 7),
this change can be reverted.

Uses reflection to find the close method of RevWalk if needed.
When RevWalk and TreeWalk from JGit 3 are loaded, their release()
methods are called.  When RevWalk and TreeWalk from JGit 4 are loaded,
their close() methods are called.

@rsandell rsandell merged commit e64f30e into jenkinsci:master Aug 17, 2016

1 check passed

Jenkins This pull request looks good
Details

@MarkEWaite MarkEWaite deleted the MarkEWaite:git-client-2.0.0-safeguard branch Dec 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.