[Mulgara-svn] r1556 - trunk/src/jar/querylang/java/org/mulgara/itql
pag at mulgara.org
pag at mulgara.org
Wed Feb 25 19:04:27 UTC 2009
Author: pag
Date: 2009-02-25 11:04:27 -0800 (Wed, 25 Feb 2009)
New Revision: 1556
Modified:
trunk/src/jar/querylang/java/org/mulgara/itql/ItqlSessionUI.java
Log:
Fixed warnings be adding generics and removing unused variables
Modified: trunk/src/jar/querylang/java/org/mulgara/itql/ItqlSessionUI.java
===================================================================
--- trunk/src/jar/querylang/java/org/mulgara/itql/ItqlSessionUI.java 2009-02-25 19:03:45 UTC (rev 1555)
+++ trunk/src/jar/querylang/java/org/mulgara/itql/ItqlSessionUI.java 2009-02-25 19:04:27 UTC (rev 1556)
@@ -44,7 +44,6 @@
*
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
-import java.beans.*;
import java.io.*;
import java.util.*;
@@ -52,33 +51,24 @@
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
-import javax.swing.event.*;
import org.apache.log4j.*;
import org.jrdf.graph.Node;
import org.mulgara.query.Answer;
-import org.mulgara.query.TuplesException;
public class ItqlSessionUI extends JScrollPane implements Runnable,
KeyListener, java.awt.event.MouseListener, ActionListener {
+ /** Serialization ID */
+ private static final long serialVersionUID = 6713691768040570333L;
+
/**
* The logging category to log to
*/
private final static Logger log = Logger.getLogger(ItqlSessionUI.class);
/**
- * Inputstream to take user input.
- */
- private InputStream in;
-
- /**
- * Outputstream to display user output.
- */
- private PrintStream out;
-
- /**
* Used to pipe input.
*/
private InputStream inPipe;
@@ -96,7 +86,7 @@
/**
* The list of history items.
*/
- private ArrayList history = new ArrayList();
+ private ArrayList<String> history = new ArrayList<String>();
/**
* Current index into the history.
@@ -162,14 +152,14 @@
outPipe = new PipedOutputStream();
try {
- in = new PipedInputStream((PipedOutputStream) outPipe);
+ new PipedInputStream((PipedOutputStream) outPipe);
} catch (IOException e) {
log.error("Error creating input stream", e);
}
PipedOutputStream pout = new PipedOutputStream();
- out = new PrintStream(pout);
+ new PrintStream(pout);
try {
inPipe = new PipedInputStream(pout);
@@ -722,6 +712,7 @@
/**
* Extension to JTextPane to put all pastes at the end of the command line.
*/
+ @SuppressWarnings("serial")
class PasteablePane extends JTextPane {
public PasteablePane(StyledDocument doc) {
@@ -775,20 +766,20 @@
itqlSession.executeCommand(command);
println();
- java.util.List answers = itqlSession.getLastAnswers();
- java.util.List messages = itqlSession.getLastMessages();
+ java.util.List<Answer> answers = itqlSession.getLastAnswers();
+ java.util.List<String> messages = itqlSession.getLastMessages();
int answerIndex = 0;
String lastMessage;
while (answerIndex < answers.size()) {
- lastMessage = (String) messages.get(answerIndex);
+ lastMessage = messages.get(answerIndex);
try {
// Assume the same number of answers and messages
- Answer answer = (Answer) answers.get(answerIndex);
+ Answer answer = answers.get(answerIndex);
// If there's more than one answer print a heading.
if (answers.size() > 1) {
More information about the Mulgara-svn
mailing list