Skip to content

Commit

Permalink
MemberName fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill380 committed Sep 27, 2016
1 parent a162be7 commit f7e52d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Expand Up @@ -468,7 +468,7 @@ private void allThreadsFromGroup(ThreadGroup group,
for (Thread t : gThreads) { for (Thread t : gThreads) {
if (t != null) { if (t != null) {
ThreadStruct ts = threadsMap.get(t.getId()); ThreadStruct ts = threadsMap.get(t.getId());
ts.t = t; ts.thread = t;
} }
} }
for (ThreadGroup tg : tGroups) { for (ThreadGroup tg : tGroups) {
Expand Down Expand Up @@ -546,7 +546,7 @@ class ThreadStruct implements Comparable<ThreadStruct> {
/** /**
* The thread. * The thread.
*/ */
public Thread t; public Thread thread;


/** /**
* The thread info. * The thread info.
Expand All @@ -559,7 +559,7 @@ class ThreadStruct implements Comparable<ThreadStruct> {
* @return the group name * @return the group name
*/ */
public String getGroupName() { public String getGroupName() {
return t != null ? t.getThreadGroup().getName() : ""; return thread != null ? thread.getThreadGroup().getName() : "";
} }


/** /**
Expand All @@ -568,7 +568,7 @@ public String getGroupName() {
* @return the priority * @return the priority
*/ */
public String getPriority() { public String getPriority() {
return t != null ? t.getPriority() + "" : ""; return thread != null ? thread.getPriority() + "" : "";
} }


/** /**
Expand All @@ -577,7 +577,7 @@ public String getPriority() {
* @return the "daemon" string if thread is daemon otherwise empty string * @return the "daemon" string if thread is daemon otherwise empty string
*/ */
public String isDaemon() { public String isDaemon() {
return t != null && t.isDaemon() ? "daemon" : ""; return thread != null && thread.isDaemon() ? "daemon" : "";
} }


/** /**
Expand All @@ -586,7 +586,7 @@ public String isDaemon() {
* @return the "alive" string if thread is alive otherwise empty string * @return the "alive" string if thread is alive otherwise empty string
*/ */
public String isAlive() { public String isAlive() {
return t != null && t.isAlive() ? "alive" : ""; return thread != null && thread.isAlive() ? "alive" : "";
} }


/* /*
Expand All @@ -595,10 +595,10 @@ public String isAlive() {
* @see java.lang.Comparable#compareTo(java.lang.Object) * @see java.lang.Comparable#compareTo(java.lang.Object)
*/ */
@Override @Override
public int compareTo(ThreadStruct o) { public int compareTo(ThreadStruct obj) {
int result = getGroupName().compareTo(o.getGroupName()); int result = getGroupName().compareTo(obj.getGroupName());
if (result == 0) { if (result == 0) {
result = (int) (ti.getThreadId() - o.ti.getThreadId()); result = (int) (ti.getThreadId() - obj.ti.getThreadId());
} }
return result; return result;
} }
Expand All @@ -609,17 +609,17 @@ public int compareTo(ThreadStruct o) {
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
@Override @Override
public boolean equals(Object o) { public boolean equals(Object obj) {
if (this == o) { if (this == obj) {
return true; return true;
} }
if (!(o instanceof ThreadStruct)) { if (!(obj instanceof ThreadStruct)) {
return false; return false;
} }


ThreadStruct that = (ThreadStruct) o; ThreadStruct that = (ThreadStruct) obj;


if (t != null ? !t.equals(that.t) : that.t != null) { if (thread != null ? !thread.equals(that.thread) : that.thread != null) {
return false; return false;
} }
if (ti != null ? !ti.equals(that.ti) : that.ti != null) { if (ti != null ? !ti.equals(that.ti) : that.ti != null) {
Expand All @@ -636,7 +636,7 @@ public boolean equals(Object o) {
*/ */
@Override @Override
public int hashCode() { public int hashCode() {
int result = t != null ? t.hashCode() : 0; int result = thread != null ? thread.hashCode() : 0;
result = 31 * result + (ti != null ? ti.hashCode() : 0); result = 31 * result + (ti != null ? ti.hashCode() : 0);
return result; return result;
} }
Expand Down
Expand Up @@ -62,12 +62,12 @@ public class ThriftClient<T extends TServiceClient> implements Runnable {
/** /**
* The t class. * The t class.
*/ */
private Class<T> tClass; private Class<T> clazz;


/** /**
* The t constructor. * The t constructor.
*/ */
private Constructor<T> tConstructor; private Constructor<T> constructor;


/** /**
* The client. * The client.
Expand Down Expand Up @@ -103,15 +103,15 @@ public ThriftClient(String endpointHost, int endpointPort, KaaThriftService kaaT
InstantiationException, InstantiationException,
IllegalAccessException, IllegalAccessException,
InvocationTargetException { InvocationTargetException {
this.tClass = clazz; this.clazz = clazz;
this.endpointHost = endpointHost; this.endpointHost = endpointHost;
this.endpointPort = endpointPort; this.endpointPort = endpointPort;
tConstructor = tClass.getConstructor(TProtocol.class, TProtocol.class); constructor = this.clazz.getConstructor(TProtocol.class, TProtocol.class);
transport = new TSocket(endpointHost, endpointPort); transport = new TSocket(endpointHost, endpointPort);
LOG.debug("ThriftClient sokcet to " + endpointHost + ":" + endpointPort + " created."); LOG.debug("ThriftClient sokcet to " + endpointHost + ":" + endpointPort + " created.");
TProtocol protocol = new TBinaryProtocol(transport); TProtocol protocol = new TBinaryProtocol(transport);
TMultiplexedProtocol mp = new TMultiplexedProtocol(protocol, kaaThriftService.getServiceName()); TMultiplexedProtocol mp = new TMultiplexedProtocol(protocol, kaaThriftService.getServiceName());
client = tConstructor.newInstance(mp, mp); client = constructor.newInstance(mp, mp);
LOG.debug("ThriftClient new Client to " + endpointHost + ":" + endpointPort + " created."); LOG.debug("ThriftClient new Client to " + endpointHost + ":" + endpointPort + " created.");
} }


Expand Down

0 comments on commit f7e52d1

Please sign in to comment.