org.eclipse.linuxtools.valgrind.memcheck_1.3.18.201310312000

16:46:11.849 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.valgrind.memcheck_1.3.18.201310312000.jar
package org.eclipse.linuxtools.valgrind.memcheck;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.linuxtools.valgrind.core.ValgrindCommand;
import org.eclipse.linuxtools.valgrind.launch.CommandManager;
import org.eclipse.linuxtools.valgrind.launch.IValgrindLaunchDelegate;
import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
import org.eclipse.linuxtools.valgrind.ui.ValgrindUIPlugin;
import org.eclipse.linuxtools.valgrind.ui.ValgrindViewPart;
import org.tizen.nativecommon.launch.TizenLaunchDelegate;
import org.xml.sax.SAXException;

public class MemcheckLaunchDelegate
  extends TizenLaunchDelegate
  implements IValgrindLaunchDelegate
{
  public static final String OPT_LEAKCHECK = "--leak-check";
  public static final String OPT_SHOWREACH = "--show-reachable";
  public static final String OPT_LEAKRES = "--leak-resolution";
  public static final String OPT_FREELIST = "--freelist-vol";
  public static final String OPT_GCCWORK = "--workaround-gcc296-bugs";
  public static final String OPT_PARTIAL = "--partial-loads-ok";
  public static final String OPT_UNDEF = "--undef-value-errors";
  protected static final String EMPTY_STRING = "";
  protected static final String NO = "no";
  protected static final String YES = "yes";
  protected static final String EQUALS = "=";
  protected ArrayList<ValgrindError> errors;
  protected ValgrindError error;
  
  public void launch(ValgrindCommand paramValgrindCommand, ILaunchConfiguration paramILaunchConfiguration, ILaunch paramILaunch, IProgressMonitor paramIProgressMonitor)
    throws Exception
  {
    try
    {
      String str1 = ValgrindUIPlugin.getDefault().getStateLocation().toOSString();
      localObject = "/tmp/valgrind_result.xml";
      String str2 = str1 + File.separator + "valgrind_result.xml";
      File localFile = new File(str2);
      if (localFile.exists()) {
        localFile.delete();
      }
      CommandManager.pull((String)localObject, str2);
      parseOutput(str2);
    }
    catch (ParserConfigurationException localParserConfigurationException)
    {
      abort(Messages.getString("MemcheckLaunchDelegate.Error_parsing_output"), localParserConfigurationException, 150);
      localParserConfigurationException.printStackTrace();
    }
    catch (IOException localIOException)
    {
      abort(Messages.getString("MemcheckLaunchDelegate.Error_parsing_output"), localIOException, 150);
      localIOException.printStackTrace();
    }
    catch (SAXException localSAXException)
    {
      Object localObject = localSAXException;
      abort(Messages.getString("MemcheckLaunchDelegate.Error_parsing_output"), (Throwable)localObject, 150);
      localSAXException.printStackTrace();
    }
  }
  
  protected void parseOutput(String paramString)
    throws ParserConfigurationException, IOException, CoreException, SAXException
  {
    ValgrindXMLParser localValgrindXMLParser = new ValgrindXMLParser(new FileInputStream(paramString));
    errors = localValgrindXMLParser.getErrors();
    ValgrindViewPart localValgrindViewPart = ValgrindUIPlugin.getDefault().getView();
    IValgrindToolView localIValgrindToolView = localValgrindViewPart.getDynamicView();
    if ((localIValgrindToolView instanceof MemcheckViewPart)) {
      ((MemcheckViewPart)localIValgrindToolView).setErrors((ValgrindError[])errors.toArray(new ValgrindError[errors.size()]));
    }
  }
  
  public String[] getCommandArray(ValgrindCommand paramValgrindCommand, ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add("--xml=yes");
    localArrayList.add("--xml-file=/tmp/valgrind_result.xml");
    localArrayList.add("--leak-check=yes");
    localArrayList.add("--show-reachable=" + (paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_SHOWREACH", false) ? "yes" : "no"));
    localArrayList.add("--leak-resolution=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES", "low"));
    localArrayList.add("--freelist-vol=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_FREELIST", 10000000));
    localArrayList.add("--workaround-gcc296-bugs=" + (paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_GCCWORK", false) ? "yes" : "no"));
    localArrayList.add("--partial-loads-ok=" + (paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_PARTIAL", false) ? "yes" : "no"));
    localArrayList.add("--undef-value-errors=" + (paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_UNDEF", true) ? "yes" : "no"));
    return (String[])localArrayList.toArray(new String[localArrayList.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckLaunchDelegate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class MemcheckPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.memcheck";
  public static final String MARKER_TYPE = "org.eclipse.linuxtools.valgrind.memcheck.marker";
  private static MemcheckPlugin plugin;
  public static final String TOOL_ID = "org.eclipse.linuxtools.valgrind.launch.memcheck";
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    plugin = this;
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    plugin = null;
    super.stop(paramBundleContext);
  }
  
  public static MemcheckPlugin getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MemcheckToolPage$1
  extends SelectionAdapter
{
  MemcheckToolPage$1(MemcheckToolPage paramMemcheckToolPage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    this$0.updateLaunchConfigurationDialog();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckToolPage.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class MemcheckToolPage$2
  implements ModifyListener
{
  MemcheckToolPage$2(MemcheckToolPage paramMemcheckToolPage) {}
  
  public void modifyText(ModifyEvent paramModifyEvent)
  {
    this$0.updateLaunchConfigurationDialog();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckToolPage.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.linuxtools.valgrind.launch.IValgrindToolPage;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Spinner;

public class MemcheckToolPage
  extends AbstractLaunchConfigurationTab
  implements IValgrindToolPage
{
  public static final String MEMCHECK = "memcheck";
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.memcheck";
  protected Combo leakCheckCombo;
  protected Combo leakResCombo;
  protected Button showReachableButton;
  protected Spinner freelistSpinner;
  protected Button partialLoadsButton;
  protected Button undefValueButton;
  protected Button gccWorkaroundButton;
  protected Spinner alignmentSpinner;
  public static final String ATTR_MEMCHECK_LEAKCHECK = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKCHECK";
  public static final String ATTR_MEMCHECK_LEAKRES = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES";
  public static final String ATTR_MEMCHECK_SHOWREACH = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_SHOWREACH";
  public static final String ATTR_MEMCHECK_PARTIAL = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_PARTIAL";
  public static final String ATTR_MEMCHECK_UNDEF = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_UNDEF";
  public static final String ATTR_MEMCHECK_FREELIST = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_FREELIST";
  public static final String ATTR_MEMCHECK_GCCWORK = "org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_GCCWORK";
  protected static final String EMPTY_STRING = "";
  protected static final String NO = "no";
  protected static final String YES = "yes";
  protected static final String EQUALS = "=";
  protected boolean isInitializing = false;
  protected SelectionListener selectListener = new SelectionAdapter()
  {
    public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
    {
      updateLaunchConfigurationDialog();
    }
  };
  protected ModifyListener modifyListener = new ModifyListener()
  {
    public void modifyText(ModifyEvent paramAnonymousModifyEvent)
    {
      updateLaunchConfigurationDialog();
    }
  };
  
  public void createControl(Composite paramComposite)
  {
    Composite localComposite1 = new Composite(paramComposite, 0);
    GridLayout localGridLayout = new GridLayout(2, true);
    localComposite1.setLayout(localGridLayout);
    localComposite1.setLayoutData(new GridData(768));
    Composite localComposite2 = new Composite(localComposite1, 0);
    localComposite2.setLayout(new GridLayout(2, false));
    localComposite2.setLayoutData(new GridData(768));
    Label localLabel1 = new Label(localComposite2, 0);
    localLabel1.setText(Messages.getString("MemcheckToolPage.leak_check"));
    leakCheckCombo = new Combo(localComposite2, 8);
    String[] arrayOfString1 = { "no", "summary", "yes", "full" };
    leakCheckCombo.setItems(arrayOfString1);
    leakCheckCombo.addSelectionListener(selectListener);
    Composite localComposite3 = new Composite(localComposite1, 0);
    localComposite3.setLayout(new GridLayout(2, false));
    localComposite3.setLayoutData(new GridData(768));
    Label localLabel2 = new Label(localComposite3, 0);
    localLabel2.setText(Messages.getString("MemcheckToolPage.leak_resolution"));
    leakResCombo = new Combo(localComposite3, 8);
    String[] arrayOfString2 = { "low", "med", "high" };
    leakResCombo.setItems(arrayOfString2);
    leakResCombo.addSelectionListener(selectListener);
    Composite localComposite4 = new Composite(localComposite1, 0);
    localComposite4.setLayout(new GridLayout(2, false));
    localComposite4.setLayoutData(new GridData(768));
    Label localLabel3 = new Label(localComposite4, 0);
    localLabel3.setText(Messages.getString("MemcheckToolPage.freelist_size"));
    freelistSpinner = new Spinner(localComposite4, 2048);
    freelistSpinner.setMaximum(Integer.MAX_VALUE);
    freelistSpinner.addModifyListener(modifyListener);
    showReachableButton = new Button(localComposite1, 32);
    showReachableButton.setLayoutData(new GridData(768));
    showReachableButton.setText(Messages.getString("MemcheckToolPage.show_reachable"));
    showReachableButton.addSelectionListener(selectListener);
    partialLoadsButton = new Button(localComposite1, 32);
    partialLoadsButton.setLayoutData(new GridData(768));
    partialLoadsButton.setText(Messages.getString("MemcheckToolPage.allow_partial"));
    partialLoadsButton.addSelectionListener(selectListener);
    undefValueButton = new Button(localComposite1, 32);
    undefValueButton.setLayoutData(new GridData(768));
    undefValueButton.setText(Messages.getString("MemcheckToolPage.undef_value_errors"));
    undefValueButton.addSelectionListener(selectListener);
    Composite localComposite5 = new Composite(localComposite1, 0);
    localComposite5.setLayout(new GridLayout(2, false));
    localComposite5.setLayoutData(new GridData(768));
  }
  
  public String getName()
  {
    return Messages.getString("MemcheckToolPage.Memcheck_Options");
  }
  
  public void initializeFrom(ILaunchConfiguration paramILaunchConfiguration)
  {
    isInitializing = true;
    try
    {
      initializeMemcheck(paramILaunchConfiguration);
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    isInitializing = false;
  }
  
  protected void initializeMemcheck(ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException
  {
    leakCheckCombo.setText(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKCHECK", "summary"));
    leakResCombo.setText(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES", "low"));
    showReachableButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_SHOWREACH", false));
    freelistSpinner.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_FREELIST", 10000000));
    partialLoadsButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_PARTIAL", false));
    undefValueButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_UNDEF", true));
  }
  
  public void performApply(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKCHECK", leakCheckCombo.getText());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES", leakResCombo.getText());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_SHOWREACH", showReachableButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_FREELIST", freelistSpinner.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_PARTIAL", partialLoadsButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_UNDEF", undefValueButton.getSelection());
  }
  
  public void setDefaults(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    setDefaultToolAttributes(paramILaunchConfigurationWorkingCopy);
  }
  
  protected static void setDefaultToolAttributes(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKCHECK", "yes");
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES", "low");
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_SHOWREACH", false);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_FREELIST", 10000000);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_PARTIAL", false);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_UNDEF", true);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_GCCWORK", false);
  }
  
  protected void createHorizontalSpacer(Composite paramComposite, int paramInt)
  {
    Label localLabel = new Label(paramComposite, 0);
    GridData localGridData = new GridData(768);
    horizontalSpan = paramInt;
    localLabel.setLayoutData(localGridData);
  }
  
  protected void updateLaunchConfigurationDialog()
  {
    if (!isInitializing) {
      super.updateLaunchConfigurationDialog();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckToolPage
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.ui.forms.widgets.Section;

class MemcheckViewPart$1
  implements ControlListener
{
  MemcheckViewPart$1(MemcheckViewPart paramMemcheckViewPart) {}
  
  public void controlMoved(ControlEvent paramControlEvent) {}
  
  public void controlResized(ControlEvent paramControlEvent)
  {
    this$0.memoryErrorSection.layout(true);
    this$0.resizeComposite();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckViewPart.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.ui.forms.widgets.Section;

class MemcheckViewPart$2
  implements ControlListener
{
  MemcheckViewPart$2(MemcheckViewPart paramMemcheckViewPart) {}
  
  public void controlMoved(ControlEvent paramControlEvent) {}
  
  public void controlResized(ControlEvent paramControlEvent)
  {
    this$0.memoryLeakSection.layout(true);
    this$0.resizeComposite();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckViewPart.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import java.util.ArrayList;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.valgrind.memcheck.model.RootTreeElement;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.Section;

class MemcheckViewPart$3$1
  implements Runnable
{
  MemcheckViewPart$3$1(MemcheckViewPart.3 param3) {}
  
  public void run()
  {
    if (access$0this$1).errors != null)
    {
      int i = access$0this$1).errors.length > 1000 ? 1000 : access$0this$1).errors.length;
      ArrayList localArrayList1 = new ArrayList();
      ArrayList localArrayList2 = new ArrayList();
      for (int j = 0; j < i; j++) {
        if (access$0this$1).errors[j].getKind().startsWith("Invalid")) {
          localArrayList1.add(access$0this$1).errors[j]);
        } else {
          localArrayList2.add(access$0this$1).errors[j]);
        }
      }
      MemcheckViewPart.3.access$0(this$1).getFilelistInProjects();
      j = 0;
      int k = 0;
      int m = 0;
      int n = 0;
      int i1 = 0;
      int i2 = 0;
      int i3 = 0;
      int i4 = 0;
      int i5 = 0;
      Object localObject2;
      int i9;
      for (int i6 = 0; i6 < localArrayList1.size(); i6++)
      {
        ValgrindError localValgrindError = (ValgrindError)localArrayList1.get(i6);
        for (int i8 = 0; i8 < localValgrindError.getFrames().size(); i8++)
        {
          localObject2 = (ValgrindStackFrame)localValgrindError.getFrames().get(i8);
          if (((ValgrindStackFrame)localObject2).getFile() != null) {
            for (i9 = 0; i9 < MemcheckViewPart.access$0(MemcheckViewPart.3.access$0(this$1)).size(); i9++) {
              if (((ValgrindStackFrame)localObject2).getFile().compareToIgnoreCase((String)MemcheckViewPart.access$0(MemcheckViewPart.3.access$0(this$1)).get(i9)) == 0)
              {
                j++;
                i8 = localValgrindError.getFrames().size();
                break;
              }
            }
          }
        }
      }
      String str1 = "*** Memory Error Summary ***\n\n";
      str1 = str1 + "[ " + localArrayList1.size() + " ] errors \n";
      str1 = str1 + "\t from [ " + j + " ] defect \n";
      str1 = str1 + "\t from [ " + (localArrayList1.size() - j) + " ] system library";
      access$0this$1).memoryErrorSection.setToolTipText(str1);
      for (int i7 = 0; i7 < localArrayList2.size(); i7++)
      {
        localObject1 = (ValgrindError)localArrayList2.get(i7);
        ValgrindStackFrame localValgrindStackFrame;
        int i14;
        if (((ValgrindError)localObject1).getKind().startsWith("Leak_DefinitelyLost"))
        {
          k++;
          localObject2 = ((ValgrindError)localObject1).getWhat();
          i9 = ((String)localObject2).indexOf(" byte");
          if ((localObject2 != null) && (i9 >= 0))
          {
            String str2 = ((String)localObject2).substring(0, i9);
            try
            {
              m += Integer.valueOf(str2).intValue();
            }
            catch (NumberFormatException localNumberFormatException1)
            {
              try
              {
                str2 = str2.replace(",", "");
                m += Integer.valueOf(str2).intValue();
              }
              catch (NumberFormatException localNumberFormatException2)
              {
                str2 = str2.substring(0, str2.indexOf(" ("));
                m += Integer.valueOf(str2).intValue();
              }
            }
          }
          int i10 = ((String)localObject2).indexOf(" in ");
          i9 = ((String)localObject2).indexOf(" block");
          if ((localObject2 != null) && (i10 >= 0) && (i9 >= 0))
          {
            String str4 = ((String)localObject2).substring(i10 + 3, i9).trim();
            try
            {
              n += Integer.valueOf(str4).intValue();
            }
            catch (NumberFormatException localNumberFormatException3)
            {
              str4 = str4.replace(",", "");
              n += Integer.valueOf(str4).intValue();
            }
          }
          for (int i12 = 0; i12 < ((ValgrindError)localObject1).getFrames().size(); i12++)
          {
            localValgrindStackFrame = (ValgrindStackFrame)((ValgrindError)localObject1).getFrames().get(i12);
            if (localValgrindStackFrame.getFile() != null) {
              for (i14 = 0; i14 < MemcheckViewPart.access$0(MemcheckViewPart.3.access$0(this$1)).size(); i14++) {
                if (localValgrindStackFrame.getFile().compareToIgnoreCase((String)MemcheckViewPart.access$0(MemcheckViewPart.3.access$0(this$1)).get(i14)) == 0)
                {
                  i1++;
                  i12 = ((ValgrindError)localObject1).getFrames().size();
                  break;
                }
              }
            }
          }
        }
        if (((ValgrindError)localObject1).getKind().startsWith("Leak_PossiblyLost"))
        {
          i2++;
          localObject2 = ((ValgrindError)localObject1).getWhat();
          i9 = ((String)localObject2).indexOf(" byte");
          if ((localObject2 != null) && (i9 >= 0))
          {
            String str3 = ((String)localObject2).substring(0, i9);
            try
            {
              i3 += Integer.valueOf(str3).intValue();
            }
            catch (NumberFormatException localNumberFormatException4)
            {
              str3 = str3.replace(",", "");
              i3 += Integer.valueOf(str3).intValue();
            }
          }
          int i11 = ((String)localObject2).indexOf(" in ");
          i9 = ((String)localObject2).indexOf(" block");
          if ((localObject2 != null) && (i11 >= 0) && (i9 >= 0))
          {
            String str5 = ((String)localObject2).substring(i11 + 3, i9).trim();
            try
            {
              i4 += Integer.valueOf(str5).intValue();
            }
            catch (NumberFormatException localNumberFormatException5)
            {
              str5 = str5.replace(",", "");
              i4 += Integer.valueOf(str5).intValue();
            }
          }
          for (int i13 = 0; i13 < ((ValgrindError)localObject1).getFrames().size(); i13++)
          {
            localValgrindStackFrame = (ValgrindStackFrame)((ValgrindError)localObject1).getFrames().get(i13);
            if (localValgrindStackFrame.getFile() != null) {
              for (i14 = 0; i14 < MemcheckViewPart.access$0(MemcheckViewPart.3.access$0(this$1)).size(); i14++) {
                if (localValgrindStackFrame.getFile().compareToIgnoreCase((String)MemcheckViewPart.access$0(MemcheckViewPart.3.access$0(this$1)).get(i14)) == 0)
                {
                  i5++;
                  i13 = ((ValgrindError)localObject1).getFrames().size();
                  break;
                }
              }
            }
          }
        }
      }
      str1 = "*** Memory Leak Summary ***\n\n";
      str1 = str1 + "[ " + k + " ] definitely lost: [ " + String.format("%,d", new Object[] { Integer.valueOf(m) }) + " ] bytes in [ " + String.format("%,d", new Object[] { Integer.valueOf(n) }) + " ] blocks.\n";
      str1 = str1 + "\t from [ " + i1 + " ] defect \n";
      str1 = str1 + "\t from [ " + (k - i1) + " ] system library\n\n";
      str1 = str1 + "[ " + i2 + " ] possibly lost: [ " + String.format("%,d", new Object[] { Integer.valueOf(i3) }) + " ] bytes in [ " + String.format("%,d", new Object[] { Integer.valueOf(i4) }) + " ] blocks. \n";
      str1 = str1 + "\t from [ " + i5 + " ] defect \n";
      str1 = str1 + "\t from [ " + (i2 - i5) + " ] system library \n";
      access$0this$1).memoryLeakSection.setToolTipText(str1);
      RootTreeElement localRootTreeElement = new RootTreeElement((ValgrindError[])localArrayList1.toArray(new ValgrindError[localArrayList1.size()]));
      Object localObject1 = new RootTreeElement((ValgrindError[])localArrayList2.toArray(new ValgrindError[localArrayList2.size()]));
      access$0this$1).memoryErrorTreeViewer.setInput(localRootTreeElement);
      access$0this$1).memoryLeakTreeViewer.setInput(localObject1);
      access$0this$1).scrolledComposite.setContent(access$0this$1).mainComposite);
      access$0this$1).scrolledComposite.setMinSize(access$0this$1).mainComposite.computeSize(-1, -1));
      access$0this$1).scrolledComposite.setExpandVertical(true);
      access$0this$1).scrolledComposite.setExpandHorizontal(true);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckViewPart.3.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.valgrind.memcheck.model.RootTreeElement;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.Section;

class MemcheckViewPart$3
  implements IRunnableWithProgress
{
  MemcheckViewPart$3(MemcheckViewPart paramMemcheckViewPart) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
    throws InvocationTargetException, InterruptedException
  {
    paramIProgressMonitor.beginTask(Messages.getString("MemcheckLaunchDelegate.Error_parsing_output"), 2);
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        if (this$0.errors != null)
        {
          int i = this$0.errors.length > 1000 ? 1000 : this$0.errors.length;
          ArrayList localArrayList1 = new ArrayList();
          ArrayList localArrayList2 = new ArrayList();
          for (int j = 0; j < i; j++) {
            if (this$0.errors[j].getKind().startsWith("Invalid")) {
              localArrayList1.add(this$0.errors[j]);
            } else {
              localArrayList2.add(this$0.errors[j]);
            }
          }
          this$0.getFilelistInProjects();
          j = 0;
          int k = 0;
          int m = 0;
          int n = 0;
          int i1 = 0;
          int i2 = 0;
          int i3 = 0;
          int i4 = 0;
          int i5 = 0;
          Object localObject2;
          int i9;
          for (int i6 = 0; i6 < localArrayList1.size(); i6++)
          {
            ValgrindError localValgrindError = (ValgrindError)localArrayList1.get(i6);
            for (int i8 = 0; i8 < localValgrindError.getFrames().size(); i8++)
            {
              localObject2 = (ValgrindStackFrame)localValgrindError.getFrames().get(i8);
              if (((ValgrindStackFrame)localObject2).getFile() != null) {
                for (i9 = 0; i9 < MemcheckViewPart.access$0(this$0).size(); i9++) {
                  if (((ValgrindStackFrame)localObject2).getFile().compareToIgnoreCase((String)MemcheckViewPart.access$0(this$0).get(i9)) == 0)
                  {
                    j++;
                    i8 = localValgrindError.getFrames().size();
                    break;
                  }
                }
              }
            }
          }
          String str1 = "*** Memory Error Summary ***\n\n";
          str1 = str1 + "[ " + localArrayList1.size() + " ] errors \n";
          str1 = str1 + "\t from [ " + j + " ] defect \n";
          str1 = str1 + "\t from [ " + (localArrayList1.size() - j) + " ] system library";
          this$0.memoryErrorSection.setToolTipText(str1);
          for (int i7 = 0; i7 < localArrayList2.size(); i7++)
          {
            localObject1 = (ValgrindError)localArrayList2.get(i7);
            ValgrindStackFrame localValgrindStackFrame;
            int i14;
            if (((ValgrindError)localObject1).getKind().startsWith("Leak_DefinitelyLost"))
            {
              k++;
              localObject2 = ((ValgrindError)localObject1).getWhat();
              i9 = ((String)localObject2).indexOf(" byte");
              if ((localObject2 != null) && (i9 >= 0))
              {
                String str2 = ((String)localObject2).substring(0, i9);
                try
                {
                  m += Integer.valueOf(str2).intValue();
                }
                catch (NumberFormatException localNumberFormatException1)
                {
                  try
                  {
                    str2 = str2.replace(",", "");
                    m += Integer.valueOf(str2).intValue();
                  }
                  catch (NumberFormatException localNumberFormatException2)
                  {
                    str2 = str2.substring(0, str2.indexOf(" ("));
                    m += Integer.valueOf(str2).intValue();
                  }
                }
              }
              int i10 = ((String)localObject2).indexOf(" in ");
              i9 = ((String)localObject2).indexOf(" block");
              if ((localObject2 != null) && (i10 >= 0) && (i9 >= 0))
              {
                String str4 = ((String)localObject2).substring(i10 + 3, i9).trim();
                try
                {
                  n += Integer.valueOf(str4).intValue();
                }
                catch (NumberFormatException localNumberFormatException3)
                {
                  str4 = str4.replace(",", "");
                  n += Integer.valueOf(str4).intValue();
                }
              }
              for (int i12 = 0; i12 < ((ValgrindError)localObject1).getFrames().size(); i12++)
              {
                localValgrindStackFrame = (ValgrindStackFrame)((ValgrindError)localObject1).getFrames().get(i12);
                if (localValgrindStackFrame.getFile() != null) {
                  for (i14 = 0; i14 < MemcheckViewPart.access$0(this$0).size(); i14++) {
                    if (localValgrindStackFrame.getFile().compareToIgnoreCase((String)MemcheckViewPart.access$0(this$0).get(i14)) == 0)
                    {
                      i1++;
                      i12 = ((ValgrindError)localObject1).getFrames().size();
                      break;
                    }
                  }
                }
              }
            }
            if (((ValgrindError)localObject1).getKind().startsWith("Leak_PossiblyLost"))
            {
              i2++;
              localObject2 = ((ValgrindError)localObject1).getWhat();
              i9 = ((String)localObject2).indexOf(" byte");
              if ((localObject2 != null) && (i9 >= 0))
              {
                String str3 = ((String)localObject2).substring(0, i9);
                try
                {
                  i3 += Integer.valueOf(str3).intValue();
                }
                catch (NumberFormatException localNumberFormatException4)
                {
                  str3 = str3.replace(",", "");
                  i3 += Integer.valueOf(str3).intValue();
                }
              }
              int i11 = ((String)localObject2).indexOf(" in ");
              i9 = ((String)localObject2).indexOf(" block");
              if ((localObject2 != null) && (i11 >= 0) && (i9 >= 0))
              {
                String str5 = ((String)localObject2).substring(i11 + 3, i9).trim();
                try
                {
                  i4 += Integer.valueOf(str5).intValue();
                }
                catch (NumberFormatException localNumberFormatException5)
                {
                  str5 = str5.replace(",", "");
                  i4 += Integer.valueOf(str5).intValue();
                }
              }
              for (int i13 = 0; i13 < ((ValgrindError)localObject1).getFrames().size(); i13++)
              {
                localValgrindStackFrame = (ValgrindStackFrame)((ValgrindError)localObject1).getFrames().get(i13);
                if (localValgrindStackFrame.getFile() != null) {
                  for (i14 = 0; i14 < MemcheckViewPart.access$0(this$0).size(); i14++) {
                    if (localValgrindStackFrame.getFile().compareToIgnoreCase((String)MemcheckViewPart.access$0(this$0).get(i14)) == 0)
                    {
                      i5++;
                      i13 = ((ValgrindError)localObject1).getFrames().size();
                      break;
                    }
                  }
                }
              }
            }
          }
          str1 = "*** Memory Leak Summary ***\n\n";
          str1 = str1 + "[ " + k + " ] definitely lost: [ " + String.format("%,d", new Object[] { Integer.valueOf(m) }) + " ] bytes in [ " + String.format("%,d", new Object[] { Integer.valueOf(n) }) + " ] blocks.\n";
          str1 = str1 + "\t from [ " + i1 + " ] defect \n";
          str1 = str1 + "\t from [ " + (k - i1) + " ] system library\n\n";
          str1 = str1 + "[ " + i2 + " ] possibly lost: [ " + String.format("%,d", new Object[] { Integer.valueOf(i3) }) + " ] bytes in [ " + String.format("%,d", new Object[] { Integer.valueOf(i4) }) + " ] blocks. \n";
          str1 = str1 + "\t from [ " + i5 + " ] defect \n";
          str1 = str1 + "\t from [ " + (i2 - i5) + " ] system library \n";
          this$0.memoryLeakSection.setToolTipText(str1);
          RootTreeElement localRootTreeElement = new RootTreeElement((ValgrindError[])localArrayList1.toArray(new ValgrindError[localArrayList1.size()]));
          Object localObject1 = new RootTreeElement((ValgrindError[])localArrayList2.toArray(new ValgrindError[localArrayList2.size()]));
          this$0.memoryErrorTreeViewer.setInput(localRootTreeElement);
          this$0.memoryLeakTreeViewer.setInput(localObject1);
          this$0.scrolledComposite.setContent(this$0.mainComposite);
          this$0.scrolledComposite.setMinSize(this$0.mainComposite.computeSize(-1, -1));
          this$0.scrolledComposite.setExpandVertical(true);
          this$0.scrolledComposite.setExpandHorizontal(true);
        }
      }
    });
    paramIProgressMonitor.worked(1);
    paramIProgressMonitor.done();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckViewPart.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.profiling.ui.ProfileUIUtils;
import org.eclipse.linuxtools.valgrind.memcheck.model.StackFrameTreeElement;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.widgets.Section;

public class MemcheckViewPart$DoubleClickListener
  implements IDoubleClickListener
{
  private TreeViewer viewer;
  private Section section;
  
  public MemcheckViewPart$DoubleClickListener(MemcheckViewPart paramMemcheckViewPart, TreeViewer paramTreeViewer, Section paramSection)
  {
    viewer = paramTreeViewer;
    section = paramSection;
  }
  
  public void doubleClick(DoubleClickEvent paramDoubleClickEvent)
  {
    Object localObject = ((TreeSelection)paramDoubleClickEvent.getSelection()).getFirstElement();
    if ((localObject instanceof StackFrameTreeElement))
    {
      ValgrindStackFrame localValgrindStackFrame = ((StackFrameTreeElement)localObject).getFrame();
      if (localValgrindStackFrame.getFile() != null)
      {
        String str1 = localValgrindStackFrame.getDir() + '/' + localValgrindStackFrame.getFile();
        String str2 = str1;
        int i = localValgrindStackFrame.getLine();
        try
        {
          ProfileUIUtils.openEditorAndSelect(str2, i);
        }
        catch (PartInitException localPartInitException)
        {
          localPartInitException.printStackTrace();
        }
        catch (BadLocationException localBadLocationException)
        {
          localBadLocationException.printStackTrace();
        }
      }
    }
    else
    {
      if (!viewer.isExpandable(localObject)) {
        return;
      }
      if (viewer.getExpandedState(localObject)) {
        viewer.collapseToLevel(localObject, -1);
      } else {
        viewer.expandToLevel(localObject, 1);
      }
      section.layout(true);
      this$0.resizeComposite();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.memcheck.MemcheckViewPart.DoubleClickListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.memcheck;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.linuxtools.valgrind.memcheck.model.AuxErrorTreeElement;
import org.eclipse.linuxtools.valgrind.memcheck.model.ErrorTreeElement;
import org.eclipse.linuxtools.valgrind.memcheck.model.StackFrameTreeElement;
import org.eclipse.linuxtools.valgrind.memcheck.model.ValgrindTreeElement;
import org.eclipse.swt.graphics.Image;

public class MemcheckViewPart$ErrorTreeLabelProvider
  extends LabelProvider
  implements ITableLabelProvider
{
  protected MemcheckViewPart$ErrorTreeLabelProvider(MemcheckViewPart paramMemcheckViewPart) {}
  
  public Image getColumnImage(Object paramObject, int paramInt)
  {
    if (paramInt == 0) {
      return ((ValgrindTreeElement)paramObject).getImage();
    }
    
1 2 3 4

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd