-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Use UID for event in tracker importer [DHIS2-17790] #19012
base: master
Are you sure you want to change the base?
Conversation
bc3a26a
to
7becd40
Compare
...rvice-tracker/src/main/java/org/hisp/dhis/tracker/imports/validation/PersistablesFilter.java
Fixed
Show fixed
Hide fixed
c0f8066
to
e8847d7
Compare
} | ||
|
||
public Optional<Relationship> findRelationshipByUid(String uid) { | ||
return findById(this.relationships, uid); | ||
} | ||
|
||
private static <T extends TrackerDto> Optional<T> findById(List<T> entities, String uid) { | ||
return entities.stream().filter(e -> Objects.equals(e.getUid(), uid)).findFirst(); | ||
return entities.stream().filter(e -> Objects.equals(e.getStringUid(), uid)).findFirst(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
TrackerDto.getStringUid
return this.getResolvedStrategyMap().get(dto.getTrackerType()).put(dto.getUid(), strategy); | ||
return this.getResolvedStrategyMap() | ||
.get(dto.getTrackerType()) | ||
.put(dto.getStringUid(), strategy); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
TrackerDto.getStringUid
} | ||
|
||
public TrackerImportStrategy getStrategy(TrackerDto dto) { | ||
return getResolvedStrategyMap().get(dto.getTrackerType()).get(dto.getUid()); | ||
return getResolvedStrategyMap().get(dto.getTrackerType()).get(dto.getStringUid()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
TrackerDto.getStringUid
@@ -107,7 +107,7 @@ | |||
|
|||
for (T trackerDto : dtos) { | |||
|
|||
Entity objectReport = new Entity(getType(), trackerDto.getUid()); | |||
Entity objectReport = new Entity(getType(), trackerDto.getStringUid()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
TrackerDto.getStringUid
@@ -201,7 +202,7 @@ | |||
} | |||
|
|||
private boolean isContained(EnumMap<TrackerType, Set<String>> map, TrackerDto entity) { | |||
return map.get(entity.getTrackerType()).contains(entity.getUid()); | |||
return map.get(entity.getTrackerType()).contains(entity.getStringUid()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
TrackerDto.getStringUid
@@ -567,7 +571,7 @@ | |||
private <T extends TrackerDto> Set<String> invalid(List<Entity<T>> entities) { | |||
return entities.stream() | |||
.filter(e -> !e.valid) | |||
.map(e -> e.entity.getUid()) | |||
.map(e -> e.entity.getStringUid()) |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
TrackerDto.getStringUid
@@ -647,7 +651,7 @@ | |||
|
|||
private static <T extends TrackerDto> List<String> persistableUids( | |||
PersistablesFilter.Result persistable, Class<T> type) { | |||
return persistable.get(type).stream().map(TrackerDto::getUid).toList(); | |||
return persistable.get(type).stream().map(TrackerDto::getStringUid).toList(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
TrackerDto.getStringUid
@@ -73,7 +73,7 @@ | |||
} | |||
|
|||
TrackerType type = dto.getTrackerType(); | |||
String uid = dto.getUid(); | |||
String uid = dto.getStringUid(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
TrackerDto.getStringUid
@@ -132,7 +132,7 @@ | |||
TrackerDto dto, | |||
ValidationCode code) { | |||
TrackerType type = dto.getTrackerType(); | |||
String uid = dto.getUid(); | |||
String uid = dto.getStringUid(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
TrackerDto.getStringUid
@@ -155,7 +155,7 @@ | |||
ValidationCode code, | |||
String messageContains) { | |||
TrackerType type = dto.getTrackerType(); | |||
String uid = dto.getUid(); | |||
String uid = dto.getStringUid(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
TrackerDto.getStringUid
e8847d7
to
af307b7
Compare
af307b7
to
691de42
Compare
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
No description provided.