Issue Type: Bug Bug
Assignee: Félix Belzunce Arcos
Components: bitbucket-plugin
Created: 05/Feb/15 12:34 PM
Description:

The steps to re-produce the issue are:

1. git checkout -b feature/test
2. touch README.md
3. git add README.md
4. git commit -m "a change"
5. git push origin feature/test
6. git checkout feature/A
7. git merge feature/test
8. git push origin feature/A

So when you merge `feature/test` Bitbucket is not reporting raw_node so it was producing the stacktrace below:

```
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:400)
at java.util.ArrayList.get(ArrayList.java:413)
at net.sf.json.JSONArray.get(JSONArray.java:1881)
at net.sf.json.JSONArray.getJSONObject(JSONArray.java:1970)
at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.processPayload(BitbucketHookReceiver.java:111)
at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:60)
```

The lines of the code below in BitBucketHookReceiver are not used and they are producing the above stacktrace.

```
JSONArray commits = payload.getJSONArray("commits");
int last = commits.size() - 1;
String sha1 = commits.getJSONObject(last).getString("raw_node");
String branch = commits.getJSONObject(last).getString("branch");
```

Just need to delete them.

Project: Jenkins
Priority: Critical Critical
Reporter: Félix Belzunce Arcos
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to