-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from stephenc/jenkins-45130
[JENKINS-45130] Ambiguous classes in list / array need their FQCN
- Loading branch information
Showing
7 changed files
with
342 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
plugin/src/test/java/org/jenkinsci/plugins/structs/describable/AbstractSharedName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
/* | |||
* The MIT License | |||
* | |||
* Copyright (c) 2017, CloudBees, Inc. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to deal | |||
* in the Software without restriction, including without limitation the rights | |||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
* copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included in | |||
* all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
* THE SOFTWARE. | |||
*/ | |||
|
|||
package org.jenkinsci.plugins.structs.describable; | |||
|
|||
import hudson.model.AbstractDescribableImpl; | |||
|
|||
public abstract class AbstractSharedName extends AbstractDescribableImpl<AbstractSharedName> { | |||
} |
52 changes: 52 additions & 0 deletions
52
plugin/src/test/java/org/jenkinsci/plugins/structs/describable/AmbiguousArrayContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,52 @@ | |||
/* | |||
* The MIT License | |||
* | |||
* Copyright (c) 2017, CloudBees, Inc. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to deal | |||
* in the Software without restriction, including without limitation the rights | |||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
* copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included in | |||
* all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
* THE SOFTWARE. | |||
*/ | |||
|
|||
package org.jenkinsci.plugins.structs.describable; | |||
|
|||
import hudson.Extension; | |||
import hudson.model.AbstractDescribableImpl; | |||
import hudson.model.Describable; | |||
import hudson.model.Descriptor; | |||
import org.kohsuke.stapler.DataBoundConstructor; | |||
|
|||
public class AmbiguousArrayContainer extends AbstractDescribableImpl<AmbiguousArrayContainer> { | |||
private final Describable<?>[] array; | |||
|
|||
@DataBoundConstructor | |||
public AmbiguousArrayContainer(Describable<?>... array) { | |||
this.array = array.clone(); | |||
} | |||
|
|||
public Describable<?>[] getArray() { | |||
return array.clone(); | |||
} | |||
|
|||
@Extension | |||
public static class DescriptorImpl extends Descriptor<AmbiguousArrayContainer> { | |||
@Override | |||
public String getDisplayName() { | |||
return "ambiguous array container"; | |||
} | |||
} | |||
} |
50 changes: 50 additions & 0 deletions
50
plugin/src/test/java/org/jenkinsci/plugins/structs/describable/AmbiguousListContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
/* | |||
* The MIT License | |||
* | |||
* Copyright (c) 2017, CloudBees, Inc. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to deal | |||
* in the Software without restriction, including without limitation the rights | |||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
* copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included in | |||
* all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
* THE SOFTWARE. | |||
*/ | |||
|
|||
package org.jenkinsci.plugins.structs.describable; | |||
|
|||
import hudson.Extension; | |||
import hudson.model.AbstractDescribableImpl; | |||
import hudson.model.Describable; | |||
import hudson.model.Descriptor; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import org.kohsuke.stapler.DataBoundConstructor; | |||
|
|||
public class AmbiguousListContainer extends AbstractDescribableImpl<AmbiguousListContainer> { | |||
public final List<Describable<?>> list; | |||
|
|||
@DataBoundConstructor | |||
public AmbiguousListContainer(List<Describable<?>> list) { | |||
this.list = new ArrayList<Describable<?>>(list); | |||
} | |||
|
|||
@Extension | |||
public static class DescriptorImpl extends Descriptor<AmbiguousListContainer> { | |||
@Override | |||
public String getDisplayName() { | |||
return "ambiguous list container"; | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
plugin/src/test/java/org/jenkinsci/plugins/structs/describable/first/SharedName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,73 @@ | |||
/* | |||
* The MIT License | |||
* | |||
* Copyright (c) 2017, CloudBees, Inc. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to deal | |||
* in the Software without restriction, including without limitation the rights | |||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
* copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included in | |||
* all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
* THE SOFTWARE. | |||
*/ | |||
|
|||
package org.jenkinsci.plugins.structs.describable.first; | |||
|
|||
import hudson.Extension; | |||
import hudson.model.Descriptor; | |||
import org.jenkinsci.Symbol; | |||
import org.jenkinsci.plugins.structs.describable.AbstractSharedName; | |||
import org.kohsuke.stapler.DataBoundConstructor; | |||
import org.kohsuke.stapler.DataBoundSetter; | |||
|
|||
public class SharedName extends AbstractSharedName { | |||
private final String one; | |||
private String two; | |||
|
|||
@DataBoundConstructor | |||
public SharedName(String one) { | |||
this.one = one; | |||
} | |||
|
|||
public String getOne() { | |||
return one; | |||
} | |||
|
|||
public String getTwo() { | |||
return two; | |||
} | |||
|
|||
@DataBoundSetter | |||
public void setTwo(String two) { | |||
this.two = two; | |||
} | |||
|
|||
public String getLegacyTwo() { | |||
return two; | |||
} | |||
|
|||
@Deprecated | |||
@DataBoundSetter | |||
public void setLegacyTwo(String two) { | |||
this.two = two; | |||
} | |||
|
|||
@Extension | |||
public static class DescriptorImpl extends Descriptor<AbstractSharedName> { | |||
@Override | |||
public String getDisplayName() { | |||
return "first.SharedName"; | |||
} | |||
} | |||
} |
48 changes: 48 additions & 0 deletions
48
plugin/src/test/java/org/jenkinsci/plugins/structs/describable/second/SharedName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,48 @@ | |||
/* | |||
* The MIT License | |||
* | |||
* Copyright (c) 2017, CloudBees, Inc. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to deal | |||
* in the Software without restriction, including without limitation the rights | |||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
* copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included in | |||
* all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
* THE SOFTWARE. | |||
*/ | |||
|
|||
package org.jenkinsci.plugins.structs.describable.second; | |||
|
|||
import hudson.Extension; | |||
import hudson.model.Descriptor; | |||
import org.jenkinsci.Symbol; | |||
import org.jenkinsci.plugins.structs.describable.AbstractSharedName; | |||
import org.kohsuke.stapler.DataBoundConstructor; | |||
|
|||
public class SharedName extends AbstractSharedName { | |||
public final String two; | |||
|
|||
@DataBoundConstructor | |||
public SharedName(String two) { | |||
this.two = two; | |||
} | |||
|
|||
@Extension | |||
public static class DescriptorImpl extends Descriptor<AbstractSharedName> { | |||
@Override | |||
public String getDisplayName() { | |||
return "second.SharedName"; | |||
} | |||
} | |||
} |