Commit 7bfaa163 authored by Vít Kabele's avatar Vít Kabele

Merge remote-tracking branch 'origin/master' into sessions

* origin/master:
  Release unused local references when querying thread name
  Remove setMultipleValDelim() from the marker Parameter class
parents 6a02bdea a7bc3130
......@@ -19,18 +19,13 @@ import java.util.Set;
*/
public class BytecodeMarker extends AbstractDWRMarker {
protected static final String INSTR_DELIM = ",";
protected Set <Integer> searchedInstrNums = new HashSet <Integer> ();
public BytecodeMarker (final Parameter param) throws MarkerException {
// set delim for instruction list
param.setMultipleValDelim (INSTR_DELIM);
// translate all instructions to opcodes
for (final String instr : param.getMultipleValues ()) {
for (final String instr : param.getMultipleValues (",")) {
try {
final AsmOpcodes opcode = AsmOpcodes.valueOf (
instr.trim ().toUpperCase ()
......
......@@ -24,11 +24,8 @@ public class InsnNodeMarker extends AbstractInsnMarker {
classes = new HashSet<Class<? extends AbstractInsnNode>>();
// set delimiter for list of *InsnNode classes
param.setMultipleValDelim (",");
// translate all instructions to opcodes
for (String className : param.getMultipleValues()) {
for (String className : param.getMultipleValues(",")) {
try {
......
......@@ -7,8 +7,6 @@ public final class Parameter {
protected String __value;
protected String __delimiter;
/**
* Create parameter with a value.
*/
......@@ -16,12 +14,6 @@ public final class Parameter {
__value = value;
}
/**
* Set delimiter for multi-value parsing.
*/
public void setMultipleValDelim(final String delim) {
__delimiter = delim;
}
/**
* Get parameter value.
......@@ -30,10 +22,17 @@ public final class Parameter {
return __value;
}
/**
* @return Array of values split using a predefined delimiter.
* Retrieves multiple values by splitting the annotation parameter using the
* given delimiter.
*
* @param delimiter
* the delimiter to use for splitting the parameter
* @return An array of values obtained by splitting the annotation
* parameter.
*/
public String [] getMultipleValues () {
return __value.split (__delimiter);
public String [] getMultipleValues (final String delimiter) {
return __value.split (delimiter);
}
}
......@@ -28,7 +28,7 @@ public class StrictBytecodeMarker extends AbstractInsnMarker {
public StrictBytecodeMarker(Parameter param) throws MarkerException {
// translate all instructions to opcodes
for (String instr : param.getMultipleValues()) {
for (String instr : param.getMultipleValues(",")) {
try {
......
......@@ -413,13 +413,22 @@ __thread_id (JNIEnv * jni) {
static char *
__thread_name (jvmtiEnv * jvmti) {
__thread_name (jvmtiEnv * jvmti, JNIEnv * jni) {
assert (jvmti != NULL && jvm_is_initialized);
jvmtiThreadInfo info;
jvmtiError error = (* jvmti)->GetThreadInfo (jvmti, NULL, &info);
check_jvmti_error (jvmti, error, "failed to get current thread info");
//
// Release the thread_group and context_class_loader
// references because we dont not need them.
//
if (jni != NULL) {
(* jni)->DeleteLocalRef (jni, info.thread_group);
(* jni)->DeleteLocalRef (jni, info.context_class_loader);
}
return info.name;
}
......@@ -435,7 +444,7 @@ struct thread_info {
static void
__thread_info_init (jvmtiEnv * jvmti, JNIEnv * jni, struct thread_info * info) {
if (jvmti != NULL && jvm_is_initialized) {
info->name = __thread_name (jvmti);
info->name = __thread_name (jvmti, jni);
}
if (jni != NULL && jvm_is_started) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment