diff options
| author | Siva Velusamy <vsiva@google.com> | 2012-09-24 14:46:06 -0700 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-09-24 14:46:06 -0700 |
| commit | 66bf9103fd44e1aa9a98fc211850b5eca316b80c (patch) | |
| tree | 3996b19ed7655e836de3a81c5a62d8039678345a | |
| parent | 724dd9e79baadf9f7cfabbf2222827711cda63b4 (diff) | |
| parent | 379331a4e8769ac7972d4c6e39b841d00028ba7e (diff) | |
| download | sdk-66bf9103fd44e1aa9a98fc211850b5eca316b80c.zip sdk-66bf9103fd44e1aa9a98fc211850b5eca316b80c.tar.gz sdk-66bf9103fd44e1aa9a98fc211850b5eca316b80c.tar.bz2 | |
Merge "traceview: Fix check for upper case characters."
| -rw-r--r-- | common/src/com/android/utils/SdkUtils.java | 11 | ||||
| -rw-r--r-- | traceview/.classpath | 1 | ||||
| -rw-r--r-- | traceview/etc/manifest.txt | 2 | ||||
| -rw-r--r-- | traceview/src/com/android/traceview/ProfileProvider.java | 7 |
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(); |
