tmf/lttng: Remove unneeded (non-Javadoc) comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.core / src / org / eclipse / linuxtools / internal / lttng2 / core / control / model / impl / DomainInfo.java
index 31681db2c299d9492b98ff76a367f396a449e112..8a39349d26df83fddb4f4ff9ae2a87b24a648b66 100644 (file)
@@ -1,12 +1,12 @@
 /**********************************************************************
- * Copyright (c) 2012 Ericsson
- * 
+ * Copyright (c) 2012, 2013 Ericsson
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
+ *
+ * Contributors:
  *   Bernd Hufmann - Initial API and implementation
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
@@ -21,9 +21,9 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
 /**
  * <p>
  * Implementation of the trace domain interface (IDomainInfo) to store domain
- * related data. 
+ * related data.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class DomainInfo extends TraceInfo implements IDomainInfo {
@@ -34,7 +34,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
     /**
      * The channels information of the domain.
      */
-    private List<IChannelInfo> fChannels = new ArrayList<IChannelInfo>();
+    private final List<IChannelInfo> fChannels = new ArrayList<IChannelInfo>();
     private boolean fIsKernel = false;
 
     // ------------------------------------------------------------------------
@@ -63,20 +63,12 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
         }
         fIsKernel = other.fIsKernel;
     }
-    
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#isKernel()
-     */
+
     @Override
     public boolean isKernel() {
         return fIsKernel;
     }
-    
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#setIsKernel(boolean)
-     */
+
     @Override
     public void setIsKernel(boolean isKernel) {
         fIsKernel = isKernel;
@@ -85,53 +77,35 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#getChannels()
-     */
+
     @Override
     public IChannelInfo[] getChannels() {
         return fChannels.toArray(new IChannelInfo[fChannels.size()]);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#setChannels(java.util.List)
-     */
     @Override
     public void setChannels(List<IChannelInfo> channels) {
+        fChannels.clear();
         for (Iterator<IChannelInfo> iterator = channels.iterator(); iterator.hasNext();) {
-            IChannelInfo channelInfo = (IChannelInfo) iterator.next();
+            IChannelInfo channelInfo = iterator.next();
             fChannels.add(channelInfo);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#addChannel(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo)
-     */
     @Override
     public void addChannel(IChannelInfo channel) {
         fChannels.add(channel);
     }
-    
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode()
-     */
+
     @Override
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((fChannels == null) ? 0 : fChannels.hashCode());
+        result = prime * result + fChannels.hashCode();
         result = prime * result + (fIsKernel ? 1231 : 1237);
         return result;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#equals(java.lang.Object)
-     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj) {
@@ -144,11 +118,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
             return false;
         }
         DomainInfo other = (DomainInfo) obj;
-        if (fChannels == null) {
-            if (other.fChannels != null) {
-                return false;
-            }
-        } else if (!fChannels.equals(other.fChannels)) {
+        if (!fChannels.equals(other.fChannels)) {
             return false;
         }
         if (fIsKernel != other.fIsKernel) {
@@ -157,10 +127,6 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
         return true;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#toString()
-     */
     @SuppressWarnings("nls")
     @Override
     public String toString() {
@@ -172,7 +138,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
                 output.append("None");
             } else {
                 for (Iterator<IChannelInfo> iterator = fChannels.iterator(); iterator.hasNext();) {
-                    IChannelInfo channel = (IChannelInfo) iterator.next();
+                    IChannelInfo channel = iterator.next();
                     output.append(channel.toString());
                 }
             }
@@ -181,5 +147,5 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
             output.append(")]");
             return output.toString();
     }
-    
+
 }
This page took 0.02605 seconds and 5 git commands to generate.