Hi Jesse and anyone else following along,

I've got more info around my problem.  It's possible my problem because I 
don't have a good understanding of how to use generics and inheritance.  So 
any advice is appreciated.

I've found the MultiBranchProject and BranchProjectFactory both throw 
compile errors when I have my Project class defined as

public class KitchenProject extends MatrixProject {

The error being

[ERROR] KitchenMultibranchProject.java:[80,35] error: type argument 
KitchenProject is not within bounds of type-variable P
[ERROR] where P,R are type-variables:
[ERROR] P extends AbstractProject<P,R>,TopLevelItem declared in class 
BranchProjectFactory
[ERROR] R extends AbstractBuild<P,R> declared in class BranchProjectFactory

But if I don't extend MatrixProject and instead manually recreate it with a 
class definition like this, everything compiles and runs fine.

public class KitchenProject extends AbstractProject<KitchenProject,
KitchenBuild> implements TopLevelItem, SCMedItem, ItemGroup<
KitchenConfiguration>, Saveable, FlyweightTask, 
BuildableItemWithBuildWrappers {

While it is great I can get things running, then from this point forward 
I'll either drift away from the Matrix Project or have to manually watch 
the project and implement any fixes they have.  This is not my first 
choice...

Is there any recommended reading on using generics with inheritance to 
still get the generic requirements met?

Thanks again.

On Tuesday, October 7, 2014 8:02:17 AM UTC-7, Jesse Glick wrote:
>
> On Mon, Oct 6, 2014 at 2:07 PM, Tyler Fitch <tfi...@gmail.com 
> <javascript:>> wrote: 
> > Looking at the Literate Plugin as an example,  I’m trying to create a 
> > Multibranch + Matrix Configuration plugin.  Where LiterateProject 
> extends 
> > Project<LiterateBranchProject, LiterateBranchBuild> I instead want to 
> extend 
> > MatrixProject to create that type of job. 
>
> I think the first step would be to have multibranch integrated with 
> FreestyleProject, after which more complex integrations like with 
> MatrixProject could be considered. @Stephen actually wrote this code 
> but declined to release it to the public, AFAIK because the 
> configuration screen does not work well: various plugins expect 
> doSomething methods to get an AbstractProject or at least a Job in 
> @AncestorInPath, but in this case there is only an Item which is not a 
> Job. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to