Skip to content

Commit

Permalink
chennaione#393 Little bugfix and added log output for every EntityLis…
Browse files Browse the repository at this point in the history
…tener found during parsing.
  • Loading branch information
iweinzierl committed Oct 3, 2015
1 parent 4adfa04 commit 8498dbe
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.orm.entity;

import android.content.Context;
import android.util.Log;

import com.google.common.collect.Lists;
import com.orm.util.ReflectionUtil;
Expand Down Expand Up @@ -31,7 +32,7 @@ public EntityListenerManager(Context context) {
public void notify(Object entity, Class listenerType) {
List<EntityListenerMeta> entityListenerMetas = entityListenerMetaMap.get(entity.getClass());

if (entityListenerMetas != null && entityListenerMetas.isEmpty()) {
if (entityListenerMetas != null && !entityListenerMetas.isEmpty()) {
for (EntityListenerMeta meta : entityListenerMetas) {
notify(entity, listenerType, meta);
}
Expand Down Expand Up @@ -90,6 +91,8 @@ private List<EntityListenerMeta> processListenerClasses(Class domainClass, Class
List<EntityListenerMeta> metaList = Lists.newArrayList();

for (Class listenerClass : listenerClasses) {
Log.i("Sugar", "Found EntityListener for domain class '" + domainClass + "': " + listenerClass);

EntityListenerMeta meta = processListenerClass(domainClass, listenerClass);
if (meta != null) {
metaList.add(meta);
Expand Down

0 comments on commit 8498dbe

Please sign in to comment.