From 54d504206a6d77c4264fc9e66c17201315360c36 Mon Sep 17 00:00:00 2001 From: chewiebug Date: Sun, 25 Feb 2018 18:59:15 +0100 Subject: [PATCH] update javadoc comments --- .../ctrl/GCModelLoaderGroupTracker.java | 2 ++ .../ctrl/impl/ViewMenuController.java | 2 +- .../gcviewer/imp/AbstractDataReaderSun.java | 4 +++- .../perf/gcviewer/imp/DataReaderFacade.java | 8 +++---- .../gcviewer/imp/DataReaderIBMi5OS1_4_2.java | 3 ++- .../perf/gcviewer/model/AbstractGCEvent.java | 2 +- .../util/HttpUrlConnectionHelper.java | 21 +++++++++---------- .../gcviewer/view/GCViewerGuiMenuBar.java | 2 +- .../view/StayOpenCheckBoxMenuItem.java | 9 ++++++++ .../gcviewer/view/model/GCResourceGroup.java | 1 - 10 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/tagtraum/perf/gcviewer/ctrl/GCModelLoaderGroupTracker.java b/src/main/java/com/tagtraum/perf/gcviewer/ctrl/GCModelLoaderGroupTracker.java index c534d174..66e42944 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/ctrl/GCModelLoaderGroupTracker.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/ctrl/GCModelLoaderGroupTracker.java @@ -13,6 +13,7 @@ */ public interface GCModelLoaderGroupTracker extends PropertyChangeListener { /** + * @param listener The PropertyChangeListener to be added * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener) */ void addPropertyChangeListener(PropertyChangeListener listener); @@ -36,6 +37,7 @@ public interface GCModelLoaderGroupTracker extends PropertyChangeListener { void propertyChange(PropertyChangeEvent evt); /** + * @param listener The PropertyChangeListener to be removed * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener) */ void removePropertyChangeListener(PropertyChangeListener listener); diff --git a/src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/ViewMenuController.java b/src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/ViewMenuController.java index 29825926..dd7f11d8 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/ViewMenuController.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/ViewMenuController.java @@ -24,7 +24,7 @@ public class ViewMenuController implements ActionListener, PropertyChangeListene private GCViewerGui gui; /** - * @param gui + * @param gui gui to listen for actions */ public ViewMenuController(GCViewerGui gui) { this.gui = gui; diff --git a/src/main/java/com/tagtraum/perf/gcviewer/imp/AbstractDataReaderSun.java b/src/main/java/com/tagtraum/perf/gcviewer/imp/AbstractDataReaderSun.java index b7889dbe..3e57c6e0 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/imp/AbstractDataReaderSun.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/imp/AbstractDataReaderSun.java @@ -55,7 +55,9 @@ public abstract class AbstractDataReaderSun extends AbstractDataReader { protected GcLogType gcLogType; /** - * Create an instance of this class passing an inputStream an the type of the logfile. + * Create an instance of this class passing an inputStream and the type of the logfile. + * + * @param gcResource information about the resource to be parsed * @param in inputstream to the log file * @param gcLogType type of the logfile * @throws UnsupportedEncodingException if ASCII is not supported diff --git a/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderFacade.java b/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderFacade.java index 4fd5c764..cb944ca4 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderFacade.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderFacade.java @@ -85,7 +85,7 @@ public GCModel loadModel(GCResource gcResource) throws DataReaderException { * * @param gcResource the {@link GcResourceSeries} to load * @return a {@link GCModel} containing all events found in the given {@link GCResource}s that were readable - * @throws DataReaderException + * @throws DataReaderException thrown in case of some parser failure */ protected GCModel loadModelFromSeries(GcResourceSeries gcResource) throws DataReaderException { GcSeriesLoader seriesLoader = new GcSeriesLoader(this); @@ -106,12 +106,12 @@ private GCModel readModel(GcResourceFile gcResource) throws IOException { InputStream in = null; try { if (url.getProtocol().startsWith("http")) { - AtomicLong cl = new AtomicLong(); + AtomicLong atomicContentLength = new AtomicLong(); URLConnection conn = url.openConnection(); in = HttpUrlConnectionHelper.openInputStream((HttpURLConnection) conn, HttpUrlConnectionHelper.GZIP, - cl); - contentLength = cl.get(); + atomicContentLength); + contentLength = atomicContentLength.get(); } else { in = url.openStream(); diff --git a/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderIBMi5OS1_4_2.java b/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderIBMi5OS1_4_2.java index c24e123e..a5f5e834 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderIBMi5OS1_4_2.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderIBMi5OS1_4_2.java @@ -27,8 +27,9 @@ public class DataReaderIBMi5OS1_4_2 extends AbstractDataReader { /** * Constructor for the IBM i5/OS GC reader. + * @param gcResource information about the resource to be parsed * @param in InputStream delivering the GC data - * @throws UnsupportedEncodingException + * @throws UnsupportedEncodingException thrown in case the desired encoding is not supported */ public DataReaderIBMi5OS1_4_2(GCResource gcResource, InputStream in) throws UnsupportedEncodingException { super(gcResource, in); diff --git a/src/main/java/com/tagtraum/perf/gcviewer/model/AbstractGCEvent.java b/src/main/java/com/tagtraum/perf/gcviewer/model/AbstractGCEvent.java index 4ced53e8..a43abc64 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/model/AbstractGCEvent.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/model/AbstractGCEvent.java @@ -669,7 +669,7 @@ public String toString() { *
  • GC: just the name of the event type
  • *
  • PAUSE: length of a pause
  • *
  • DURATION: cycle time of a (usually concurrent) event
  • - *
  • MEMORY: information about heap changes
  • + *
  • MEMORY: information about heap changes
  • *
  • REGION: information about number of regions used (only G1 up to now)
  • * */ diff --git a/src/main/java/com/tagtraum/perf/gcviewer/util/HttpUrlConnectionHelper.java b/src/main/java/com/tagtraum/perf/gcviewer/util/HttpUrlConnectionHelper.java index d6f13234..fb4a9778 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/util/HttpUrlConnectionHelper.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/util/HttpUrlConnectionHelper.java @@ -96,15 +96,14 @@ private static String readAndCloseErrorStream(InputStream in, /** * Sets request properties, connects and opens the input stream depending on the HTTP response. * - * @param httpConn The HTTP connection - * @param acceptEncoding Content-encoding (gzip,defate or null) + * @param httpConn The HTTP connection + * @param acceptEncoding Content-encoding (gzip, deflate or null) + * @param contentLength length of content (output parameter) * @return The input stream * @throws IOException if problem occured. */ - public static InputStream openInputStream(HttpURLConnection httpConn, - String acceptEncoding, - AtomicLong cl) - throws IOException { + public static InputStream openInputStream(HttpURLConnection httpConn, String acceptEncoding, AtomicLong contentLength) + throws IOException { // set request properties httpConn.setRequestProperty(ACCEPT_ENCODING, acceptEncoding); @@ -113,20 +112,20 @@ public static InputStream openInputStream(HttpURLConnection httpConn, // from here we're reading the server's response String contentEncoding = httpConn.getContentEncoding(); String contentType = httpConn.getContentType(); - long contentLength = httpConn.getContentLengthLong(); + long contentLengthLong = httpConn.getContentLengthLong(); long lastModified = httpConn.getLastModified(); - LOGGER.log(Level.INFO, "Reading " + (contentLength < 0L + LOGGER.log(Level.INFO, "Reading " + (contentLengthLong < 0L ? "?" - : Long.toString(contentLength) ) + " bytes from " + httpConn.getURL() + + : Long.toString(contentLengthLong) ) + " bytes from " + httpConn.getURL() + "; contentType = " + contentType + "; contentEncoding = " + contentEncoding + "; last modified = " + (lastModified <= 0L ? "-" : new Date(lastModified).toString())); final int responseCode = httpConn.getResponseCode(); if (responseCode/100 == 2) { - if (cl != null) { + if (contentLength != null) { // abuse of AtomicLong, but I need a pointer to long (or FileInformation) - cl.set(contentLength); + contentLength.set(contentLengthLong); } } else { String responseMessage = httpConn.getResponseMessage(); diff --git a/src/main/java/com/tagtraum/perf/gcviewer/view/GCViewerGuiMenuBar.java b/src/main/java/com/tagtraum/perf/gcviewer/view/GCViewerGuiMenuBar.java index 8d6ac43d..94a0ccd8 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/view/GCViewerGuiMenuBar.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/view/GCViewerGuiMenuBar.java @@ -120,7 +120,7 @@ public void addToWindowMenuGroup(JCheckBoxMenuItem menuItem) { /** * Remove a menuItem from the window menu including removal of the group. - * @param menuItem + * @param menuItem menuItem to be removed */ public void removeFromWindowMenuGroup(JMenuItem menuItem) { windowMenu.remove(menuItem); diff --git a/src/main/java/com/tagtraum/perf/gcviewer/view/StayOpenCheckBoxMenuItem.java b/src/main/java/com/tagtraum/perf/gcviewer/view/StayOpenCheckBoxMenuItem.java index 86ac6e08..bff4342f 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/view/StayOpenCheckBoxMenuItem.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/view/StayOpenCheckBoxMenuItem.java @@ -38,6 +38,7 @@ public StayOpenCheckBoxMenuItem() { } /** + * @param a action, where properties are taken from to create MenuItem * @see JCheckBoxMenuItem#JCheckBoxMenuItem(Action) */ public StayOpenCheckBoxMenuItem(Action a) { @@ -45,6 +46,7 @@ public StayOpenCheckBoxMenuItem(Action a) { } /** + * @param icon icon for menu item * @see JCheckBoxMenuItem#JCheckBoxMenuItem(Icon) */ public StayOpenCheckBoxMenuItem(Icon icon) { @@ -52,6 +54,7 @@ public StayOpenCheckBoxMenuItem(Icon icon) { } /** + * @param text text for menu item * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String) */ public StayOpenCheckBoxMenuItem(String text) { @@ -59,6 +62,8 @@ public StayOpenCheckBoxMenuItem(String text) { } /** + * @param text text for menu item + * @param selected initial state of checkbox * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, boolean) */ public StayOpenCheckBoxMenuItem(String text, boolean selected) { @@ -66,6 +71,8 @@ public StayOpenCheckBoxMenuItem(String text, boolean selected) { } /** + * @param text text for menu item + * @param icon icon for menu item * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, Icon) */ public StayOpenCheckBoxMenuItem(String text, Icon icon) { @@ -73,6 +80,8 @@ public StayOpenCheckBoxMenuItem(String text, Icon icon) { } /** + * @param text text for menu item + * @param selected initial state for checkbox * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, Icon, boolean) */ public StayOpenCheckBoxMenuItem(String text, Icon icon, boolean selected) { diff --git a/src/main/java/com/tagtraum/perf/gcviewer/view/model/GCResourceGroup.java b/src/main/java/com/tagtraum/perf/gcviewer/view/model/GCResourceGroup.java index 07bd9519..98529212 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/view/model/GCResourceGroup.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/view/model/GCResourceGroup.java @@ -16,7 +16,6 @@ /** *

    Holds a group of resource names (those displayed in the same GCDocument).

    - *

    *

    This class was refactored from "URLSet".

    * * @author Joerg Wuethrich