Skip to content

Commit 78b45cb

Browse files
committed
use safe cast
1 parent b854ef0 commit 78b45cb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ public Configuration setProperties(Properties properties) {
265265
* @return The value currently associated with that property name; may be null.
266266
*/
267267
public String getProperty(String propertyName) {
268-
Object o = properties.get( propertyName );
269-
return o instanceof String ? (String) o : null;
268+
return properties.get( propertyName ) instanceof String property ? property : null;
270269
}
271270

272271
/**

0 commit comments

Comments
 (0)