Print at Dec 20, 2025, 5:09:38 AM

Posted by enzymer at Dec 15, 2007, 5:17:00 PM
Re: Question about DefaultFurnitureCatalog.ja
Hi,epuybaret :
Thank you! Using debug in Eclipse, i find the problem is really caused by code in DefaultFurnitureCatalog - it seems like something unexpected happens in ResourceBundle reading. I write a small program below (coded just like DefaultFurnitureCatalog):
----------------------------------------------------------------------------
/*
* This program aims to read information from ResourceBundle (first the testBundle, then the testBundle2). However, only the second
* bundle is readed.
*/
package testBean;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class testBundle{
private static final String NAME = "name#";
private static final String CATEGORY = "category#";

public static void main(String[] args){
new testBundle();
}

public testBundle(){
System.out.println("initialTest");
//When in debug, i can see the method below could not be executed,
//and the above sentence repeatedly print "initialTest".
read(ResourceBundle.getBundle(testBundle.class.getName()));

String classPackage = testBundle.class.getName();
classPackage = classPackage.substring(0, classPackage.lastIndexOf("."));
read(ResourceBundle.getBundle(classPackage + ".testBundle2"));
}

private void read(ResourceBundle resource){
System.out.println("initialReadTest");
for(int i = 1; ; i++){
String name = null;
try{
name = resource.getString(NAME + i);
System.out.println("Node Name: " + name);
}catch(MissingResourceException ex){
//Stop the loop when this node does not exist.
break;
}

String category = resource.getString(CATEGORY + i);
System.out.println("Category Name: " + category);
}
}
}
------------------------------------------------
So, this program has some problems (i don't know where or why) -- i think it is the same problem that i met before in Sweet Home 3D.
I add Thread.dumpStack() in the constructor of this small program, and find some unexpected things (but i have no experience on stack trace so...:( )
I installed Sweet Home 3D before using install file, the initialization seems a bit slow in my computer (But i cannot tell whether it is because of DefaultFurnitureCatalog).
Could you run the small program above? (the property file is just like DefaultFurnitureCatalog), I wish it is OK on your side, anyway, i could not find any bug in this program.
-------
and you are right, the j3d dll files will not cause such problem.
-----------------------------------------------
Really thank you for help! I will run this program on other computers including Linux environment, I wish all these are caused by my OS or Eclipse setting.
Kind regards.