Skip to content

Commit

Permalink
Fix NPE in report environment for older Coherence versions (#29)
Browse files Browse the repository at this point in the history
* Fix NPE in report environment for older Coh versions
* Fixup sonarcloud complaint
* update workflow
  • Loading branch information
tmiddlet2666 authored Oct 4, 2022
1 parent fba5e95 commit 496cd11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/test-against-released.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2022 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 @@ -44,10 +44,8 @@ jobs:
version:
- 14.1.1-0-10
- 14.1.1-0-9
- 21.06.1
- 21.12.4
- 22.06.1
- 22.06.2
- 22.09

steps:
- name: Checkout
Expand All @@ -63,7 +61,7 @@ jobs:
- name: Set up JDK 11 for Build
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'

- name: Print Versions
run: mvn -version && ant -version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package com.oracle.coherence.plugin.visualvm.panel;


import com.oracle.coherence.plugin.visualvm.Localization;
import com.oracle.coherence.plugin.visualvm.helper.GraphHelper;
import com.oracle.coherence.plugin.visualvm.helper.RenderHelper;
import com.oracle.coherence.plugin.visualvm.helper.RequestSender;
Expand Down Expand Up @@ -636,12 +637,19 @@ public String getMenuItem()
/**
* Return a sanitized message to make common errors more meaningful.
* @param e {@link Exception} to get message from
*
* @return final message
*/
private String getSanitizedMessage(Exception e)
{
String sError = e.getMessage();
return sError.contains("name cannot be null") ? "Node no longer available." : sError;

if (sError == null)
{
return Localization.getLocalText("LBL_operation_not_available");
}

return sError.contains("name cannot be null") ? Localization.getLocalText("LBL_node_not_available") : sError;
}

// ----- constants ------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ LBL_thread_dump_completed=Completed.
LBL_copy_to_clipboard=Copy contents to Clipboard
LBL_copied=Data has been copied to the Clipboard.
LBL_data_saved=Thread Dump has been saved to {0}.
LBL_operation_not_available=Operation is not available in this version.
LBL_node_not_available=Node no longer available.

# CoherencePersistencePanel
LBL_total_active_space=Total Active Persistence Space Used (MB)
Expand Down

0 comments on commit 496cd11

Please sign in to comment.