Skip to content

Commit

Permalink
NOJIRA
Browse files Browse the repository at this point in the history
default values (or lack of) causing issues
  • Loading branch information
chasegawa committed Aug 24, 2021
1 parent e4fc69d commit 4429b1e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class JPAMetadataResolverServiceImpl implements MetadataResolverService {
if (metadataFilter instanceof NameIdFormatFilter) {
NameIdFormatFilter nameIdFormatFilter = NameIdFormatFilter.cast(metadataFilter)
NameIDFormatFilter openSamlTargetFilter = new OpenSamlNameIdFormatFilter()
openSamlTargetFilter.removeExistingFormats = nameIdFormatFilter.removeExistingFormats
openSamlTargetFilter.removeExistingFormats = nameIdFormatFilter.removeExistingFormats == null ? false : nameIdFormatFilter.removeExistingFormats
Map<Predicate<EntityDescriptor>, Collection<String>> predicateRules = [:]
def type = nameIdFormatFilter.nameIdFormatFilterTarget.nameIdFormatFilterTargetType
def values = nameIdFormatFilter.nameIdFormatFilterTarget.value
Expand Down Expand Up @@ -559,4 +559,4 @@ class JPAMetadataResolverServiceImpl implements MetadataResolverService {

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,35 @@ public class MetadataResolver extends AbstractAuditable {
@Transient
private Integer version;

@JsonGetter("version")
public int getVersion() {
if (this.version != null && this.version != 0 ) {
return this.version;
}
return this.hashCode();
}

public void addFilter(MetadataFilter metadataFilter) {
//To make sure that Spring Data auditing infrastructure recognizes update and "touched" modifiedDate
markAsModified();
this.metadataFilters.add(metadataFilter);
}

public void markAsModified() {
this.versionModifiedTimestamp = System.currentTimeMillis();
}

public void entityAttributesFilterIntoTransientRepresentation() {
//expose explicit API to call to convert into transient representation
//used in unit/integration tests where JPA's @PostLoad callback execution engine is not available
this.metadataFilters
.stream()
.filter(EntityAttributesFilter.class::isInstance)
.map(EntityAttributesFilter.class::cast)
.forEach(EntityAttributesFilter::intoTransientRepresentation);
.stream()
.filter(EntityAttributesFilter.class::isInstance)
.map(EntityAttributesFilter.class::cast)
.forEach(EntityAttributesFilter::intoTransientRepresentation);
}

public Boolean getDoInitialization() {
return doInitialization == null ? false : doInitialization;
}

@JsonGetter("version")
public int getVersion() {
if (this.version != null && this.version != 0 ) {
return this.version;
}
return this.hashCode();
}

public void markAsModified() {
this.versionModifiedTimestamp = System.currentTimeMillis();
}
}
}

0 comments on commit 4429b1e

Please sign in to comment.