Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] JGit 7.1.0 null pointer exception

I've run a test with JGit 7.1.0 in the Jenkins git client plugin and have found a null pointer exception from Diff changes that arrived in JGit 7.1.0.  I'll do more investigation to understand what is different, but wanted to share the stack trace in case others have insights to offer.

The stack trace is using the path through DiffCommand that invokes  the old (JGit 7.0.0 and before) DiffFormatter.format(EditList, RawText, RawText) rather than invoking the new (added in JGit 7.1.0) DiffFormatter.format(EditList, RawText, RawText, DiffDriver) method.

Any insights or suggestions are welcomed.  Also not a problem if there is no response.

The test failure means that I won't release a git client plugin with JGit 7.1.0 until the issue is understood and resolved.  Thanks again for JGit!

The stack trace is:

java.lang.NullPointerException: Name is null
 at java.base/java.lang.Enum.valueOf(Enum.java:291)
 at org.eclipse.jgit.diff.DiffDriver.valueOf(DiffDriver.java:1)
 at org.eclipse.jgit.diff.DiffFormatter.getDiffDriver(DiffFormatter.java:1361)
 at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:708)
 at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:694)
 at org.eclipse.jgit.api.DiffCommand.call(DiffCommand.java:131)
 at io.jenkins.plugins.forensics.git.miner.DiffsCollector.getDiffsForCommit(DiffsCollector.java:40)
 at io.jenkins.plugins.forensics.git.miner.CommitAnalyzer.run(CommitAnalyzer.java:51)
 at io.jenkins.plugins.forensics.git.miner.RepositoryStatisticsCallback.invoke(RepositoryStatisticsCallback.java:45)
 at io.jenkins.plugins.forensics.git.miner.RepositoryStatisticsCallback.invoke(RepositoryStatisticsCallback.java:22)
 at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:83)
 at io.jenkins.plugins.forensics.git.miner.GitRepositoryMiner.mine(GitRepositoryMiner.java:48)
 at io.jenkins.plugins.forensics.miner.RepositoryMinerStep.mineRepositories(RepositoryMinerStep.java:113)
 at io.jenkins.plugins.forensics.miner.RepositoryMinerStep.perform(RepositoryMinerStep.java:95)
 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:47)
 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
 at hudson.model.Build$BuildExecution.post2(Build.java:179)
 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
 at hudson.model.Run.execute(Run.java:1856)
 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
 at hudson.model.ResourceController.execute(ResourceController.java:101)
 at hudson.model.Executor.run(Executor.java:446)

Mark Waite

Back to the top