We observed that a delete by feature id against an SQLFeatureStore fails in some cases. This issue seems to be related to certain feature prefix configuration and differs between Java versions, e.g. we have two feature types with the following feature id prefices:
- APP_FEATURE_
- APP_FEATURE_X
We found that deleting the feature with id "APP_FEATURE_X_1" works in a Java 7 setup (tested with OpenJDK 7, 1.7.0_151 on Ubuntu 14.04 AMD64), while it fails with an exception on Java 8 (same machine, Oracle JDK 8, 1.8.0_144).
A first analysis points to method analyze(String) in class org.deegree.feature.persistence.sql.id.IdAnalyzer:
...
// TODO implement this more efficiently
for ( String prefix : prefixToFt.keySet() ) {
if ( featureOrGeomId.startsWith( prefix ) ) {
ft = prefixToFt.get( prefix );
break;
}
}
...
We believe this is caused by the different key order in the respective HashMap implementations:
https://stackoverflow.com/questions/38587711/hashmap-keyset-returns-keys-in-different-order-in-java-7-java-8
We observed that a delete by feature id against an SQLFeatureStore fails in some cases. This issue seems to be related to certain feature prefix configuration and differs between Java versions, e.g. we have two feature types with the following feature id prefices:
We found that deleting the feature with id "APP_FEATURE_X_1" works in a Java 7 setup (tested with OpenJDK 7, 1.7.0_151 on Ubuntu 14.04 AMD64), while it fails with an exception on Java 8 (same machine, Oracle JDK 8, 1.8.0_144).
A first analysis points to method analyze(String) in class org.deegree.feature.persistence.sql.id.IdAnalyzer:
... // TODO implement this more efficiently for ( String prefix : prefixToFt.keySet() ) { if ( featureOrGeomId.startsWith( prefix ) ) { ft = prefixToFt.get( prefix ); break; } } ...We believe this is caused by the different key order in the respective HashMap implementations:
https://stackoverflow.com/questions/38587711/hashmap-keyset-returns-keys-in-different-order-in-java-7-java-8