Skip to content

Commit

Permalink
GH-545 allow to share heap cache
Browse files Browse the repository at this point in the history
  • Loading branch information
thurka committed Jan 4, 2024
1 parent 4e38874 commit 0e4f00c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Expand Up @@ -160,6 +160,17 @@ private File lookupFile(String fileName, boolean checkParent) throws FileNotFoun
if (isFileR(f)) {
return f;
}
if (!fileName.contains(File.separator)) {
// OS mismatch, try opposite separator
char sep = File.separatorChar == '/' ? '\\' : '/'; // NOI18N
int lastSep = fileName.lastIndexOf(sep);
if (lastSep != -1) {
f = new File(dir, fileName.substring(lastSep+1));
if (isFileR(f)) {
return f;
}
}
}
throw new FileNotFoundException(fileName);
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -386,7 +386,7 @@ void writeToStream(DataOutputStream out) throws IOException {
}
String os = dis.readUTF();
if (!os.equals(System.getProperty(OS_PROP))) {
throw new IOException("HPROF OS mismatch. Cached "+os+" current OS "+System.getProperty(OS_PROP));
System.err.println("Warning: HPROF OS mismatch. Cached "+os+" current OS "+System.getProperty(OS_PROP));
}
nearestGCRoot = new NearestGCRoot(this, dis);
allInstanceDumpBounds = new TagBounds(dis);
Expand Down

0 comments on commit 0e4f00c

Please sign in to comment.