Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYannick Mayeur2017-05-05 12:39:55 +0000
committerGerrit Code Review @ Eclipse.org2017-05-05 13:32:34 +0000
commit5defeb26ac9e252195bd49c4ac4df3aaf83b66e6 (patch)
treede91dcec5444dc57cb3d64632a16feaf81f95982 /dsf/org.eclipse.cdt.dsf.ui/src/org
parentd4ecd37bb1464828cc944010ba7a559aa0c67f30 (diff)
downloadorg.eclipse.cdt-5defeb26ac9e252195bd49c4ac4df3aaf83b66e6.tar.gz
org.eclipse.cdt-5defeb26ac9e252195bd49c4ac4df3aaf83b66e6.tar.xz
org.eclipse.cdt-5defeb26ac9e252195bd49c4ac4df3aaf83b66e6.zip
Reformat the file, tabs and spaces were mixed
Change-Id: If136dc3222c23f2ed41539d25b509161a0313475 Signed-off-by: Yannick Mayeur <yannick.mayeur@gmail.com>
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui/src/org')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java176
1 files changed, 79 insertions, 97 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java
index 310a546e153..54eaf4c62d0 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java
@@ -33,8 +33,8 @@ import org.eclipse.jface.preference.IPreferenceStore;
import com.ibm.icu.text.MessageFormat;
/**
- * This factory provides an instance of ICSourceNotFoundDescription that
- * can generate a description of a IFrameDMContext.
+ * This factory provides an instance of ICSourceNotFoundDescription that can
+ * generate a description of a IFrameDMContext.
*
*/
public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
@@ -42,43 +42,41 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
- if (adapterType.equals(ICSourceNotFoundDescription.class) &&
- adaptableObject instanceof IFrameDMContext)
- {
+ if (adapterType.equals(ICSourceNotFoundDescription.class) && adaptableObject instanceof IFrameDMContext) {
final IFrameDMContext frameDMC = (IFrameDMContext) adaptableObject;
- return (T)new ICSourceNotFoundDescription() {
+ return (T) new ICSourceNotFoundDescription() {
@Override
public String getDescription() {
- Query<IStack.IFrameDMData> query = new Query<IStack.IFrameDMData>() {
- @Override
- protected void execute(DataRequestMonitor<IStack.IFrameDMData> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), frameDMC.getSessionId());
-
- IStack stack = tracker.getService(IStack.class);
- if (stack != null) {
- stack.getFrameData(frameDMC, rm);
- } else {
- rm.setData(null);
- rm.done();
- }
- tracker.dispose();
- }
- };
- DsfSession session = DsfSession.getSession(frameDMC.getSessionId());
- if (session != null && session.getExecutor() != null)
- {
- session.getExecutor().execute(query);
- try {
- IFrameDMData dmData = query.get();
- return getFrameDescription(dmData);
- } catch (Exception e) {
- return frameDMC.toString();
+ Query<IStack.IFrameDMData> query = new Query<IStack.IFrameDMData>() {
+ @Override
+ protected void execute(DataRequestMonitor<IStack.IFrameDMData> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ frameDMC.getSessionId());
+
+ IStack stack = tracker.getService(IStack.class);
+ if (stack != null) {
+ stack.getFrameData(frameDMC, rm);
+ } else {
+ rm.setData(null);
+ rm.done();
}
- }
- return frameDMC.toString();
- }};
+ tracker.dispose();
+ }
+ };
+ DsfSession session = DsfSession.getSession(frameDMC.getSessionId());
+ if (session != null && session.getExecutor() != null) {
+ session.getExecutor().execute(query);
+ try {
+ IFrameDMData dmData = query.get();
+ return getFrameDescription(dmData);
+ } catch (Exception e) {
+ return frameDMC.toString();
+ }
+ }
+ return frameDMC.toString();
+ }
+ };
}
return null;
}
@@ -87,96 +85,80 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
public Class<?>[] getAdapterList() {
return new Class[] { ICSourceNotFoundDescription.class };
}
-
- /** Creates a brief description of stack frame data.
- * Based on code in StackFrameVMNode.
+
+ /**
+ * Creates a brief description of stack frame data. Based on code in
+ * StackFrameVMNode.
+ *
* @param frame
* @return the frame description
*/
- private static String getFrameDescription(IStack.IFrameDMData frame)
- {
+ private static String getFrameDescription(IStack.IFrameDMData frame) {
String formatString = ""; //$NON-NLS-1$
String[] propertyNames = null;
HashMap<String, Object> properties = new HashMap<String, Object>();
fillFrameDataProperties(properties, frame);
- Integer line = (Integer)properties.get(ILaunchVMConstants.PROP_FRAME_LINE);
- String file = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FILE);
- String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
- String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
- if (line != null && line >= 0 && file != null && !file.isEmpty())
- {
+ Integer line = (Integer) properties.get(ILaunchVMConstants.PROP_FRAME_LINE);
+ String file = (String) properties.get(ILaunchVMConstants.PROP_FRAME_FILE);
+ String function = (String) properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
+ String module = (String) properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
+ if (line != null && line >= 0 && file != null && !file.isEmpty()) {
if (function != null && function.contains(")")) //$NON-NLS-1$
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__text_format;
else
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
- propertyNames = new String[] {
- ILaunchVMConstants.PROP_FRAME_ADDRESS,
- ILaunchVMConstants.PROP_FRAME_FUNCTION,
- ILaunchVMConstants.PROP_FRAME_FILE,
- ILaunchVMConstants.PROP_FRAME_LINE,
- ILaunchVMConstants.PROP_FRAME_COLUMN,
- ILaunchVMConstants.PROP_FRAME_MODULE};
- }
- else if (function != null && !function.isEmpty() && module != null && !module.isEmpty())
- {
+ propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
+ ILaunchVMConstants.PROP_FRAME_FUNCTION, ILaunchVMConstants.PROP_FRAME_FILE,
+ ILaunchVMConstants.PROP_FRAME_LINE, ILaunchVMConstants.PROP_FRAME_COLUMN,
+ ILaunchVMConstants.PROP_FRAME_MODULE };
+ } else if (function != null && !function.isEmpty() && module != null && !module.isEmpty()) {
if (function.contains(")")) //$NON-NLS-1$
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format;
else
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
- propertyNames = new String[] {
- ILaunchVMConstants.PROP_FRAME_ADDRESS,
- ILaunchVMConstants.PROP_FRAME_FUNCTION,
- ILaunchVMConstants.PROP_FRAME_MODULE};
- }
- else if (module != null && !module.isEmpty())
- {
+ propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
+ ILaunchVMConstants.PROP_FRAME_FUNCTION, ILaunchVMConstants.PROP_FRAME_MODULE };
+ } else if (module != null && !module.isEmpty()) {
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_function__text_format;
- propertyNames = new String[] {
- ILaunchVMConstants.PROP_FRAME_ADDRESS,
- ILaunchVMConstants.PROP_FRAME_MODULE};
- }
- else if (function != null && !function.isEmpty())
- {
+ propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
+ ILaunchVMConstants.PROP_FRAME_MODULE };
+ } else if (function != null && !function.isEmpty()) {
if (function.contains(")")) //$NON-NLS-1$
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__text_format;
else
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__add_parens__text_format;
- propertyNames = new String[] {
- ILaunchVMConstants.PROP_FRAME_ADDRESS,
- ILaunchVMConstants.PROP_FRAME_FUNCTION};
- }
- else
- {
+ propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
+ ILaunchVMConstants.PROP_FRAME_FUNCTION };
+ } else {
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__Address_only__text_format;
- propertyNames = new String[] {
- ILaunchVMConstants.PROP_FRAME_ADDRESS};
+ propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS };
}
- Object[] propertyValues = new Object[propertyNames.length];
- for (int i = 0; i < propertyNames.length; i++) {
- propertyValues[i] = properties.get(propertyNames[i]);
- }
+ Object[] propertyValues = new Object[propertyNames.length];
+ for (int i = 0; i < propertyNames.length; i++) {
+ propertyValues[i] = properties.get(propertyNames[i]);
+ }
return new MessageFormat(formatString).format(propertyValues, new StringBuffer(), null).toString();
}
-
- private static void fillFrameDataProperties(java.util.Map<String,Object> properties, IFrameDMData data) {
- IAddress address = data.getAddress();
- if (address != null) {
- properties.put(ILaunchVMConstants.PROP_FRAME_ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
- }
- String file = data.getFile();
- IPreferenceStore cStore= CDebugUIPlugin.getDefault().getPreferenceStore();
- boolean show_full_path = cStore.getBoolean(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY);
- if (!show_full_path) {
- file = new Path(file).lastSegment();
- }
+
+ private static void fillFrameDataProperties(java.util.Map<String, Object> properties, IFrameDMData data) {
+ IAddress address = data.getAddress();
+ if (address != null) {
+ properties.put(ILaunchVMConstants.PROP_FRAME_ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
+ }
+ String file = data.getFile();
+ IPreferenceStore cStore = CDebugUIPlugin.getDefault().getPreferenceStore();
+ boolean show_full_path = cStore.getBoolean(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY);
+ if (!show_full_path) {
+ file = new Path(file).lastSegment();
+ }
properties.put(ILaunchVMConstants.PROP_FRAME_FILE, file);
- properties.put(ILaunchVMConstants.PROP_FRAME_FUNCTION, data.getFunction());
- properties.put(ILaunchVMConstants.PROP_FRAME_LINE, data.getLine());
- properties.put(ILaunchVMConstants.PROP_FRAME_COLUMN, data.getColumn());
- properties.put(ILaunchVMConstants.PROP_FRAME_MODULE, data.getModule());
- }
+ properties.put(ILaunchVMConstants.PROP_FRAME_FUNCTION, data.getFunction());
+ properties.put(ILaunchVMConstants.PROP_FRAME_LINE, data.getLine());
+ properties.put(ILaunchVMConstants.PROP_FRAME_COLUMN, data.getColumn());
+ properties.put(ILaunchVMConstants.PROP_FRAME_MODULE, data.getModule());
+ }
}

Back to the top