Click here to Skip to main content
15,902,938 members

Comments by AllainLG (Top 7 by date)

AllainLG 11-Nov-12 6:26am View    
If the file contains "extends":
<pre lang="java">error: cannot find symbol
public class RefactorMuveletek extends MasikOsztaly{</pre>

If the input's class is connected to another class:
<pre lang="java">
Exception in thread "main" java.lang.ClassNotFoundException: csomag.eolvasottOsztalyNev
errorCode:1

Exception while removing reference: java.lang.InterruptedException
java.lang.InterruptedException
</pre>
AllainLG 7-Nov-12 12:30pm View    
I see, thank you.
Does someone have a code for this?
AllainLG 7-Nov-12 12:29pm View    
What about javax.tools.JavaCompiler? Is it useful to me?
AllainLG 6-Nov-12 18:05pm View    
My program would work like this: the user chooses a file (text or java) and I'd like to get how many loops it have, and list them on my jList.
I want to change for example a for loop to a while, so it will work the same way.
Of course evereything in java language.
AllainLG 6-Nov-12 15:40pm View    
You are right, but the names are not in english, it would be difficult to understand.
I thing only these codes matters:

public class MyProgram {
public static void fileReading() {
lista = new ArrayList < String > ();
try {
inp = new LineNumberReader(new BufferedReader(new InputStreamReader(new FileInputStream(inFileNev), "ISO8859-1")));
String sor;
while ((sor = inp.readLine()) != null) {
lista.add(sor);
lista.add(System.getProperty("line.separator"));
}
inp.close();
} catch...


public static void beolv_osztaly_metodusok() {
try {
Class c= Class.forName("ClassName");
Method[] metodusok = c.getDeclaredMethods();

......


The rest is irrelevant, since the problem is this: I can't get the input file's class, without this I can't get the methods from it.
It works if the ClassName is my program's name.