aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/src/com/android/utils/SdkUtils.java11
-rw-r--r--traceview/.classpath1
-rw-r--r--traceview/etc/manifest.txt2
-rw-r--r--traceview/src/com/android/traceview/ProfileProvider.java7
4 files changed, 16 insertions, 5 deletions
diff --git a/common/src/com/android/utils/SdkUtils.java b/common/src/com/android/utils/SdkUtils.java
index b49c120..9bf43dc 100644
--- a/common/src/com/android/utils/SdkUtils.java
+++ b/common/src/com/android/utils/SdkUtils.java
@@ -111,6 +111,17 @@ public class SdkUtils {
return sb.toString();
}
+ /** Returns true if the given string has an upper case character. */
+ public static boolean hasUpperCaseCharacter(String s) {
+ for (int i = 0; i < s.length(); i++) {
+ if (Character.isUpperCase(s.charAt(i))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/** For use by {@link #getLineSeparator()} */
private static String sLineSeparator;
diff --git a/traceview/.classpath b/traceview/.classpath
index 34066de..6cced4c 100644
--- a/traceview/.classpath
+++ b/traceview/.classpath
@@ -4,6 +4,7 @@
<classpathentry kind="src" path="src/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/SdkStatsService"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/common"/>
<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
diff --git a/traceview/etc/manifest.txt b/traceview/etc/manifest.txt
index 6cdbc7e..0c17bec 100644
--- a/traceview/etc/manifest.txt
+++ b/traceview/etc/manifest.txt
@@ -1,2 +1,2 @@
Main-Class: com.android.traceview.MainWindow
-Class-Path: swt.jar org.eclipse.equinox.common_3.2.0.v20060603.jar org.eclipse.jface_3.2.0.I20060605-1400.jar org.eclipse.core.commands_3.2.0.I20060605-1400.jar
+Class-Path: common.jar swt.jar org.eclipse.equinox.common_3.2.0.v20060603.jar org.eclipse.jface_3.2.0.I20060605-1400.jar org.eclipse.core.commands_3.2.0.I20060605-1400.jar
diff --git a/traceview/src/com/android/traceview/ProfileProvider.java b/traceview/src/com/android/traceview/ProfileProvider.java
index a38e61b..995e606 100644
--- a/traceview/src/com/android/traceview/ProfileProvider.java
+++ b/traceview/src/com/android/traceview/ProfileProvider.java
@@ -16,6 +16,8 @@
package com.android.traceview;
+import com.android.utils.SdkUtils;
+
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -34,7 +36,6 @@ import org.eclipse.swt.widgets.TreeItem;
import java.io.InputStream;
import java.util.Arrays;
-import java.util.regex.Pattern;
class ProfileProvider implements ITreeContentProvider {
@@ -70,7 +71,6 @@ class ProfileProvider implements ITreeContentProvider {
private static final int COL_REAL_TIME_PER_CALL = 11;
private long mTotalCpuTime;
private long mTotalRealTime;
- private Pattern mUppercase;
private int mPrevMatchIndex = -1;
public ProfileProvider(TraceReader reader) {
@@ -85,12 +85,11 @@ class ProfileProvider implements ITreeContentProvider {
in = getClass().getClassLoader().getResourceAsStream(
"icons/sort_down.png");
mSortDown = new Image(display, in);
- mUppercase = Pattern.compile("[A-Z]");
}
private MethodData doMatchName(String name, int startIndex) {
// Check if the given "name" has any uppercase letters
- boolean hasUpper = mUppercase.matcher(name).matches();
+ boolean hasUpper = SdkUtils.hasUpperCaseCharacter(name);
for (int ii = startIndex; ii < mRoots.length; ++ii) {
MethodData md = mRoots[ii];
String fullName = md.getName();