[Yanel-dev] ResourceManager.java

Alec Bickerton alec.bickerton at wyona.com
Fri Feb 20 16:24:07 CET 2009


Eclipse has identified a problem that could cause some problems in the
future.

The rtd value here will never be null so the nice log message will never
be seen. It is entirely possible though that this rtd value could
contain garbage.

A reminder that simply setting your eclipse compiler settings to sane
values and looking at the problems tab from time to time will identify
this sort of thing and hwlp us to produce clean, shing and efficient code.

Alec.

ResourceMmanager.java line 60.



public Resource getResource(Environment environment, Realm realm, String
path, ResourceTypeDefinition rtd, ResourceTypeIdentifier rti) throws
Exception {
        String universalName = rtd.getResourceTypeUniversalName();
        if (rtd != null) {
            Resource resource = (Resource)
Class.forName(rtd.getResourceTypeClassname()).newInstance();

            resource.setRTD(rtd);
            resource.setYanel(Yanel.getInstance());
            resource.setRealm(realm);
            resource.setPath(path);
            resource.setRTI(rti);
            resource.setEnvironment(environment);

            passParameters(resource, environment.getRequest());

            return resource;
        }
        log.error("No resource registered for rti: " + universalName);
        return null;
    }


More information about the Yanel-development mailing list