에서 "해결할 수 없거나 필드가 없습니다."오류가 발생했습니다. Java 프로파일 러의 소스 코드를 Eclipse에 다운로드했습니다. 한 클래스에서 오류가 발생합니다.eclipse (java)
또한t.threadLocalCCTNode cannot be resolved or is not a field
getIndex 방법 라인 반환 Thread.currentThread().bytecodeIndex;
에서, 그것은 비슷한주고있다 : 그것은 나에게 다음과 같은 오류를 제공 getCurrentNode 방법 라인 CCTNode node = t.threadLocalCCTNode;
에서
/
**
* Copyright (c) 2010 Aibek Sarimbekov, Philippe Moret, Walter Binder
*
* Permission to copy, use, modify (only the included source files, modification
* of the binaries is not permitted) the software is granted provided this
* copyright notice appears in all copies.
*
* This software is provided "as is" without express or implied warranty, and
* with no claim as to its suitability for any purpose.
*/
package ch.usi.dag.jp2.runtime;
import ch.usi.dag.jborat.runtime.DynamicBypass;
public class JP2Runtime {
private static final String objectConstructorMID;
private static final String currentThreadMID;
static CCTNode main;
static {
objectConstructorMID = "Ljava/lang/Object;.<init>()V".intern();
currentThreadMID = "Ljava/lang/Thread;.currentThread()Ljava/lang/Thread".intern();
}
public static CCTNode getCurrentNode() {
boolean old = DynamicBypass.getAndSet();
try {
Thread t = Thread.currentThread();
CCTNode node = t.threadLocalCCTNode;
if (node == null) {
node = CCTNode.getRoot();
t.threadLocalCCTNode = node;
main = node;
}
return node;
} finally {
DynamicBypass.set(old);
}
}
public static void setCurrentNode(CCTNode node) {
boolean old = DynamicBypass.getAndSet();
try {
Thread.currentThread().threadLocalCCTNode = node;
} finally {
DynamicBypass.set(old);
}
}
public static void setIndex(int index) {
boolean old = DynamicBypass.getAndSet();
try{
Thread.currentThread().bytecodeIndex = index;
}
finally{
DynamicBypass.set(old);
}
}
public static int getIndex() {
boolean old = DynamicBypass.getAndSet();
try {
return Thread.currentThread().bytecodeIndex;}
finally {
DynamicBypass.set(old);
}
}
public static void enableProfiling(){
boolean old = DynamicBypass.getAndSet();
try {
Thread.currentThread().activateBytecodeCounting=true;
}
finally {
DynamicBypass.set(old);
}
}
public static void disableProfiling(){
boolean old = DynamicBypass.getAndSet();
try {
Thread.currentThread().activateBytecodeCounting=false;
}
finally {
DynamicBypass.set(old);
}
}
public static CCTNode invokeProfileInvocation(CCTNode oldNode, String MID, int numberOfBB) {
boolean old = DynamicBypass.getAndSet();
int bytecodeIndex = getIndex();
try {
CCTNode n = oldNode.profileCall(MID, bytecodeIndex, numberOfBB);
Thread.currentThread().threadLocalCCTNode=n;
return n;
} finally {
DynamicBypass.set(old);
}
}
public static void invokeProfileInvocationForObjectConstructor(CCTNode oldNode) {
boolean old = DynamicBypass.getAndSet();
int bytecodeIndex = getIndex();
try {
CCTNode n = oldNode.profileCall(objectConstructorMID, bytecodeIndex, 1);
CCTNode.bbSizes.put(objectConstructorMID, allocateNewArrayWithOneElement());
} finally {
DynamicBypass.set(old);
}
}
public static void invokeProfileInvocationForCurrentThread(CCTNode oldNode) {
boolean old = DynamicBypass.getAndSet();
int bytecodeIndex = getIndex();
try {
CCTNode n = oldNode.profileCall(currentThreadMID, bytecodeIndex, 1);
CCTNode.bbSizes.put(currentThreadMID, allocateNewArrayWithOneElement());
} finally {
DynamicBypass.set(old);
}
}
private static int[] allocateNewArrayWithOneElement() {
int[] array = {1};
return array;
}
}
: 클래스는 다음과 같습니다 다음과 같은 오류 :
bytecodeIndex cannot be resolved or is not a field
시체가 잘못되었다고 말해줘? 이미 프로젝트 정리를 시도했지만 도움이되지 않았습니다 ..
감사합니다.
답변 해 주셔서 감사합니다. 명령 프롬프트에서 프로파일 러를 실행할 수있었습니다. 따라서 Eclipse에서 사용하는 java 버전은 프로파일 러에서 지원하지 않을 수 있습니다. – Ragini