cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaanHoogland <...@git.apache.org>
Subject [GitHub] cloudstack pull request: DAO: Hit the cache for entity flagged as ...
Date Mon, 09 May 2016 11:14:42 GMT
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1532#discussion_r62482644
  
    --- Diff: framework/db/src/com/cloud/utils/db/GenericDaoBase.java ---
    @@ -942,12 +942,18 @@ public T findOneBy(final SearchCriteria<T> sc) {
         @DB()
         @SuppressWarnings("unchecked")
         public T findById(final ID id) {
    +        T result = null;
             if (_cache != null) {
                 final Element element = _cache.get(id);
    -            return element == null ? lockRow(id, null) : (T)element.getObjectValue();
    +            if (element == null) {
    +                result = lockRow(id, null);
    +            } else {
    +                result = (T)element.getObjectValue();
    +            }
             } else {
    -            return lockRow(id, null);
    +            result = lockRow(id, null);
             }
    +        return result
    --- End diff --
    
    a ';' missing :(


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message