Skip to content

Commit c109ec8

Browse files
committed
Fixing a couple bugs based on Polaris issues
1 parent 5c206b9 commit c109ec8

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/impl/PojoRepositoryImpl.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -412,24 +412,24 @@ private void findId() {
412412
break;
413413
}
414414
}
415-
if ( property.hasGetter() ) {
416-
Method getter = property.getGetter().getAnnotated();
417-
if ( getter.getAnnotation(Id.class) != null ) {
418-
idPropertyName = property.getName();
419-
idMethod = getter;
420-
break;
421-
}
422-
if ( property.hasSetter() ) {
423-
Method setter = property.getSetter().getAnnotated();
424-
if ( setter.getAnnotation(Id.class) != null ) {
425-
idPropertyName = property.getName();
426-
idMethod = getter;
427-
break;
428-
}
429-
}
430-
}
431-
// setter only doesn't work because it gives us no value accessor
432-
}
415+
if (property.hasGetter()) {
416+
Method getter = property.getGetter().getAnnotated();
417+
if (getter.getAnnotation(Id.class) != null) {
418+
idPropertyName = property.getName();
419+
idMethod = getter;
420+
}
421+
else if (property.hasSetter()) {
422+
Method setter = property.getSetter().getAnnotated();
423+
if (setter.getAnnotation(Id.class) != null) {
424+
idPropertyName = property.getName();
425+
// Polaris thinks this might be a copy/paste issue, but based on the tests -
426+
// TestPOJOMissingIdGetSetMethod - it appears to be correct.
427+
idMethod = getter;
428+
}
429+
}
430+
}
431+
// setter only doesn't work because it gives us no value accessor
432+
}
433433
}
434434
// Jackson's introspect approach should find it, but our old approach below
435435
// gives some helpful errors

marklogic-client-api/src/main/java/com/marklogic/client/impl/SemValueImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public SemStoreExpr store(XsStringSeqVal options, CtsQueryExpr query) {
4141
}
4242
@Override
4343
public SemStoreExpr rulesetStore(String... locations) {
44-
return rulesetStore(new XsValueImpl.StringSeqValImpl(locations), (SemStoreSeqExpr) null, (String[]) null);
44+
return rulesetStore(new XsValueImpl.StringSeqValImpl(locations), (SemStoreSeqExpr) null);
4545
}
4646
@Override
4747
public SemStoreExpr rulesetStore(XsStringSeqVal locations, SemStoreExpr... stores) {
48-
return rulesetStore(locations, stores(stores), (String[]) null);
48+
return rulesetStore(locations, stores(stores));
4949
}
5050
@Override
5151
public SemStoreExpr rulesetStore(XsStringSeqVal locations, SemStoreSeqExpr stores, String... options) {

0 commit comments

Comments
 (0)