more fixes
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1129 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
f28c1607f7
commit
8c56b437fa
@ -28,7 +28,7 @@ public class Sort implements Function {
|
|||||||
|
|
||||||
return r;
|
return r;
|
||||||
} else if (v instanceof List<?>) {
|
} 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);
|
Collections.sort(a);
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
|
@ -20,12 +20,11 @@ import org.json.JSONObject;
|
|||||||
public class JSObject extends Properties {
|
public class JSObject extends Properties {
|
||||||
private static final long serialVersionUID = 5864375136126385719L;
|
private static final long serialVersionUID = 5864375136126385719L;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static public void writeJSObject(IndentWriter writer, JSObject jso) throws IOException, JSONException {
|
static public void writeJSObject(IndentWriter writer, JSObject jso) throws IOException, JSONException {
|
||||||
writer.println("{");
|
writer.println("{");
|
||||||
writer.indent();
|
writer.indent();
|
||||||
{
|
{
|
||||||
Enumeration e = jso.propertyNames();
|
Enumeration<?> e = jso.propertyNames();
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
String name = (String) e.nextElement();
|
String name = (String) e.nextElement();
|
||||||
Object value = jso.get(name);
|
Object value = jso.get(name);
|
||||||
@ -45,12 +44,11 @@ public class JSObject extends Properties {
|
|||||||
writer.print("}");
|
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.println("[");
|
||||||
writer.indent();
|
writer.indent();
|
||||||
{
|
{
|
||||||
Iterator i = c.iterator();
|
Iterator<?> i = c.iterator();
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
writeObject(writer, i.next());
|
writeObject(writer, i.next());
|
||||||
if (i.hasNext()) {
|
if (i.hasNext()) {
|
||||||
@ -108,7 +106,6 @@ public class JSObject extends Properties {
|
|||||||
writer.print("]");
|
writer.print("]");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static public void writeObject(IndentWriter writer, Object o) throws IOException, JSONException {
|
static public void writeObject(IndentWriter writer, Object o) throws IOException, JSONException {
|
||||||
if (o == null) {
|
if (o == null) {
|
||||||
writer.print("null");
|
writer.print("null");
|
||||||
@ -118,7 +115,7 @@ public class JSObject extends Properties {
|
|||||||
writer.print(((Number) o).toString());
|
writer.print(((Number) o).toString());
|
||||||
|
|
||||||
} else if (o instanceof Collection) {
|
} else if (o instanceof Collection) {
|
||||||
writeCollection(writer, (Collection) o);
|
writeCollection(writer, (Collection<?>) o);
|
||||||
} else if (o instanceof JSONArray) {
|
} else if (o instanceof JSONArray) {
|
||||||
writeJSONArray(writer, (JSONArray) o);
|
writeJSONArray(writer, (JSONArray) o);
|
||||||
} else if (o instanceof JSObject) {
|
} else if (o instanceof JSObject) {
|
||||||
|
@ -201,8 +201,7 @@ class GridworksServer extends Server {
|
|||||||
scanner.setReportExistingFilesOnStartup(false);
|
scanner.setReportExistingFilesOnStartup(false);
|
||||||
|
|
||||||
scanner.addListener(new Scanner.BulkListener() {
|
scanner.addListener(new Scanner.BulkListener() {
|
||||||
@SuppressWarnings("unchecked")
|
public void filesChanged(@SuppressWarnings("rawtypes") List changedFiles) {
|
||||||
public void filesChanged(List changedFiles) {
|
|
||||||
try {
|
try {
|
||||||
logger.info("Stopping context: " + contextRoot.getAbsolutePath());
|
logger.info("Stopping context: " + contextRoot.getAbsolutePath());
|
||||||
context.stop();
|
context.stop();
|
||||||
@ -362,7 +361,6 @@ class GridworksClient extends JFrame implements ActionListener {
|
|||||||
|
|
||||||
private URI uri;
|
private URI uri;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void init(String host, int port) throws Exception {
|
public void init(String host, int port) throws Exception {
|
||||||
|
|
||||||
uri = new URI("http://" + host + ":" + port + "/");
|
uri = new URI("http://" + host + ":" + port + "/");
|
||||||
@ -380,7 +378,7 @@ class GridworksClient extends JFrame implements ActionListener {
|
|||||||
m.add(mi);
|
m.add(mi);
|
||||||
mb.add(m);
|
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);
|
Object macOSXApplication = applicationClass.getConstructor((Class[]) null).newInstance((Object[]) null);
|
||||||
Method setDefaultMenuBar = applicationClass.getDeclaredMethod("setDefaultMenuBar", new Class[] { JMenuBar.class });
|
Method setDefaultMenuBar = applicationClass.getDeclaredMethod("setDefaultMenuBar", new Class[] { JMenuBar.class });
|
||||||
setDefaultMenuBar.invoke(macOSXApplication, new Object[] { mb });
|
setDefaultMenuBar.invoke(macOSXApplication, new Object[] { mb });
|
||||||
|
Loading…
Reference in New Issue
Block a user