HHH-10715 Unclear excepion handling
This commit is contained in:
parent
b8ddc70ff1
commit
1de234ea93
|
@ -218,21 +218,25 @@ public class JpaDescriptorParser {
|
|||
}
|
||||
|
||||
private FileTimeStampChecker loadTimeStampCache() {
|
||||
FileTimeStampChecker serializedTimeStampCheck = new FileTimeStampChecker();
|
||||
File file = null;
|
||||
try {
|
||||
file = getSerializationTmpFile();
|
||||
final File file = getSerializationTmpFile();
|
||||
if ( file.exists() ) {
|
||||
ObjectInputStream in = new ObjectInputStream( new FileInputStream( file ) );
|
||||
serializedTimeStampCheck = (FileTimeStampChecker) in.readObject();
|
||||
in.close();
|
||||
try {
|
||||
try ( java.io.FileInputStream fileInputStream = new java.io.FileInputStream( file ) ) {
|
||||
try ( java.io.ObjectInputStream in = new java.io.ObjectInputStream( fileInputStream ) ) {
|
||||
return (org.hibernate.jpamodelgen.util.FileTimeStampChecker) in.readObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (java.io.IOException e) {
|
||||
//handled in the outer scope
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
//handled in the outer scope
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
// ignore - if the de-serialization failed we just have to keep parsing the xml
|
||||
context.logMessage( Diagnostic.Kind.OTHER, "Error de-serializing " + file );
|
||||
}
|
||||
return serializedTimeStampCheck;
|
||||
return new FileTimeStampChecker();
|
||||
}
|
||||
|
||||
private void parseEntities(Collection<Entity> entities, String defaultPackageName) {
|
||||
|
|
Loading…
Reference in New Issue