Project

General

Profile

« Previous | Next » 

Revision b4c19aff

Added by Andreas Müller almost 4 years ago

cleanup

View differences:

cdmlib-cache/src/main/java/eu/etaxonomy/cdm/cache/ProxyUtils.java
134 134
     * de-proxies the passed object <code>o</code> if it is an initialized proxy object,
135 135
     * otherwise <code>o</code> is returned.
136 136
     */
137
    public static Object deproxy(Object o) {
137
    public static <T extends Object> T deproxy(T o) {
138 138
        if(o != null && o instanceof HibernateProxy) {
139 139
            LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer();
140 140
            if(!hli.isUninitialized()) {
141
                return hli.getImplementation();
141
                return (T)hli.getImplementation();
142 142
            }
143 143
        }
144 144

  
145 145
        if(o != null && o instanceof PersistentCollection) {
146 146
            PersistentCollection pc = ((PersistentCollection)o);
147 147
            if(pc.wasInitialized()) {
148
                return  ProxyUtils.getObject(pc);
148
                return (T)ProxyUtils.getObject(pc);
149 149
            }
150 150
        }
151 151
        return o;
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/ICdmCacher.java
13 13
/**
14 14
 * @author cmathew
15 15
 * @since 19 Feb 2015
16
 *
17 16
 */
18 17
public interface ICdmCacher {
19 18

  
......
50 49
    /**
51 50
     *
52 51
     * @param cdmEntity
53
     * @return returns true if the <code>cdmEntity</code> is cacheable by the
52
     * @return returns true if the <code>cdmEntity</code> is cachable by the
54 53
     *         implementation
55 54
     */
56 55
    public boolean isCachable(CdmBase cdmEntity);
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/cache/CdmCacher.java
148 148

  
149 149
    @Override
150 150
    public <T extends CdmBase> T getFromCache(T cdmBase) {
151
        return (T) getFromCache(cdmBase.getUuid());
151
        return (T)getFromCache(cdmBase.getUuid());
152 152
    }
153 153

  
154 154
    @Override

Also available in: Unified diff