Hi,
Maybe someone can help me. I get a:
"Zero service while at recoder.java.declaration.TypeDeclaration.getMethods(TypeDeclaration.java)"
error when calling getMethods() on a TypeDeclaration instance. The relevant code snippet is:
I just began to play with recoder and I ran into this problem too.
This is in fact not an error but a logging information located in TypeDeclaration:
if (service == null) {
Debug.log("Zero service while " + Debug.makeStackTrace());
updateModel();
}
If you want to avoid this message, you may change the source code or you may call the updateModel() method of the ChangeHistory instance just before retrieving the methods :
config.getChangeHistory().updateModel();
I guess recoder should use a more standard logger such as log4j or commons logging to allow the user to choose the appropriate logging level.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Maybe someone can help me. I get a:
"Zero service while at recoder.java.declaration.TypeDeclaration.getMethods(TypeDeclaration.java)"
error when calling getMethods() on a TypeDeclaration instance. The relevant code snippet is:
ServiceConfiguration config=new DefaultServiceConfiguration();
ProjectSettings settings=config.getProjectSettings();
PathList pathList=settings.getSearchPathList();
pathList.add("/usr/local/share/jdk1.3.1_02/src");
SourceFileRepository rep=config.getSourceFileRepository();
rep.getAllCompilationUnitsFromPath();
SourceInfo si =config.getSourceInfo();
CompilationUnit cu = rep.getCompilationUnit(CLASS_TO_TEST);
TypeDeclaration typeDeclaration= cu.getPrimaryTypeDeclaration();
MethodList methods=typeDeclaration.getMethods();
Does anyone have any idea what I'm doing wrong? Thank you in advance.
Andras
I just began to play with recoder and I ran into this problem too.
This is in fact not an error but a logging information located in TypeDeclaration:
if (service == null) {
Debug.log("Zero service while " + Debug.makeStackTrace());
updateModel();
}
If you want to avoid this message, you may change the source code or you may call the updateModel() method of the ChangeHistory instance just before retrieving the methods :
config.getChangeHistory().updateModel();
I guess recoder should use a more standard logger such as log4j or commons logging to allow the user to choose the appropriate logging level.
Hi Barthelemy,
Thanks a lot for your help, you were right.
Andras
I've forgot to add that afterwards it seems to work though (the methods are returned), I just don't know why I'm getting the error message.
thanks,
Andras