Skip to content

Arbitrary ClassCastExceptions when using git-plugin (ChangeSet) #12

@Phleb4s

Description

@Phleb4s

I am using the hudson.plugins.cloneworkspace.CloneWorkspaceSCM plugin and my builds often fail due to a ClassCastException:

java.lang.ClassCastException: hudson.plugins.cloneworkspace.CloneWorkspaceSCM cannot be cast to hudson.plugins.git.GitSCM
    at     hudson.plugins.git.GitChangeSet.isCreateAccountBaseOnCommitterEmail(GitChangeSet.java:296)

The following patch would fix that issue:

-    if (parent != null) {
+        if (parent != null && GitSCM.class.isAssignableFrom(parent.getBuild().getProject().getScm().getClass())) {
         createAccountBaseOnCommitterEmail = ((GitSCM) parent.getBuild().getProject().getScm()).
             isCreateAccountBaseOnCommitterEmail();
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions