The generic set updaters weren't working because proguard renamed the
methods they were looking for. Since it's probably impossible to have proguard generically skip renaming for these generated method names, let's update the fields in a different way. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3434 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -23,7 +23,6 @@ package com.threerings.presents.dobj;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@@ -295,13 +294,7 @@ public class DObject extends TrackedObject
|
||||
*/
|
||||
public void addToSet (String setName, DSet.Entry entry)
|
||||
{
|
||||
String mname = "addTo" + StringUtils.capitalize(setName);
|
||||
try {
|
||||
Method m = getClass().getMethod(mname, ENTRY_CLASS_ARGS);
|
||||
m.invoke(this, new Object[] { entry });
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("No such set: " + setName);
|
||||
}
|
||||
requestEntryAdd(setName, getSet(setName), entry);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,13 +302,7 @@ public class DObject extends TrackedObject
|
||||
*/
|
||||
public void updateSet (String setName, DSet.Entry entry)
|
||||
{
|
||||
String mname = "update" + StringUtils.capitalize(setName);
|
||||
try {
|
||||
Method m = getClass().getMethod(mname, ENTRY_CLASS_ARGS);
|
||||
m.invoke(this, new Object[] { entry });
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("No such set: " + setName);
|
||||
}
|
||||
requestEntryUpdate(setName, getSet(setName), entry);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,13 +310,7 @@ public class DObject extends TrackedObject
|
||||
*/
|
||||
public void removeFromSet (String setName, Comparable key)
|
||||
{
|
||||
String mname = "removeFrom" + StringUtils.capitalize(setName);
|
||||
try {
|
||||
Method m = getClass().getMethod(mname, KEY_CLASS_ARGS);
|
||||
m.invoke(this, new Object[] { key });
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("No such set: " + setName);
|
||||
}
|
||||
requestEntryRemove(setName, getSet(setName), key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user