Hello,
Since we updated to bamboo 4.4.5 we are getting nullpointer errors in once of our plugins at the point where it tries to iterate over the file collection obtained from 'com.atlassian.bamboo.commit.CommitContext.getFiles()'. Both the iterator or toArray methods are yielding the following errors:
java.lang.NullPointerException at java.util.ArrayList.get(ArrayList.java:324) at java.util.AbstractList$Itr.next(AbstractList.java:345) at foo.bar.bamboo.plugins.ChangeSetCollectorTask.execute(ChangeSetCollectorTask.java:94)
What can I do to get by, this doesn't seem right? This was not happening on an earlier 4.4 version as far as I know.
The repo that is used is an SVN.
thanks!
Community moderators have prevented the ability to post new answers.
The problem is resolved in the Bamboo 5 release.
I managed to zero the breakage in, it happens only on the 4.4.5 release, I switched versions until I was able to reproduce. You can download the plugin from the Atlassian Marketplace, it's called bamboo-changesetcollector-plugin. You only need to hook-up an svn repo, add the task and check the source jar option (no extra config needed). Then do the inital build and then make a change that triggers the change set build to get the nullpointer.
I did some diff-ing on the source between 4.4.4 and 4.4.5 and found that there are some changes on CommitContext and other related classes -- not sure what could be the cause though.
thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good find about the version. I ran across this as well!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post the complete stack trace?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, here it is:
java.lang.NullPointerException at java.util.ArrayList.get(ArrayList.java:324) at java.util.AbstractList$Itr.next(AbstractList.java:345) at foo.bar.bamboo.plugins.ChangeSetCollectorTask.execute(ChangeSetCollectorTask.java:94) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:188) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:94) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) at java.lang.Thread.run(Thread.java:662)
I also had a look in debug mode (we created the plugin) and I can't even inspect the list in the debug view, it also yields the error. Something strange seems to be going on internally in that list implementation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the code which eventually gets to the method call:
List<CommitContext> changes = taskContext.getBuildContext().getBuildChanges().getChanges(repoId.intValue()); if(!changes.isEmpty()){ Iterator<CommitContext> it = changes.iterator(); List<String> deltaFiles = new ArrayList<String>(); while (it.hasNext()) { // Pull changes for this commit CommitContext commitContext = (CommitContext) it.next(); List<CommitFile> files = commitContext.getFiles();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.