Looking at the code, it seems like the only difference between one way and the other is that the IniLoader is a shared instance.
…so maybe there is something weird in IniLoader?
Edit: for reference:
Your “working” way, addHandler() is called twice. Else addHandler() is called once. The only difference then would be that ImplThreadLocal is shared in one case and not the other.
import com.jme3.asset.AssetInfo;
import com.jme3.asset.AssetLoader;
import java.io.IOException;
import org.ini4j.Ini;
public class IniLoader implements AssetLoader {
@Override
public Ini load(AssetInfo assetInfo) throws IOException {
Ini result = new Ini(assetInfo.openStream());
return result;
}
}