Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

ORMDroid attempts to map public static final vars #4

Closed
ronnyek opened this issue Dec 21, 2012 · 2 comments
Closed

ORMDroid attempts to map public static final vars #4

ronnyek opened this issue Dec 21, 2012 · 2 comments
Assignees
Labels

Comments

@ronnyek
Copy link

ronnyek commented Dec 21, 2012

android frequently uses int/string constants instead of enum's.. .attempting any setting of these causes expected errors.

ex

public class User{
public final static int USER_TYPE_ADMIN = 0;
public final static int USER_TYPE_SUPERADMIN=1;

public int userType;

}

I had to move the constants out into another class, then deserializing from db worked properly again.

Perhaps we should ignore, or if we can access protection levels and whether or not its static / non-static, we should automatically ignore said fields? (we'll never be able to set a static var like the actual USER_TYPE_ADMIN in this case).

Otherwise we could put together an ignore annotation for explicit ignoring.

@ghost ghost assigned roscopeco Dec 23, 2012
@roscopeco
Copy link
Owner

This is a bug - we should definitely ignore all non-public, non-instance fields.

I'll put together a fix for this later today.

roscopeco added a commit that referenced this issue Dec 23, 2012
Fix static/final field handling issue (bug #4)
@roscopeco
Copy link
Owner

Fixed in master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants