[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [sca-j] [NEW ISSUE] Java C&I Constrctor Examples are incorrect - [JAVA-137]
Hi, I have created new issue 137 for this. It
can be found at: http://www.osoa.org/jira/browse/JAVA-137 Thanks, Mark Mark Combellack| Software Developer| Avaya | From:
Mike Edwards [mailto:mike_edwards@uk.ibm.com]
public class Impl1 { String someProperty; public Impl1(String propval) {...} } <mje> This one does not
"unambiguously identify all property and reference
values"</mje> /** Simple class taking a property and reference in the
constructor; * The values are not injected into the fields.
*// public class Impl2 { public String someProperty; public SomeService someReference; public Impl2(String a, SomeService b) {...}
} <mje> This one does not
"unambiguously identify all property and reference
values"</mje> /** Class declaring a named property and reference through the
constructor */ public class Impl3 { @Constructor({"someProperty",
"someReference"}) public Impl3(String a, SomeService b) {...}
} <mje>@Constructor annotation has no
such attributes (see [JAVACAA]) </mje> /** Class declaring a named property and reference through
parameters */ public class Impl3b { public Impl3b( @Property("someProperty")
String a, @Reference("someReference)
SomeService b ) {...} } <mje>This one is OK</mje>
/** Additional property set through a method */ public class Impl4 { public String someProperty; public SomeService someReference; public Impl2(String a, SomeService b) {...}
@Property public void setAnotherProperty(int x)
{...} } <mje> This one does not
"unambiguously identify all property and reference
values"</mje>
public class Impl1 { private String someProperty; @Constructor public Impl1( @Property("someProperty")
String propval ) {...} } /** Declared constructor unambiguously identifying all Property
and Reference values */ public class Impl2 { private String someProperty; private SomeService someReference; public Impl2( @Property("someProperty")
String a,
@Reference("someReference") SomeService b ) {...} } /** Declared constructor unambiguously identifying all Property
and Reference values plus an additional Property injected via a setter
method */ public class Impl3 { private String someProperty; private String anotherProperty; private SomeService someReference; public Impl3( @Property("someProperty")
String a, @Reference("someReference")
SomeService b) {...} @Property public void setAnotherProperty( String
anotherProperty ) {...} } /** No-arg constructor */ public class Impl4 { @Property public String someProperty; @Reference public SomeService someReference; public Impl4() {...} }
Unless stated otherwise above:
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]