Hi
I am getting the following error when using JReversePro. I have attached
the class file to this item.
Regards
Chris
C:\jreversepro-1.4.1\bin>jrevpro.bat -dc SuperManager.java
// JReversePro v 1.4.1 Wed Oct 14 10:25:58 CAT 2009
// http://jrevpro.sourceforge.net
// Copyright (C)2000 2001 2002 Karthik Kumar.
// JReversePro comes with ABSOLUTELY NO WARRANTY;
// This is free software, and you are welcome to redistribute
// it under certain conditions;See the File 'COPYING' for more details.
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:85)
at java.util.Stack.pop(Stack.java:67)
at jreversepro.reflect.JMethod.closeBlock(JMethod.java:183)
at
jreversepro.revengine.JBranchEntry.appendEndBlockStmt(JBranchEntry.java:658
)
at
jreversepro.runtime.JRunTimeContext.getEndStmt(JRunTimeContext.java:182)
at
jreversepro.revengine.JDecompiler.genSource(JDecompiler.java:482)
at jreversepro.revengine.JDecompiler.genCode(JDecompiler.java:215)
at
jreversepro.reflect.JClassInfo.processMethods(JClassInfo.java:406)
at
jreversepro.reflect.JClassInfo.reverseEngineer(JClassInfo.java:592)
at jreversepro.JCmdMain.process(JCmdMain.java:323)
at jreversepro.JCmdMain.process(JCmdMain.java:198)
at jreversepro.JCmdMain.main(JCmdMain.java:159)
jreversepro.revengine.RevEngineException: getFieldBreakdown decompilation
failed. Please feel free to report the problem to me at
akkumar@users.sourceforge.net.
at jreversepro.revengine.JDecompiler.genCode(JDecompiler.java:219)
at
jreversepro.reflect.JClassInfo.processMethods(JClassInfo.java:406)
at
jreversepro.reflect.JClassInfo.reverseEngineer(JClassInfo.java:592)
at jreversepro.JCmdMain.process(JCmdMain.java:323)
at jreversepro.JCmdMain.process(JCmdMain.java:198)
at jreversepro.JCmdMain.main(JCmdMain.java:159)
// Decompiled by JReversePro 1.4.1
// Home : http://jrevpro.sourceforge.net
// JVM VERSiON: 47.0
// SOURCEFILE: SuperManager.java
package sscan.core;
import com.braidquest.util.FileUtils;
import com.braidquest.util.ParseUtils;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.StringReader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import org.apache.log4j.Logger;
public class SuperManager
implements Runnable ,SuperNotify{
static Logger trace;
File applfile;
File idreffile;
boolean keepRunning;
boolean isRunning;
Thread thread;
String traceid;
WaitQueue queue;
Hashtable supers;
public String enqueue(Map map)
throws WaitQueueException ,IOException
{
String string = FileUtils.newIncrementNumber(idreffile);
map.put("jobid" , string);
queue.enqueue(map);
return (string);
}
public synchronized void start()
{
if (isRunning)
SuperManager.trace.warn(new
StringBuffer().append(traceid).append("already running, not
started.").toString());
else {
startSupers();
keepRunning = true;
thread = new Thread(this , "SuperManager");
SuperManager.trace.info("SuperManager Starting.");
thread.start();
}
return;
}
public synchronized void stopThread()
{
stopSupers();
keepRunning = false;
if (thread != null)
thread.interrupt();
return;
}
public void run()
{
isRunning = true;
try {
for (;keepRunning;)
threadLoop();
}
catch (Exception exception) {
SuperManager.trace.error("SuperManager:exception:" ,
exception);
}
finally {
isRunning = false;
SuperManager.trace.info(new
StringBuffer().append(traceid).append("terminating!").toString());
}
return;
}
public synchronized void wakeup()
{
notify();
return;
}
public void threadLoop()
throws Exception
{
int i = 0;
try {
Map map = (Map)queue.dequeue(0);
doRequest(map);
i = 0;
}
catch (Exception exception) {
SuperManager.trace.error(new
StringBuffer().append(traceid).append("threadloop failed:").toString() ,
exception);
i++;
if (i > 10)
throw exception;
}
return;
}
public void startSupers()
{
File[] fileArr = applfile.listFiles();
int i = 0;
for (;i < fileArr.length;) {
String string = fileArr[i].getName();
try {
if (fileArr[i].isDirectory())
startSuper(fileArr[i]);
}
catch (Exception exception) {
SuperManager.trace.warn(new
StringBuffer().append(traceid).append("Error starting
supers:").append(exception.toString()).toString());
i++;
}
}
return;
}
public void stopSupers()
{
Iterator iterator1 = supers.values().iterator();
for (;iterator1.hasNext();) {
SuperProcess superprocess = (SuperProcess)iterator1.next();
SuperManager.trace.debug(new
StringBuffer().append(traceid).append("calling stopSuper
for:").append(superprocess.getName()).toString());
superprocess.stopSuper();
SuperManager.trace.debug(new
StringBuffer().append(traceid).append("back from stopSuper, removing sp
from iterator.").toString());
iterator1.remove();
SuperManager.trace.debug(new
StringBuffer().append(traceid).append("done removing sp from
iterator.").toString());
}
SuperManager.trace.debug(new
StringBuffer().append(traceid).append("done stopSupers.").toString());
return;
}
public void startSuper(File file)
throws IOException
{
SuperProcess superprocess;
if (supers.get(file.getName()) != null)
throw new IOException(new
StringBuffer().append(traceid).append("not started, already in supers
table:").append(file.getName()).toString());
superprocess = new SuperProcess(file , this);
superprocess.start();
supers.put(file.getName() , superprocess);
return;
}
public void superStarted(SuperProcess superprocess)
{
return;
}
public void superStopped(SuperProcess superprocess)
{
return;
}
public void doRequest(Map map)
{
Object object = null;
Object object4 = null;
String string = "";
String string2;
if (map == null) {
SuperManager.trace.info(new
StringBuffer().append(traceid).append("received null
request.").toString());
return;
}
try {
string2 = (String)map.get("req");
SuperManager.trace.debug(new StringBuffer("in supermanager,
req:").append(string2).toString());
if (string2 == null && string2.equals("csvbuild"))
doCsvBuild(map);
else if (string2 == null && string2.equals("qry"))
doQry(map);
}
catch (Exception exception) {
SuperManager.trace.error(new
StringBuffer().append(traceid).append("doRequest failed:").toString() ,
exception);
return;
}
}
public void doQry(Map map)
{
System.out.println(new
StringBuffer("reqmap:").append(map).toString());
Object object = null;
Object object3 = null;
Object object4 = null;
Object object5 = null;
String string = "job-unknownid.log";
Object object8 = null;
Object object9 = null;
Object object10 = null;
Object object11 = null;
String string12 = "";
String string13 = "";
String string14 = "";
String string15 = "";
try {
File file = (File)map.get("reposfile");
File file19 = new File(file , "S_outQ/S_stat.current");
Map map3;
Map map4;
Map map5;
StringBuffer stringbuffer;
String string21;
String string21;
Iterator iterator20;
File file23;
String string22;
File file22;
String string22;
Iterator iterator25;
File file24;
String string27;
String string26;
List list29;
List list;
String string31;
int k;
int i;
String string32;
String string32;
if (!file19.exists())
throw new IOException("Stat file not found.\nEither
build in progress or repository not initialised.");
map4 = (Map)map.get("schemamap");
map3 = (Map)map.get("qrymap");
map5 = (Map)map.get("weightsmap");
stringbuffer = new StringBuffer();
iterator20 = map5.keySet().iterator();
for (;iterator20.hasNext();) {
string21 = (String)iterator20.next();
string22 = (String)map5.get(string21);
if (string22 == null || string22.length() == 0)
string22 = "0";
stringbuffer.append(string21).append(",").append(string22).append("\n");
}
string21 = stringbuffer.toString();
if (string21.length() > 0) {
file22 = new File(file , "S_inQ/T_cnfg.weights");
file23 = new File(file , "S_inQ/S_cnfg.weights");
FileUtils.toFile(file22 , string21.getBytes());
file22.renameTo(file23);
}
string12 = (String)map3.get("weightthresh");
string13 = (String)map3.get("qrysort");
string14 = (String)map.get("currqry");
string15 = (String)map.get("qryusrid");
string22 = new
StringBuffer().append(string12).append(string13).append(string14).append('.
').append(string15).toString();
string22 = string22.trim();
file23 = new File(file , new
StringBuffer("S_inQ/T_b").append(string22).toString());
file24 = new File(file , new
StringBuffer("S_inQ/S_b").append(string22).toString());
stringbuffer = new StringBuffer();
iterator25 = map5.keySet().iterator();
for (;iterator25.hasNext();) {
string26 = (String)iterator25.next();
string27 = (String)map5.get(string26);
if (string27 == null || string27.equals("0"))
continue;
list = (List)map3.get(string26);
if (list == null)
continue;
list29 = (List)map4.get(string26);
i = 0;
if (list29.size() > 1) {
string31 = (String)list29.get(1);
if (string31.indexOf("lower") > -1)
i = 1;
}
k = 0;
for (;k < list.size();) {
string32 = (String)list.get(k);
if (string32.trim().length() < 1) {
}
else if (i != 0)
string32 = string32.toLowerCase();
stringbuffer.append(new
StringBuffer().append(string26).append('
').append(Integer.toString(string32.length())).append('
').append(string32).append('
').toString());
k++;
}
}
FileUtils.toFile(file23 ,
stringbuffer.toString().getBytes());
file23.renameTo(file24);
}
catch (Exception exception) {
SuperManager.trace.error(new
StringBuffer().append(traceid).append("doRequest failed:").toString() ,
exception);
}
finally {
if (object10 != null) {
try {
object10.close();
}
catch (Exception exception18) {
}
}
if (object11 != null) {
try {
object11.close();
}
catch (Exception exception18) {
}
}
}
return;
}
public void doCsvBuild(Map map)
{
String string = "";
Object object = null;
Object object4 = null;
String string5 = "job-loadcsv.log";
String string6 = "unknown";
Object object7 = null;
Object object8 = null;
Object object9 = null;
Object object10 = null;
Object object11 = null;
Object object12 = null;
Object object13 = null;
Date date = new Date();
Object object16 = null;
BufferedReader bufferedreader;
BufferedWriter bufferedwriter;
BufferedWriter bufferedwriter11;
RandomAccessFile randomaccessfile;
File file13;
try {
string = (String)map.get("schemastr");
File file = (File)map.get("reposfile");
file13 = new File(file , string5);
List list = (List)map.get("csvlist");
string6 = (String)map.get("jobid");
Date date15;
String string16;
String string21;
File file20;
File file23;
String string22;
File file25;
File file24;
File file27;
File file26;
long i;
Iterator iterator31;
Map map30;
int k;
int l;
String string32;
int j;
List list38;
StringBuffer stringbuffer;
File file36;
boolean p;
List list37;
String string42;
Iterator iterator43;
String string40;
String string40;
String string41;
String string46;
String string47;
String string44;
List list45;
List list51;
String string50;
String string49;
int m;
int n;
if (string6 == null)
string6 = "unknown";
string16 = (String)map.get("keeprld");
jobLog(file13 , new StringBuffer("In progress
job:").append(string6).append("
started:").append(date.toString()).toString());
if (string == null || file == null || list == null)
throw new IOException(new
StringBuffer().append(traceid).append("Invalid reqmap, missing request
objects.").toString());
file20 = new File(file , "S_outQ/S_stat.current");
if (!file20.exists())
throw new IOException("Stat file not found.\nEither
build in progress or repository not initialised.");
string21 = FileUtils.fileToString(file20);
string22 = getNextRldSerNo(string21);
file23 = new File(file , new
StringBuffer("S_inQ/T_rld.").append(string22).toString());
file24 = new File(file , new
StringBuffer("S_inQ/S_rld.").append(string22).toString());
file25 = new File(file , new
StringBuffer("S_inQ/T_Bld.").append(string22).toString());
file26 = new File(file , new
StringBuffer("S_inQ/S_Bld.").append(string22).toString());
file27 = new File(file , "rejects.dat");
randomaccessfile = new RandomAccessFile(new File(file ,
"scanmaster.dat") , "rw");
i = 0;
randomaccessfile.setLength(i);
map30 = SuperManager.parseSchema(string);
iterator31 = list.iterator();
bufferedwriter = new BufferedWriter(new FileWriter(file23 ,
false));
bufferedwriter11 = new BufferedWriter(new FileWriter(file27 ,
false));
j = 0;
k = 0;
l = 0;
for (;iterator31.hasNext();) {
file36 = (File)iterator31.next();
bufferedreader = new BufferedReader(new
InputStreamReader(new FileInputStream(file36)));
string32 = bufferedreader.readLine();
if (string32 == null)
throw new IOException(new StringBuffer("No header
line found in ").append(file36.getAbsolutePath()).toString());
list37 = ParseUtils.parseMsCsvLine(string32.trim());
FileUtils.toFile(new File(file , "scanmaster.hdr") ,
string32.getBytes());
string32 = bufferedreader.readLine();
for (;string32 != null;) {
string32 = string32.trim();
if (string32.length() == 0) {
string32 = bufferedreader.readLine();
continue;
}
j++;
list38 = ParseUtils.parseMsCsvLine(string32);
if (list38.size() != list37.size()) {
bufferedwriter11.write(string32);
bufferedwriter11.newLine();
l++;
string32 = bufferedreader.readLine();
continue;
}
stringbuffer = new StringBuffer();
string40 = Long.toString(i);
string41 = Integer.toString(string40.length());
string42 = new
StringBuffer("00,").append(string41).append(',').append(string40).append('
').toString();
stringbuffer.append(string42);
iterator43 = map30.keySet().iterator();
for (;iterator43.hasNext();) {
string44 = (String)iterator43.next();
if (Integer.parseInt(string44) == 0)
continue;
list45 = (List)map30.get(string44);
string46 = (String)list45.get(0);
string47 = "";
if (list45.size() > 1)
string47 = (String)list45.get(1);
m = 0;
for (;m < list38.size();) {
string49 = (String)list37.get(m);
string50 = (String)list38.get(m);
if (string50.trim().length() == 0) {
}
else if (string49.equals(string46)) {
list51 = getFieldBreakdown(string50
, string47);
if (list51 == null) {
bufferedwriter11.write(string32);
bufferedwriter11.newLine();
l++;
string32 =
bufferedreader.readLine();
}
else {
n = 0;
for (;n < list51.size();) {
string40 =
(String)list51.get(n);
if (string40.length() ==
0) {
}
else {
string41 =
Integer.toString(string40.length());
string42 = new
StringBuffer().append(string44).append(',').append(string41).append(',').ap
pend(string40).append(' ').toString();
stringbuffer.append(string42);
}
n++;
}
}
}
m++;
}
}
bufferedwriter.write(stringbuffer.toString());
bufferedwriter.newLine();
k++;
randomaccessfile.seek(i);
randomaccessfile.write(string32.getBytes());
randomaccessfile.write(10);
i = randomaccessfile.getFilePointer();
string32 = bufferedreader.readLine();
}
bufferedreader.close();
bufferedreader = null;
}
if (k > 0) {
bufferedwriter.close();
bufferedwriter = null;
bufferedwriter11.close();
bufferedwriter11 = null;
if (string16 != null) {
file36 = new File(file , "lastrld.txt");
FileUtils.copyFile(file23 , file36);
}
p = file23.renameTo(file24);
if (p) {
FileUtils.toFile(file25 ,
Integer.toString(k).getBytes());
file25.renameTo(file26);
}
else
throw new IOException(new StringBuffer("Build did
not start, unable to rename ").append(file23.getName()).toString());
}
date15 = new Date();
jobLog(file13 , new StringBuffer("Csv load -
job:").append(string6).append(" read:").append(j).append("
accepted:").append(k).append(" rejects:").append(l).append("
finished:").append(da
te15.toString()).toString());
}
catch (Exception exception) {
SuperManager.trace.error(new
StringBuffer().append(traceid).append("Csv load failed:").toString() ,
exception);
jobLog(file13 , new StringBuffer("Csv load -
job:").append(string6).append(" failed -
reason:\n").append(exception.toString()).toString());
}
finally {
if (bufferedreader != null) {
try {
bufferedreader.close();
}
catch (Exception exception19) {
}
}
if (bufferedwriter != null) {
try {
bufferedwriter.close();
}
catch (Exception exception19) {
}
}
if (bufferedwriter11 != null) {
try {
bufferedwriter11.close();
}
catch (Exception exception19) {
}
}
if (randomaccessfile != null) {
try {
randomaccessfile.close();
}
catch (Exception exception19) {
}
}
}
return;
}
private final void jobLog(File file ,String string)
{
try {
FileUtils.toFile(file , string.getBytes());
}
catch (Exception exception) {
SuperManager.trace.error(new
StringBuffer().append(traceid).append("Could not write csv load
log.").toString() , exception);
return;
}
}
private final List getFieldBreakdown(String string ,String string2)
{
ArrayList arraylist = new ArrayList();
Object object = null;
Object object5 = null;
StreamTokenizer streamtokenizer;
StringReader stringreader;
Object object8;
int i;
try {
if (string2.indexOf("words") > -1) {
stringreader = new StringReader(string);
streamtokenizer = new StreamTokenizer(stringreader);
streamtokenizer.resetSyntax();
if (string2.indexOf("lower") > -1)
streamtokenizer.lowerCaseMode(true);
streamtokenizer.wordChars(48 , 57);
streamtokenizer.wordChars(97 , 122);
streamtokenizer.wordChars(65 , 90);
i = streamtokenizer.nextToken();
for (;i != -1;) {
if (i == -3)
break;
if (!checkAsciiDisplayable(streamtokenizer.sval))
break;
object8 = null;
}
}
}
}
private final boolean checkAsciiDisplayable(String string)
{
int i;
if (string.length() == 0 || string.length() > 99)
return (false);
i = 0;
for (;i < string.length();) {
if (string.charAt(i) < 32 || string.charAt(i) > 126)
return (false);
i++;
}
return (true);
}
public static Map parseSchema(String string)
throws IOException
{
try {
TreeMap treemap = new TreeMap(new CategoryComparator());
string = new StringBuffer.append(new
StringBuffer()).append('
').toString();
int i = string.indexOf(10);
int j = 0;
for (;i > -1;) {
String string3 = string.substring(0 , i).trim();
if (string3.length() > 0) {
List list = ParseUtils.parseMsCsvLine(string3);
ArrayList arraylist;
int k;
if (list.size() < 2)
throw new IOException("Invalid schema string,
< 2 entries.");
arraylist = new ArrayList();
k = 1;
for (;k < list.size();) {
arraylist.add(list.get(k));
k++;
}
treemap.put((String)list.get(0) , arraylist);
}
if (i + 1 > string.length())
break;
string = string.substring(i + 1);
i = string.indexOf(10);
}
return (treemap);
}
catch (Exception exception) {
throw new IOException(new StringBuffer("Could not parse
schemastr, error:").append(exception.toString()).toString());
}
}
public static Map parseWeights(String string)
throws IOException
{
try {
TreeMap treemap = new TreeMap();
int i = string.indexOf(10);
string = new StringBuffer.append(new
StringBuffer()).append('
').toString();
int j = 0;
for (;i > -1;) {
String string3 = string.substring(0 , i).trim();
if (string3.length() > 0) {
List list = ParseUtils.parseMsCsvLine(string3);
treemap.put((String)list.get(0) ,
(String)list.get(1));
}
if (i + 1 > string.length())
break;
string = string.substring(i + 1);
i = string.indexOf(10);
}
return (treemap);
}
catch (Exception exception) {
throw new IOException(new StringBuffer("Could not parse
weightsstr, error:").append(exception.toString()).toString());
}
}
private final String getNextRldSerNo(String string)
{
String string2 = "00000001";
String string2;
String string3;
int i;
String string5;
int j;
if (string == null)
return (string2);
string3 = "Last reload serial no. . . . ";
i = string.indexOf(string3);
if (i < 0)
return (string2);
string5 = string.substring(i + string3.length() , i +
string3.length() + 8);
try {
j = Integer.parseInt(string5);
j++;
string2 = SuperManager.zeroPad(8 , Integer.toString(j));
return (string2);
}
catch (Exception exception) {
return (string2);
}
}
public static String zeroPad(int i ,String string)
{
int j = i - string.length();
int k = 0;
for (;k < j;) {
string = new StringBuffer("0").append(string).toString();
k++;
}
if (string.length() > i)
string = string.substring(string.length() - i);
return (string);
}
public static Map parseQuery(String string)
throws IOException
{
try {
TreeMap treemap = new TreeMap();
TreeMap treemap2 = new TreeMap();
string = new StringBuffer.append(new
StringBuffer()).append('
').toString();
int i = string.indexOf(10);
int j = 0;
for (;i > -1;) {
String string4 = string.substring(0 , i).trim();
if (string4.length() > 0) {
List list = ParseUtils.parseMsCsvLine(string4);
ArrayList arraylist;
int k;
if (j == 0) {
treemap.put("weightthresh" , list.get(0));
treemap.put("qrysort" , list.get(1));
list.remove(0);
list.remove(0);
String string7 = SuperManager.toCsv(list);
treemap.put("rsltfields" , string7);
}
else {
treemap2.put((String)list.get(0) ,
(String)list.get(1));
arraylist = new ArrayList(list.size() - 2);
k = 2;
for (;k < list.size();) {
arraylist.add(list.get(k));
k++;
}
treemap.put((String)list.get(0) , arraylist);
}
j++;
}
if (i + 1 > string.length())
break;
string = string.substring(i + 1);
i = string.indexOf(10);
}
treemap.put("weightsmap" , treemap2);
return (treemap);
}
catch (Exception exception) {
throw new IOException(new StringBuffer("Could not parse
qrystr, error:").append(exception.toString()).toString());
}
}
public static String toCsv(List list)
{
StringBuffer stringbuffer;
int i;
if (list == null)
return ("");
stringbuffer = new StringBuffer();
i = 0;
for (;i < list.size();) {
if (i > 0)
stringbuffer.append(",");
stringbuffer.append((String)list.get(i));
i++;
}
return (stringbuffer.toString());
}
private final void this()
{
keepRunning = false;
isRunning = false;
thread = null;
return;
}
public SuperManager(File file)
{
;
this();
applfile = file;
idreffile = new File(file , "jobid.refid");
traceid = "SuperManager ";
supers = new Hashtable();
queue = new WaitQueue(200);
return;
}
static
{
SuperManager.trace = Logger.getLogger("Trace.SuperManager");
return;
}
}
C:\jreversepro-1.4.1\bin>
Nobody/Anonymous
None
None
Public
| Filename | Description | Download |
|---|---|---|
| SuperManager.class | Class file used while decopmpiling, causing the error | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 346912: SuperManager.class | 2009-10-16 14:04 | chris123410 |