Some Galileo inspired raw type and dead code elimination.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5956 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -222,7 +222,7 @@ public abstract class ConfigRegistry
|
|||||||
{
|
{
|
||||||
// mirror this configuration update to the persistent config
|
// mirror this configuration update to the persistent config
|
||||||
Object value = event.getValue();
|
Object value = event.getValue();
|
||||||
if (value instanceof DSet) {
|
if (value instanceof DSet<?>) {
|
||||||
serializeAttribute(event.getName());
|
serializeAttribute(event.getName());
|
||||||
} else {
|
} else {
|
||||||
updateValue(event.getName(), value);
|
updateValue(event.getName(), value);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class Streamer
|
|||||||
*/
|
*/
|
||||||
public static Class<?> getStreamerClass (Object object)
|
public static Class<?> getStreamerClass (Object object)
|
||||||
{
|
{
|
||||||
return (object instanceof Enum) ?
|
return (object instanceof Enum<?>) ?
|
||||||
((Enum<?>)object).getDeclaringClass() : object.getClass();
|
((Enum<?>)object).getDeclaringClass() : object.getClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class EntryAddedEvent<T extends DSet.Entry> extends NamedEvent
|
|||||||
@Override
|
@Override
|
||||||
protected void notifyListener (Object listener)
|
protected void notifyListener (Object listener)
|
||||||
{
|
{
|
||||||
if (listener instanceof SetListener) {
|
if (listener instanceof SetListener<?>) {
|
||||||
@SuppressWarnings("unchecked") SetListener<T> setlist = (SetListener<T>)listener;
|
@SuppressWarnings("unchecked") SetListener<T> setlist = (SetListener<T>)listener;
|
||||||
setlist.entryAdded(this);
|
setlist.entryAdded(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
|
|||||||
@Override
|
@Override
|
||||||
protected void notifyListener (Object listener)
|
protected void notifyListener (Object listener)
|
||||||
{
|
{
|
||||||
if (listener instanceof SetListener) {
|
if (listener instanceof SetListener<?>) {
|
||||||
@SuppressWarnings("unchecked") SetListener<T> setlist = (SetListener<T>)listener;
|
@SuppressWarnings("unchecked") SetListener<T> setlist = (SetListener<T>)listener;
|
||||||
setlist.entryRemoved(this);
|
setlist.entryRemoved(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
|
|||||||
@Override
|
@Override
|
||||||
protected void notifyListener (Object listener)
|
protected void notifyListener (Object listener)
|
||||||
{
|
{
|
||||||
if (listener instanceof SetListener) {
|
if (listener instanceof SetListener<?>) {
|
||||||
@SuppressWarnings("unchecked") SetListener<T> setlist = (SetListener<T>)listener;
|
@SuppressWarnings("unchecked") SetListener<T> setlist = (SetListener<T>)listener;
|
||||||
setlist.entryUpdated(this);
|
setlist.entryUpdated(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class ReportingInvoker extends Invoker
|
|||||||
if (PresentsDObjectMgr.UNIT_PROF_ENABLED) {
|
if (PresentsDObjectMgr.UNIT_PROF_ENABLED) {
|
||||||
for (Object key : _tracker.keySet()) {
|
for (Object key : _tracker.keySet()) {
|
||||||
UnitProfile profile = _tracker.get(key);
|
UnitProfile profile = _tracker.get(key);
|
||||||
if (key instanceof Class) {
|
if (key instanceof Class<?>) {
|
||||||
key = StringUtil.shortClassName((Class<?>)key);
|
key = StringUtil.shortClassName((Class<?>)key);
|
||||||
}
|
}
|
||||||
buf.append(" ").append(key).append(" ");
|
buf.append(" ").append(key).append(" ");
|
||||||
|
|||||||
@@ -94,30 +94,29 @@ public class GenActionScriptBundlesTask extends Task
|
|||||||
out.println("{");
|
out.println("{");
|
||||||
out.println(" override protected function getContent () :Object");
|
out.println(" override protected function getContent () :Object");
|
||||||
out.println(" {");
|
out.println(" {");
|
||||||
if (true) {
|
|
||||||
// create an array with all the values, then populate in a loop
|
|
||||||
out.println(" var data :Array = [");
|
|
||||||
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
|
||||||
String key = saveConvert((String) entry.getKey());
|
|
||||||
String val = saveConvert((String) entry.getValue());
|
|
||||||
out.println(" \"" + key + "\", \"" + val + "\",");
|
|
||||||
}
|
|
||||||
out.println(" null];");
|
|
||||||
out.println(" var o :Object = new Object();");
|
|
||||||
out.println(" for (var ii :int = 0; ii < data.length; ii += 2) {");
|
|
||||||
out.println(" o[data[ii]] = data[ii + 1];");
|
|
||||||
out.println(" }");
|
|
||||||
|
|
||||||
} else {
|
// create an array with all the values, then populate in a loop
|
||||||
// alternate impl: just set each value directly. For non-trivial
|
out.println(" var data :Array = [");
|
||||||
// resource bundles, this generates a larger class after compilation
|
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
||||||
out.println(" var o :Object = new Object();");
|
String key = saveConvert((String) entry.getKey());
|
||||||
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
String val = saveConvert((String) entry.getValue());
|
||||||
String key = saveConvert((String) entry.getKey());
|
out.println(" \"" + key + "\", \"" + val + "\",");
|
||||||
String val = saveConvert((String) entry.getValue());
|
|
||||||
out.println(" o[\"" + key + "\"] = \"" + val + "\";");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
out.println(" null];");
|
||||||
|
out.println(" var o :Object = new Object();");
|
||||||
|
out.println(" for (var ii :int = 0; ii < data.length; ii += 2) {");
|
||||||
|
out.println(" o[data[ii]] = data[ii + 1];");
|
||||||
|
out.println(" }");
|
||||||
|
|
||||||
|
// // alternate impl: just set each value directly. For non-trivial
|
||||||
|
// // resource bundles, this generates a larger class after compilation
|
||||||
|
// out.println(" var o :Object = new Object();");
|
||||||
|
// for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
||||||
|
// String key = saveConvert((String) entry.getKey());
|
||||||
|
// String val = saveConvert((String) entry.getValue());
|
||||||
|
// out.println(" o[\"" + key + "\"] = \"" + val + "\";");
|
||||||
|
// }
|
||||||
|
|
||||||
out.println(" return o;");
|
out.println(" return o;");
|
||||||
out.println(" }");
|
out.println(" }");
|
||||||
out.println("}}");
|
out.println("}}");
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public abstract class InvocationTask extends Task
|
|||||||
|
|
||||||
protected void addImportsForType (Type type, ImportSet imports)
|
protected void addImportsForType (Type type, ImportSet imports)
|
||||||
{
|
{
|
||||||
if (type instanceof Class) {
|
if (type instanceof Class<?>) {
|
||||||
imports.add((Class<?>)type);
|
imports.add((Class<?>)type);
|
||||||
} else if (type instanceof ParameterizedType) {
|
} else if (type instanceof ParameterizedType) {
|
||||||
imports.add((Class<?>)((ParameterizedType)type).getRawType());
|
imports.add((Class<?>)((ParameterizedType)type).getRawType());
|
||||||
@@ -326,7 +326,7 @@ public abstract class InvocationTask extends Task
|
|||||||
|
|
||||||
protected String unboxArgument (Type type, int index, boolean listenerMode)
|
protected String unboxArgument (Type type, int index, boolean listenerMode)
|
||||||
{
|
{
|
||||||
if (listenerMode && (type instanceof Class) &&
|
if (listenerMode && (type instanceof Class<?>) &&
|
||||||
_ilistener.isAssignableFrom((Class<?>)type)) {
|
_ilistener.isAssignableFrom((Class<?>)type)) {
|
||||||
return "listener" + index;
|
return "listener" + index;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class StreamableEnumSet<E extends Enum<E>> extends AbstractSet<E>
|
|||||||
*/
|
*/
|
||||||
public static <E extends Enum<E>> StreamableEnumSet<E> copyOf (Collection<E> s)
|
public static <E extends Enum<E>> StreamableEnumSet<E> copyOf (Collection<E> s)
|
||||||
{
|
{
|
||||||
if (s instanceof StreamableEnumSet) {
|
if (s instanceof StreamableEnumSet<?>) {
|
||||||
StreamableEnumSet<E> set = (StreamableEnumSet<E>)s;
|
StreamableEnumSet<E> set = (StreamableEnumSet<E>)s;
|
||||||
return copyOf(set);
|
return copyOf(set);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user