Permalink
Browse files

change returned type of SessionEntryPoint.getObjects to a generic Col…

…lection<? extends Object>
  • Loading branch information...
1 parent c76f2bb commit cca0f3ad7ecd10cac69a6d965878ce4e1f50ce84 @mariofusco mariofusco committed Mar 25, 2013
Showing with 40 additions and 40 deletions.
  1. +3 −3 drools-compiler/src/test/java/org/drools/compiler/command/SimpleBatchExecutionTest.java
  2. +1 −1 drools-compiler/src/test/java/org/drools/compiler/factmodel/traits/TraitTest.java
  3. +1 −1 drools-compiler/src/test/java/org/drools/compiler/integrationtests/MVELTest.java
  4. +2 −2 drools-compiler/src/test/java/org/drools/compiler/integrationtests/StreamsTest.java
  5. +1 −1 drools-compiler/src/test/java/org/drools/compiler/integrationtests/TruthMaintenanceTest.java
  6. +1 −1 drools-compiler/src/test/java/org/drools/compiler/integrationtests/marshalling/MarshallingTest.java
  7. +2 −2 drools-compiler/src/test/java/org/drools/compiler/testframework/MockWorkingMemory.java
  8. +2 −2 drools-core/src/main/java/org/drools/core/command/impl/CommandBasedStatefulKnowledgeSession.java
  9. +2 −2 drools-core/src/main/java/org/drools/core/common/DisconnectedWorkingMemoryEntryPoint.java
  10. +2 −2 drools-core/src/main/java/org/drools/core/common/NamedEntryPoint.java
  11. +2 −2 drools-core/src/main/java/org/drools/core/impl/StatefulKnowledgeSessionImpl.java
  12. +2 −2 drools-core/src/main/java/org/drools/core/reteoo/DisposedReteooWorkingMemory.java
  13. +2 −2 drools-core/src/main/java/org/drools/core/reteoo/ReteooWorkingMemory.java
  14. +2 −2 drools-templates/src/test/java/org/drools/template/parser/ExternalSheetListenerTest.java
  15. +2 −2 drools-verifier/src/main/java/org/drools/verifier/data/VerifierDataKnowledgeSession.java
  16. +1 −1 drools-verifier/src/test/java/org/drools/verifier/overlaps/OverlappingRestrictionsTest.java
  17. +2 −2 drools-verifier/src/test/java/org/drools/verifier/redundancy/RedundancyTest.java
  18. +4 −4 drools-verifier/src/test/java/org/drools/verifier/subsumption/SubsumptantRestrictionsTest.java
  19. +5 −5 drools-verifier/src/test/java/org/drools/verifier/subsumption/SubsumptantSubPatternsTest.java
  20. +1 −1 drools-verifier/src/test/java/org/drools/verifier/subsumption/SubsumptantSubRulesTest.java
