Make some inner classes static
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Sat, 23 Jan 2016 03:34:50 +0000 (22:34 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 25 Jan 2016 16:15:59 +0000 (11:15 -0500)
These classes are inner classes, but they do not use its embedded
reference to the object which created them.  This reference makes
the instances of the class larger, and may keep the reference to
the creator object alive longer than necessary.

The classes should be static.

Change-Id: I76982a42e10fa89ea7e18524914605d60016fbf3
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/65036
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
btf/org.eclipse.tracecompass.btf.ui/src/org/eclipse/tracecompass/btf/ui/BtfEventPropertySource.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventPropertySource.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java

index 8aae9d9b92146453fd2521fedf180a2efadde601..d9abc0055f161a4e8194fe239fdc99646efec0ab 100644 (file)
@@ -71,7 +71,7 @@ public class BtfEventPropertySource extends TmfEventPropertySource {
         return DESCRIPTORS;
     }
 
-    private class EntityPropertySource implements IPropertySource {
+    private static class EntityPropertySource implements IPropertySource {
         private final String fName;
         private final String fInstance;
 
@@ -115,7 +115,7 @@ public class BtfEventPropertySource extends TmfEventPropertySource {
 
     }
 
-    private class TypePropertySource implements IPropertySource {
+    private static class TypePropertySource implements IPropertySource {
         private final String fType;
         private final String fDescr;
 
@@ -158,7 +158,7 @@ public class BtfEventPropertySource extends TmfEventPropertySource {
         }
     }
 
-    private class EventPropertySource implements IPropertySource {
+    private static class EventPropertySource implements IPropertySource {
         private final ITmfEventField fEventField;
 
         public EventPropertySource(ITmfEventField eventField) {
index 693b660d20af65d8d60359daf8fc4f23ef6408fd..5276616ad5c7d3fddde43336d2f654bb4579fd6f 100644 (file)
@@ -52,7 +52,7 @@ public class TmfEventPropertySource implements IPropertySource {
 
     private ITmfEvent fEvent;
 
-    private class TimestampPropertySource implements IPropertySource {
+    private static class TimestampPropertySource implements IPropertySource {
         private static final String ID_TIMESTAMP_VALUE = "timestamp_value"; //$NON-NLS-1$
         private static final String ID_TIMESTAMP_SCALE = "timestamp_scale"; //$NON-NLS-1$
         private static final String NAME_TIMESTAMP_VALUE = "value"; //$NON-NLS-1$
@@ -101,7 +101,7 @@ public class TmfEventPropertySource implements IPropertySource {
         }
     }
 
-    private class ContentPropertySource implements IPropertySource {
+    private static class ContentPropertySource implements IPropertySource {
         private ITmfEventField fContent;
 
         public ContentPropertySource(ITmfEventField content) {
@@ -147,7 +147,7 @@ public class TmfEventPropertySource implements IPropertySource {
         }
     }
 
-    private class SourceLookupPropertySource implements IPropertySource {
+    private static class SourceLookupPropertySource implements IPropertySource {
 
         private static final String ID_FILE_NAME = "callsite_file"; //$NON-NLS-1$
         private static final String ID_FUNCTION_NAME = "callsite_function"; //$NON-NLS-1$
index f71a9d8fbb659e0212aaf457e2195f9909c23e15..f393e04bd2b3b887a641543a8af82fb384482582 100644 (file)
@@ -417,7 +417,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
-    private final class PainItemListener implements Listener {
+    private static final class PainItemListener implements Listener {
         @Override
         public void handleEvent(Event event) {
             TableItem item = (TableItem) event.item;
@@ -451,7 +451,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
-    private final class EraseItemListener implements Listener {
+    private static final class EraseItemListener implements Listener {
         @Override
         public void handleEvent(Event event) {
             TableItem item = (TableItem) event.item;
index 6a8f01b62eadee19b0a03c9f2600fa10cabe2d7d..0d4ce1d94871c485a228ef5dae2beb588f227273 100644 (file)
@@ -182,7 +182,7 @@ public class CallStackView extends AbstractTimeGraphView {
     // Classes
     // ------------------------------------------------------------------------
 
-    private class TraceEntry extends TimeGraphEntry {
+    private static class TraceEntry extends TimeGraphEntry {
         public TraceEntry(String name, long startTime, long endTime) {
             super(name, startTime, endTime);
         }
@@ -193,7 +193,7 @@ public class CallStackView extends AbstractTimeGraphView {
         }
     }
 
-    private class ThreadEntry extends TimeGraphEntry {
+    private static class ThreadEntry extends TimeGraphEntry {
         // The call stack quark
         private final int fCallStackQuark;
         // The state system from which this entry comes
@@ -237,7 +237,7 @@ public class CallStackView extends AbstractTimeGraphView {
         }
     }
 
-    private class ThreadNameComparator implements Comparator<ITimeGraphEntry> {
+    private static class ThreadNameComparator implements Comparator<ITimeGraphEntry> {
         private boolean reverse;
 
         public ThreadNameComparator(boolean reverse) {
@@ -251,7 +251,7 @@ public class CallStackView extends AbstractTimeGraphView {
         }
     }
 
-    private class ThreadIdComparator implements Comparator<ITimeGraphEntry> {
+    private static class ThreadIdComparator implements Comparator<ITimeGraphEntry> {
         private boolean reverse;
 
         public ThreadIdComparator(boolean reverse) {
@@ -267,7 +267,7 @@ public class CallStackView extends AbstractTimeGraphView {
         }
     }
 
-    private class ThreadTimeComparator implements Comparator<ITimeGraphEntry> {
+    private static class ThreadTimeComparator implements Comparator<ITimeGraphEntry> {
         private boolean reverse;
 
         public ThreadTimeComparator(boolean reverse) {
@@ -281,7 +281,7 @@ public class CallStackView extends AbstractTimeGraphView {
         }
     }
 
-    private class CallStackTreeLabelProvider extends TreeLabelProvider {
+    private static class CallStackTreeLabelProvider extends TreeLabelProvider {
 
         @Override
         public Image getColumnImage(Object element, int columnIndex) {
index cc31d219d3cc37eca4dc4c0a234a73dd3ecfa432..4ff736cc93c994c891a7e19cc2f435962a429587 100644 (file)
@@ -242,7 +242,7 @@ public class TimeGraphCombo extends Composite {
      * The TreeLabelProviderWrapper is used to intercept the filler items
      * from the calls to the tree's real label provider.
      */
-    private class TreeLabelProviderWrapper implements ITableLabelProvider {
+    private static class TreeLabelProviderWrapper implements ITableLabelProvider {
         private final ITableLabelProvider labelProvider;
 
         public TreeLabelProviderWrapper(ITableLabelProvider labelProvider) {
@@ -334,7 +334,7 @@ public class TimeGraphCombo extends Composite {
      * the time graph combo's real ViewerFilters. These filler items should
      * always be visible.
      */
-    private class ViewerFilterWrapper extends ViewerFilter {
+    private static class ViewerFilterWrapper extends ViewerFilter {
 
         private ViewerFilter fWrappedFilter;
 
This page took 0.028399 seconds and 5 git commands to generate.