PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : compilen



luggas
09-02-2003, 11:13
hi ich hab hier ein problemchen und hoffe ihr könnt mir weiterhelfen.

hier sind zwei dateien a.java und h.java

a.java kann ich problemlos compilen. h.java allerdings nicht.
da kommt folgende fehlermeldung:

javac h.java

h.java:52: cannot resolve symbol
symbol : variable _fldnew
location: clas java.lang.String[]
aT=a._fldnew[i];

h.java:93: cannot resolve symbol
symbol_variable _fldnew
location: class java.lang.String[]
aT=a._fldnew[a0];

2 errors



und hier der quellcode:

a.java
=================


public interface a
{

public static final String _fldlong = "Doktor";
public static final String _fldint = "Schlafen";
public static final String _fldif = "Junkfood";
public static final String a[] = {
"K\344se", "M\366hre", "Schinken", "Bier", "Tier", "Schnaps"
};
public static final String _flddo = "Di\344t";
public static final String _fldgoto = "Tiefschlaf";
public static final String _fldfor = "Heilung";
public static final String _fldtry = "Stre\337abbau";
public static final String _fldbyte = "Entschmackung";
public static final String _fldcase = "Ausdauer";
public static final String _fldchar = "Kraft";
public static final String _fldelse = "Abh\344rtung";
public static final String _fldnew[] = {
"Keule", "Klavier", "Sprung", "Boxen", "Stecher", "Helm", "Brille", "Latte"
};

}


=======================

h.java

==========================


import java.io.*;

public class h
implements a
{

public h()
{
bk = new double[8];
}

public h(String s, double d1, double d2, double d3,
double d4, double d5, double d6, double d7, double d8)
{
this(s, -1, d1, d2, d3, d4, d5, d6, d7, d8, 0, 0.0D, 0, 0.0D);
}

public h(String s, int i, double d1, double d2, double d3, double d4, double d5, double d6,
double d7, double d8, int j, double d9,
int k, double d10)
{
bk = new double[8];
aT = s;
aO = i;
bn = d1;
aY = d2;
aQ = d3;
bl = d4;
be = d5;
aH = d6;
aW = d7;
bp = d8;
aU = j;
aR = d9;
a3 = k;
aM = d10;
aX = 0.050000000000000003D;
for(int l = 0; l < 8; l++)
bk[l] = 0.30000000000000004D;

}

public h(int i, double d1, double d2, double d3,
double d4, double d5, double d6, double d7, double d8, int j, double d9, int k,
double d10)
{
bk = new double[8];
aT = a._fldnew[i];
aO = i;
bn = d1;
aY = d2;
aQ = d3;
bl = d4;
be = d5;
aH = d6;
aW = d7;
bp = d8;
aU = j;
aR = d9;
a3 = k;
aM = d10;
aX = 0.050000000000000003D;
for(int l = 0; l < 8; l++)
bk[l] = 0.30000000000000004D;

}

public h(DataInput datainput)
throws IOException
{
bk = new double[8];
aO = datainput.readInt();
bn = datainput.readDouble();
aY = datainput.readDouble();
aQ = datainput.readDouble();
bl = datainput.readDouble();
be = datainput.readDouble();
aH = datainput.readDouble();
aW = datainput.readDouble();
bp = datainput.readDouble();
aU = datainput.readInt();
aR = datainput.readDouble();
a3 = datainput.readInt();
aM = datainput.readDouble();
aX = datainput.readDouble();
for(int i = 0; i < 8; i++)
bk[i] = datainput.readDouble();

aT = a._fldnew[aO];
}

public h g()
{
h h1 = new h(aT, aO, bn, aY, aQ, bl, be, aH, aW, bp, aU, aR, a3, aM);
h1.aX = aX;
for(int i = 0; i < 8; i++)
h1.bk[i] = bk[i];

return h1;
}

public boolean f()
{
return (aU & 0xffff0000) != 0;
}

public boolean h()
{
return (aU & 0xffff) != 0;
}

public void _mthif(DataOutput dataoutput)
throws IOException
{
dataoutput.writeInt(aO);
dataoutput.writeDouble(bn);
dataoutput.writeDouble(aY);
dataoutput.writeDouble(aQ);
dataoutput.writeDouble(bl);
dataoutput.writeDouble(be);
dataoutput.writeDouble(aH);
dataoutput.writeDouble(aW);
dataoutput.writeDouble(bp);
dataoutput.writeInt(aU);
dataoutput.writeDouble(aR);
dataoutput.writeInt(a3);
dataoutput.writeDouble(aM);
dataoutput.writeDouble(aX);
for(int i = 0; i < 8; i++)
dataoutput.writeDouble(bk[i]);

}

}


HILFEEEEEEEE ;)

Edit by anda_skoa: Code tags gesetzt. Bitte in Zukunft selber verwenden

SeeksTheMoon
09-02-2003, 12:31
argh, ziemlich unleserlich. Hast Du etwa den Bytecode von einem Obfuscator decompiliert?

Auf jeden Fall liegt der Fehler hier:
a._fldnew[i];

Es sieht so aus, als ob hier mit Overloading gearbeitet wurde (Interface a und Variablen a). Du musst schauen, wo welche "a"s gemeint sind und die Variablen durch andere Namen ersetzen, denn offenbar klappt der Zugriff auf das Array nicht.

luggas
09-02-2003, 12:38
ja, ich hab mir mal so ein aplettchen mit jad dekompiliert ;) also wie ich dich verstehe, sind da die selben bezeichner für unterschiedliche variablen der fehler?

anda_skoa
09-02-2003, 22:09
Sowohl das Interface als auch eine Konstante im Interface heißt a.

Lass bei den Aufrufen mal das a. weg

Ciao,
_

luggas
10-02-2003, 21:15
DU GOTT =)