Skip to content

Commit 651c713

Browse files
authored
Fixup heap dump on windows (#98)
1 parent 60cf85a commit 651c713

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceMemberPanel.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -586,16 +586,19 @@ private void showThreadDumpInVisualVM(int nNode, String sThreadDump)
586586
String sPrefix = "node-" + nNode + "-";
587587
File fileTempDir = new File(System.getProperty("java.io.tmpdir"));
588588
File fileTemp = File.createTempFile(sPrefix, null, fileTempDir);
589-
boolean fResult1 = fileTemp.setReadable(false);
590-
boolean fResult2 = fileTemp.setWritable(false);
591-
boolean fResult3 = fileTemp.setExecutable(false);
592-
boolean fResult4 = fileTemp.setReadable(true, true);
593-
boolean fResult5 = fileTemp.setWritable(true, true);
594-
boolean fResult6 = fileTemp.setExecutable(true, true);
595-
596-
if (!fResult1 || !fResult2 || !fResult3 || !fResult4 || !fResult5 || !fResult6)
589+
if (!System.getProperty("os.name").toLowerCase().contains("win"))
597590
{
598-
throw new RuntimeException("unable to set file permissions for " + fileTemp.getAbsolutePath());
591+
boolean fResult1 = fileTemp.setReadable(false);
592+
boolean fResult2 = fileTemp.setWritable(false);
593+
boolean fResult3 = fileTemp.setExecutable(false);
594+
boolean fResult4 = fileTemp.setReadable(true, true);
595+
boolean fResult5 = fileTemp.setWritable(true, true);
596+
boolean fResult6 = fileTemp.setExecutable(true, true);
597+
598+
if (!fResult1 || !fResult2 || !fResult3 || !fResult4 || !fResult5 || !fResult6)
599+
{
600+
throw new RuntimeException("unable to set file permissions for " + fileTemp.getAbsolutePath());
601+
}
599602
}
600603

601604
try (PrintWriter pw = new PrintWriter(fileTemp, "UTF-8"))

0 commit comments

Comments
 (0)