summaryrefslogtreecommitdiffstats
path: root/dalvik/src/main
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-12-04 11:54:39 -0800
committerElliott Hughes <enh@google.com>2012-12-04 11:54:39 -0800
commitc2d0a1f1bd2c6414c29dd44fe240dcf1f45e59b9 (patch)
tree47052a38cbf61cb7624acc01959d95f5bf220bae /dalvik/src/main
parentc02fbeb07ef67396cd7ba8757e8e8918d4d65c50 (diff)
downloadlibcore-c2d0a1f1bd2c6414c29dd44fe240dcf1f45e59b9.zip
libcore-c2d0a1f1bd2c6414c29dd44fe240dcf1f45e59b9.tar.gz
libcore-c2d0a1f1bd2c6414c29dd44fe240dcf1f45e59b9.tar.bz2
Add detail messages to all remaining NullPointerExceptions.
I've left java.util.concurrent alone, since that's upstream code. Change-Id: I349960aaddb78e55d4c336b58b637009db69ff98
Diffstat (limited to 'dalvik/src/main')
-rw-r--r--dalvik/src/main/java/dalvik/system/VMDebug.java23
-rw-r--r--dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmServer.java7
2 files changed, 16 insertions, 14 deletions
diff --git a/dalvik/src/main/java/dalvik/system/VMDebug.java b/dalvik/src/main/java/dalvik/system/VMDebug.java
index ace149c..8f40165 100644
--- a/dalvik/src/main/java/dalvik/system/VMDebug.java
+++ b/dalvik/src/main/java/dalvik/system/VMDebug.java
@@ -165,11 +165,10 @@ public final class VMDebug {
* @param flags flags to control method tracing. The only one that
* is currently defined is {@link #TRACE_COUNT_ALLOCS}.
*/
- public static void startMethodTracing(String traceFileName,
- int bufferSize, int flags) {
+ public static void startMethodTracing(String traceFileName, int bufferSize, int flags) {
if (traceFileName == null) {
- throw new NullPointerException();
+ throw new NullPointerException("traceFileName == null");
}
startMethodTracingNative(traceFileName, null, bufferSize, flags);
@@ -183,8 +182,11 @@ public final class VMDebug {
public static void startMethodTracing(String traceFileName,
FileDescriptor fd, int bufferSize, int flags)
{
- if (traceFileName == null || fd == null) {
- throw new NullPointerException();
+ if (traceFileName == null) {
+ throw new NullPointerException("traceFileName == null");
+ }
+ if (fd == null) {
+ throw new NullPointerException("fd == null");
}
startMethodTracingNative(traceFileName, fd, bufferSize, flags);
@@ -291,15 +293,16 @@ public final class VMDebug {
*
* The VM may create a temporary file in the same directory.
*
- * @param fileName Full pathname of output file (e.g. "/sdcard/dump.hprof").
+ * @param filename Full pathname of output file (e.g. "/sdcard/dump.hprof").
* @throws UnsupportedOperationException if the VM was built without
* HPROF support.
* @throws IOException if an error occurs while opening or writing files.
*/
- public static void dumpHprofData(String fileName) throws IOException {
- if (fileName == null)
- throw new NullPointerException();
- dumpHprofData(fileName, null);
+ public static void dumpHprofData(String filename) throws IOException {
+ if (filename == null) {
+ throw new NullPointerException("filename == null");
+ }
+ dumpHprofData(filename, null);
}
/**
diff --git a/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmServer.java b/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmServer.java
index 61bee34..7717fd9 100644
--- a/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmServer.java
+++ b/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmServer.java
@@ -50,9 +50,9 @@ public class DdmServer {
* Throws an exception if the type already has a handler registered.
*/
public static void registerHandler(int type, ChunkHandler handler) {
- if (handler == null)
- throw new NullPointerException();
-
+ if (handler == null) {
+ throw new NullPointerException("handler == null");
+ }
synchronized (mHandlerMap) {
if (mHandlerMap.get(type) != null)
throw new RuntimeException("type " + Integer.toHexString(type)
@@ -171,4 +171,3 @@ public class DdmServer {
return handler.handleChunk(chunk);
}
}
-