Skip to content

Commit

Permalink
update javadoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chewiebug committed Feb 25, 2018
1 parent 7334420 commit 54d5042
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -669,7 +669,7 @@ public String toString() {
* <li><code>GC</code>: just the name of the event type</li>
* <li><code>PAUSE</code>: length of a pause</li>
* <li><code>DURATION</code>: cycle time of a (usually concurrent) event</li>
* <li><code>MEMORY</code>: information about heap changes</li></li>
* <li><code>MEMORY</code>: information about heap changes</li>
* <li><code>REGION</code>: information about number of regions used (only G1 up to now)</li>
* </ul>
*/
Expand Down
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -38,41 +38,50 @@ public StayOpenCheckBoxMenuItem() {
}

/**
* @param a action, where properties are taken from to create MenuItem
* @see JCheckBoxMenuItem#JCheckBoxMenuItem(Action)
*/
public StayOpenCheckBoxMenuItem(Action a) {
super(a);
}

/**
* @param icon icon for menu item
* @see JCheckBoxMenuItem#JCheckBoxMenuItem(Icon)
*/
public StayOpenCheckBoxMenuItem(Icon icon) {
super(icon);
}

/**
* @param text text for menu item
* @see JCheckBoxMenuItem#JCheckBoxMenuItem(String)
*/
public StayOpenCheckBoxMenuItem(String text) {
super(text);
}

/**
* @param text text for menu item
* @param selected initial state of checkbox
* @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, boolean)
*/
public StayOpenCheckBoxMenuItem(String text, boolean selected) {
super(text, selected);
}

/**
* @param text text for menu item
* @param icon icon for menu item
* @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, Icon)
*/
public StayOpenCheckBoxMenuItem(String text, Icon icon) {
super(text, 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) {
Expand Down
Expand Up @@ -16,7 +16,6 @@

/**
* <p>Holds a group of resource names (those displayed in the same GCDocument).</p>
* <p>
* <p>This class was refactored from "URLSet".</p>
*
* @author <a href="mailto:gcviewer@gmx.ch">Joerg Wuethrich</a>
Expand Down

0 comments on commit 54d5042

Please sign in to comment.