@@ -90,7 +90,7 @@ public void testInsertObjectCommand() throws Exception {
Object [] expectedArr = {expected_1, expected_2};
List<Object> expectedList = new ArrayList<Object>(Arrays.asList(expectedArr));
- Collection<Object> factList = ksession.getObjects();
+ Collection<? extends Object> factList = ksession.getObjects();
assertTrue("Expected " + expectedList.size() + " objects but retrieved " + factList.size(), factList.size() == expectedList.size() );
for( Object fact : factList ) {
if( expectedList.contains(fact) ) {
@@ -121,7 +121,7 @@ public void testInsertElementsCommand() throws Exception {
List<Object> expectedList = new ArrayList<Object>(Arrays.asList(expectedArr));
- Collection<Object> factList = ksession.getObjects();
+ Collection<? extends Object> factList = ksession.getObjects();
assertTrue("Expected " + expectedList.size() + " objects but retrieved " + factList.size(), factList.size() == expectedList.size() );
for( Object fact : factList ) {
if( expectedList.contains(fact) ) {
@@ -224,7 +224,7 @@ public void testGetObjectsCommand() throws Exception {
List<Object> objectList = (List) result.getValue("out_list");
assertTrue("Retrieved object list is null or empty!", objectList != null && ! objectList.isEmpty());
- Collection<Object> factList = ksession.getObjects();
+ Collection<? extends Object> factList = ksession.getObjects();
Object [] expectedArr = {expected_1, expected_2};
List<Object> expectedList = new ArrayList<Object>(Arrays.asList(expectedArr));
assertTrue("Expected " + expectedList.size() + " objects but retrieved " + factList.size(), factList.size() == expectedList.size() );
@@ -268,7 +268,7 @@ public void traitDon( TraitFactory.VirtualPropertyMode mode ) {
ks.fireAllRules();
- Collection<Object> wm = ks.getObjects();
+ Collection<? extends Object> wm = ks.getObjects();
ks.insert( "die" );
ks.fireAllRules();
@@ -311,7 +311,7 @@ public void testPackageImports() throws Exception {
int result = ksession.fireAllRules();
assertEquals(1, result);
- Collection<Object> insertedObjects = ksession.getObjects();
+ Collection<? extends Object> insertedObjects = ksession.getObjects();
assertEquals(3, insertedObjects.size());
}
@@ -468,7 +468,7 @@ public void testEventDoesNotExpireIfNotInPattern() throws Exception {
times(2)).objectInserted(any(org.kie.api.event.rule.ObjectInsertedEvent.class));
assertThat(ksession.getObjects().size(),
equalTo(2));
- assertThat(ksession.getObjects(),
+ assertThat((Collection<Object>) ksession.getObjects(),
hasItems((Object) st1,
st2));
@@ -519,7 +519,7 @@ public void testEventExpirationSetToZero() throws Exception {
times(2)).matchCreated(any(MatchCreatedEvent.class));
assertThat(ksession.getObjects().size(),
equalTo(2));
- assertThat(ksession.getObjects(),
+ assertThat((Collection<Object>) ksession.getObjects(),
hasItems((Object) st1,
st2));
@@ -1120,7 +1120,7 @@ public void testTMSWithLateUpdate() {
Father abraham = new Father("abraham");
Father bart = new Father("bart");
- Collection<Object> youngestFathers;
+ Collection<? extends Object> youngestFathers;
bart.setFather(abraham);
FactHandle abrahamHandle = kSession.insert(abraham);
@@ -3079,7 +3079,7 @@ public void testMarshalWithProtoBuf() throws Exception {
assertEquals( new Integer( 4 ),
list.get( 0 ) );
- Collection<Object> facts = ksession.getObjects();
+ Collection<? extends Object> facts = ksession.getObjects();
System.out.println( new ArrayList( facts ) );
assertEquals( 2,
facts.size() );
@@ -496,12 +496,12 @@ public void startBatchExecution(ExecutionResultImpl results) {
}
- public Collection< Object > getObjects() {
+ public Collection<? extends Object> getObjects() {
// TODO Auto-generated method stub
return null;
}
- public Collection< Object > getObjects(ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(ObjectFilter filter) {
// TODO Auto-generated method stub
return null;
}
@@ -355,11 +355,11 @@ public FactHandle getFactHandle(Object object) {
return (Collection<T>) this.commandService.execute( new GetFactHandlesCommand( filter ) );
}
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
return getObjects( null );
}
- public Collection<Object> getObjects(ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(ObjectFilter filter) {
Collection result = commandService.execute( new GetObjectsCommand( filter ) );
return result;
}
@@ -39,11 +39,11 @@ public Object getObject(FactHandle factHandle) {
throw new UnsupportedOperationException( "This method is not supported for disconnected objects" );
}
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
throw new UnsupportedOperationException( "This method is not supported for disconnected objects" );
}
- public Collection<Object> getObjects(ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(ObjectFilter filter) {
throw new UnsupportedOperationException( "This method is not supported for disconnected objects" );
}
@@ -748,14 +748,14 @@ public Object getObject(org.kie.api.runtime.rule.FactHandle factHandle) {
}
@SuppressWarnings("unchecked")
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
return new ObjectStoreWrapper( this.objectStore,
null,
ObjectStoreWrapper.OBJECT );
}
@SuppressWarnings("unchecked")
- public Collection<Object> getObjects(org.kie.api.runtime.ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(org.kie.api.runtime.ObjectFilter filter) {
return new ObjectStoreWrapper( this.objectStore,
filter,
ObjectStoreWrapper.OBJECT );
@@ -405,13 +405,13 @@ public Environment getEnvironment() {
ObjectStoreWrapper.FACT_HANDLE );
}
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
return new ObjectStoreWrapper( session.getObjectStore(),
null,
ObjectStoreWrapper.OBJECT );
}
- public Collection<Object> getObjects(org.kie.api.runtime.ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(org.kie.api.runtime.ObjectFilter filter) {
return new ObjectStoreWrapper( session.getObjectStore(),
filter,
ObjectStoreWrapper.OBJECT );
@@ -457,11 +457,11 @@ public String getEntryPointId() {
throw new IllegalStateException( ERRORMSG );
}
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
throw new IllegalStateException( ERRORMSG );
}
- public Collection<Object> getObjects( ObjectFilter filter ) {
+ public Collection<? extends Object> getObjects( ObjectFilter filter ) {
throw new IllegalStateException( ERRORMSG );
}
@@ -1183,11 +1183,11 @@ public InternalWorkingMemory getInternalWorkingMemory() {
throw new UnsupportedOperationException( "this is implementedby StatefulKnowledgeImpl" );
}
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
throw new UnsupportedOperationException( "this is implementedby StatefulKnowledgeImpl" );
}
- public Collection<Object> getObjects(ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(ObjectFilter filter) {
throw new UnsupportedOperationException( "this is implementedby StatefulKnowledgeImpl" );
}
@@ -400,12 +400,12 @@ public Environment getEnvironment() {
return null;
}
- public Collection<Object> getObjects() {
+ public Collection<? extends Object> getObjects() {
// TODO Auto-generated method stub
return null;
}
- public Collection<Object> getObjects(ObjectFilter filter) {
+ public Collection<? extends Object> getObjects(ObjectFilter filter) {
// TODO Auto-generated method stub
return null;
}
@@ -61,7 +61,7 @@ public VerifierDataKnowledgeSession() {
}
public Collection<ObjectType> getObjectTypesByRuleName(String ruleName) {
- Collection<Object> list = kSession.getObjects( new ClassObjectFilter( Integer.class ) );
+ Collection<? extends Object> list = kSession.getObjects( new ClassObjectFilter( Integer.class ) );
return new ArrayList( list );
}
@@ -80,7 +80,7 @@ public Variable getVariableByRuleAndVariableName(String ruleName,
}
public Collection<VerifierComponent> getAll() {
- Collection<Object> list = kSession.getObjects();
+ Collection<? extends Object> list = kSession.getObjects();
return new ArrayList( list );
}
@@ -50,7 +50,7 @@ public void testOverlap() {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> overlaps = ((VerifierImpl) verifier)
+ Collection<? extends Object> overlaps = ((VerifierImpl) verifier)
.getKnowledgeSession().getObjects(
new ClassObjectFilter(Overlap.class));
@@ -49,8 +49,8 @@ public void testVerifierLiteralRestrictionRedundancy() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
- Collection<Object> redundancyList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Redundancy.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> redundancyList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Redundancy.class));
assertEquals(2,
subsumptionList.size());
@@ -52,7 +52,7 @@ public void testVerifierLiteralRestrictionRedundancy1() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
assertEquals(9,
subsumptionList.size());
@@ -80,7 +80,7 @@ public void testVerifierLiteralRestrictionRedundancy2() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
assertEquals(9,
subsumptionList.size());
@@ -108,7 +108,7 @@ public void testVerifierLiteralRestrictionRedundancy3() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
assertEquals(6,
subsumptionList.size());
@@ -136,7 +136,7 @@ public void testVerifierLiteralRestrictionRedundancy4() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
// for ( Object object : subsumptionList ) {
// System.out.println( object );
@@ -60,7 +60,7 @@ public void testSubpatternSubsumption1() throws Exception {
}
}
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
int count = 0;
for (Object object : subsumptionList) {
@@ -101,7 +101,7 @@ public void testSubpatternSubsumption2() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
int count = 0;
for (Object object : subsumptionList) {
@@ -141,7 +141,7 @@ public void testSubpatternSubsumption3() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
int count = 0;
for (Object object : subsumptionList) {
@@ -182,7 +182,7 @@ public void testSubpatternSubsumption4() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
int count = 0;
for (Object object : subsumptionList) {
@@ -222,7 +222,7 @@ public void testSubpatternSubsumption5() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
int count = 0;
for (Object object : subsumptionList) {
@@ -54,7 +54,7 @@ public void testSubruleSubsumption1() throws Exception {
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
- Collection<Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
+ Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
int count = 0;
for (Object object : subsumptionList) {

0 comments on commit cca0f3a

Please sign in to comment.