--- old/application/org.openjdk.jmc.browser/build.properties 2019-02-27 20:12:22.000000000 +0100 +++ new/application/org.openjdk.jmc.browser/build.properties 2019-02-27 20:12:22.000000000 +0100 @@ -41,4 +41,3 @@ contexts.xml,\ appicons/ pde.match.rule.bundle=compatible -javacDefaultEncoding.. = UTF-8 --- old/application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/common/ChartToolTipProvider.java 2019-02-27 20:12:22.000000000 +0100 +++ new/application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/common/ChartToolTipProvider.java 2019-02-27 20:12:22.000000000 +0100 @@ -134,7 +134,7 @@ } protected void appendTitle(String title) { - text.append("

").append(title).append("

"); + text.append("

").append(title).append("

"); //$NON-NLS-1$ //$NON-NLS-2$ } protected void appendAtIfNew(IDisplayable newAt) { --- old/application/tests/org.openjdk.jmc.flightrecorder.ui.test/src/test/java/org/openjdk/jmc/flightrecorder/ui/scripts/TokenizerTest.java 2019-02-27 20:12:23.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.flightrecorder.ui.test/src/test/java/org/openjdk/jmc/flightrecorder/ui/scripts/TokenizerTest.java 2019-02-27 20:12:23.000000000 +0100 @@ -44,31 +44,31 @@ public class TokenizerTest { @Test public void testQuotedString() { - Tokenizer tokenizer = new Tokenizer("my text \"is such a nice text\""); //$NON-NLS-1$ + Tokenizer tokenizer = new Tokenizer("my text \"is such a nice text\""); Iterator tokenIter = tokenizer.iterator(); Token token = tokenIter.next(); - assertEquals("my", token.getText()); //$NON-NLS-1$ + assertEquals("my", token.getText()); token = tokenIter.next(); - assertEquals("text", token.getText()); //$NON-NLS-1$ + assertEquals("text", token.getText()); token = tokenIter.next(); - assertEquals("is such a nice text", token.getText()); //$NON-NLS-1$ + assertEquals("is such a nice text", token.getText()); assertEquals(true, token.isInQuotes()); } @Test public void testMultipleRows() { - Tokenizer tokenizer = new Tokenizer("row1;row2;row3"); //$NON-NLS-1$ + Tokenizer tokenizer = new Tokenizer("row1;row2;row3"); Iterator tokenIter = tokenizer.iterator(); Token token = tokenIter.next(); - assertEquals("row1", token.getText()); //$NON-NLS-1$ + assertEquals("row1", token.getText()); assertEquals(0, token.getRow()); tokenIter.next(); token = tokenIter.next(); - assertEquals("row2", token.getText()); //$NON-NLS-1$ + assertEquals("row2", token.getText()); assertEquals(1, token.getRow()); tokenIter.next(); token = tokenIter.next(); - assertEquals("row3", token.getText()); //$NON-NLS-1$ + assertEquals("row3", token.getText()); assertEquals(2, token.getRow()); } } --- old/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/GreyChartPanelTester.java 2019-02-27 20:12:24.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/GreyChartPanelTester.java 2019-02-27 20:12:24.000000000 +0100 @@ -52,7 +52,7 @@ * Little test program creating a graph containing a huge amount of data. */ public class GreyChartPanelTester { - private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("HH:mm:ss"); //$NON-NLS-1$ + private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("HH:mm:ss"); /** * Program entry point. @@ -73,7 +73,7 @@ @Override public String getUnitString(Number min, Number max) { - return ""; //$NON-NLS-1$ + return ""; } }); @@ -90,11 +90,11 @@ // ((DefaultXYLineRenderer) graph.getSeriesPlotRenderer()).setMode(DefaultXYLineRenderer.RENDERING_MODE_AVERAGING); GreyChartPanel panel = new GreyChartPanel(graph); - panel.setName(" graph with lot's of entries"); //$NON-NLS-1$ + panel.setName(" graph with lot's of entries"); panel.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - System.out.println("Changed structure!"); //$NON-NLS-1$ + System.out.println("Changed structure!"); provider.sendNotification(); } }); --- old/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/PieChartTester.java 2019-02-27 20:12:25.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/PieChartTester.java 2019-02-27 20:12:24.000000000 +0100 @@ -56,7 +56,7 @@ */ @Override public void mouseClicked(MouseEvent e) { - System.out.println("Adding value!"); //$NON-NLS-1$ + System.out.println("Adding value!"); } /** @@ -64,7 +64,7 @@ */ @Override public void mouseEntered(MouseEvent e) { - System.out.println("Entered graph!"); //$NON-NLS-1$ + System.out.println("Entered graph!"); } /** @@ -72,7 +72,7 @@ */ @Override public void mouseExited(MouseEvent e) { - System.out.println("Exited graph!"); //$NON-NLS-1$ + System.out.println("Exited graph!"); } } @@ -88,11 +88,11 @@ addNumberSeries(graph, seriesProvider, 40); addNumberSeries(graph, seriesProvider, 60); addNumberSeries(graph, seriesProvider, 80); - graph.setTitle("Test pie chart"); //$NON-NLS-1$ + graph.setTitle("Test pie chart"); graph.setMetadataProvider(new DefaultMetadataProvider()); graph.setDataProvider(seriesProvider); GreyChartPanel panel = new GreyChartPanel(graph); - panel.setName("default pie chart"); //$NON-NLS-1$ + panel.setName("default pie chart"); panel.addMouseListener(new MyMouseListener()); ChartRenderingToolkit.testComponent(panel, 320, 250); } --- old/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/RenderingOutOfOrderTester.java 2019-02-27 20:12:25.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/RenderingOutOfOrderTester.java 2019-02-27 20:12:25.000000000 +0100 @@ -81,7 +81,7 @@ */ @Override public void mouseClicked(MouseEvent e) { - System.out.println("Adding value!"); //$NON-NLS-1$ + System.out.println("Adding value!"); doStep(); } @@ -90,7 +90,7 @@ */ @Override public void mouseEntered(MouseEvent e) { - System.out.println("Entered graph!"); //$NON-NLS-1$ + System.out.println("Entered graph!"); } /** @@ -98,7 +98,7 @@ */ @Override public void mouseExited(MouseEvent e) { - System.out.println("Exited graph!"); //$NON-NLS-1$ + System.out.println("Exited graph!"); } } @@ -123,7 +123,7 @@ SAW_DATA = new TimestampDataSeries(); provider.addDataSeries(SAW_DATA); provider.addDataSeries(SINUS_DATA); - String title = "Out of order rendering test. Click for next point!"; //$NON-NLS-1$ + String title = "Out of order rendering test. Click for next point!"; DefaultXYGreyChart graph = new DefaultXYGreyChart<>(); DefaultYAxis yaxis_left = new DefaultYAxis(graph); @@ -134,7 +134,7 @@ yaxis_left.setNumberOfTicks(20); yaxis_left.setAlwaysShowZero(false); yaxis_left.setAutoPadding(0.05); - yaxis_left.setTitle("Saw value"); //$NON-NLS-1$ + yaxis_left.setTitle("Saw value"); yaxis_left.setPosition(Position.LEFT); yaxis_right.setMin(MIN_Y); yaxis_right.setMax(MAX_Y); @@ -142,7 +142,7 @@ yaxis_right.setNumberOfTicks(20); yaxis_right.setAlwaysShowZero(false); yaxis_right.setAutoPadding(0.05); - yaxis_right.setTitle("Sine value"); //$NON-NLS-1$ + yaxis_right.setTitle("Sine value"); yaxis_right.setPosition(Position.RIGHT); graph.setMetadataProvider(new DefaultMetadataProvider()); @@ -158,14 +158,14 @@ graph.addYAxis(yaxis_left); graph.addYAxis(yaxis_right); - graph.getXAxis().setTitle("Time"); //$NON-NLS-1$ + graph.getXAxis().setTitle("Time"); panel = new GreyChartPanel(graph); graph.setIndexRenderer(new DefaultVerticalIndexRenderer(graph)); panel.setBackground(new Color(240, 240, 240)); panel.addMouseListener(new MyMouseListener()); - panel.setName("rendering performance"); //$NON-NLS-1$ + panel.setName("rendering performance"); panel.setBackground(Color.WHITE); panel.getChart().getPlotRenderer().setBackground(Color.LIGHT_GRAY); // Range chosen to provoke interpolation. --- old/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/RenderingPerformanceTester.java 2019-02-27 20:12:26.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.greychart.test/src/test/java/org/openjdk/jmc/greychart/testutil/RenderingPerformanceTester.java 2019-02-27 20:12:26.000000000 +0100 @@ -75,7 +75,7 @@ */ @Override public void mouseClicked(MouseEvent e) { - System.out.println("Adding value!"); //$NON-NLS-1$ + System.out.println("Adding value!"); if (m_adder != null) { m_adder.doStep(); } @@ -86,7 +86,7 @@ */ @Override public void mouseEntered(MouseEvent e) { - System.out.println("Entered graph!"); //$NON-NLS-1$ + System.out.println("Entered graph!"); } /** @@ -94,7 +94,7 @@ */ @Override public void mouseExited(MouseEvent e) { - System.out.println("Exited graph!"); //$NON-NLS-1$ + System.out.println("Exited graph!"); } } @@ -114,7 +114,7 @@ SAW_DATA = new TimestampDataSeries(); provider.addDataSeries(SAW_DATA); provider.addDataSeries(SINUS_DATA); - String title = "Mode: "; //$NON-NLS-1$ + String title = "Mode: "; DefaultXYGreyChart graph = new DefaultXYGreyChart<>(); DefaultYAxis yaxis_left = new DefaultYAxis(graph); @@ -125,7 +125,7 @@ yaxis_left.setNumberOfTicks(20); yaxis_left.setAlwaysShowZero(false); yaxis_left.setAutoPadding(0.05); - yaxis_left.setTitle("Saw value"); //$NON-NLS-1$ + yaxis_left.setTitle("Saw value"); yaxis_left.setPosition(Position.LEFT); yaxis_right.setMin(MIN_Y); yaxis_right.setMax(MAX_Y); @@ -133,7 +133,7 @@ yaxis_right.setNumberOfTicks(20); yaxis_right.setAlwaysShowZero(false); yaxis_right.setAutoPadding(0.05); - yaxis_right.setTitle("Sine value"); //$NON-NLS-1$ + yaxis_right.setTitle("Sine value"); yaxis_right.setPosition(Position.RIGHT); // yaxis.setVisible(false); // xaxis.setVisible(false); @@ -151,17 +151,17 @@ graph.addYAxis(yaxis_left); graph.addYAxis(yaxis_right); - graph.getXAxis().setTitle("Time"); //$NON-NLS-1$ + graph.getXAxis().setTitle("Time"); panel = new GreyChartPanel(graph); graph.setIndexRenderer(new DefaultVerticalIndexRenderer(graph)); panel.setBackground(new Color(240, 240, 240)); - if (set.contains("gradient")) { //$NON-NLS-1$ - title += "gradient "; //$NON-NLS-1$ + if (set.contains("gradient")) { + title += "gradient "; } - if (set.contains("fill")) { //$NON-NLS-1$ - title += "fill "; //$NON-NLS-1$ + if (set.contains("fill")) { + title += "fill "; } // if (set.contains("averaging")) { // ((DefaultXYLineRenderer) graph.getSeriesPlotRenderer()) @@ -174,7 +174,7 @@ // } panel.addMouseListener(new MyMouseListener()); - panel.setName("rendering performance"); //$NON-NLS-1$ + panel.setName("rendering performance"); panel.setBackground(Color.WHITE); panel.getChart().getPlotRenderer().setBackground(Color.LIGHT_GRAY); graph.setAntialiasingEnabled(false); --- old/application/tests/org.openjdk.jmc.jdp.test/src/test/java/org/openjdk/jmc/jdp/client/TestToolkit.java 2019-02-27 20:12:27.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.jdp.test/src/test/java/org/openjdk/jmc/jdp/client/TestToolkit.java 2019-02-27 20:12:26.000000000 +0100 @@ -50,7 +50,7 @@ private static final String HEXES = "0123456789ABCDEF"; private final static SecureRandom RND = new SecureRandom(); public static final int TEST_MULTICAST_PORT = 7711; - private static final String TEST_MULTICAST_ADDRESS_STRING = "224.0.23.177"; //$NON-NLS-1$ + private static final String TEST_MULTICAST_ADDRESS_STRING = "224.0.23.177"; public static final InetAddress TEST_MULTICAST_ADDRESS; static { @@ -59,7 +59,7 @@ tmp = InetAddress.getByName(TEST_MULTICAST_ADDRESS_STRING); } catch (UnknownHostException e) { // Multicast address by IP, should never happen! - JDPClientTest.LOGGER.log(Level.SEVERE, "Could not create test multicast address!", e); //$NON-NLS-1$ //$NON-NLS-2$ + JDPClientTest.LOGGER.log(Level.SEVERE, "Could not create test multicast address!", e); } TEST_MULTICAST_ADDRESS = tmp; } --- old/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/JfrControlTest.java 2019-02-27 20:12:27.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/JfrControlTest.java 2019-02-27 20:12:27.000000000 +0100 @@ -91,7 +91,7 @@ IQuantity duration = MILLISECOND.quantity(5000); Random rnd = new Random(); - String name = "test_recording_" + rnd.nextInt() % 4711; //$NON-NLS-1$ + String name = "test_recording_" + rnd.nextInt() % 4711; IFlightRecorderService service = getFlightRecorderService(); IConstrainedMap recordingOptions = new RecordingOptionsBuilder(service).name(name).duration(duration) .build(); @@ -101,7 +101,7 @@ assertNotNull(durationOption); assertSame(duration, (IQuantity) durationOption); assertEquals(IRecordingDescriptor.RecordingState.RUNNING, recording.getState()); - System.out.println("Started " + recording.getName()); //$NON-NLS-1$ + System.out.println("Started " + recording.getName()); assertEquals(name, recording.getName()); service.stop(recording); @@ -113,7 +113,7 @@ Thread.sleep(1000); } assertEquals(IRecordingDescriptor.RecordingState.STOPPED, recording.getState()); - System.out.println("Stopped " + recording.getName()); //$NON-NLS-1$ + System.out.println("Stopped " + recording.getName()); service.close(recording); recording = service.getUpdatedRecordingDescription(recording); assertNull(recording); @@ -142,7 +142,7 @@ while ((lastRead = stream.read(bytes)) != -1) { read += lastRead; } - assertMin("Should have read something!", 1, read); //$NON-NLS-1$ + assertMin("Should have read something!", 1, read); stream.close(); stopRecording(recording); } --- old/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/JfrPackageExampleTest.java 2019-02-27 20:12:28.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/JfrPackageExampleTest.java 2019-02-27 20:12:28.000000000 +0100 @@ -63,9 +63,9 @@ @Test public void testPackageExample1FunctionalityVerbatim() throws Exception { - IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$ + IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); IServerHandle serverHandle = IServerHandle.create(descriptor); - IConnectionHandle handle = serverHandle.connect("Get JFR recording info"); //$NON-NLS-1$ + IConnectionHandle handle = serverHandle.connect("Get JFR recording info"); try { IFlightRecorderService jfr = handle.getServiceOrThrow(IFlightRecorderService.class); for (IRecordingDescriptor desc : jfr.getAvailableRecordings()) { @@ -78,7 +78,7 @@ @Test public void testPackageExample2FunctionalityVerbatim() throws Exception { - IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$ + IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); IServerHandle serverHandle = IServerHandle.create(descriptor); IConnectionHandle handle = serverHandle.connect("Start time bound flight recording"); try { --- old/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/JfrTestCase.java 2019-02-27 20:12:29.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/JfrTestCase.java 2019-02-27 20:12:28.000000000 +0100 @@ -88,11 +88,11 @@ protected IRecordingDescriptor startContinuousRecording() throws Exception { Random rnd = new Random(); - String name = "test_recording_" + rnd.nextInt() % 4711; //$NON-NLS-1$ + String name = "test_recording_" + rnd.nextInt() % 4711; IFlightRecorderService service = getFlightRecorderService(); IConstrainedMap recordingOptions = new RecordingOptionsBuilder(service).name(name).duration(0L).build(); IRecordingDescriptor recording = service.start(recordingOptions, service.getDefaultEventOptions()); - System.out.println("Started " + recording.getName()); //$NON-NLS-1$ + System.out.println("Started " + recording.getName()); IConstrainedMap options = service.getRecordingOptions(recording); Object durationOption = options.get(RecordingOptionsBuilder.KEY_DURATION); // FIXME: It seems duration may be null for continuous recordings on Java 9 and later. Check with specification. @@ -117,7 +117,7 @@ Thread.sleep(1000); } assertEquals(IRecordingDescriptor.RecordingState.STOPPED, recording.getState()); - System.out.println("Stopped " + recording.getName()); //$NON-NLS-1$ + System.out.println("Stopped " + recording.getName()); service.close(recording); recording = service.getUpdatedRecordingDescription(recording); assertNull(recording); --- old/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/RecordingOptionsTest.java 2019-02-27 20:12:29.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/src/test/java/org/openjdk/jmc/rjmx/services/jfr/test/RecordingOptionsTest.java 2019-02-27 20:12:29.000000000 +0100 @@ -79,7 +79,7 @@ @Test public void testValidateOption() throws Exception { RecordingOptionsBuilder builder = new RecordingOptionsBuilder(getFlightRecorderService()); - builder.addByKey(RecordingOptionsBuilder.KEY_DURATION, "20s"); //$NON-NLS-1$ + builder.addByKey(RecordingOptionsBuilder.KEY_DURATION, "20s"); IConstrainedMap options = builder.build(); try { ValidationToolkit.validate(options); @@ -94,7 +94,7 @@ IMutableConstrainedMap options = service.getDefaultRecordingOptions().emptyWithSameConstraints(); try { // Not allowed to put string representations directly in options map anymore. - options.put(RecordingOptionsBuilder.KEY_DURATION, "20s"); //$NON-NLS-1$ + options.put(RecordingOptionsBuilder.KEY_DURATION, "20s"); fail("Expected exception to be thrown for invalid options"); } catch (Exception expected) { } @@ -104,7 +104,7 @@ @Test public void testStringOptions() throws Exception { RecordingOptionsBuilder builder = new RecordingOptionsBuilder(getFlightRecorderService()); - builder.addByKey(RecordingOptionsBuilder.KEY_DURATION, "20s"); //$NON-NLS-1$ + builder.addByKey(RecordingOptionsBuilder.KEY_DURATION, "20s"); IConstrainedMap map = builder.build(); assertSame(SECOND.quantity(20), (IQuantity) map.get(RecordingOptionsBuilder.KEY_DURATION)); } @@ -115,11 +115,11 @@ IFlightRecorderService service = getFlightRecorderService(); RecordingOptionsBuilder builder = new RecordingOptionsBuilder(service); boolean hasCompressed = "1.0".equals(service.getVersion()); - props.put(RecordingOptionsBuilder.KEY_DURATION, "45 ms"); //$NON-NLS-1$ + props.put(RecordingOptionsBuilder.KEY_DURATION, "45 ms"); Date myDate = new Date(); if (hasCompressed) { - props.put(RecordingOptionsBuilder.KEY_DESTINATION_FILE, "myfile"); //$NON-NLS-1$ - props.put(RecordingOptionsBuilder.KEY_DESTINATION_COMPRESSED, "true"); //$NON-NLS-1$ + props.put(RecordingOptionsBuilder.KEY_DESTINATION_FILE, "myfile"); + props.put(RecordingOptionsBuilder.KEY_DESTINATION_COMPRESSED, "true"); // FIXME: Do we really want to support parsing Date.toString() format? // props.put(RecordingOptionsBuilder.KEY_START_TIME, myDate.toString()); props.put(RecordingOptionsBuilder.KEY_START_TIME, Long.toString(myDate.getTime())); @@ -127,7 +127,7 @@ IConstrainedMap options = builder.fromProperties(props).build(); assertSame(MILLISECOND.quantity(45), (IQuantity) options.get(RecordingOptionsBuilder.KEY_DURATION)); if (hasCompressed) { - assertEquals("myfile", options.get(RecordingOptionsBuilder.KEY_DESTINATION_FILE)); //$NON-NLS-1$ + assertEquals("myfile", options.get(RecordingOptionsBuilder.KEY_DESTINATION_FILE)); assertEquals(Boolean.TRUE, options.get(RecordingOptionsBuilder.KEY_DESTINATION_COMPRESSED)); assertSame(UnitLookup.fromDate(myDate), (IQuantity) options.get(RecordingOptionsBuilder.KEY_START_TIME)); } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/BasicCommunicationTest.java 2019-02-27 20:12:30.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/BasicCommunicationTest.java 2019-02-27 20:12:30.000000000 +0100 @@ -60,8 +60,8 @@ */ public class BasicCommunicationTest extends ServerHandleTestCase { final static int DEFAULT_PORT = 0; - final static String DEFAULT_HOST = "localhost".intern(); //$NON-NLS-1$ - final static String ALTERNATIVE_HOST = "127.1.0.1".intern(); //$NON-NLS-1$ + final static String DEFAULT_HOST = "localhost".intern(); + final static String ALTERNATIVE_HOST = "127.1.0.1".intern(); /** * Attempts creating a {@link JMXConnectionDescriptor} with a bunch of options. @@ -76,9 +76,9 @@ @Test public void testIConnectionHandle() throws Exception { - IConnectionHandle handle = getDefaultServer().connect("Test"); //$NON-NLS-1$ - MRI descriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", //$NON-NLS-1$ - "ThreadCount"); //$NON-NLS-1$ + IConnectionHandle handle = getDefaultServer().connect("Test"); + MRI descriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", + "ThreadCount"); MBeanServerConnection connection = handle.getServiceOrThrow(MBeanServerConnection.class); assertBetween(1L, 1000L, ((Number) connection.getAttribute(descriptor.getObjectName(), descriptor.getDataPath())).longValue()); @@ -87,7 +87,7 @@ @Test public void testServerHandle() throws Exception { - IConnectionHandle handle = getDefaultServer().connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = getDefaultServer().connect("Test"); assertEquals(1, getDefaultServer().getConnectionHandles().length); assertEquals(handle, getDefaultServer().getConnectionHandles()[0]); @@ -98,12 +98,12 @@ protected void muppTestConnection() throws Exception { ConnectionDescriptorBuilder builder = new ConnectionDescriptorBuilder(); - IConnectionDescriptor descriptor = builder.hostName("localhost").port(0).build(); //$NON-NLS-1$ - IConnectionHandle handle = IServerHandle.create(descriptor).connect("Test"); //$NON-NLS-1$ + IConnectionDescriptor descriptor = builder.hostName("localhost").port(0).build(); + IConnectionHandle handle = IServerHandle.create(descriptor).connect("Test"); ISubscriptionService service = handle.getServiceOrThrow(ISubscriptionService.class); - MRI attribute = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", //$NON-NLS-1$ - "ThreadCount"); //$NON-NLS-1$ + MRI attribute = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", + "ThreadCount"); service.addMRIValueListener(attribute, new IMRIValueListener() { @Override public void valueChanged(MRIValueEvent event) { --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/DefaultServicesTest.java 2019-02-27 20:12:31.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/DefaultServicesTest.java 2019-02-27 20:12:31.000000000 +0100 @@ -51,23 +51,23 @@ @Test public void testMBeanServerConnection() throws Exception { - IConnectionHandle handle = getDefaultServer().connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = getDefaultServer().connect("Test"); MBeanServerConnection connection = handle.getServiceOrThrow(MBeanServerConnection.class); String[] domains = connection.getDomains(); assertNotNull(connection.getDomains()); // At least java.lang, no matter what, or we're breaking J2SE compliance... for (String domain : domains) { - if (domain.equals("java.lang")) { //$NON-NLS-1$ + if (domain.equals("java.lang")) { return; } } - fail("Could not find java.lang.management among the domains!"); //$NON-NLS-1$ + fail("Could not find java.lang.management among the domains!"); } @Test public void xtestMBeanHelperService() throws Exception { - IConnectionHandle handle = getDefaultServer().connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = getDefaultServer().connect("Test"); IMBeanHelperService helper = handle.getServiceOrThrow(IMBeanHelperService.class); // FIXME: JMC-4270 - Server time approximation is not reliable. Disabling until a solution is found. @@ -75,12 +75,12 @@ // // // The server time calculations should not be this much off. // long diff = time - helper.getApproximateServerTime(time); -// assertLessThan("Server time approximation off by more than five seconds", 5000L, Math.abs(diff)); //$NON-NLS-1$ -// System.out.println("DefaultServicesTest.testMBeanHelperService(): Server time approximation difference = " //$NON-NLS-1$ -// + Math.abs(diff) + " ms"); //$NON-NLS-1$ +// assertLessThan("Server time approximation off by more than five seconds", 5000L, Math.abs(diff)); +// System.out.println("DefaultServicesTest.testMBeanHelperService(): Server time approximation difference = " +// + Math.abs(diff) + " ms"); // Should at least contain the java.lang mbeans. Just testing for the Threading one. - assertTrue("Could not find the Threading MBean!", helper.getMBeanNames().contains( //$NON-NLS-1$ - new ObjectName("java.lang:type=Threading"))); //$NON-NLS-1$ + assertTrue("Could not find the Threading MBean!", helper.getMBeanNames().contains( + new ObjectName("java.lang:type=Threading"))); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/PackageExampleTest.java 2019-02-27 20:12:31.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/PackageExampleTest.java 2019-02-27 20:12:31.000000000 +0100 @@ -74,12 +74,12 @@ */ @Test public void testPackageExampleVerbatim() throws Exception { - IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$ + IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); IServerHandle serverHandle = IServerHandle.create(descriptor); - IConnectionHandle handle = serverHandle.connect("Usage description"); //$NON-NLS-1$ + IConnectionHandle handle = serverHandle.connect("Usage description"); try { ISubscriptionService service = handle.getServiceOrThrow(ISubscriptionService.class); - MRI attribute = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", "ThreadCount"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI attribute = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", "ThreadCount"); service.addMRIValueListener(attribute, new IMRIValueListener() { @Override public void valueChanged(MRIValueEvent event) { @@ -98,12 +98,12 @@ @Test public void testPackageExampleFunctionality() throws Exception { ConnectionDescriptorBuilder builder = new ConnectionDescriptorBuilder(); - IConnectionDescriptor descriptor = builder.hostName("localhost").port(0).build(); //$NON-NLS-1$ - IConnectionHandle handle = IServerHandle.create(descriptor).connect("Usage description"); //$NON-NLS-1$ + IConnectionDescriptor descriptor = builder.hostName("localhost").port(0).build(); + IConnectionHandle handle = IServerHandle.create(descriptor).connect("Usage description"); try { ISubscriptionService service = handle.getServiceOrThrow(ISubscriptionService.class); gotEvent = false; - MRI attribute = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", "ThreadCount"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI attribute = new MRI(Type.ATTRIBUTE, "java.lang:type=Threading", "ThreadCount"); service.addMRIValueListener(attribute, new IMRIValueListener() { @Override public void valueChanged(MRIValueEvent event) { @@ -121,7 +121,7 @@ } finally { IOToolkit.closeSilently(handle); } - assertTrue("Never got any event!", gotEvent); //$NON-NLS-1$ + assertTrue("Never got any event!", gotEvent); } @Test @@ -131,7 +131,7 @@ IServerDescriptor descriptor = server.getServerHandle().getServerDescriptor(); if (descriptor.getJvmInfo() != null && Integer.valueOf(Environment.getThisPID()).equals(descriptor.getJvmInfo().getPid())) { - IConnectionHandle handle = server.getServerHandle().connect("Usage description"); //$NON-NLS-1$ + IConnectionHandle handle = server.getServerHandle().connect("Usage description"); try { handle.getServiceOrThrow(IMBeanHelperService.class).getMBeanNames().size(); return; --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/RjmxTestCase.java 2019-02-27 20:12:32.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/RjmxTestCase.java 2019-02-27 20:12:32.000000000 +0100 @@ -66,29 +66,29 @@ /** * The host running the management server. */ - public final static String PROPERTY_RJMX_HOST = "jmc.test.rjmx.host"; //$NON-NLS-1$ + public final static String PROPERTY_RJMX_HOST = "jmc.test.rjmx.host"; /** * The port of the management server. (Used for both JMX over RMI and RMP.) */ - public final static String PROPERTY_RJMX_PORT = "jmc.test.rjmx.port"; //$NON-NLS-1$ + public final static String PROPERTY_RJMX_PORT = "jmc.test.rjmx.port"; /** * Boolean option to use RMP to talk to the management server. (False means to use JMX over * RMI.) */ - public final static String PROPERTY_RJMX_RMP = "jmc.test.rjmx.rmp"; //$NON-NLS-1$ + public final static String PROPERTY_RJMX_RMP = "jmc.test.rjmx.rmp"; /** * The service URL to the management server. (If set, has precedence over host, port and * protocol.) */ - public final static String PROPERTY_JMX_SERVICE_URL = "jmc.test.rjmx.serviceURL"; //$NON-NLS-1$ + public final static String PROPERTY_JMX_SERVICE_URL = "jmc.test.rjmx.serviceURL"; /** * The default host to test against. */ - public final static String DEFAULT_HOST = "localhost"; //$NON-NLS-1$ + public final static String DEFAULT_HOST = "localhost"; protected String m_host; protected IConnectionHandle m_connectionHandle; @@ -129,19 +129,19 @@ protected static boolean probe(IConnectionDescriptor descriptor) { long start = System.currentTimeMillis(); try { - System.out.println("Probing Service URL " + descriptor.createJMXServiceURL() + " ..."); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Probing Service URL " + descriptor.createJMXServiceURL() + " ..."); IConnectionHandle handle = createConnectionHandle(descriptor); long up = System.currentTimeMillis(); - System.out.println("... connected in " + (up - start) + " ms ..."); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("... connected in " + (up - start) + " ms ..."); // Just in case we fail ... start = up; handle.close(); long down = System.currentTimeMillis(); - System.out.println("... closed in " + (down - start) + " ms."); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("... closed in " + (down - start) + " ms."); return true; } catch (Exception e) { long fail = System.currentTimeMillis(); - System.out.println("... failed in " + (fail - start) + " ms."); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("... failed in " + (fail - start) + " ms."); return false; } } @@ -169,7 +169,7 @@ */ public static void getServerProperties(IConnectionHandle connector, Properties props, String prefix) throws Exception { - System.out.println("Retrieving system properties (prefixed with '" + prefix + "') ..."); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Retrieving system properties (prefixed with '" + prefix + "') ..."); MBeanServerConnection server = connector.getServiceOrThrow(MBeanServerConnection.class); Map systemProperties = ConnectionToolkit.getRuntimeBean(server).getSystemProperties(); if (systemProperties != null) { @@ -177,7 +177,7 @@ props.setProperty(prefix + e.getKey(), e.getValue()); } } else { - System.out.println("Could not retrieve system properties"); //$NON-NLS-1$ + System.out.println("Could not retrieve system properties"); } } @@ -193,10 +193,10 @@ */ public static void getServerProperties(IConnectionDescriptor connDesc, Properties props, String prefix) throws Exception { - System.out.println("Connecting to " + connDesc.createJMXServiceURL() + " ..."); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Connecting to " + connDesc.createJMXServiceURL() + " ..."); IConnectionHandle connectionHandle = createConnectionHandle(connDesc); getServerProperties(connectionHandle, props, prefix); - System.out.println("Disconnecting ..."); //$NON-NLS-1$ + System.out.println("Disconnecting ..."); connectionHandle.close(); } @@ -220,7 +220,7 @@ */ private static IConnectionHandle createConnectionHandle(IConnectionDescriptor descriptor) throws IOException, FailedLoginException, ConnectionException { - return IServerHandle.create(descriptor).connect("Test"); //$NON-NLS-1$ + return IServerHandle.create(descriptor).connect("Test"); } /** @@ -263,22 +263,22 @@ } protected void assumeHotSpot8OrLater(IConnectionHandle handle) { - Assume.assumeTrue("This test assumes JDK 8 (HotSpot 25) or later!", ConnectionToolkit.isHotSpot(handle) //$NON-NLS-1$ + Assume.assumeTrue("This test assumes JDK 8 (HotSpot 25) or later!", ConnectionToolkit.isHotSpot(handle) && ConnectionToolkit.isJavaVersionAboveOrEqual(handle, JavaVersionSupport.JDK_8)); } protected void assumeHotSpot7u4OrLater(IConnectionHandle handle) { - Assume.assumeTrue("This test assumes JDK 7u4 (HotSpot 23) or later!", ConnectionToolkit.isHotSpot(handle) //$NON-NLS-1$ + Assume.assumeTrue("This test assumes JDK 7u4 (HotSpot 23) or later!", ConnectionToolkit.isHotSpot(handle) && ConnectionToolkit.isJavaVersionAboveOrEqual(handle, JavaVersionSupport.JDK_7_U_4)); } protected void assumeHotSpot7u12OrLater(IConnectionHandle handle) { - Assume.assumeTrue("This test assumes JDK 7u12 (HotSpot 24) or later!", ConnectionToolkit.isHotSpot(handle) //$NON-NLS-1$ + Assume.assumeTrue("This test assumes JDK 7u12 (HotSpot 24) or later!", ConnectionToolkit.isHotSpot(handle) && ConnectionToolkit.isJavaVersionAboveOrEqual(handle, JavaVersionSupport.JDK_7_U_40)); } protected void assumeHasDiagnosticCommandsService(IConnectionHandle handle) { - Assume.assumeTrue("This test needs a working diagnostic commands service!", //$NON-NLS-1$ + Assume.assumeTrue("This test needs a working diagnostic commands service!", handle.hasService(IDiagnosticCommandService.class)); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/internal/RJMXConnectionTest.java 2019-02-27 20:12:33.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/internal/RJMXConnectionTest.java 2019-02-27 20:12:33.000000000 +0100 @@ -66,12 +66,12 @@ @SuppressWarnings("nls") public class RJMXConnectionTest extends RjmxTestCase { // The MBEANS vital to console functionality. - public final static String[] MBEAN_NAMES = {"java.lang:type=OperatingSystem", "java.lang:type=ClassLoading", //$NON-NLS-1$ //$NON-NLS-2$ - "java.lang:type=Threading", "java.lang:type=Compilation", "java.lang:type=Memory", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - "java.lang:type=Runtime", "java.lang:type=MemoryPool,*", "java.lang:type=GarbageCollector,*", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - "java.lang:type=MemoryManager,*"}; //$NON-NLS-1$ + public final static String[] MBEAN_NAMES = {"java.lang:type=OperatingSystem", "java.lang:type=ClassLoading", + "java.lang:type=Threading", "java.lang:type=Compilation", "java.lang:type=Memory", + "java.lang:type=Runtime", "java.lang:type=MemoryPool,*", "java.lang:type=GarbageCollector,*", + "java.lang:type=MemoryManager,*"}; - public final static String[] MBEAN_CLASS_NAMES = {"sun.management.RuntimeImpl"}; //$NON-NLS-1$ + public final static String[] MBEAN_CLASS_NAMES = {"sun.management.RuntimeImpl"}; public static final int MIN_CPUS = 1; public static final int MAX_CPUS = 1024; @@ -79,7 +79,7 @@ private MRI[] ATTRIBUTES_OS; // Only use this one for testing! - private final static String[] ATTRIBUTE_SPEC_NAME = {"SpecName"}; //$NON-NLS-1$ + private final static String[] ATTRIBUTE_SPEC_NAME = {"SpecName"}; private RJMXConnection m_connection; /** @@ -99,9 +99,9 @@ } public static MRI[] getOSAttributes() { - return new MRI[] {new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"), //$NON-NLS-1$ //$NON-NLS-2$ - new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "ProcessCpuLoad"), //$NON-NLS-1$ //$NON-NLS-2$ - new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "AvailableProcessors")}; //$NON-NLS-1$ //$NON-NLS-2$ + return new MRI[] {new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"), + new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "ProcessCpuLoad"), + new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "AvailableProcessors")}; } @After @@ -134,7 +134,7 @@ break; } } - assertTrue("MBean names did not contain: " + element, found); //$NON-NLS-1$ + assertTrue("MBean names did not contain: " + element, found); } } @@ -182,14 +182,14 @@ } // No longer check all the class names for (String element : MBEAN_CLASS_NAMES) { - assertTrue("Returned infos did not contain MBean class name: " + element, infos //$NON-NLS-1$ + assertTrue("Returned infos did not contain MBean class name: " + element, infos .containsKey(element)); } MBeanInfo loggingInfo = infos.get(MBEAN_CLASS_NAMES[0]); - assertNotNull("MBeanInfo was null for " + MBEAN_CLASS_NAMES[0], loggingInfo); //$NON-NLS-1$ + assertNotNull("MBeanInfo was null for " + MBEAN_CLASS_NAMES[0], loggingInfo); MBeanAttributeInfo[] attrInfo = loggingInfo.getAttributes(); - assertNotNull("MBeanAttributeInfo was null for " + MBEAN_CLASS_NAMES[0], attrInfo); //$NON-NLS-1$ + assertNotNull("MBeanAttributeInfo was null for " + MBEAN_CLASS_NAMES[0], attrInfo); } @Test @@ -210,7 +210,7 @@ Object attr = m_connection .getAttributeValue(new MRI(Type.ATTRIBUTE, getObjectName(MBEAN_NAMES[5]), ATTRIBUTE_SPEC_NAME[0])); assertNotNull(attr); - assertTrue(String.valueOf(attr).contains("Virtual Machine")); //$NON-NLS-1$ + assertTrue(String.valueOf(attr).contains("Virtual Machine")); } public void handleRJMXException(Exception exception) { --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/internal/RJMXProxyOperationsTest.java 2019-02-27 20:12:33.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/internal/RJMXProxyOperationsTest.java 2019-02-27 20:12:33.000000000 +0100 @@ -48,7 +48,7 @@ public void testCtrlBreakHandler() throws Exception { assumeHotSpot8OrLater(getConnectionHandle()); - String help = getDiagnosticCommandService().runCtrlBreakHandlerWithResult("help"); //$NON-NLS-1$ + String help = getDiagnosticCommandService().runCtrlBreakHandlerWithResult("help"); Assert.assertNotNull(help); } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/internal/TabularDataBeanTestMBean.java 2019-02-27 20:12:34.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/internal/TabularDataBeanTestMBean.java 2019-02-27 20:12:34.000000000 +0100 @@ -60,39 +60,39 @@ public TabularDataBeanTestMBean() { CompositeType simpleCompositeType; try { - simpleCompositeType = new CompositeType("simpleCompositeType", "compdescription", //$NON-NLS-1$ //$NON-NLS-2$ - new String[] {"djur", "bil", "apa", "båt"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - new String[] {"ett djur", "en bil", "en apa", "en båt"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + simpleCompositeType = new CompositeType("simpleCompositeType", "compdescription", + new String[] {"djur", "bil", "apa", "båt"}, + new String[] {"ett djur", "en bil", "en apa", "en båt"}, new OpenType[] {SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,}); - TabularType simpleTabularType = new TabularType("simpleTabularTypeName", "tabdescription", //$NON-NLS-1$ //$NON-NLS-2$ - simpleCompositeType, new String[] {"djur", "bil", "apa", "båt"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + TabularType simpleTabularType = new TabularType("simpleTabularTypeName", "tabdescription", + simpleCompositeType, new String[] {"djur", "bil", "apa", "båt"}); OpenType[] compositeContentsTypes = new OpenType[5]; String[] compositeKeys = new String[5]; String[] compositeDescriptions = new String[5]; compositeContentsTypes[0] = simpleTabularType; - compositeKeys[0] = "Tab Data"; //$NON-NLS-1$ - compositeDescriptions[0] = "tab data desc"; //$NON-NLS-1$ + compositeKeys[0] = "Tab Data"; + compositeDescriptions[0] = "tab data desc"; compositeContentsTypes[4] = simpleCompositeType; - compositeKeys[4] = "Comp Data"; //$NON-NLS-1$ - compositeDescriptions[4] = "comp data desc"; //$NON-NLS-1$ + compositeKeys[4] = "Comp Data"; + compositeDescriptions[4] = "comp data desc"; compositeContentsTypes[3] = new ArrayType(2, SimpleType.STRING); - compositeKeys[3] = "Array Data"; //$NON-NLS-1$ - compositeDescriptions[3] = "comp data desc"; //$NON-NLS-1$ + compositeKeys[3] = "Array Data"; + compositeDescriptions[3] = "comp data desc"; for (int i = 1; i < 3; i++) { compositeContentsTypes[i] = SimpleType.STRING; - compositeKeys[i] = "StringIndex" + i; //$NON-NLS-1$ - compositeDescriptions[i] = "description" + i; //$NON-NLS-1$ + compositeKeys[i] = "StringIndex" + i; + compositeDescriptions[i] = "description" + i; } - CompositeType complexCompositeType = new CompositeType("ComplexCompositeTypeName", //$NON-NLS-1$ - "complex composite type desc", compositeKeys, compositeDescriptions, compositeContentsTypes); //$NON-NLS-1$ - TabularType complexTabularType = new TabularType("ComplexTabularTypeName", "complex tabular type", //$NON-NLS-1$ //$NON-NLS-2$ + CompositeType complexCompositeType = new CompositeType("ComplexCompositeTypeName", + "complex composite type desc", compositeKeys, compositeDescriptions, compositeContentsTypes); + TabularType complexTabularType = new TabularType("ComplexTabularTypeName", "complex tabular type", complexCompositeType, compositeKeys); CompositeData simpleCompositeData = new CompositeDataSupport(simpleCompositeType, - new String[] {"djur", "bil", "apa", "båt"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - new String[] {"häst", "corvette", "lemur", "nautilus"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + new String[] {"djur", "bil", "apa", "båt"}, + new String[] {"häst", "corvette", "lemur", "nautilus"}); TabularDataSupport simpleTabularData = new TabularDataSupport(simpleTabularType); simpleTabularData.put(simpleCompositeData); /* @@ -102,14 +102,14 @@ */ compTest = new CompositeDataSupport(complexCompositeType, compositeKeys, - new Object[] {simpleTabularData, "string2", "string3", //$NON-NLS-1$ //$NON-NLS-2$ - new String[][] {{"string1_1", "string1_2"}, {"string2_1", "string2_2"}}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + new Object[] {simpleTabularData, "string2", "string3", + new String[][] {{"string1_1", "string1_2"}, {"string2_1", "string2_2"}}, simpleCompositeData}); tabTest = new TabularDataSupport(complexTabularType); tabTest.put(compTest); tabTest.put(new CompositeDataSupport(complexCompositeType, compositeKeys, - new Object[] {simpleTabularData, "secondcomp2", "secondcomp3", //$NON-NLS-1$ //$NON-NLS-2$ - new String[][] {{"array1_1", "array1_2"}, {"array2_1", "array2_2"}}, simpleCompositeData})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + new Object[] {simpleTabularData, "secondcomp2", "secondcomp3", + new String[][] {{"array1_1", "array1_2"}, {"array2_1", "array2_2"}}, simpleCompositeData})); /* * tabTest.put(complexCompositeData); tabTest.put(complexCompositeData); * tabTest.put(complexCompositeData); tabTest.put(complexCompositeData); @@ -155,7 +155,7 @@ try { try { ManagementFactory.getPlatformMBeanServer().createMBean(TabularDataBeanTestMBean.class.getName(), - new ObjectName("com.jrockit", "name", "TestMBean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + new ObjectName("com.jrockit", "name", "TestMBean")); } catch (Exception e) { e.printStackTrace(); } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/CommercialFeaturesServiceTest.java 2019-02-27 20:12:35.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/CommercialFeaturesServiceTest.java 2019-02-27 20:12:35.000000000 +0100 @@ -66,7 +66,7 @@ if (!service.isCommercialFeaturesEnabled()) { service.enableCommercialFeatures(); } - assertTrue("Commercial features should now be enabled!", service.isCommercialFeaturesEnabled()); //$NON-NLS-1$ + assertTrue("Commercial features should now be enabled!", service.isCommercialFeaturesEnabled()); } private ICommercialFeaturesService getCommercialFeaturesService() throws ConnectionException { @@ -78,7 +78,7 @@ ICommercialFeaturesService service = handle.getServiceOrNull(ICommercialFeaturesService.class); assertNotNull( - "Could not retrieve the commercial features service. Please make sure that you are connecting to a Java 7u4 or later JVM.", //$NON-NLS-1$ + "Could not retrieve the commercial features service. Please make sure that you are connecting to a Java 7u4 or later JVM.", service); return service; } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/ServicesPackageExampleTest.java 2019-02-27 20:12:36.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/ServicesPackageExampleTest.java 2019-02-27 20:12:35.000000000 +0100 @@ -54,14 +54,14 @@ // NOTE: If you change the verbatim test YOU MUST update the corresponding package.html document. public class ServicesPackageExampleTest extends RjmxTestCase { public void packageExampleFunctionalityVerbatim() throws Exception { - IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$ + IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); IServerHandle handle = IServerHandle.create(descriptor); try { - IConnectionHandle connection = handle.connect("Run Diagnostic commands"); //$NON-NLS-1$ + IConnectionHandle connection = handle.connect("Run Diagnostic commands"); assumeHasDiagnosticCommandsService(connection); IDiagnosticCommandService dcmd = connection.getServiceOrThrow(IDiagnosticCommandService.class); for (IOperation operation : dcmd.getOperations()) { - System.out.println(dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", operation.getName()))); //$NON-NLS-1$ + System.out.println(dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", operation.getName()))); } } finally { handle.dispose(); @@ -70,16 +70,16 @@ @Test public void testPackageExampleFunctionality() throws Exception { - IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$ + IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); IServerHandle handle = IServerHandle.create(descriptor); try { - IConnectionHandle connection = handle.connect("Run Diagnostic commands"); //$NON-NLS-1$ + IConnectionHandle connection = handle.connect("Run Diagnostic commands"); assumeHasDiagnosticCommandsService(connection); IDiagnosticCommandService dcmd = connection.getServiceOrThrow(IDiagnosticCommandService.class); for (IOperation operation : dcmd.getOperations()) { String command = operation.getName(); - assertNotNull("Could not retrieve help for the command: " + command, //$NON-NLS-1$ - dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", command))); //$NON-NLS-1$ + assertNotNull("Could not retrieve help for the command: " + command, + dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", command))); } } finally { handle.dispose(); --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeDescriptorTest.java 2019-02-27 20:12:36.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeDescriptorTest.java 2019-02-27 20:12:36.000000000 +0100 @@ -125,40 +125,40 @@ @Test public void testCreateFromQualifiedName1() throws Exception { - MRI descriptor = MRI.createFromQualifiedName("attribute://java.lang:type=OperatingSystem/Arch"); //$NON-NLS-1$ + MRI descriptor = MRI.createFromQualifiedName("attribute://java.lang:type=OperatingSystem/Arch"); assertEquals(createDescriptor1(), descriptor); } @Test public void testCreateFromQualifiedName2() throws Exception { - MRI descriptor = MRI.createFromQualifiedName("attribute://java.lang:type=OperatingSystem/Arch/Sub"); //$NON-NLS-1$ + MRI descriptor = MRI.createFromQualifiedName("attribute://java.lang:type=OperatingSystem/Arch/Sub"); assertEquals(Type.ATTRIBUTE, descriptor.getType()); - assertEquals("java.lang:type=OperatingSystem", descriptor.getObjectName().getCanonicalName()); //$NON-NLS-1$ - assertEquals("Arch/Sub", descriptor.getDataPath()); //$NON-NLS-1$ + assertEquals("java.lang:type=OperatingSystem", descriptor.getObjectName().getCanonicalName()); + assertEquals("Arch/Sub", descriptor.getDataPath()); } @Test public void testMalformedQualifiedName1() throws Exception { try { - MRI.createFromQualifiedName("smurf://java.lang:type=OperatingSystem/Arch"); //$NON-NLS-1$ + MRI.createFromQualifiedName("smurf://java.lang:type=OperatingSystem/Arch"); } catch (IllegalArgumentException iae) { return; } - assertTrue("Should not be possible to create an attribute with the type smurf!", false); //$NON-NLS-1$ + assertTrue("Should not be possible to create an attribute with the type smurf!", false); } @Test public void testMalformedQualifiedName2() throws Exception { try { - MRI.createFromQualifiedName("java.lang:type=OperatingSystem/Arch"); //$NON-NLS-1$ + MRI.createFromQualifiedName("java.lang:type=OperatingSystem/Arch"); } catch (IllegalArgumentException iae) { return; } - assertTrue("Should not be possible to create an attribute name without specifying a type!", false); //$NON-NLS-1$ + assertTrue("Should not be possible to create an attribute name without specifying a type!", false); } private MRI createDescriptor1() throws Exception { - return new MRI(Type.ATTRIBUTE, new ObjectName("java.lang:type=OperatingSystem"), "Arch"); //$NON-NLS-1$ //$NON-NLS-2$ + return new MRI(Type.ATTRIBUTE, new ObjectName("java.lang:type=OperatingSystem"), "Arch"); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeSubscriptionTest.java 2019-02-27 20:12:37.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeSubscriptionTest.java 2019-02-27 20:12:37.000000000 +0100 @@ -60,7 +60,7 @@ IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); ISubscriptionService subscriptionService = handle.getServiceOrThrow(ISubscriptionService.class); try { - MRI attributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI attributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); subscriptionService.addMRIValueListener(attributeDescriptor, this); synchronized (this) { for (int i = 0; i < 4; i++) { @@ -81,8 +81,8 @@ IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); ISubscriptionService subscriptionService = handle.getServiceOrThrow(ISubscriptionService.class); try { - MRI availableProcessorsAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "AvailableProcessors"); //$NON-NLS-1$ + MRI availableProcessorsAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "AvailableProcessors"); subscriptionService.addMRIValueListener(availableProcessorsAttribute, this); @@ -109,8 +109,8 @@ public void testGetAttributeSubscriptionOne() { try { // Starting up a subscription on a one shot attribute. - MRI physicalMemoryUsedAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "UsedPhysicalMemorySize"); //$NON-NLS-1$ + MRI physicalMemoryUsedAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "UsedPhysicalMemorySize"); getAttributeSubscriptionService().addMRIValueListener(physicalMemoryUsedAttribute, this); synchronized (this) { @@ -128,9 +128,9 @@ public void testGetAttributeSubscriptionTwo() { try { // Starting up a subscription on a one shot attribute. - MRI tcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "UsedPhysicalMemorySize"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI tcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "UsedPhysicalMemorySize"); getAttributeSubscriptionService().addMRIValueListener(tcad, this); - MRI tstcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "FreePhysicalMemorySize"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI tstcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "FreePhysicalMemorySize"); getAttributeSubscriptionService().addMRIValueListener(tstcad, this); for (int i = 0; i < 7; i++) { @@ -156,7 +156,7 @@ public void testGetSyntheticSubscription() { try { // Starting up a subscription on a one shot attribute. - MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsagePercent"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsagePercent"); getAttributeSubscriptionService().addMRIValueListener(synthad, this); synchronized (this) { @@ -175,7 +175,7 @@ try { // Starting up a subscription on a one shot attribute. - MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "PhysicalMemoryUsagePercent"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "PhysicalMemoryUsagePercent"); getAttributeSubscriptionService().addMRIValueListener(synthad, this); synchronized (this) { --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeValueTest.java 2019-02-27 20:12:38.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeValueTest.java 2019-02-27 20:12:37.000000000 +0100 @@ -112,12 +112,12 @@ private static List createCommonAttributesList(IConnectionHandle connectionHandle) { List fetchList = new ArrayList<>(); - fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad")); //$NON-NLS-1$ //$NON-NLS-2$ - fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "ProcessCpuLoad")); //$NON-NLS-1$ //$NON-NLS-2$ - fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "TotalPhysicalMemorySize")); //$NON-NLS-1$ - fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "UsedPhysicalMemorySize")); //$NON-NLS-1$ + fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad")); + fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "ProcessCpuLoad")); + fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "TotalPhysicalMemorySize")); + fetchList.add(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "UsedPhysicalMemorySize")); return fetchList; } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/CompositeDataSubscriptionTest.java 2019-02-27 20:12:38.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/CompositeDataSubscriptionTest.java 2019-02-27 20:12:38.000000000 +0100 @@ -66,8 +66,8 @@ public void testCompositeDataSubscription() { try { // Starting up a subscription on a one shot attribute. - MRI attributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", //$NON-NLS-1$ - "HeapMemoryUsage/used"); //$NON-NLS-1$ + MRI attributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", + "HeapMemoryUsage/used"); getAttributeSubscriptionService().addMRIValueListener(attributeDescriptor, this); IMRISubscription subscription = getAttributeSubscriptionService().getMRISubscription(attributeDescriptor); --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/JRockitPerfCounterMBeanTest.java 2019-02-27 20:12:39.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/JRockitPerfCounterMBeanTest.java 2019-02-27 20:12:39.000000000 +0100 @@ -53,7 +53,7 @@ } catch (Exception e) { fail(e.toString()); } - assertMin("Should at least have started one thread!", 1, startedThreads); //$NON-NLS-1$ + assertMin("Should at least have started one thread!", 1, startedThreads); } catch (Exception e) { fail(e.getMessage()); } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/JmxOperatingSystemTest.java 2019-02-27 20:12:40.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/JmxOperatingSystemTest.java 2019-02-27 20:12:39.000000000 +0100 @@ -49,12 +49,12 @@ public void testGetCPULoad() { try { Object data = getMBeanServerConnection().getAttribute(ConnectionToolkit.OPERATING_SYSTEM_BEAN_NAME, - "SystemCpuLoad"); //$NON-NLS-1$ + "SystemCpuLoad"); double cpuLoad = ((Number) data).doubleValue(); // A negative value is returned if load is not available - assertMax("CPU Load", 100.0, cpuLoad); //$NON-NLS-1$ - TestToolkit.println("CPU Load: " + cpuLoad); //$NON-NLS-1$ + assertMax("CPU Load", 100.0, cpuLoad); + TestToolkit.println("CPU Load: " + cpuLoad); } catch (Exception e) { fail(e.getMessage()); } @@ -64,12 +64,12 @@ public void testGetCPUJVMLoad() { try { Object data = getMBeanServerConnection().getAttribute(ConnectionToolkit.OPERATING_SYSTEM_BEAN_NAME, - "ProcessCpuLoad"); //$NON-NLS-1$ + "ProcessCpuLoad"); double jvmLoad = ((Number) data).doubleValue(); // A negative value is returned if load is not available - assertMax("JVM Load", 100.0, jvmLoad); //$NON-NLS-1$ - TestToolkit.println("JVM Load: " + jvmLoad); //$NON-NLS-1$ + assertMax("JVM Load", 100.0, jvmLoad); + TestToolkit.println("JVM Load: " + jvmLoad); } catch (Exception e) { fail(e.getMessage()); } @@ -79,9 +79,9 @@ public void testGetTotalPhysicalMemory() { try { Object data = getMBeanServerConnection().getAttribute(ConnectionToolkit.OPERATING_SYSTEM_BEAN_NAME, - "TotalPhysicalMemorySize"); //$NON-NLS-1$ + "TotalPhysicalMemorySize"); long totalPhysicalMemory = ((Number) data).longValue(); - assertMin("TotalPhysicalMemory", 256 * 1024 * 1024L, totalPhysicalMemory); //$NON-NLS-1$ + assertMin("TotalPhysicalMemory", 256 * 1024 * 1024L, totalPhysicalMemory); } catch (Exception e) { fail(e.getMessage()); } @@ -91,9 +91,9 @@ public void testGetUsedPhysicalMemory() { try { Object data = getMBeanServerConnection().getAttribute(ConnectionToolkit.OPERATING_SYSTEM_BEAN_NAME, - "UsedPhysicalMemorySize"); //$NON-NLS-1$ + "UsedPhysicalMemorySize"); long usedPhysicalMemory = ((Number) data).longValue(); - assertMin("UsedPhysicalMemory", 16 * 1024 * 1024L, usedPhysicalMemory); //$NON-NLS-1$ + assertMin("UsedPhysicalMemory", 16 * 1024 * 1024L, usedPhysicalMemory); } catch (Exception e) { fail(e.getMessage()); } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/JmxThreadTest.java 2019-02-27 20:12:40.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/JmxThreadTest.java 2019-02-27 20:12:40.000000000 +0100 @@ -53,7 +53,7 @@ } catch (Exception e) { fail(e.toString()); } - assertMin("Should at least have started one thread!", 1, startedThread); //$NON-NLS-1$ + assertMin("Should at least have started one thread!", 1, startedThread); } catch (Exception e) { fail(e.getMessage()); } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/MRIMetadataServiceTest.java 2019-02-27 20:12:41.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/MRIMetadataServiceTest.java 2019-02-27 20:12:41.000000000 +0100 @@ -59,16 +59,16 @@ * Tests the basic functionality of the {@link IMRIMetadataService}. */ public class MRIMetadataServiceTest extends RjmxTestCase { - private static final String MOOH = "Mooh!"; //$NON-NLS-1$ - private static final String MY_COW = "MyCow"; //$NON-NLS-1$ + private static final String MOOH = "Mooh!"; + private static final String MY_COW = "MyCow"; @Test public void testGetAttributeInfo() throws Exception { @SuppressWarnings("nls") IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "SystemCpuLoad")); //$NON-NLS-1$ + IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "SystemCpuLoad")); assertNotNull(info); assertNotNull(info.getMRI()); assertNotNull(info.getValueType()); @@ -78,10 +78,10 @@ @Test public void testGetMetadata() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "SystemCpuLoad")); //$NON-NLS-1$ + IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "SystemCpuLoad")); assertNotNull(info); String description = info.getDescription(); @@ -92,22 +92,22 @@ @Test public void testGetExtendedProperties() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); IMRIMetadata info = service - .getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/used")); //$NON-NLS-1$ //$NON-NLS-2$ + .getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/used")); assertNotNull(info); - assertTrue("Should be numerical", MRIMetadataToolkit.isNumerical(info)); //$NON-NLS-1$ - assertNotNull(info.getMetadata("color")); //$NON-NLS-1$ + assertTrue("Should be numerical", MRIMetadataToolkit.isNumerical(info)); + assertNotNull(info.getMetadata("color")); } @Test public void testGetNumericalMetadata() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - evaluateNumericalMetadata(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage"), false); //$NON-NLS-1$ //$NON-NLS-2$ + evaluateNumericalMetadata(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage"), false); evaluateNumericalMetadata(service, - new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/committed"), true); //$NON-NLS-1$ //$NON-NLS-2$ + new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/committed"), true); handle.close(); } @@ -119,17 +119,17 @@ @Test public void testAttributeTypes() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage"), //$NON-NLS-1$ //$NON-NLS-2$ + evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage"), MemoryUsage.class); - evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/committed"), //$NON-NLS-1$ //$NON-NLS-2$ + evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/committed"), Long.TYPE); - evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "JMImplementation:type=MBeanServerDelegate", //$NON-NLS-1$ - "ImplementationVendor"), String.class); //$NON-NLS-1$ - evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Runtime", "InputArguments"), //$NON-NLS-1$ //$NON-NLS-2$ + evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "JMImplementation:type=MBeanServerDelegate", + "ImplementationVendor"), String.class); + evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Runtime", "InputArguments"), List.class); - evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Runtime", "SystemProperties"), //$NON-NLS-1$ //$NON-NLS-2$ + evaluateAttributeType(service, new MRI(Type.ATTRIBUTE, "java.lang:type=Runtime", "SystemProperties"), Map.class); handle.close(); } @@ -139,12 +139,12 @@ assertNotNull(info); String typeName = stripGenericType(info.getValueType()); if (clazz.isPrimitive()) { - assertTrue("Not assignable!", clazz.getName().equals(typeName)); //$NON-NLS-1$ + assertTrue("Not assignable!", clazz.getName().equals(typeName)); } else { try { - assertTrue("Not assignable!", clazz.isAssignableFrom(Class.forName(typeName))); //$NON-NLS-1$ + assertTrue("Not assignable!", clazz.isAssignableFrom(Class.forName(typeName))); } catch (ClassNotFoundException e) { - assertTrue("Could not instantiate metadata type " + typeName, false); //$NON-NLS-1$ + assertTrue("Could not instantiate metadata type " + typeName, false); } } } @@ -160,28 +160,28 @@ @Test public void testSetMetadata() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "SystemCpuLoad")); //$NON-NLS-1$ + IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "SystemCpuLoad")); assertNotNull(info); - service.setMetadata(info.getMRI(), "testgegga", "Oh, testgegga!"); //$NON-NLS-1$ //$NON-NLS-2$ - String testGegga = (String) service.getMetadata(info.getMRI(), "testgegga"); //$NON-NLS-1$ - assertEquals("Oh, testgegga!", testGegga); //$NON-NLS-1$ + service.setMetadata(info.getMRI(), "testgegga", "Oh, testgegga!"); + String testGegga = (String) service.getMetadata(info.getMRI(), "testgegga"); + assertEquals("Oh, testgegga!", testGegga); handle.close(); } @Test public void testSetMetadataInDifferentConnections() throws Exception { - Assume.assumeTrue("Will not pass until BUG XYZ is fixed", false); //$NON-NLS-1$ + Assume.assumeTrue("Will not pass until BUG XYZ is fixed", false); IConnectionHandle handle1 = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()) - .connect("Test"); //$NON-NLS-1$ + .connect("Test"); IConnectionHandle handle2 = IServerHandle.create(LocalRJMXTestToolkit.createAlternativeDescriptor()) - .connect("Test"); //$NON-NLS-1$ + .connect("Test"); IMRIMetadataService service1 = LocalRJMXTestToolkit.getInfoService(handle1); IMRIMetadataService service2 = LocalRJMXTestToolkit.getInfoService(handle2); - MRI mri = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI mri = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); service1.setMetadata(mri, MY_COW, MOOH); assertNotNull(service1.getMetadata(mri, MY_COW)); assertEquals(MOOH, service1.getMetadata(mri, MY_COW)); @@ -192,31 +192,31 @@ @Test public void testOverrideDefultMetadata() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - MRI mri = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", //$NON-NLS-1$ - "HeapMemoryUsage/committed"); //$NON-NLS-1$ + MRI mri = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", + "HeapMemoryUsage/committed"); IMRIMetadata info = service.getMetadata(mri); String description = info.getDescription(); - String newDescription = "[ja]" + description; //$NON-NLS-1$ + String newDescription = "[ja]" + description; service.setMetadata(mri, IMRIMetadataProvider.KEY_DESCRIPTION, newDescription); - assertEquals("Description not updated", newDescription, info.getDescription()); //$NON-NLS-1$ + assertEquals("Description not updated", newDescription, info.getDescription()); handle.close(); } @Test public void testCompositeIsChild() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); IMRIMetadataService service = LocalRJMXTestToolkit.getInfoService(handle); - IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("MRI is not composite!", MRIMetadataToolkit.isComposite(info)); //$NON-NLS-1$ + IMRIMetadata info = service.getMetadata(new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage")); + assertTrue("MRI is not composite!", MRIMetadataToolkit.isComposite(info)); int childCount = 0; for (MRI mri : handle.getServiceOrThrow(IMRIService.class).getMRIs()) { if (info.getMRI().isChild(mri)) { childCount++; } } - assertEquals("There is not four composite children!", 4, childCount); //$NON-NLS-1$ + assertEquals("There is not four composite children!", 4, childCount); handle.close(); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/MRIMetadataToolkitTest.java 2019-02-27 20:12:42.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/MRIMetadataToolkitTest.java 2019-02-27 20:12:41.000000000 +0100 @@ -43,9 +43,9 @@ @Test public void testIsNumerical() { - assertTrue(MRIMetadataToolkit.isNumerical("int")); //$NON-NLS-1$ - assertTrue(MRIMetadataToolkit.isNumerical("java.lang.Integer")); //$NON-NLS-1$ - assertFalse(MRIMetadataToolkit.isNumerical("gurka")); //$NON-NLS-1$ + assertTrue(MRIMetadataToolkit.isNumerical("int")); + assertTrue(MRIMetadataToolkit.isNumerical("java.lang.Integer")); + assertFalse(MRIMetadataToolkit.isNumerical("gurka")); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/MultipleAttributeSubscriptionTest.java 2019-02-27 20:12:42.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/MultipleAttributeSubscriptionTest.java 2019-02-27 20:12:42.000000000 +0100 @@ -55,12 +55,12 @@ */ @Test public void testMultipleSubscriptions() throws Exception { - IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); //$NON-NLS-1$ + IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test"); ISubscriptionService service = handle.getServiceOrThrow(ISubscriptionService.class); - MRI cpuAttributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI cpuAttributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); service.addMRIValueListener(cpuAttributeDescriptor, this); - MRI loadAttributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "ProcessCpuLoad"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI loadAttributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "ProcessCpuLoad"); service.addMRIValueListener(loadAttributeDescriptor, this); synchronized (this) { --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/NotificationAttributeSubscriptionTest.java 2019-02-27 20:12:43.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/NotificationAttributeSubscriptionTest.java 2019-02-27 20:12:43.000000000 +0100 @@ -64,8 +64,8 @@ MRI descriptor = null; synchronized (this) { // Starting up a subscription on a one shot attribute. - descriptor = new MRI(Type.NOTIFICATION, "com.sun.management:type=GarbageCollectionAggregator", //$NON-NLS-1$ - "com.sun.management.gc.notification"); //$NON-NLS-1$ + descriptor = new MRI(Type.NOTIFICATION, "com.sun.management:type=GarbageCollectionAggregator", + "com.sun.management.gc.notification"); getAttributeSubscriptionService().addMRIValueListener(descriptor, this); secondThreadException = null; --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/internal/ConsoleAttributeInfoManagerTest.java 2019-02-27 20:12:44.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/internal/ConsoleAttributeInfoManagerTest.java 2019-02-27 20:12:44.000000000 +0100 @@ -57,29 +57,29 @@ @Test public void testGetAttributeInfo() { - MRI descriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$ - "AvailableProcessors"); //$NON-NLS-1$ + MRI descriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", + "AvailableProcessors"); IMRIMetadata info = m_manager.getMetadata(descriptor); assertNotNull(info); assertEquals(5000, ((IIntervalUpdatePolicy) UpdatePolicyToolkit.getUpdatePolicy(m_connectionHandle, info.getMRI())) .getIntervalTime()); - assertMin("Description shorter than expected.", 10, info.getDescription().length()); //$NON-NLS-1$ - assertMin("Display name shorter than expected.", 4, MRIMetadataToolkit.getDisplayName(m_connectionHandle, //$NON-NLS-1$ + assertMin("Description shorter than expected.", 10, info.getDescription().length()); + assertMin("Display name shorter than expected.", 4, MRIMetadataToolkit.getDisplayName(m_connectionHandle, info.getMRI()).length()); assertTrue(info.getMRI().getParentMRIs().length == 0); } @Test public void testCompositeIsChild() { - MRI descriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/committed"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI descriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/committed"); IMRIMetadata info = m_manager.getMetadata(descriptor); assertNotNull(info); - MRI parent = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI parent = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage"); IMRIMetadata parentInfo = m_manager.getMetadata(parent); assertNotNull(parentInfo); - assertTrue("Info not child to parent!", parent.isChild(descriptor)); //$NON-NLS-1$ + assertTrue("Info not child to parent!", parent.isChild(descriptor)); } @Before --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/internal/DummyConnectionHandle.java 2019-02-27 20:12:44.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/internal/DummyConnectionHandle.java 2019-02-27 20:12:44.000000000 +0100 @@ -60,8 +60,8 @@ * we would like to check this at compile time, but there was no way to do that yet. JSR * 308 and the Checker Framework should change that.) */ - throw new IllegalArgumentException("Will not be able to create dummy implementations of " //$NON-NLS-1$ - + serviceInterface.getName() + " since the service is not an interface"); //$NON-NLS-1$ + throw new IllegalArgumentException("Will not be able to create dummy implementations of " + + serviceInterface.getName() + " since the service is not an interface"); } T service = getServiceOrNull(serviceInterface); if (service == null) { @@ -119,7 +119,7 @@ @Override public String getDescription() { - return "Dummy"; //$NON-NLS-1$ + return "Dummy"; } @Override --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/internal/UpdatePolicyTest.java 2019-02-27 20:12:45.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/internal/UpdatePolicyTest.java 2019-02-27 20:12:45.000000000 +0100 @@ -67,7 +67,7 @@ private void helpUpdatePolicyLookup(MRI mri) throws Exception { IUpdatePolicy policy = UpdatePolicyToolkit.getUpdatePolicy(getConnectionHandle(), mri); - assertNotNull("Policy is null!", policy); //$NON-NLS-1$ + assertNotNull("Policy is null!", policy); } @Test @@ -170,11 +170,11 @@ } private MRI getExistingAttribute() { - return new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "UsedPhysicalMemorySize"); //$NON-NLS-1$ //$NON-NLS-2$ + return new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "UsedPhysicalMemorySize"); } private MRI getNonExistingAttribute() { - return new MRI(Type.ATTRIBUTE, "this.could.possible.not:really=exist,as=an", "attribute"); //$NON-NLS-1$ //$NON-NLS-2$ + return new MRI(Type.ATTRIBUTE, "this.could.possible.not:really=exist,as=an", "attribute"); } @Override --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/PropertyTestAttribute.java 2019-02-27 20:12:46.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/PropertyTestAttribute.java 2019-02-27 20:12:46.000000000 +0100 @@ -49,7 +49,7 @@ @Override public void setValue(MBeanServerConnection connection, Object value) { - throw new AssertionError("Not writeable!"); //$NON-NLS-1$ + throw new AssertionError("Not writeable!"); } @Override --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/SyntheticAttributesTest.java 2019-02-27 20:12:46.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/SyntheticAttributesTest.java 2019-02-27 20:12:46.000000000 +0100 @@ -61,43 +61,43 @@ import org.openjdk.jmc.rjmx.test.ServerHandleTestCase; public class SyntheticAttributesTest extends ServerHandleTestCase { - private final static String NEW_VALUE = "new value"; //$NON-NLS-1$ + private final static String NEW_VALUE = "new value"; protected IConnectionHandle localConnection; @Test public void testLookupDomain() throws Exception { - assertTrue("Could not find the test domain!", containsDomain("org.openjdk.jmc.test")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue("Could not find the test domain!", containsDomain("org.openjdk.jmc.test")); } @Test public void testFindNonSyntheticDomain() throws Exception { - assertTrue("Could not find the java.lang domain!", containsDomain("java.lang")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue("Could not find the java.lang domain!", containsDomain("java.lang")); } @Test public void testFindMBean() throws Exception { ObjectName mbean = getSyntheticAttributeDescriptor().getObjectName(); - assertTrue("Could not find the test mbean!", containsMBean(mbean)); //$NON-NLS-1$ + assertTrue("Could not find the test mbean!", containsMBean(mbean)); } @Test public void testFindNonSyntheticMBean() throws Exception { - ObjectName mbean = new ObjectName("java.lang:type=Runtime"); //$NON-NLS-1$ - assertTrue("Could not find the Runtime mbean!", containsMBean(mbean)); //$NON-NLS-1$ + ObjectName mbean = new ObjectName("java.lang:type=Runtime"); + assertTrue("Could not find the Runtime mbean!", containsMBean(mbean)); } @Test public void testGetAttribute() throws Exception { MRI descriptor = getSyntheticAttributeDescriptor(); Object value = getAttributeValue(descriptor); - assertNotNull("Could not retrieve the attribute value", value); //$NON-NLS-1$ + assertNotNull("Could not retrieve the attribute value", value); } @Test public void testGetCompositeAttribute() throws Exception { MRI descriptor = getCompositeAttributeDescriptor(); Object value = getAttributeValue(descriptor); - assertNotNull("Could not retrieve the attribute value", value); //$NON-NLS-1$ + assertNotNull("Could not retrieve the attribute value", value); } @Test @@ -105,7 +105,7 @@ MRI descriptor = getSyntheticAttributeDescriptor(); AttributeList list = getAttributeValues(descriptor.getObjectName(), new String[] {descriptor.getDataPath()}); Object value = list.get(0); - assertNotNull("Could not retrieve the attribute value", value); //$NON-NLS-1$ + assertNotNull("Could not retrieve the attribute value", value); } @Test @@ -117,7 +117,7 @@ names.add(ad.getDataPath()); } AttributeList list = getAttributeValues(objectName, names.toArray(new String[descriptors.length])); - assertEquals("Could not retrieve all values", descriptors.length, list.size()); //$NON-NLS-1$ + assertEquals("Could not retrieve all values", descriptors.length, list.size()); } @Test @@ -129,7 +129,7 @@ names.add(ad.getDataPath()); } Collection list = getAttributeValuesThroughMBeanHelperService(objectName, names); - assertEquals("Could not retrieve all values", descriptors.length, list.size()); //$NON-NLS-1$ + assertEquals("Could not retrieve all values", descriptors.length, list.size()); } @Test @@ -137,10 +137,10 @@ MRI syntheticDescriptor = getExtendedSyntheticAttributeDescriptor(); MRI nonsyntheticDescriptor = getNonSyntheticDescriptor(); ObjectName mbean = syntheticDescriptor.getObjectName(); - assertTrue("Not same MBean", mbean.equals(nonsyntheticDescriptor.getObjectName())); //$NON-NLS-1$ + assertTrue("Not same MBean", mbean.equals(nonsyntheticDescriptor.getObjectName())); String[] attributes = new String[] {nonsyntheticDescriptor.getDataPath(), syntheticDescriptor.getDataPath()}; AttributeList values = getAttributeValues(mbean, attributes); - assertTrue("Not two values", values.size() == 2); //$NON-NLS-1$ + assertTrue("Not two values", values.size() == 2); for (Object attribute : values) { assertNotNull(((Attribute) attribute).getValue()); } @@ -150,7 +150,7 @@ public void testGetExtendedAttribute() throws Exception { MRI descriptor = getExtendedSyntheticAttributeDescriptor(); Object value = getAttributeValue(descriptor); - assertNotNull("Could not retrieve the extended attribute value", value); //$NON-NLS-1$ + assertNotNull("Could not retrieve the extended attribute value", value); } @Test @@ -159,9 +159,9 @@ String newValue = NEW_VALUE; String oldValue = (String) getAttributeValue(descriptor); setAttributeValue(descriptor, newValue); - assertEquals("Could not set the attribute value!", NEW_VALUE, getAttributeValue(descriptor)); //$NON-NLS-1$ + assertEquals("Could not set the attribute value!", NEW_VALUE, getAttributeValue(descriptor)); setAttributeValue(descriptor, oldValue); - assertEquals("Could not restore old attribute value!", oldValue, getAttributeValue(descriptor)); //$NON-NLS-1$ + assertEquals("Could not restore old attribute value!", oldValue, getAttributeValue(descriptor)); } @Test @@ -170,9 +170,9 @@ String newValue = NEW_VALUE; String oldValue = (String) getAttributeValue(descriptor); setAttributeValue(descriptor, newValue); - assertEquals("Could not set the attribute value!", NEW_VALUE, getAttributeValue(descriptor)); //$NON-NLS-1$ + assertEquals("Could not set the attribute value!", NEW_VALUE, getAttributeValue(descriptor)); setAttributeValue(descriptor, oldValue); - assertEquals("Could not restore old attribute value!", oldValue, getAttributeValue(descriptor)); //$NON-NLS-1$ + assertEquals("Could not restore old attribute value!", oldValue, getAttributeValue(descriptor)); } @Test @@ -180,11 +180,11 @@ @SuppressWarnings("unchecked") Map values = (Map) getAttributeValue( getPropertiesSyntheticAttributeDescriptor()); - assertEquals("Gegga", values.get("denominator")); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Moja", values.get("numerator")); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals(100, values.get("someinteger")); //$NON-NLS-1$ - assertEquals(0.01f, values.get("factor")); //$NON-NLS-1$ - assertEquals(true, values.get("someboolean")); //$NON-NLS-1$ + assertEquals("Gegga", values.get("denominator")); + assertEquals("Moja", values.get("numerator")); + assertEquals(100, values.get("someinteger")); + assertEquals(0.01f, values.get("factor")); + assertEquals(true, values.get("someboolean")); } @Test @@ -217,11 +217,11 @@ setAttributeValues(new MRI[] {synthethicDescriptor, normalDescriptor}, new Object[] {newValue, Boolean.valueOf(!value.booleanValue())}); - assertEquals("Could not set the attribute value!", NEW_VALUE, getAttributeValue(synthethicDescriptor)); //$NON-NLS-1$ + assertEquals("Could not set the attribute value!", NEW_VALUE, getAttributeValue(synthethicDescriptor)); assertNotSame(value, getAttributeValue(normalDescriptor)); setAttributeValues(new MRI[] {synthethicDescriptor, normalDescriptor}, new Object[] {oldValue, value}); - assertEquals("Could not restore old attribute value!", oldValue, getAttributeValue(synthethicDescriptor)); //$NON-NLS-1$ + assertEquals("Could not restore old attribute value!", oldValue, getAttributeValue(synthethicDescriptor)); assertEquals(value, getAttributeValue(normalDescriptor)); } @@ -235,14 +235,14 @@ assertTrue(attributeInfo.isReadable()); assertTrue(attributeInfo.isWritable()); assertFalse(attributeInfo.isIs()); - assertEquals("java.lang.String", attributeInfo.getType()); //$NON-NLS-1$ + assertEquals("java.lang.String", attributeInfo.getType()); } @Test public void testExtendedMetadata() throws Exception { MRI descriptor = getExtendedSyntheticAttributeDescriptor(); MBeanInfo info = getMetadata(descriptor); - assertTrue(info.getDescription().contains("Extended")); //$NON-NLS-1$ + assertTrue(info.getDescription().contains("Extended")); MBeanAttributeInfo extendedInfo = null; for (MBeanAttributeInfo attr : info.getAttributes()) { @@ -255,7 +255,7 @@ assertTrue(attributeInfo.isReadable()); assertTrue(attributeInfo.isWritable()); assertFalse(attributeInfo.isIs()); - assertEquals("java.lang.String", attributeInfo.getType()); //$NON-NLS-1$ + assertEquals("java.lang.String", attributeInfo.getType()); } private MBeanAttributeInfo findCorresponding(MBeanAttributeInfo[] attributes, MRI descriptor) { @@ -268,7 +268,7 @@ } private MRI getPropertiesSyntheticAttributeDescriptor() { - return MRI.createFromQualifiedName("attribute://org.openjdk.jmc.test:type=Test/Properties"); //$NON-NLS-1$ + return MRI.createFromQualifiedName("attribute://org.openjdk.jmc.test:type=Test/Properties"); } private boolean containsMBean(ObjectName mbean) throws Exception { @@ -279,25 +279,25 @@ } private MRI getSyntheticAttributeDescriptor() { - return MRI.createFromQualifiedName("attribute://org.openjdk.jmc.test:type=Test/Test"); //$NON-NLS-1$ + return MRI.createFromQualifiedName("attribute://org.openjdk.jmc.test:type=Test/Test"); } private MRI getExtendedSyntheticAttributeDescriptor() { - return MRI.createFromQualifiedName("attribute://java.lang:type=ClassLoading/Test"); //$NON-NLS-1$ + return MRI.createFromQualifiedName("attribute://java.lang:type=ClassLoading/Test"); } private MRI getNonSyntheticDescriptor() { - return MRI.createFromQualifiedName("attribute://java.lang:type=ClassLoading/Verbose"); //$NON-NLS-1$ + return MRI.createFromQualifiedName("attribute://java.lang:type=ClassLoading/Verbose"); } private MRI getCompositeAttributeDescriptor() { - return MRI.createFromQualifiedName("attribute://java.lang:type=OperatingSystem/TotalPhysicalMemorySize"); //$NON-NLS-1$ + return MRI.createFromQualifiedName("attribute://java.lang:type=OperatingSystem/TotalPhysicalMemorySize"); } private MRI[] getCombinedAttributeDescriptors() { - return new MRI[] {MRI.createFromQualifiedName("attribute://java.lang:type=Memory/HeapMemoryUsage/used"), //$NON-NLS-1$ - MRI.createFromQualifiedName("attribute://java.lang:type=Memory/NonHeapMemoryUsage/max"), //$NON-NLS-1$ - MRI.createFromQualifiedName("attribute://java.lang:type=Memory/Verbose")}; //$NON-NLS-1$ + return new MRI[] {MRI.createFromQualifiedName("attribute://java.lang:type=Memory/HeapMemoryUsage/used"), + MRI.createFromQualifiedName("attribute://java.lang:type=Memory/NonHeapMemoryUsage/max"), + MRI.createFromQualifiedName("attribute://java.lang:type=Memory/Verbose")}; } private boolean containsDomain(String checkDomain) throws Exception { @@ -360,7 +360,7 @@ @Before public void setUp() throws Exception { super.setUp(); - localConnection = getDefaultServer().connect("Test"); //$NON-NLS-1$ + localConnection = getDefaultServer().connect("Test"); } @Override --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/SyntheticNotificationTest.java 2019-02-27 20:12:47.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/SyntheticNotificationTest.java 2019-02-27 20:12:47.000000000 +0100 @@ -83,7 +83,7 @@ @Before public void setUp() throws Exception { super.setUp(); - handle = getDefaultServer().connect("Test"); //$NON-NLS-1$ + handle = getDefaultServer().connect("Test"); connection = handle.getServiceOrThrow(MBeanServerConnection.class); gotNotification = false; } @@ -99,7 +99,7 @@ @Test public void testGetNotificationMetadata() throws InstanceNotFoundException, IntrospectionException, MalformedObjectNameException, ReflectionException, NullPointerException, IOException { - MBeanInfo info = connection.getMBeanInfo(new ObjectName("org.openjdk.jmc.test:type=Test")); //$NON-NLS-1$ + MBeanInfo info = connection.getMBeanInfo(new ObjectName("org.openjdk.jmc.test:type=Test")); assertTrue(info.getNotifications().length > 0); } @@ -109,7 +109,7 @@ @Test public void testCombinedMetadata() throws InstanceNotFoundException, IntrospectionException, MalformedObjectNameException, ReflectionException, NullPointerException, IOException { - MBeanInfo info = connection.getMBeanInfo(new ObjectName("org.openjdk.jmc.test:type=Test")); //$NON-NLS-1$ + MBeanInfo info = connection.getMBeanInfo(new ObjectName("org.openjdk.jmc.test:type=Test")); assertTrue(info.getNotifications().length > 0); assertTrue(info.getAttributes().length > 0); } @@ -120,7 +120,7 @@ @Test public void testOverloadMetadata() throws InstanceNotFoundException, IntrospectionException, MalformedObjectNameException, ReflectionException, NullPointerException, IOException { - MBeanInfo info = connection.getMBeanInfo(new ObjectName("java.lang:type=ClassLoading")); //$NON-NLS-1$ + MBeanInfo info = connection.getMBeanInfo(new ObjectName("java.lang:type=ClassLoading")); assertTrue(info.getNotifications().length > 0); assertTrue(info.getAttributes().length > 0); } @@ -131,17 +131,17 @@ @Test public void testShadowMetadata() throws InstanceNotFoundException, IntrospectionException, MalformedObjectNameException, ReflectionException, NullPointerException, IOException { - Assume.assumeTrue("FIXME: Shadowing does not work yet!", false); //$NON-NLS-1$ - MBeanInfo info = connection.getMBeanInfo(new ObjectName("java.lang:type=Memory")); //$NON-NLS-1$ + Assume.assumeTrue("FIXME: Shadowing does not work yet!", false); + MBeanInfo info = connection.getMBeanInfo(new ObjectName("java.lang:type=Memory")); assertTrue(info.getNotifications().length > 0); for (MBeanNotificationInfo notificationInfo : info.getNotifications()) { - if (notificationInfo.getName().equals("java.management.memory.collection.threshold.exceeded")) { //$NON-NLS-1$ - assertTrue("Failed to shadow description", notificationInfo.getDescription().contains("shadow")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Got the wrong type:" + notificationInfo.getNotifTypes()[0], "int".equals(notificationInfo //$NON-NLS-1$ //$NON-NLS-2$ + if (notificationInfo.getName().equals("java.management.memory.collection.threshold.exceeded")) { + assertTrue("Failed to shadow description", notificationInfo.getDescription().contains("shadow")); + assertTrue("Got the wrong type:" + notificationInfo.getNotifTypes()[0], "int".equals(notificationInfo .getNotifTypes()[0])); } else { - assertTrue("Should NOT contain shadow!", !notificationInfo.getDescription().contains("shadow")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Should not be int!", !"int".equals(notificationInfo.getNotifTypes()[0])); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue("Should NOT contain shadow!", !notificationInfo.getDescription().contains("shadow")); + assertTrue("Should not be int!", !"int".equals(notificationInfo.getNotifTypes()[0])); } } } @@ -151,16 +151,16 @@ NullPointerException, IOException, InterruptedException, ListenerNotFoundException { Notification notif = null; SyntheticNotificationListener listener = new SyntheticNotificationListener(); - ObjectName testMBean = new ObjectName("org.openjdk.jmc.test:type=Test"); //$NON-NLS-1$ + ObjectName testMBean = new ObjectName("org.openjdk.jmc.test:type=Test"); connection.addNotificationListener(testMBean, listener, null, null); synchronized (this) { this.wait(30000); notif = listener.getLastNotification(); } - assertTrue("Never got any notification!", gotNotification); //$NON-NLS-1$ + assertTrue("Never got any notification!", gotNotification); assertNotNull(notif); - assertTrue("Expected a user data > 0!", ((Integer) notif.getUserData()) > 0); //$NON-NLS-1$ - assertTrue("Expected Woho!", notif.getMessage().startsWith("Woho!")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue("Expected a user data > 0!", ((Integer) notif.getUserData()) > 0); + assertTrue("Expected Woho!", notif.getMessage().startsWith("Woho!")); connection.removeNotificationListener(testMBean, listener, null, null); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/TestAttribute.java 2019-02-27 20:12:48.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/synthetic/TestAttribute.java 2019-02-27 20:12:48.000000000 +0100 @@ -40,7 +40,7 @@ * A synthetic test attribute that can be set and read. */ public class TestAttribute extends AbstractSyntheticAttribute { - private String lastValue = "Mission Control <3"; //$NON-NLS-1$ + private String lastValue = "Mission Control <3"; @Override public Object getValue(MBeanServerConnection connection) { @@ -52,7 +52,7 @@ if (value == null || value instanceof String) { lastValue = (String) value; } else { - throw new AssertionError(String.format("The value was not a String! (%s)", value.getClass())); //$NON-NLS-1$ + throw new AssertionError(String.format("The value was not a String! (%s)", value.getClass())); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/testutil/JVMKeepAlive.java 2019-02-27 20:12:48.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/testutil/JVMKeepAlive.java 2019-02-27 20:12:48.000000000 +0100 @@ -53,8 +53,8 @@ private static int m_aliveTime; private static long m_startTime = System.currentTimeMillis(); public static final int DEFAULT_KILL_PORT = 4713; - public static final byte[] KILL_MESSAGE = "KILL".getBytes(); //$NON-NLS-1$ - private static final String PROPERTY_KILL_PORT = "jmc.test.kill.port"; //$NON-NLS-1$ + public static final byte[] KILL_MESSAGE = "KILL".getBytes(); + private static final String PROPERTY_KILL_PORT = "jmc.test.kill.port"; /** * Small server that listens for datagram packets on the specified port and kills the JVM when @@ -76,8 +76,8 @@ } catch (NumberFormatException nfe) { port = DEFAULT_KILL_PORT; } - System.out.println(buildClassNamePrefix(JVMKeepAliveSlayer.class) + "Send kill command to port " + port //$NON-NLS-1$ - + " to kill me."); //$NON-NLS-1$ + System.out.println(buildClassNamePrefix(JVMKeepAliveSlayer.class) + "Send kill command to port " + port + + " to kill me."); try { try (DatagramSocket s = new DatagramSocket(port)) { @@ -89,7 +89,7 @@ } catch (IOException e) { System.out.println(buildClassNamePrefix(JVMKeepAliveSlayer.class) + e.getMessage()); System.out.println(buildClassNamePrefix(JVMKeepAliveSlayer.class) - + "Proceeding without JRockitKeepAliveSlayer..."); //$NON-NLS-1$ + + "Proceeding without JRockitKeepAliveSlayer..."); return; } } @@ -97,7 +97,7 @@ } private static String buildClassNamePrefix(Class clazz) { - return '[' + clazz.getName() + "] "; //$NON-NLS-1$ + return '[' + clazz.getName() + "] "; } /** @@ -115,7 +115,7 @@ Thread t = new Thread(new JVMKeepAliveSlayer(), buildClassNamePrefix(JVMKeepAliveSlayer.class)); t.start(); - System.out.println(buildClassNamePrefix(JVMKeepAlive.class) + "Started..."); //$NON-NLS-1$ + System.out.println(buildClassNamePrefix(JVMKeepAlive.class) + "Started..."); while (m_aliveTime == 0 || (System.currentTimeMillis() - m_startTime) / 1000 <= m_aliveTime) { try { --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/testutil/TestToolkit.java 2019-02-27 20:12:49.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/testutil/TestToolkit.java 2019-02-27 20:12:49.000000000 +0100 @@ -36,13 +36,13 @@ * Toolkit for testing related methods. */ public class TestToolkit { - public final static String PROPERTY_TESTS_QUIET = "jmc.test.rjmx.quiet"; //$NON-NLS-1$ + public final static String PROPERTY_TESTS_QUIET = "jmc.test.rjmx.quiet"; static { String quiet = System.getProperty(PROPERTY_TESTS_QUIET); // If unset, use quiet as default. if (quiet == null) { - System.setProperty(PROPERTY_TESTS_QUIET, "true"); //$NON-NLS-1$ + System.setProperty(PROPERTY_TESTS_QUIET, "true"); } } --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/triggers/NotificationActionCallback.java 2019-02-27 20:12:50.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/triggers/NotificationActionCallback.java 2019-02-27 20:12:50.000000000 +0100 @@ -46,12 +46,12 @@ /** * Action name. */ - public static final String NAME = "Callback action"; //$NON-NLS-1$ + public static final String NAME = "Callback action"; /** * Description. Won't be used for this class. */ - public static final String DESCRIPTION = "Blablablablablablabla"; //$NON-NLS-1$ + public static final String DESCRIPTION = "Blablablablablablabla"; private final NotificationActionCallbackReceiver m_receiver; --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/triggers/NotificationModelTest.java 2019-02-27 20:12:51.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/triggers/NotificationModelTest.java 2019-02-27 20:12:50.000000000 +0100 @@ -76,9 +76,9 @@ m_notificationRegistry.registerRule(rule, serverGuid); Collection rulesList = m_notificationRegistry.getRegisteredRules(serverGuid); - assertTrue("Failed to register anything at all!", rulesList.size() > 0); //$NON-NLS-1$ + assertTrue("Failed to register anything at all!", rulesList.size() > 0); TriggerRule regRule = rulesList.iterator().next(); - assertTrue("Failed rule comparison!", regRule == rule); //$NON-NLS-1$ + assertTrue("Failed rule comparison!", regRule == rule); } /** @@ -94,18 +94,18 @@ String serverGuid = m_connectionHandle.getServerDescriptor().getGUID(); m_notificationRegistry.registerRule(rule, serverGuid); m_notificationRegistry.unregisterRule(rule, serverGuid); - assertTrue("Failed to unregister rule!", m_notificationRegistry.getRegisteredRules(serverGuid).size() == 0); //$NON-NLS-1$ + assertTrue("Failed to unregister rule!", m_notificationRegistry.getRegisteredRules(serverGuid).size() == 0); } private TriggerRule createTestNotificationRule() throws Exception { assertTrue(m_connectionHandle.isConnected()); NotificationTrigger trigger = new NotificationTrigger(); - MRI mri = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/used"); //$NON-NLS-1$ //$NON-NLS-2$ + MRI mri = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsage/used"); IMRIMetadata metadata = getMRIMetadataService().getMetadata(mri); IUnit unit = UnitLookup.getUnitOrNull(metadata.getUnitString()); trigger.setAttributeDescriptor(mri); trigger.setValueEvaluator(new ValueEvaluatorNumberMin(unit.quantity(100000))); - return new TriggerRule("TestRule", trigger, new NotificationActionCallback(this)); //$NON-NLS-1$ + return new TriggerRule("TestRule", trigger, new NotificationActionCallback(this)); } /** --- old/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/triggers/NotificationTriggerAndRuleTest.java 2019-02-27 20:12:51.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/triggers/NotificationTriggerAndRuleTest.java 2019-02-27 20:12:51.000000000 +0100 @@ -87,11 +87,11 @@ @Test public void testUnregisterRule() throws FailedLoginException, IOException { TriggerRule rule = createTestNotificationRule( - new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad")); //$NON-NLS-1$ //$NON-NLS-2$ + new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad")); String serverGuid = UUID.randomUUID().toString(); m_notificationRegistry.registerRule(rule, serverGuid); m_notificationRegistry.unregisterRule(rule, serverGuid); - assertEquals("Failed to remove rule!", m_notificationRegistry.getRegisteredRules(serverGuid).size(), 0); //$NON-NLS-1$ + assertEquals("Failed to remove rule!", m_notificationRegistry.getRegisteredRules(serverGuid).size(), 0); } /** @@ -108,17 +108,17 @@ String serverGuid = m_connectionHandle.getServerDescriptor().getGUID(); m_notificationRegistry.activateTriggersFor(m_connectionHandle); m_notificationRegistry.registerRule(rule, serverGuid); - assertEquals("Didn't register rule!", 1, m_notificationRegistry.getRegisteredRules(serverGuid).size()); //$NON-NLS-1$ + assertEquals("Didn't register rule!", 1, m_notificationRegistry.getRegisteredRules(serverGuid).size()); synchronized (m_notifObj) { try { m_notifObj.wait(TIMEOUT); } catch (InterruptedException e) { - fail("Timedout while waiting for notification!"); //$NON-NLS-1$ + fail("Timedout while waiting for notification!"); } } m_notificationRegistry.unregisterRule(rule, serverGuid); - assertNotNull("Never received any notification!", m_lastEvent); //$NON-NLS-1$ + assertNotNull("Never received any notification!", m_lastEvent); } /** @@ -136,22 +136,22 @@ assertTrue(!aRule.isComplete()); TriggerRule anotherRule = createTestNotificationRule( - new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad")); //$NON-NLS-1$ //$NON-NLS-2$ + new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad")); assertTrue(anotherRule.hasAction()); assertTrue(!anotherRule.hasConstraints()); assertTrue(anotherRule.hasTrigger()); assertTrue(anotherRule.isComplete()); - assertEquals("TestRule", anotherRule.toString()); //$NON-NLS-1$ - assertEquals("TestRule", anotherRule.getName()); //$NON-NLS-1$ + assertEquals("TestRule", anotherRule.toString()); + assertEquals("TestRule", anotherRule.getName()); - aRule.setName("Abrakadabra"); //$NON-NLS-1$ + aRule.setName("Abrakadabra"); // Test sorting assertTrue(aRule.compareTo(anotherRule) < 0); } private TriggerRule createTestNotificationRule(MRI descriptor) { NotificationTrigger trigger = new NotificationTrigger(descriptor, new ValueEvaluatorBoolean()); - return new TriggerRule("TestRule", trigger, new NotificationActionCallback(this)); //$NON-NLS-1$ + return new TriggerRule("TestRule", trigger, new NotificationActionCallback(this)); } /** @@ -160,7 +160,7 @@ @Override public void onNotificationAction(TriggerEvent e) { synchronized (m_notifObj) { - TestToolkit.println("Got a callback: " + e); //$NON-NLS-1$ + TestToolkit.println("Got a callback: " + e); m_lastEvent = e; m_notifObj.notify(); } @@ -174,8 +174,8 @@ * @throws IOException */ protected TriggerRule createRule() throws Exception { - MRI uptimeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Runtime", //$NON-NLS-1$ - "Uptime"); //$NON-NLS-1$ + MRI uptimeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=Runtime", + "Uptime"); long uptime = ConnectionToolkit.getRuntimeBean(getMBeanServerConnection()).getUptime(); IMRIMetadata metadata = getMRIMetadataService().getMetadata(uptimeDescriptor); IUnit unit = UnitLookup.getUnitOrDefault(metadata.getUnitString()); --- old/application/tests/org.openjdk.jmc.ui.common.test/src/test/java/org/openjdk/jmc/ui/common/jvm/JVMCommandLineToolkitTest.java 2019-02-27 20:12:52.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.ui.common.test/src/test/java/org/openjdk/jmc/ui/common/jvm/JVMCommandLineToolkitTest.java 2019-02-27 20:12:52.000000000 +0100 @@ -45,37 +45,37 @@ @Test public void testEclipseJar() { assertEquals( - "D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar", //$NON-NLS-1$ + "D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar", JVMCommandLineToolkit.getMainClassOrJar( - "D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -os win32 -ws win32 -arch x86_64 -showsplash -launcher D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\eclipse.exe -name Eclipse --launcher.library D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.0.v20100503\\eclipse_1307.dll -startup D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -exitdata 1528_5c -product org.eclipse.epp.package.rcp.product -showlocation -vm d:/jrockits/R28.0.1_R28.0.1-21_1.6.0/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -jar D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar")); //$NON-NLS-1$ + "D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -os win32 -ws win32 -arch x86_64 -showsplash -launcher D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\eclipse.exe -name Eclipse --launcher.library D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.0.v20100503\\eclipse_1307.dll -startup D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -exitdata 1528_5c -product org.eclipse.epp.package.rcp.product -showlocation -vm d:/jrockits/R28.0.1_R28.0.1-21_1.6.0/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -jar D:\\eclipse\\install\\eclipse-rcp-helios-win32-x86_64\\eclipse\\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar")); } @Test public void testSimpleClass() { - assertEquals("org.openjdk.jmc.test.Runner1", //$NON-NLS-1$ - JVMCommandLineToolkit.getMainClassOrJar("org.openjdk.jmc.test.Runner1")); //$NON-NLS-1$ + assertEquals("org.openjdk.jmc.test.Runner1", + JVMCommandLineToolkit.getMainClassOrJar("org.openjdk.jmc.test.Runner1")); } @Test public void testJarAndMoreFlags() { - assertEquals("/path1/path2/mc.jar", JVMCommandLineToolkit //$NON-NLS-1$ - .getMainClassOrJar("/path1/path2/mc.jar -consoleLog -data /work/path3")); //$NON-NLS-1$ + assertEquals("/path1/path2/mc.jar", JVMCommandLineToolkit + .getMainClassOrJar("/path1/path2/mc.jar -consoleLog -data /work/path3")); } @Test public void testSlashClassAndFlags() { - assertEquals("org/netbeans/Main", JVMCommandLineToolkit.getMainClassOrJar("org/netbeans/Main --branding nb")); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("org/netbeans/Main", JVMCommandLineToolkit.getMainClassOrJar("org/netbeans/Main --branding nb")); } @Test public void testEclipsClassAndFlOags() { - assertEquals("org.eclipse.equinox.launcher.Main", JVMCommandLineToolkit.getMainClassOrJar( //$NON-NLS-1$ - "org.eclipse.equinox.launcher.Main -launcher C:\\path1\\path2\\eclipse\\eclipse.exe -name Eclipse -showsplash 600 -product org.openjdk.jmc.rcp.application.product -data C:\\workspaces\\mcmain/../jmc_rcp -configuration file:C:/workspaces/mcmain/.metadata/.plugins/org.eclipse.pde.core/JMC RCP/ -dev file:C:/workspaces/mcmain/.metadata/.plugins/org.eclipse.pde.core/JMC RCP/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog")); //$NON-NLS-1$ + assertEquals("org.eclipse.equinox.launcher.Main", JVMCommandLineToolkit.getMainClassOrJar( + "org.eclipse.equinox.launcher.Main -launcher C:\\path1\\path2\\eclipse\\eclipse.exe -name Eclipse -showsplash 600 -product org.openjdk.jmc.rcp.application.product -data C:\\workspaces\\mcmain/../jmc_rcp -configuration file:C:/workspaces/mcmain/.metadata/.plugins/org.eclipse.pde.core/JMC RCP/ -dev file:C:/workspaces/mcmain/.metadata/.plugins/org.eclipse.pde.core/JMC RCP/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog")); } @Test public void testEmptyString() { - assertEquals("", JVMCommandLineToolkit.getMainClassOrJar("")); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("", JVMCommandLineToolkit.getMainClassOrJar("")); } @Test @@ -87,40 +87,40 @@ @Test public void testCpAndClass() { - assertEquals("org.openjdk.jmc.test.Runner2", //$NON-NLS-1$ - JVMCommandLineToolkit.getJavaCommandLine("-cp application.jar org.openjdk.jmc.test.Runner2")); //$NON-NLS-1$ + assertEquals("org.openjdk.jmc.test.Runner2", + JVMCommandLineToolkit.getJavaCommandLine("-cp application.jar org.openjdk.jmc.test.Runner2")); } @Test public void testCpWithSpaceDashAndClass() { - assertEquals("org.openjdk.jmc.test.Runner2", JVMCommandLineToolkit //$NON-NLS-1$ - .getJavaCommandLine("-cp \"foo -bar/application.jar\" org.openjdk.jmc.test.Runner2")); //$NON-NLS-1$ + assertEquals("org.openjdk.jmc.test.Runner2", JVMCommandLineToolkit + .getJavaCommandLine("-cp \"foo -bar/application.jar\" org.openjdk.jmc.test.Runner2")); } @Test public void testCpPropClassAndArg() { - assertEquals("org.openjdk.jmc.test.Runner3 arg", JVMCommandLineToolkit //$NON-NLS-1$ - .getJavaCommandLine("-cp application.jar -Darg1=foo org.openjdk.jmc.test.Runner3 arg")); //$NON-NLS-1$ + assertEquals("org.openjdk.jmc.test.Runner3 arg", JVMCommandLineToolkit + .getJavaCommandLine("-cp application.jar -Darg1=foo org.openjdk.jmc.test.Runner3 arg")); } @Test public void testJarFlag() { - assertEquals("C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4", //$NON-NLS-1$ + assertEquals("C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4", JVMCommandLineToolkit.getJavaCommandLine( - "-jar C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4")); //$NON-NLS-1$ + "-jar C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4")); } @Test public void testClassPathJarAndFlags() { // not really a valid cmdline - assertEquals("C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4", //$NON-NLS-1$ + assertEquals("C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4", JVMCommandLineToolkit.getJavaCommandLine( - "-classpath application.jar -jar C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4")); //$NON-NLS-1$ + "-classpath application.jar -jar C:/path1/path2/mc.jar -consoleLog -data C:/path3/path4")); } @Test public void testEmptyString2() { - assertEquals("", JVMCommandLineToolkit.getJavaCommandLine("")); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("", JVMCommandLineToolkit.getJavaCommandLine("")); } @Test --- old/application/tests/org.openjdk.jmc.ui.common.test/src/test/java/org/openjdk/jmc/ui/common/security/SecureStoreTest.java 2019-02-27 20:12:53.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.ui.common.test/src/test/java/org/openjdk/jmc/ui/common/security/SecureStoreTest.java 2019-02-27 20:12:52.000000000 +0100 @@ -54,11 +54,11 @@ @SuppressWarnings("nls") public class SecureStoreTest { - private final String pwd = "test"; //$NON-NLS-1$ - private final String family = "family"; //$NON-NLS-1$ - private final String family2 = "family2"; //$NON-NLS-1$ - private final String value1 = "1"; //$NON-NLS-1$ - private final String value2 = "2"; //$NON-NLS-1$ + private final String pwd = "test"; + private final String family = "family"; + private final String family2 = "family2"; + private final String value1 = "1"; + private final String value2 = "2"; @BeforeClass public static void beforeClass() { @@ -89,7 +89,7 @@ SecureStore store = new SecureStore(prefs); store.initialize(); store.setPassword(pwd); - store.setEncryptionCipher("UnknownCipher"); //$NON-NLS-1$ + store.setEncryptionCipher("UnknownCipher"); } @Test @@ -136,7 +136,7 @@ store.insert(null, true, value1); store = new SecureStore(prefs); try { - store.initialize("other"); //$NON-NLS-1$ + store.initialize("other"); fail(); } catch (Exception e) { } @@ -155,7 +155,7 @@ store.initialize(pwd); assertEquals(cipher, store.getEncryptionCipher()); assertEquals(value1, store.get(key)); - System.out.println(cipher + " tested ok"); //$NON-NLS-1$ + System.out.println(cipher + " tested ok"); } } @@ -168,9 +168,9 @@ String key = store.insert(null, true, value1); store = new SecureStore(prefs); store.initialize(pwd); - store.setPassword("newPwd"); //$NON-NLS-1$ + store.setPassword("newPwd"); store = new SecureStore(prefs); - store.initialize("newPwd"); //$NON-NLS-1$ + store.initialize("newPwd"); assertEquals(value1, store.get(key)); } --- old/application/tests/org.openjdk.jmc.ui.test/src/test/java/org/openjdk/jmc/ui/test/fields/FilterMatcherTest.java 2019-02-27 20:12:53.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.ui.test/src/test/java/org/openjdk/jmc/ui/test/fields/FilterMatcherTest.java 2019-02-27 20:12:53.000000000 +0100 @@ -50,37 +50,37 @@ @Test public void testMatch() throws Exception { - assertTrue(match("", "")); //$NON-NLS-1$ //$NON-NLS-2$ - assertFalse(match("foo", "")); //$NON-NLS-1$ //$NON-NLS-2$ - assertFalse(match("", "foo")); //$NON-NLS-1$ //$NON-NLS-2$ - - assertTrue(match("foo", "foo")); //$NON-NLS-1$ //$NON-NLS-2$ - assertFalse(match("foo", "bar")); //$NON-NLS-1$ //$NON-NLS-2$ - - assertTrue(match("foo", "f?o")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "???")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("f?o", "???")); //$NON-NLS-1$ //$NON-NLS-2$ - assertFalse(match("???", "foo")); //$NON-NLS-1$ //$NON-NLS-2$ - - assertTrue(match("", "*")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("", "**")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "*")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "**")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "*foo*")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "**f**o**o**")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("barfoobar", "*foo*")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue(match("", "")); + assertFalse(match("foo", "")); + assertFalse(match("", "foo")); + + assertTrue(match("foo", "foo")); + assertFalse(match("foo", "bar")); + + assertTrue(match("foo", "f?o")); + assertTrue(match("foo", "???")); + assertTrue(match("f?o", "???")); + assertFalse(match("???", "foo")); + + assertTrue(match("", "*")); + assertTrue(match("", "**")); + assertTrue(match("foo", "*")); + assertTrue(match("foo", "**")); + assertTrue(match("foo", "*foo*")); + assertTrue(match("foo", "**f**o**o**")); + assertTrue(match("barfoobar", "*foo*")); - assertTrue(matchCaseUnsensitive("fOo", "foO")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue(matchCaseUnsensitive("fOo", "foO")); } @Test public void testRegexpMatch() throws Exception { - assertTrue(match("foo", "regexp:.*")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "regexp:fo.")); //$NON-NLS-1$ //$NON-NLS-2$ - assertFalse(match("foo", "regexp:f.")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "regexp:.o.")); //$NON-NLS-1$ //$NON-NLS-2$ - assertFalse(match("foo", "regexp:bo.")); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue(match("foo", "regexp: .o.")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue(match("foo", "regexp:.*")); + assertTrue(match("foo", "regexp:fo.")); + assertFalse(match("foo", "regexp:f.")); + assertTrue(match("foo", "regexp:.o.")); + assertFalse(match("foo", "regexp:bo.")); + assertTrue(match("foo", "regexp: .o.")); // assertFalse(match("foo", "regexp:*")); } } --- old/application/tests/org.openjdk.jmc.ui.test/src/test/java/org/openjdk/jmc/ui/test/util/ProgressCircleTester.java 2019-02-27 20:12:54.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.ui.test/src/test/java/org/openjdk/jmc/ui/test/util/ProgressCircleTester.java 2019-02-27 20:12:54.000000000 +0100 @@ -86,6 +86,6 @@ } private static String getStatusText(ProgressCircle c) { - return String.format("Antialiasing is %s. Press mouse to change!", c.isAntialiasing() ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return String.format("Antialiasing is %s. Press mouse to change!", c.isAntialiasing() ? "on" : "off"); } } --- old/application/uitests/org.openjdk.jmc.console.uitest/src/test/java/org/openjdk/jmc/console/uitest/mbeanhelpers/TestRunner.java 2019-02-27 20:12:55.000000000 +0100 +++ new/application/uitests/org.openjdk.jmc.console.uitest/src/test/java/org/openjdk/jmc/console/uitest/mbeanhelpers/TestRunner.java 2019-02-27 20:12:54.000000000 +0100 @@ -58,7 +58,7 @@ public void stopRunning() { loopRun(false); runLast(); - System.out.println("Stopping " + this.getClass().getName()); //$NON-NLS-1$ + System.out.println("Stopping " + this.getClass().getName()); } public void setArgs(String[] args) { @@ -80,7 +80,7 @@ @Override public void run() { - System.out.println("Starting " + this.getClass().getName()); //$NON-NLS-1$ + System.out.println("Starting " + this.getClass().getName()); runFirst(); while (loopRun) { runLoop(); --- old/application/uitests/org.openjdk.jmc.console.uitest/src/test/java/org/openjdk/jmc/console/uitest/mbeanhelpers/Testable.java 2019-02-27 20:12:55.000000000 +0100 +++ new/application/uitests/org.openjdk.jmc.console.uitest/src/test/java/org/openjdk/jmc/console/uitest/mbeanhelpers/Testable.java 2019-02-27 20:12:55.000000000 +0100 @@ -117,7 +117,7 @@ // @jmx.mbean.description("Abstract Webservice deployer") // @javax.management.ManagedAttribute public Testable() { - this("Hello there"); //$NON-NLS-1$ + this("Hello there"); } public Testable(String s) { @@ -168,7 +168,7 @@ _long = Long.valueOf(Long.MAX_VALUE); nullLong = null; - bigInteger = new BigInteger("123456789012345678901234567890"); //$NON-NLS-1$ + bigInteger = new BigInteger("123456789012345678901234567890"); nullBigInteger = null; primitiveFloat = Float.MIN_VALUE; @@ -179,7 +179,7 @@ _double = Double.valueOf(Math.PI); nullDouble = null; - string = "Hello there"; //$NON-NLS-1$ + string = "Hello there"; nullString = null; primitiveArray = new int[] {1, 2, 3}; @@ -192,28 +192,28 @@ } nullStringArray = null; - multiArray = new String[][] {{"1-1", "1-2", "1-3"}, {"2-2", "2-3"}, {null}, null}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + multiArray = new String[][] {{"1-1", "1-2", "1-3"}, {"2-2", "2-3"}, {null}, null}; nullMultiArray = null; - collection = Arrays.asList("one", "two", "three"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + collection = Arrays.asList("one", "two", "three"); map = new Hashtable<>(); - map.put("one", Integer.valueOf(1)); //$NON-NLS-1$ - map.put("two", Integer.valueOf(2)); //$NON-NLS-1$ - map.put("three", Integer.valueOf(3)); //$NON-NLS-1$ + map.put("one", Integer.valueOf(1)); + map.put("two", Integer.valueOf(2)); + map.put("three", Integer.valueOf(3)); largeMap = new Hashtable<>(); for (int i = 0; i < 256; i += 1) { - largeMap.put("nr_" + i, Integer.valueOf(i)); //$NON-NLS-1$ + largeMap.put("nr_" + i, Integer.valueOf(i)); } - editableObjectArray = new Object[] {1, Float.valueOf(1.5f), "two", null}; //$NON-NLS-1$ + editableObjectArray = new Object[] {1, Float.valueOf(1.5f), "two", null}; editableCollection = new ArrayList<>(); editableCollection.add(1); editableCollection.add(Float.valueOf(1.5f)); - editableCollection.add("two"); //$NON-NLS-1$ + editableCollection.add("two"); editableMap = new Hashtable<>(); editableMap.put(0, 1); editableMap.put(1, Float.valueOf(1.5f)); - editableMap.put(2, "two"); //$NON-NLS-1$ + editableMap.put(2, "two"); } // Boolean @@ -723,9 +723,9 @@ @Override public Collection getReadOnlyObjectCollection() { Collection c = new ArrayList<>(); - c.add("one"); //$NON-NLS-1$ - c.add("two"); //$NON-NLS-1$ - c.add("three"); //$NON-NLS-1$ + c.add("one"); + c.add("two"); + c.add("three"); return c; } @@ -772,7 +772,7 @@ @Override public TestContainer getUneditableTestContainer() { - return new TestContainer(new String[] {"this", "is", "an", "opaque", "object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + return new TestContainer(new String[] {"this", "is", "an", "opaque", "object"}); } @Override @@ -827,9 +827,9 @@ long oldLastTime = lastTime; lastTime = System.currentTimeMillis(); // System.out.println("Current time: " + getAliveTime()); - sendNotification(new AttributeChangeNotification(this, sequenceNumber++, lastTime, "Update", //$NON-NLS-1$ - "AliveTime", "long", Long.valueOf(oldLastTime - startTime), //$NON-NLS-1$ //$NON-NLS-2$ - Long.valueOf(lastTime - startTime))); //$NON-NLS-1$ //$NON-NLS-2$ + sendNotification(new AttributeChangeNotification(this, sequenceNumber++, lastTime, "Update", + "AliveTime", "long", Long.valueOf(oldLastTime - startTime), + Long.valueOf(lastTime - startTime))); try { wait(Math.max(1, updateTime)); } catch (InterruptedException e) { @@ -867,7 +867,7 @@ @Override public boolean killExistingHelloMBean(String name) { try { - ObjectName mbeanName = new ObjectName("SimpleAgent:name=" + name); //$NON-NLS-1$ + ObjectName mbeanName = new ObjectName("SimpleAgent:name=" + name); ManagementFactory.getPlatformMBeanServer().unregisterMBean(mbeanName); return true; } catch (Exception e) { @@ -882,7 +882,7 @@ ObjectName mbeanName = null; try { - mbeanName = new ObjectName("SimpleAgent:name=" + name + ',' + type); //$NON-NLS-1$ + mbeanName = new ObjectName("SimpleAgent:name=" + name + ',' + type); ManagementFactory.getPlatformMBeanServer().registerMBean(test, mbeanName); return true; } catch (Exception e) { @@ -894,7 +894,7 @@ @Override public boolean startNewHelloMBean(String name) { - return startNewHelloMBeanWithType(name, "type=added"); //$NON-NLS-1$ + return startNewHelloMBeanWithType(name, "type=added"); } @Override @@ -916,7 +916,7 @@ public MBeanNotificationInfo[] getNotificationInfo() { String[] types = new String[] {AttributeChangeNotification.ATTRIBUTE_CHANGE}; String name = AttributeChangeNotification.class.getName(); - String description = "An attribute of this MBean has changed"; //$NON-NLS-1$ + String description = "An attribute of this MBean has changed"; MBeanNotificationInfo info = new MBeanNotificationInfo(types, name, description); return new MBeanNotificationInfo[] {info}; } --- old/application/uitests/org.openjdk.jmc.test.jemmy/src/test/java/org/openjdk/jmc/test/jemmy/TestHelper.java 2019-02-27 20:12:56.000000000 +0100 +++ new/application/uitests/org.openjdk.jmc.test.jemmy/src/test/java/org/openjdk/jmc/test/jemmy/TestHelper.java 2019-02-27 20:12:56.000000000 +0100 @@ -50,7 +50,7 @@ public class TestHelper { public static File createResultFile(String prefix, String suffix, boolean deleteTempOnExit) throws IOException { - String resultDir = System.getProperty("results.dir"); //$NON-NLS-1$ + String resultDir = System.getProperty("results.dir"); File resultFile; if (resultDir != null) { resultFile = new File(resultDir, prefix + '.' + System.currentTimeMillis() + '.' + suffix); @@ -70,7 +70,7 @@ robot = new Robot(); BufferedImage screenShot = robot .createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); - ImageIO.write(screenShot, "PNG", TestHelper.createResultFile(name, "dump.png", false)); //$NON-NLS-1$ //$NON-NLS-2$ + ImageIO.write(screenShot, "PNG", TestHelper.createResultFile(name, "dump.png", false)); } catch (IOException e) { e.printStackTrace(); } catch (AWTException e) { --- old/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/TestDefaultTransformRegistry.java 2019-02-27 20:12:57.000000000 +0100 +++ new/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/TestDefaultTransformRegistry.java 2019-02-27 20:12:57.000000000 +0100 @@ -51,7 +51,7 @@ @Test public void testHasPendingTransforms() throws FileNotFoundException, XMLStreamException { TransformRegistry registry = DefaultTransformRegistry - .from(TestToolkit.getProbesXML("HasPendingTransforms")); //$NON-NLS-1$ + .from(TestToolkit.getProbesXML("HasPendingTransforms")); assertNotNull(registry); assertTrue(registry.hasPendingTransforms(Type.getInternalName(InstrumentMe.class))); } @@ -59,14 +59,14 @@ @Test public void testFrom() throws FileNotFoundException, XMLStreamException { TransformRegistry registry = DefaultTransformRegistry - .from(TestToolkit.getProbesXML("From")); //$NON-NLS-1$ + .from(TestToolkit.getProbesXML("From")); assertNotNull(registry); } @Test public void testGetTransformData() throws FileNotFoundException, XMLStreamException { TransformRegistry registry = DefaultTransformRegistry - .from(TestToolkit.getProbesXML("GetTransformData")); //$NON-NLS-1$ + .from(TestToolkit.getProbesXML("GetTransformData")); assertNotNull(registry); List transformData = registry.getTransformData(Type.getInternalName(InstrumentMe.class)); assertNotNull(transformData); --- old/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/TestJFRTransformer.java 2019-02-27 20:12:57.000000000 +0100 +++ new/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/TestJFRTransformer.java 2019-02-27 20:12:57.000000000 +0100 @@ -61,7 +61,7 @@ @Test public void testRunTransforms() throws XMLStreamException, IllegalClassFormatException, IOException { TransformRegistry registry = DefaultTransformRegistry - .from(TestToolkit.getProbesXML("RunTransforms" + runCount.getAndIncrement())); //$NON-NLS-1$ + .from(TestToolkit.getProbesXML("RunTransforms" + runCount.getAndIncrement())); assertTrue(registry.hasPendingTransforms(Type.getInternalName(InstrumentMe.class))); --- old/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/util/TestToolkit.java 2019-02-27 20:12:58.000000000 +0100 +++ new/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/util/TestToolkit.java 2019-02-27 20:12:58.000000000 +0100 @@ -48,11 +48,11 @@ public static final Random RND = new Random(); private TestToolkit() { - throw new UnsupportedOperationException("Not to be instantiated."); //$NON-NLS-1$ + throw new UnsupportedOperationException("Not to be instantiated."); } public static byte[] getByteCode(Class c) throws IOException { - InputStream is = c.getClassLoader().getResourceAsStream(c.getName().replace('.', '/') + ".class"); //$NON-NLS-1$ + InputStream is = c.getClassLoader().getResourceAsStream(c.getName().replace('.', '/') + ".class"); return readFully(is, -1, true); } @@ -75,7 +75,7 @@ int cc = is.read(output, pos, bytesToRead); if (cc < 0) { if (readAll && length != Integer.MAX_VALUE) { - throw new EOFException("Detect premature EOF"); //$NON-NLS-1$ + throw new EOFException("Detect premature EOF"); } else { if (output.length != pos) { output = Arrays.copyOf(output, pos); @@ -103,7 +103,7 @@ public static InputStream getProbesXML(String testName) { try { String s = readTemplate(); - s = s.replaceAll("%TEST_NAME%", testName); //$NON-NLS-1$ + s = s.replaceAll("%TEST_NAME%", testName); return new ByteArrayInputStream(s.getBytes()); } catch (IOException e) { @@ -113,7 +113,7 @@ } private static String readTemplate() throws IOException { - InputStream inputStream = InstrumentMe.class.getResourceAsStream("jfrprobes_template.xml"); //$NON-NLS-1$ + InputStream inputStream = InstrumentMe.class.getResourceAsStream("jfrprobes_template.xml"); String s = readString(inputStream); closeSilently(inputStream); return s; @@ -132,7 +132,7 @@ StringBuilder builder = new StringBuilder(); try { while ((s = reader.readLine()) != null) { - builder.append(s + "\r"); //$NON-NLS-1$ + builder.append(s + "\r"); } s = builder.toString(); } finally { --- old/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/util/TestVisitor.java 2019-02-27 20:12:59.000000000 +0100 +++ new/core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/util/TestVisitor.java 2019-02-27 20:12:59.000000000 +0100 @@ -49,61 +49,61 @@ @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { - System.out.println("Visiting class: " + name); //$NON-NLS-1$ - System.out.println("Class Major Version: " + version); //$NON-NLS-1$ - System.out.println("Super class: " + superName); //$NON-NLS-1$ - System.out.println("Signature: " + signature); //$NON-NLS-1$ - System.out.println("Interfaces: " + Arrays.toString(interfaces)); //$NON-NLS-1$ + System.out.println("Visiting class: " + name); + System.out.println("Class Major Version: " + version); + System.out.println("Super class: " + superName); + System.out.println("Signature: " + signature); + System.out.println("Interfaces: " + Arrays.toString(interfaces)); super.visit(version, access, name, signature, superName, interfaces); } @Override public void visitOuterClass(String owner, String name, String desc) { - System.out.println("Outer class: " + owner); //$NON-NLS-1$ + System.out.println("Outer class: " + owner); super.visitOuterClass(owner, name, desc); } @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { - System.out.println("Annotation: " + desc); //$NON-NLS-1$ + System.out.println("Annotation: " + desc); return super.visitAnnotation(desc, visible); } @Override public void visitAttribute(Attribute attr) { - System.out.println("Class Attribute: " + attr.type); //$NON-NLS-1$ + System.out.println("Class Attribute: " + attr.type); super.visitAttribute(attr); } @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { - System.out.println("Inner Class: " + innerName + " defined in " + outerName); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Inner Class: " + innerName + " defined in " + outerName); super.visitInnerClass(name, outerName, innerName, access); } @Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { - System.out.println("Field: " + name + " " + desc + " value:" + value); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + System.out.println("Field: " + name + " " + desc + " value:" + value); return super.visitField(access, name, desc, signature, value); } @Override public void visitEnd() { - System.out.println("Visit ended"); //$NON-NLS-1$ + System.out.println("Visit ended"); super.visitEnd(); } @Override public MethodVisitor visitMethod( int access, String name, String descriptor, String signature, String[] exceptions) { - System.out.println("Method: " + name + descriptor); //$NON-NLS-1$ + System.out.println("Method: " + name + descriptor); return super.visitMethod(access, name, descriptor, signature, exceptions); } @Override public void visitSource(String source, String debug) { - System.out.println("Source: " + source); //$NON-NLS-1$ + System.out.println("Source: " + source); super.visitSource(source, debug); } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/BinaryPrefixTest.java 2019-02-27 20:12:59.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/BinaryPrefixTest.java 2019-02-27 20:12:59.000000000 +0100 @@ -74,14 +74,14 @@ BinaryPrefix prefix = BinaryPrefix.getFloorPrefix(val); if ((i++ % 10) == 0) { - assertGreaterThan("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertGreaterThan("For value " + val, oldLog1024, log1024); if (oldPrefix == null) { assertNotNull(prefix); } else { assertGreaterThan(oldPrefix, prefix); } } else { - assertEquals("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertEquals("For value " + val, oldLog1024, log1024); assertSame(oldPrefix, prefix); } @@ -101,14 +101,14 @@ BinaryPrefix prefix = BinaryPrefix.getFloorPrefix(val); if ((i++ % 10) == 0) { - assertGreaterThan("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertGreaterThan("For value " + val, oldLog1024, log1024); if (oldPrefix == null) { assertNotNull(prefix); } else { assertGreaterThan(oldPrefix, prefix); } } else { - assertEquals("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertEquals("For value " + val, oldLog1024, log1024); assertSame(oldPrefix, prefix); } @@ -127,14 +127,14 @@ BinaryPrefix prefix = BinaryPrefix.getFloorPrefix(val); if ((i++ % 10) == 0) { - assertGreaterThan("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertGreaterThan("For value " + val, oldLog1024, log1024); if (oldPrefix == null) { assertNotNull(prefix); } else { assertGreaterThan(oldPrefix, prefix); } } else { - assertEquals("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertEquals("For value " + val, oldLog1024, log1024); assertSame(oldPrefix, prefix); } @@ -154,14 +154,14 @@ BinaryPrefix prefix = BinaryPrefix.getFloorPrefix(val); if ((i++ % 10) == 0) { - assertGreaterThan("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertGreaterThan("For value " + val, oldLog1024, log1024); if (oldPrefix == null) { assertNotNull(prefix); } else { assertGreaterThan(oldPrefix, prefix); } } else { - assertEquals("For value " + val, oldLog1024, log1024); //$NON-NLS-1$ + assertEquals("For value " + val, oldLog1024, log1024); assertSame(oldPrefix, prefix); } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/MCTestCase.java 2019-02-27 20:13:00.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/MCTestCase.java 2019-02-27 20:13:00.000000000 +0100 @@ -79,8 +79,8 @@ */ static public void assertMaskedEquals(String message, long expected, long actual, long mask) { if (((expected ^ actual) & mask) != 0) { - Assert.fail(((message != null) ? message + ' ' : "") //$NON-NLS-1$ - + "masked with " + hex(mask) + " expected:<" + hex(expected) + "> was not:<" + hex(actual) + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + Assert.fail(((message != null) ? message + ' ' : "") + + "masked with " + hex(mask) + " expected:<" + hex(expected) + "> was not:<" + hex(actual) + ">"); } } @@ -92,7 +92,7 @@ } protected static String hex(long val) { - return "0x" + Long.toHexString(val); //$NON-NLS-1$ + return "0x" + Long.toHexString(val); } /** @@ -101,8 +101,8 @@ */ static public > void assertBetween(String message, T min, T max, T actual) { if ((min.compareTo(actual) > 0) || (max.compareTo(actual) < 0)) { - Assert.fail(((message != null) ? message + ' ' : "") //$NON-NLS-1$ - + "expected in:[" + min + ", " + max + "] was not:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + Assert.fail(((message != null) ? message + ' ' : "") + + "expected in:[" + min + ", " + max + "] was not:<" + actual + ">"); } } @@ -119,8 +119,8 @@ */ static public > void assertMax(String message, T max, T actual) { if (max.compareTo(actual) < 0) { - Assert.fail(((message != null) ? message + ' ' : "") //$NON-NLS-1$ - + "expected max:<" + max + "> was not:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Assert.fail(((message != null) ? message + ' ' : "") + + "expected max:<" + max + "> was not:<" + actual + ">"); } } @@ -137,8 +137,8 @@ */ static public > void assertMin(String message, T min, T actual) { if (min.compareTo(actual) > 0) { - Assert.fail(((message != null) ? message + ' ' : "") //$NON-NLS-1$ - + "expected min:<" + min + "> was not:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Assert.fail(((message != null) ? message + ' ' : "") + + "expected min:<" + min + "> was not:<" + actual + ">"); } } @@ -155,8 +155,8 @@ */ static public > void assertLessThan(String message, T greaterVal, T actual) { if (greaterVal.compareTo(actual) <= 0) { - Assert.fail(((message != null) ? message + ' ' : "") //$NON-NLS-1$ - + "expected less than:<" + greaterVal + "> was not:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Assert.fail(((message != null) ? message + ' ' : "") + + "expected less than:<" + greaterVal + "> was not:<" + actual + ">"); } } @@ -173,8 +173,8 @@ */ static public > void assertGreaterThan(String message, T lesserVal, T actual) { if (lesserVal.compareTo(actual) >= 0) { - Assert.fail(((message != null) ? message + ' ' : "") //$NON-NLS-1$ - + "expected greater than:<" + lesserVal + "> was not:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Assert.fail(((message != null) ? message + ' ' : "") + + "expected greater than:<" + lesserVal + "> was not:<" + actual + ">"); } } @@ -200,22 +200,22 @@ } protected void skipIfEarlierThan8u0() { - Assume.assumeTrue("This feature is only valid on JDK8u0 or later.", //$NON-NLS-1$ + Assume.assumeTrue("This feature is only valid on JDK8u0 or later.", (getClientVersion().compareTo(JVMVersion.JDK8)) >= 0); } protected void skipIfEarlierThan7u40() { - Assume.assumeTrue("This feature is only valid on JDK7u40 or later.", //$NON-NLS-1$ + Assume.assumeTrue("This feature is only valid on JDK7u40 or later.", (getClientVersion().compareTo(JVMVersion.JDK7u40)) >= 0); } protected void skipIfEarlierThan7u4() { - Assume.assumeTrue("This feature is only valid on JDK7u4 or later.", //$NON-NLS-1$ + Assume.assumeTrue("This feature is only valid on JDK7u4 or later.", (getClientVersion().compareTo(JVMVersion.JDK7u4)) >= 0); } protected void skipIfEarlierThan7u0() { - Assume.assumeTrue("This feature is only valid on JDK7u0 or later.", //$NON-NLS-1$ + Assume.assumeTrue("This feature is only valid on JDK7u0 or later.", (getClientVersion().compareTo(JVMVersion.JDK7)) >= 0); } @@ -225,10 +225,10 @@ } private JVMVersion getClientVersion() { - if (JavaVMVersionToolkit.isJRockitJVMName(System.getProperty("java.vm.name"))) { //$NON-NLS-1$ + if (JavaVMVersionToolkit.isJRockitJVMName(System.getProperty("java.vm.name"))) { return JVMVersion.JRockit; - } else if (JavaVMVersionToolkit.isHotspotJVMName(System.getProperty("java.vm.name"))) { //$NON-NLS-1$ - JavaVersion javaVersion = new JavaVersion(System.getProperty("java.version")); //$NON-NLS-1$ + } else if (JavaVMVersionToolkit.isHotspotJVMName(System.getProperty("java.vm.name"))) { + JavaVersion javaVersion = new JavaVersion(System.getProperty("java.version")); if (javaVersion.isGreaterOrEqualThan(JavaVersionSupport.JDK_8)) { return JVMVersion.JDK8; } else if (javaVersion.isGreaterOrEqualThan(JavaVersionSupport.JDK_7_U_40)) { --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/mock/item/MockAttributes.java 2019-02-27 20:13:01.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/mock/item/MockAttributes.java 2019-02-27 20:13:01.000000000 +0100 @@ -40,14 +40,14 @@ @SuppressWarnings("nls") public class MockAttributes { - public static final String DOUBLE_VALUE_ID = "mock/doubletype"; //$NON-NLS-1$ - public static final String LONG_INDEX_ID = "mock/index"; //$NON-NLS-1$ + public static final String DOUBLE_VALUE_ID = "mock/doubletype"; + public static final String LONG_INDEX_ID = "mock/index"; /* * NOTE: Need to be the same as the actual attribute used in Flight Recorder. Maybe use constant * from somewhere else? If stacktrace mocking is moved to flightrecorder.test then we could * perhaps use accessor from there. */ - public static final String STACKTRACE_ID = "stackTrace"; //$NON-NLS-1$ + public static final String STACKTRACE_ID = "stackTrace"; public static final IAttribute DOUBLE_VALUE = Attribute.attr(DOUBLE_VALUE_ID, "A double value", UnitLookup.NUMBER); --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/mock/item/MockCollections.java 2019-02-27 20:13:02.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/mock/item/MockCollections.java 2019-02-27 20:13:01.000000000 +0100 @@ -65,7 +65,7 @@ StringBuilder builder = new StringBuilder(); for (int i = 0; i < values.length; i++) { builder.append(formatter.format(values[i])); - builder.append("\n"); //$NON-NLS-1$ + builder.append("\n"); } return builder.toString(); } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/string/StringToolkitTest.java 2019-02-27 20:13:02.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/string/StringToolkitTest.java 2019-02-27 20:13:02.000000000 +0100 @@ -44,8 +44,8 @@ @Test public void testJoin() { - assertEquals("apa-kossa", StringToolkit.join(Arrays.asList("apa", "kossa"), "-")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("2.-4711", StringToolkit.join(Arrays.asList(Integer.valueOf(2), Integer.valueOf(4711)), ".-")); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("apa-kossa", StringToolkit.join(Arrays.asList("apa", "kossa"), "-")); + assertEquals("2.-4711", StringToolkit.join(Arrays.asList(Integer.valueOf(2), Integer.valueOf(4711)), ".-")); } } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/unit/ContentTypeTest.java 2019-02-27 20:13:03.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/test/unit/ContentTypeTest.java 2019-02-27 20:13:03.000000000 +0100 @@ -63,13 +63,13 @@ static public void assertContains(String expectedSubStr, String actual) { if (!actual.contains(expectedSubStr)) { - fail("expected to contain:<" + expectedSubStr + "> did not:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + fail("expected to contain:<" + expectedSubStr + "> did not:<" + actual + ">"); } } static public void assertNotContain(String unexpectedSubStr, String actual) { if (actual.contains(unexpectedSubStr)) { - fail("didn't expect to contain:<" + unexpectedSubStr + "> did:<" + actual + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + fail("didn't expect to contain:<" + unexpectedSubStr + "> did:<" + actual + ">"); } } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/util/BoundedListTest.java 2019-02-27 20:13:04.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/util/BoundedListTest.java 2019-02-27 20:13:03.000000000 +0100 @@ -152,10 +152,10 @@ @Test public void testEmptyIterator() { BoundedList bl = new BoundedList<>(10); - assertFalse("Empty list should have no elements!", bl.iterator().hasNext()); //$NON-NLS-1$ + assertFalse("Empty list should have no elements!", bl.iterator().hasNext()); try { bl.iterator().next(); - fail("next should have generated an exception!"); //$NON-NLS-1$ + fail("next should have generated an exception!"); } catch (NoSuchElementException el) { // Fall through... } @@ -194,10 +194,10 @@ final BoundedList bl = new BoundedList<>(20); ProducerThread t = new ProducerThread(bl); ValidationThread[] validators = new ValidationThread[10]; - new Thread(t, "Producer").start(); //$NON-NLS-1$ + new Thread(t, "Producer").start(); for (int i = 0; i < validators.length; i++) { validators[i] = new ValidationThread(bl); - new Thread(validators[i], "Validator " + i).start(); //$NON-NLS-1$ + new Thread(validators[i], "Validator " + i).start(); } Thread.sleep(30000); for (ValidationThread validator : validators) { @@ -206,12 +206,12 @@ t.stop(); long maxNo = 0; for (ValidationThread validator : validators) { - assertEquals("Failed count validation!", -1, validator.countError); //$NON-NLS-1$ - assertEquals("Failed sequence validation!", -1, validator.sequenceError); //$NON-NLS-1$ + assertEquals("Failed count validation!", -1, validator.countError); + assertEquals("Failed sequence validation!", -1, validator.sequenceError); maxNo = Math.max(maxNo, validator.maxNum); } - System.out.println("Allocated up to " + t.counter); //$NON-NLS-1$ - System.out.println("Max no was " + maxNo); //$NON-NLS-1$ + System.out.println("Allocated up to " + t.counter); + System.out.println("Max no was " + maxNo); } // FIXME: This test has been commented out for a long time. Check if it is still relevant and either remove or reintroduce it. @@ -222,7 +222,7 @@ // // Adding a few billion numbers, just to show that we do not leak under normal circumstances... // for (long i = 1; i <= Integer.MAX_VALUE; i++) { // if (i % (Integer.MAX_VALUE / 20) == 0) { -// System.out.println(String.format("Passed %.0f%%", (i * 100f) / Integer.MAX_VALUE)); //$NON-NLS-1$ +// System.out.println(String.format("Passed %.0f%%", (i * 100f) / Integer.MAX_VALUE)); // } // bl.add(i); // } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/version/JavaVMVersionToolkitTest.java 2019-02-27 20:13:04.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/version/JavaVMVersionToolkitTest.java 2019-02-27 20:13:04.000000000 +0100 @@ -40,16 +40,16 @@ @Test public void testParseJavaVersion() { - assertEquals("1.7", JavaVMVersionToolkit.parseJavaVersion("1.7.0-ea")); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("1.5", JavaVMVersionToolkit.parseJavaVersion("1.5.0_24-b02")); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("1.6", JavaVMVersionToolkit.parseJavaVersion("1.6")); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("1.7", JavaVMVersionToolkit.parseJavaVersion("1.7.0-ea")); + assertEquals("1.5", JavaVMVersionToolkit.parseJavaVersion("1.5.0_24-b02")); + assertEquals("1.6", JavaVMVersionToolkit.parseJavaVersion("1.6")); } @Test public void testDecodeJavaversion() { - assertEquals("1.5", //$NON-NLS-1$ - JavaVMVersionToolkit.decodeJavaVersion("R28.0.2-7-134974-1.5.0_24-20100611-1706-windows-x86_64")); //$NON-NLS-1$ - assertEquals("1.6", JavaVMVersionToolkit //$NON-NLS-1$ - .decodeJavaVersion("DEBUG-R28.2.0-33-142110-1.6.0_22-20110309-2111-windows-x86_64")); //$NON-NLS-1$ + assertEquals("1.5", + JavaVMVersionToolkit.decodeJavaVersion("R28.0.2-7-134974-1.5.0_24-20100611-1706-windows-x86_64")); + assertEquals("1.6", JavaVMVersionToolkit + .decodeJavaVersion("DEBUG-R28.2.0-33-142110-1.6.0_22-20110309-2111-windows-x86_64")); } } --- old/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/version/JavaVersionTest.java 2019-02-27 20:13:05.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/src/test/java/org/openjdk/jmc/common/version/JavaVersionTest.java 2019-02-27 20:13:05.000000000 +0100 @@ -42,32 +42,32 @@ @Test public void testJava9NewShortGEQJava9OldVersion() { - JavaVersion ver1 = new JavaVersion("9"); //$NON-NLS-1$ - JavaVersion ver2 = new JavaVersion("1.9.foo"); //$NON-NLS-1$ + JavaVersion ver1 = new JavaVersion("9"); + JavaVersion ver2 = new JavaVersion("1.9.foo"); assertTrue(ver1.isGreaterOrEqualThan(ver2)); } @Test public void testJava9NewShortEQJava9NewLongSameVersion() { - JavaVersion version9 = new JavaVersion("9-ea"); //$NON-NLS-1$ - JavaVersion version9000 = new JavaVersion("9.0.0.0-ea"); //$NON-NLS-1$ + JavaVersion version9 = new JavaVersion("9-ea"); + JavaVersion version9000 = new JavaVersion("9.0.0.0-ea"); assertTrue(version9000.equals(version9)); } @Test public void testJava9NewShortWithExtraEQJava9NewLongSameVersion() { - JavaVersion version190 = new JavaVersion("9-ea+19-BR-435345"); //$NON-NLS-1$ - JavaVersion version900 = new JavaVersion("9.0.0.0-ea"); //$NON-NLS-1$ + JavaVersion version190 = new JavaVersion("9-ea+19-BR-435345"); + JavaVersion version900 = new JavaVersion("9.0.0.0-ea"); assertTrue(version900.equals(version190)); } @Test public void testJava9NewWithExtraGEQJava9OldVersion() { - JavaVersion version913 = new JavaVersion("9.1.3.0"); //$NON-NLS-1$ - JavaVersion version190 = new JavaVersion("1.9.0-ea+19-BR-435345"); //$NON-NLS-1$ + JavaVersion version913 = new JavaVersion("9.1.3.0"); + JavaVersion version190 = new JavaVersion("1.9.0-ea+19-BR-435345"); assertTrue(version913.isGreaterOrEqualThan(version190)); } @@ -78,32 +78,32 @@ */ @Test public void testJava9OldVersionGEQJava9NewWithExtra() { - JavaVersion version913 = new JavaVersion("9.1.3.0"); //$NON-NLS-1$ - JavaVersion version192 = new JavaVersion("1.9.2-ea+19-BR-435345"); //$NON-NLS-1$ + JavaVersion version913 = new JavaVersion("9.1.3.0"); + JavaVersion version192 = new JavaVersion("1.9.2-ea+19-BR-435345"); assertTrue(version192.isGreaterOrEqualThan(version913)); } @Test public void testJava9LongVersionisGreaterOrEqualsJava9ShortVersion() { - JavaVersion version9 = new JavaVersion("9"); //$NON-NLS-1$ - JavaVersion version921 = new JavaVersion("9.2.1.0"); //$NON-NLS-1$ + JavaVersion version9 = new JavaVersion("9"); + JavaVersion version921 = new JavaVersion("9.2.1.0"); assertTrue(version921.isGreaterOrEqualThan(version9)); } @Test public void testJava9isGreaterOrEqualsVersion() { - JavaVersion version913 = new JavaVersion("9.1.3.0-ea"); //$NON-NLS-1$ - JavaVersion version921 = new JavaVersion("9.2.1.0"); //$NON-NLS-1$ + JavaVersion version913 = new JavaVersion("9.1.3.0-ea"); + JavaVersion version921 = new JavaVersion("9.2.1.0"); assertTrue(version921.isGreaterOrEqualThan(version913)); } @Test public void testJava9isGreaterOrEqualsVersionEA() { - JavaVersion version921ea = new JavaVersion("9.2.1.0-ea"); //$NON-NLS-1$ - JavaVersion version921 = new JavaVersion("9.2.1.0"); //$NON-NLS-1$ + JavaVersion version921ea = new JavaVersion("9.2.1.0-ea"); + JavaVersion version921 = new JavaVersion("9.2.1.0"); assertTrue(version921.isGreaterOrEqualThan(version921ea)); assertTrue(!version921ea.isGreaterOrEqualThan(version921)); @@ -111,32 +111,32 @@ @Test public void testGreaterOrEqualsMediumVsLongVersion() { - JavaVersion version123 = new JavaVersion("1.2.3"); //$NON-NLS-1$ - JavaVersion version12245 = new JavaVersion("1.2.2.4.5"); //$NON-NLS-1$ + JavaVersion version123 = new JavaVersion("1.2.3"); + JavaVersion version12245 = new JavaVersion("1.2.2.4.5"); assertTrue(version123.isGreaterOrEqualThan(version12245)); } @Test public void testGreaterOrEqualsLongVsMediumVersion() { - JavaVersion version12345 = new JavaVersion("1.2.3.4.5"); //$NON-NLS-1$ - JavaVersion version12 = new JavaVersion("1.2"); //$NON-NLS-1$ + JavaVersion version12345 = new JavaVersion("1.2.3.4.5"); + JavaVersion version12 = new JavaVersion("1.2"); assertTrue(version12345.isGreaterOrEqualThan(version12)); } @Test public void testJava9isGreaterOrEqualsThanJava8Version() { - JavaVersion version903 = new JavaVersion("9.0.3.0-ea"); //$NON-NLS-1$ - JavaVersion version8u40 = new JavaVersion("1.8.0_40"); //$NON-NLS-1$ + JavaVersion version903 = new JavaVersion("9.0.3.0-ea"); + JavaVersion version8u40 = new JavaVersion("1.8.0_40"); assertTrue(version903.isGreaterOrEqualThan(version8u40)); } @Test public void testGEQ() { - JavaVersion version16 = new JavaVersion("1.6.0_14ea"); //$NON-NLS-1$ - JavaVersion version17 = new JavaVersion("1.7.0_0"); //$NON-NLS-1$ + JavaVersion version16 = new JavaVersion("1.6.0_14ea"); + JavaVersion version17 = new JavaVersion("1.7.0_0"); assertTrue(version17.isGreaterOrEqualThan(version16)); assertFalse(version16.isGreaterOrEqualThan(version17)); @@ -146,8 +146,8 @@ @Test public void testGEQJava7EA() { - JavaVersion version17ea = new JavaVersion("1.7.0_0ea"); //$NON-NLS-1$ - JavaVersion version17 = new JavaVersion("1.7.0_0"); //$NON-NLS-1$ + JavaVersion version17ea = new JavaVersion("1.7.0_0ea"); + JavaVersion version17 = new JavaVersion("1.7.0_0"); assertTrue(version17.isGreaterOrEqualThan(version17ea)); assertFalse(version17ea.isGreaterOrEqualThan(version17)); @@ -155,8 +155,8 @@ @Test public void testGEQWithMicro() { - JavaVersion version142 = new JavaVersion("1.4.2_14"); //$NON-NLS-1$ - JavaVersion version131 = new JavaVersion("1.3.1_67"); //$NON-NLS-1$ + JavaVersion version142 = new JavaVersion("1.4.2_14"); + JavaVersion version131 = new JavaVersion("1.3.1_67"); assertTrue(version142.isGreaterOrEqualThan(version131)); assertFalse(version131.isGreaterOrEqualThan(version142)); @@ -166,8 +166,8 @@ @Test public void testGEQCropped() { - JavaVersion version17 = new JavaVersion("1.7"); //$NON-NLS-1$ - JavaVersion version17u12 = new JavaVersion("1.7.0_12"); //$NON-NLS-1$ + JavaVersion version17 = new JavaVersion("1.7"); + JavaVersion version17u12 = new JavaVersion("1.7.0_12"); assertTrue(version17u12.isGreaterOrEqualThan(version17)); assertFalse(version17u12.equals(version17)); @@ -175,8 +175,8 @@ @Test public void testIsReverseNumbers() { - JavaVersion version17u13 = new JavaVersion("1.7.12_13ea"); //$NON-NLS-1$ - JavaVersion version17u31 = new JavaVersion("1.7.12_31"); //$NON-NLS-1$ + JavaVersion version17u13 = new JavaVersion("1.7.12_13ea"); + JavaVersion version17u31 = new JavaVersion("1.7.12_31"); assertTrue(version17u31.isGreaterOrEqualThan(version17u13)); assertFalse(version17u31.equals(version17u13)); @@ -184,8 +184,8 @@ @Test public void testOldVersionShortAndLongEquals() { - JavaVersion version17u0 = new JavaVersion("1.7.0_0"); //$NON-NLS-1$ - JavaVersion version17 = new JavaVersion("1.7"); //$NON-NLS-1$ + JavaVersion version17u0 = new JavaVersion("1.7.0_0"); + JavaVersion version17 = new JavaVersion("1.7"); assertTrue(version17u0.equals(version17)); } --- old/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/JfrAttributesTest.java 2019-02-27 20:13:06.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/JfrAttributesTest.java 2019-02-27 20:13:06.000000000 +0100 @@ -54,10 +54,10 @@ @Test public void testGetEventTypes() throws IOException, CouldNotLoadRecordingException { IItemCollection events = RecordingToolkit.getFlightRecording(RecordingToolkit.getRecordings()); - String typesStr = events.getAggregate(Aggregators.distinctAsString(JfrAttributes.EVENT_TYPE_ID, ", ")); //$NON-NLS-1$ + String typesStr = events.getAggregate(Aggregators.distinctAsString(JfrAttributes.EVENT_TYPE_ID, ", ")); IAggregator>, ?> distinct = Aggregators.distinct(JfrAttributes.EVENT_TYPE); Set> types = events.getAggregate(distinct); - assertEquals(types.size(), typesStr.split(",").length); //$NON-NLS-1$ + assertEquals(types.size(), typesStr.split(",").length); } } --- old/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/MetadataEventLocationUpdateTest.java 2019-02-27 20:13:06.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/MetadataEventLocationUpdateTest.java 2019-02-27 20:13:06.000000000 +0100 @@ -26,8 +26,8 @@ public final class MetadataEventLocationUpdateTest { private static final int CHUNK_COUNT_FLUSH_RECORDINGS = 2; private static final int CHUNK_COUNT_METADATA_RECORDINGS = 1; - private static final String[] TYPES_TO_CHECK = {"jdk.GCPhaseParallel", "jdk.CompilerInlining"}; //$NON-NLS-1$ //$NON-NLS-2$ - private static final String[] TYPES_TO_CHECK_FLUSH = {"jdk.ModuleExport", "jdk.BooleanFlag", "jdk.JavaMonitorWait"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + private static final String[] TYPES_TO_CHECK = {"jdk.GCPhaseParallel", "jdk.CompilerInlining"}; + private static final String[] TYPES_TO_CHECK_FLUSH = {"jdk.ModuleExport", "jdk.BooleanFlag", "jdk.JavaMonitorWait"}; private static final long[] EXPECTED_COUNTS_CONTROL = {12584, 7283}; private static final long[] EXPECTED_COUNTS_NEW = {27738, 6883}; @@ -37,11 +37,11 @@ private static final int EXPECTED_NUMBER_OF_TYPES_FLUSH_RECORDINGS = 133; - private static final String RECORDING_METADATA_CONTROL = "metadata_control.jfr"; //$NON-NLS-1$ - private static final String RECORDING_METADATA_NEW = "metadata_new.jfr"; //$NON-NLS-1$ + private static final String RECORDING_METADATA_CONTROL = "metadata_control.jfr"; + private static final String RECORDING_METADATA_NEW = "metadata_new.jfr"; - private static final String RECORDING_FLUSH_METADATA = "flush_metadata.jfr"; //$NON-NLS-1$ - private static final String RECORDING_FLUSH_INCREMENTAL_METADATA = "flush_incremental_metadata.jfr"; //$NON-NLS-1$ + private static final String RECORDING_FLUSH_METADATA = "flush_metadata.jfr"; + private static final String RECORDING_FLUSH_INCREMENTAL_METADATA = "flush_incremental_metadata.jfr"; @Test public void testChunkSplitter() throws IOException, CouldNotLoadRecordingException { @@ -71,7 +71,7 @@ Set newTypes = newEvents.getAggregate(distinctTypesAggregator); newTypes.removeAll(controlTypes); // The new flush event should be the one remaining - assertTrue(newTypes.contains("jdk.Flush")); //$NON-NLS-1$ + assertTrue(newTypes.contains("jdk.Flush")); assertEquals(1, newTypes.size()); } --- old/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/StacktraceBaselineGenerator.java 2019-02-27 20:13:07.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/StacktraceBaselineGenerator.java 2019-02-27 20:13:07.000000000 +0100 @@ -47,7 +47,7 @@ File stacktracesDirectory = StacktraceTestToolkit.getStacktracesDirectory(); File recordingDirectory = RecordingToolkit.getRecordingDirectory(); - System.out.println("Deleting all files in directory " + stacktracesDirectory); //$NON-NLS-1$ + System.out.println("Deleting all files in directory " + stacktracesDirectory); for (File file : stacktracesDirectory.listFiles()) { if (!file.delete()) { System.out.println("Could not remove old files!\nExiting!"); @@ -56,10 +56,10 @@ } for (File recordingFile : recordingDirectory.listFiles()) { - File stacktraceFile = new File(stacktracesDirectory, recordingFile.getName() + ".txt"); //$NON-NLS-1$ - System.out.println("Generating " + stacktraceFile + " ..."); //$NON-NLS-1$ //$NON-NLS-2$ + File stacktraceFile = new File(stacktracesDirectory, recordingFile.getName() + ".txt"); + System.out.println("Generating " + stacktraceFile + " ..."); StacktraceTestToolkit.printStacktraces(recordingFile, stacktraceFile); - System.out.println(" finished!"); //$NON-NLS-1$ + System.out.println(" finished!"); } } } --- old/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/util/StacktraceTestToolkit.java 2019-02-27 20:13:08.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.test/src/test/java/org/openjdk/jmc/flightrecorder/test/util/StacktraceTestToolkit.java 2019-02-27 20:13:08.000000000 +0100 @@ -182,7 +182,7 @@ handleBranch(branch, frameSeparator, indent, traces); Fork endFork = branch.getEndFork(); walkStacktraceTree(endFork, frameSeparator, indent + " ", traces); - traces.add(""); //$NON-NLS-1$ + traces.add(""); } return traces; } --- /dev/null 2019-02-27 20:13:08.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.flightrecorder.ui.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:08.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:09.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.greychart.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:09.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:10.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:09.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:10.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.rjmx.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:10.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:11.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.ui.common.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:11.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:11.000000000 +0100 +++ new/application/tests/org.openjdk.jmc.ui.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:11.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:12.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.common.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:12.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore --- /dev/null 2019-02-27 20:13:13.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.rules.jdk.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:13.000000000 +0100 @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.7 --- /dev/null 2019-02-27 20:13:13.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.rules.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:13.000000000 +0100 @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.7 --- /dev/null 2019-02-27 20:13:14.000000000 +0100 +++ new/core/tests/org.openjdk.jmc.flightrecorder.test/.settings/org.eclipse.jdt.core.prefs 2019-02-27 20:13:14.000000000 +0100 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore