more fixes

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1129 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-08-03 20:19:48 +00:00
parent f28c1607f7
commit 8c56b437fa
3 changed files with 7 additions and 12 deletions

View File

@ -28,7 +28,7 @@ public class Sort implements Function {
return r;
} else if (v instanceof List<?>) {
List<? extends Comparable> a = (List<? extends Comparable>) v;
List<? extends Comparable<Object>> a = (List<? extends Comparable<Object>>) v;
Collections.sort(a);
return a;

View File

@ -20,12 +20,11 @@ import org.json.JSONObject;
public class JSObject extends Properties {
private static final long serialVersionUID = 5864375136126385719L;
@SuppressWarnings("unchecked")
static public void writeJSObject(IndentWriter writer, JSObject jso) throws IOException, JSONException {
writer.println("{");
writer.indent();
{
Enumeration e = jso.propertyNames();
Enumeration<?> e = jso.propertyNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
Object value = jso.get(name);
@ -45,12 +44,11 @@ public class JSObject extends Properties {
writer.print("}");
}
@SuppressWarnings("unchecked")
static public void writeCollection(IndentWriter writer, Collection c) throws IOException, JSONException {
static public void writeCollection(IndentWriter writer, Collection<?> c) throws IOException, JSONException {
writer.println("[");
writer.indent();
{
Iterator i = c.iterator();
Iterator<?> i = c.iterator();
while (i.hasNext()) {
writeObject(writer, i.next());
if (i.hasNext()) {
@ -108,7 +106,6 @@ public class JSObject extends Properties {
writer.print("]");
}
@SuppressWarnings("unchecked")
static public void writeObject(IndentWriter writer, Object o) throws IOException, JSONException {
if (o == null) {
writer.print("null");
@ -118,7 +115,7 @@ public class JSObject extends Properties {
writer.print(((Number) o).toString());
} else if (o instanceof Collection) {
writeCollection(writer, (Collection) o);
writeCollection(writer, (Collection<?>) o);
} else if (o instanceof JSONArray) {
writeJSONArray(writer, (JSONArray) o);
} else if (o instanceof JSObject) {

View File

@ -201,8 +201,7 @@ class GridworksServer extends Server {
scanner.setReportExistingFilesOnStartup(false);
scanner.addListener(new Scanner.BulkListener() {
@SuppressWarnings("unchecked")
public void filesChanged(List changedFiles) {
public void filesChanged(@SuppressWarnings("rawtypes") List changedFiles) {
try {
logger.info("Stopping context: " + contextRoot.getAbsolutePath());
context.stop();
@ -362,7 +361,6 @@ class GridworksClient extends JFrame implements ActionListener {
private URI uri;
@SuppressWarnings("unchecked")
public void init(String host, int port) throws Exception {
uri = new URI("http://" + host + ":" + port + "/");
@ -380,7 +378,7 @@ class GridworksClient extends JFrame implements ActionListener {
m.add(mi);
mb.add(m);
Class applicationClass = Class.forName("com.apple.eawt.Application");
Class<?> applicationClass = Class.forName("com.apple.eawt.Application");
Object macOSXApplication = applicationClass.getConstructor((Class[]) null).newInstance((Object[]) null);
Method setDefaultMenuBar = applicationClass.getDeclaredMethod("setDefaultMenuBar", new Class[] { JMenuBar.class });
setDefaultMenuBar.invoke(macOSXApplication, new Object[] { mb });