[jsword-svn] r2056 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/book bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop bibledesktop/src/main/java/org/crosswire/bibledesktop/display bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic bibledesktop/src/main/java/org/crosswire/bibledesktop/passage common-swing/src/main/java/org/crosswire/common/config/swing common-swing/src/main/java/org/crosswire/common/progress/swing common-swing/src/main/java/org/crosswire/common/swing common-swing/src/main/java/org/crosswire/common/swing/desktop jsword/src/main/java/org/crosswire/common/util jsword/src/main/java/org/crosswire/jsword/book jsword/src/test/java jsword/src/test/java/org/crosswire/common/util jsword-limbo/.settings jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference jsword-limbo/src/main/java/org/crosswire/common/io jsword-limbo/src/main/java/org/crosswire/common/net jsword-limbo/src/main/java/org/crosswire/common/swing jsword-limbo/src/main/java/org/crosswire/common/util jsword-limbo/src/main/java/org/crosswire/common/xml jsword-limbo/src/main/java/org/crosswire/jsword/book jsword-limbo/src/main/java/org/crosswire/jsword/book/install/sword jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc jsword-limbo/src/main/java/org/crosswire/jsword/book/raw jsword-limbo/src/main/java/org/crosswire/jsword/book/remote jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse jsword-limbo/src/main/java/org/crosswire/jsword/book/ser jsword-limbo/src/main/java/org/crosswire/jsword/book/stub jsword-limbo/src/main/java/org/crosswire/jsword/passage jsword-limbo/src/main/java/org/crosswire/jsword/view/web jsword-limbo/src/test/java/org/crosswire/common/util jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse
dmsmith at crosswire.org
dmsmith at crosswire.org
Sat Dec 11 21:34:42 MST 2010
Author: dmsmith
Date: 2010-12-11 21:34:41 -0700 (Sat, 11 Dec 2010)
New Revision: 2056
Modified:
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksListModel.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/MultiBookPane.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/BookNode.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/IndexResolver.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallManagerComboBoxModel.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallerFactoryComboBoxModel.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/BookDataDisplayFactory.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/SplitBookDataDisplay.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TabbedBookDataDisplay.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeySidebar.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeyTreeNode.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/RangeListModel.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AdvancedConfigEditor.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ConfigEditorFactory.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FieldMap.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/OptionsField.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/TreeConfigEditor.java
trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/ActionFactory.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/FontStore.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/FormPane.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/MapComboBoxModel.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/MapEntryRenderer.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/MapTableModel.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/AbstractViewLayout.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java
trunk/jsword-limbo/.settings/org.eclipse.jdt.core.prefs
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/CompareResultsPane.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/DebugPane.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/GeneratorPane.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLStreamHandler.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceBookTreeNode.java
trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceKeyTreeNode.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/io/BrowserOutputStream.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/io/ConnectedReader.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/io/NullWriter.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/io/TimeoutReader.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Cookie.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Header.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/AppletFrame.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/BeanPanel.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DeckLayout.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/EirPanel.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapCellRenderer.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapTable.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MoneyDocument.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTable.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTableModel.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/SortRenderer.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanel.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanelBeanInfo.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/UpperCaseDocument.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/util/OldStringUtilTest.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/util/RobustList.java
trunk/jsword-limbo/src/main/java/org/crosswire/common/xml/DOMDefaultHandler.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/Strongs.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/install/sword/FtpSwordInstaller.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBook.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBookDriver.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/CaseInstsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/InstsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ItemsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ParaInstsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsDisk.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncItemsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/RawBookDriver.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsDisk.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordItemsMem.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/HttpRemoteBookDriver.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoteBookDriver.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoteBook.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoterException.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/DefaultWord.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/ser/SerBook.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/stub/StubBook.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/passage/PassageSet.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/RemoterServlet.java
trunk/jsword-limbo/src/test/java/org/crosswire/common/util/ThreadUtilTest.java
trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/CustomTokenizerTest.java
trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/DictionaryTest.java
trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/ParserTest.java
trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/WordsTest.java
trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java
trunk/jsword/src/main/java/org/crosswire/common/util/Reporter.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
trunk/jsword/src/test/java/Bench.java
trunk/jsword/src/test/java/org/crosswire/common/util/PropertyMapTest.java
Log:
JS-142 Java 5 Generics
Added generics across bibledesktop, common-swing and jsword-limbo.
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -650,8 +650,8 @@
*
* @return the labels
*/
- private Dictionary createSliderLabels() {
- Dictionary labels = new Hashtable();
+ private Dictionary<Integer,JLabel> createSliderLabels() {
+ Dictionary<Integer,JLabel> labels = new Hashtable<Integer,JLabel>();
int max = DisplaySelectPane.getMaxNumRankedVerses();
for (int i = 0; i <= max; i += 20) {
Integer label = Integer.valueOf(i);
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -57,7 +57,7 @@
/**
* Basic Constructor
*/
- public BooksComboBoxModel(BookFilter filter, Comparator comparator) {
+ public BooksComboBoxModel(BookFilter filter, Comparator<Book> comparator) {
super(filter, comparator);
postCacheData();
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksListModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksListModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksListModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -32,6 +32,7 @@
import javax.swing.event.ListDataListener;
import org.crosswire.common.util.Logger;
+import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookFilter;
import org.crosswire.jsword.book.BookList;
import org.crosswire.jsword.book.Books;
@@ -67,14 +68,14 @@
/**
* Basic constructor, redefining ordering.
*/
- public BooksListModel(BookFilter filter, Comparator comp) {
+ public BooksListModel(BookFilter filter, Comparator<Book> comp) {
this(filter, Books.installed(), comp);
}
/**
* Basic constructor for a filtered list of books, ordered as requested.
*/
- public BooksListModel(BookFilter filter, BookList bookList, Comparator comparator) {
+ public BooksListModel(BookFilter filter, BookList bookList, Comparator<Book> comparator) {
this.filter = filter;
this.bookList = bookList;
this.comparator = comparator;
@@ -154,7 +155,7 @@
* Setup the data-stores of the current Bibles and drivers
*/
protected final synchronized void cacheData() {
- books = new ArrayList();
+ books = new ArrayList<Book>();
books.addAll(bookList.getBooks(filter));
Collections.sort(books, comparator);
}
@@ -228,12 +229,12 @@
* marked synchronized to ensure that one thread can't update the list of
* books while another is trying to create a JList based on this class.
*/
- protected List books;
+ protected List<Book> books;
/**
* The sort algorithm to use.
*/
- protected transient Comparator comparator;
+ protected transient Comparator<Book> comparator;
/**
* The log stream
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/MultiBookPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/MultiBookPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/MultiBookPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -256,9 +256,8 @@
/*
// Code to search for a word
- for (Iterator it = Books.getBooks(filter).iterator(); it.hasNext();)
- {
- DictionaryMetaData dmd = (DictionaryMetaData) it.next();
+ for (BookMetaData bmd : Books.getBooks(filter)) {
+ DictionaryMetaData dmd = (DictionaryMetaData) bmd;
Dictionary tempdict = dmd.getDictionary();
try
{
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -60,7 +60,7 @@
* @param comparator
* the order to put the books in
*/
- public ParallelBookPicker(BookFilter filter, Comparator comparator) {
+ public ParallelBookPicker(BookFilter filter, Comparator<Book> comparator) {
this.filter = filter;
this.comparator = comparator;
initialize();
@@ -126,19 +126,19 @@
* @see org.crosswire.jsword.book.BookProvider#getBooks()
*/
public Book[] getBooks() {
- List books = new ArrayList();
+ List<Book> books = new ArrayList<Book>();
int count = getComponentCount();
for (int i = 1; i < count; i++) {
Component comp = getComponent(i);
if (comp instanceof JComboBox) {
JComboBox combo = (JComboBox) comp;
- Object book = combo.getSelectedItem();
+ Book book = (Book) combo.getSelectedItem();
if (book != null) {
books.add(book);
}
}
}
- return (Book[]) books.toArray(new Book[books.size()]);
+ return books.toArray(new Book[books.size()]);
}
/* (non-Javadoc)
@@ -287,7 +287,7 @@
/**
* The comparator to order the books.
*/
- private transient Comparator comparator;
+ private transient Comparator<Book> comparator;
/**
* Allow for adding and removing pickers.
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/BookNode.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/BookNode.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/BookNode.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -21,7 +21,6 @@
*/
package org.crosswire.bibledesktop.book.install;
-import java.util.Iterator;
import java.util.Set;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -43,10 +42,8 @@
setUserObject(node);
if (level < grouping.length) {
String key = (String) grouping[level];
- Set group = books.getGroup(key);
- Iterator iter = group.iterator();
- while (iter.hasNext()) {
- Object value = iter.next();
+ Set<Object> group = books.getGroup(key);
+ for (Object value : group) {
BookSet subBooks = books.filter(key, value);
add(new BookNode(value, subBooks, level + 1, grouping));
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/IndexResolver.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/IndexResolver.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/IndexResolver.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -24,7 +24,6 @@
import java.awt.BorderLayout;
import java.awt.Component;
import java.io.IOException;
-import java.util.Iterator;
import java.util.Map;
import javax.swing.JComboBox;
@@ -133,13 +132,14 @@
private static Installer selectInstaller(Component parent) {
// Pick an installer
InstallManager insman = new InstallManager();
- Map installers = insman.getInstallers();
+ Map<String,Installer> installers = insman.getInstallers();
Installer installer = null;
if (installers.size() == 1) {
- Iterator<Installer> it = installers.values().iterator();
- boolean hasNext = it.hasNext();
- assert hasNext;
- installer = it.next();
+ for (Installer anInstaller : installers.values()) {
+ installer = anInstaller;
+ break;
+ }
+ assert installer != null;
} else {
JComboBox choice = new JComboBox(new InstallManagerComboBoxModel(insman));
// TRANSLATOR: Label for a list of index download sites.
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallManagerComboBoxModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallManagerComboBoxModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallManagerComboBoxModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -138,7 +138,7 @@
/**
* A cache of the names in the Install Manager
*/
- private List names = new ArrayList();
+ private List<String> names = new ArrayList<String>();
/**
* The install manager that we are representing
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallerFactoryComboBoxModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallerFactoryComboBoxModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InstallerFactoryComboBoxModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -43,8 +43,8 @@
* Simple ctor
*/
public InstallerFactoryComboBoxModel(InstallManager imanager) {
- Set nameset = imanager.getInstallerFactoryNames();
- names = new ArrayList();
+ Set<String> nameset = imanager.getInstallerFactoryNames();
+ names = new ArrayList<String>();
names.addAll(nameset);
Collections.sort(names);
}
@@ -80,7 +80,7 @@
/**
* The list of installer names
*/
- private List names;
+ private List<String> names;
/**
* The currently selected object
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -29,7 +29,6 @@
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.ObjectInputStream;
-import java.util.Iterator;
import java.util.Map;
import javax.swing.BorderFactory;
@@ -96,10 +95,8 @@
*/
protected final void addAllInstallers() {
// Now add panels for book installation sites
- Iterator<String> iter = installers.keySet().iterator();
- while (iter.hasNext()) {
- String name = iter.next();
- Installer installer = (Installer) installers.get(name);
+ for (String name : installers.keySet()) {
+ Installer installer = installers.get(name);
SitePane site = new SitePane(installer);
tabMain.add(name, site);
@@ -249,7 +246,7 @@
/**
* The known installers fetched from InstallManager
*/
- private transient Map installers;
+ private transient Map<String, Installer> installers;
/**
* The current installer
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -94,6 +94,7 @@
import org.crosswire.common.util.Reporter;
import org.crosswire.common.util.ResourceUtil;
import org.crosswire.common.util.Translations;
+import org.crosswire.common.xml.Converter;
import org.crosswire.common.xml.XMLUtil;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookFilters;
@@ -830,7 +831,7 @@
public void checkForBooks() {
// News users probably wont have any Bibles installed so we give them a
// hand getting to the installation dialog.
- List bibles = Books.installed().getBooks(BookFilters.getBibles());
+ List<Book> bibles = Books.installed().getBooks(BookFilters.getBibles());
if (bibles.isEmpty()) {
// TRANSLATOR: Title of dialog asking the user to install at least one Bible.
String title = Msg.gettext("Install Bibles?");
@@ -948,9 +949,9 @@
Translations.instance().register();
// And the array of allowed osis>html converters
- Map converters = ConverterFactory.getKnownConverters();
- Set keys = converters.keySet();
- String[] names = (String[]) keys.toArray(new String[keys.size()]);
+ Map<String, Class<Converter>> converters = ConverterFactory.getKnownConverters();
+ Set<String> keys = converters.keySet();
+ String[] names = keys.toArray(new String[keys.size()]);
ChoiceFactory.getDataMap().put(CONV_KEY, names);
// The choice of configurable XSL stylesheets
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -25,7 +25,6 @@
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
-import java.util.Iterator;
import javax.swing.Action;
import javax.swing.JCheckBoxMenuItem;
@@ -182,9 +181,7 @@
public void doSaveAll() {
boolean ok = false;
- Iterator iter = getDesktop().getViews().iterator();
- while (iter.hasNext()) {
- Component comp = (Component) iter.next();
+ for (Component comp : getDesktop().getViews()) {
BibleViewPane view = (BibleViewPane) comp;
if (view.maySave()) {
ok = true;
@@ -198,9 +195,7 @@
return;
}
- iter = getDesktop().getViews().iterator();
- while (iter.hasNext()) {
- Component comp = (Component) iter.next();
+ for (Component comp : getDesktop().getViews()) {
try {
BibleViewPane view = (BibleViewPane) comp;
view.save();
@@ -456,7 +451,7 @@
public boolean macOSXRegistration() {
if (OSType.MAC.equals(OSType.getOSType())) {
try {
- Class osxAdapter = ClassUtil.forName("org.crosswire.common.aqua.OSXAdapter");
+ Class<?> osxAdapter = ClassUtil.forName("org.crosswire.common.aqua.OSXAdapter");
Object[] registerOSXArgs = {
actions, DesktopActions.ABOUT, DesktopActions.OPTIONS, DesktopActions.EXIT
};
@@ -464,7 +459,7 @@
// To call a method taking a type of boolean, the type has to
// match but the object has to be wrapped
- Class[] enablePrefTypes = {
+ Class<?>[] enablePrefTypes = {
boolean.class
};
Object[] enablePrefArgs = {
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -31,7 +31,6 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.URI;
-import java.util.Iterator;
import javax.swing.BorderFactory;
import javax.swing.JButton;
@@ -79,9 +78,7 @@
try {
StringBuilder buf = new StringBuilder();
- Iterator iter = key.iterator();
- while (iter.hasNext()) {
- Key currentKey = (Key) iter.next();
+ for (Key currentKey : key) {
String osisID = currentKey.getOsisID();
for (int i = 0; i < books.length; i++) {
Book book = books[i];
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/BookDataDisplayFactory.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/BookDataDisplayFactory.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/BookDataDisplayFactory.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -45,7 +45,7 @@
public static BookDataDisplay createBookDataDisplay() {
Exception ex = null;
try {
- return (BookDataDisplay) PluginUtil.getImplementation(BookDataDisplay.class);
+ return PluginUtil.getImplementation(BookDataDisplay.class);
} catch (ClassCastException e) {
ex = e;
} catch (IOException e) {
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/SplitBookDataDisplay.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/SplitBookDataDisplay.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/SplitBookDataDisplay.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -36,7 +36,6 @@
import org.crosswire.bibledesktop.passage.KeySidebar;
import org.crosswire.common.swing.FixedSplitPane;
import org.crosswire.common.util.Logger;
-import org.crosswire.common.util.StringUtil;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookProvider;
import org.crosswire.jsword.passage.Key;
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TabbedBookDataDisplay.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TabbedBookDataDisplay.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TabbedBookDataDisplay.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,7 +26,6 @@
import java.beans.PropertyChangeEvent;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -64,8 +63,8 @@
* Simple Constructor
*/
public TabbedBookDataDisplay() {
- views = new HashMap();
- displays = new ArrayList();
+ views = new HashMap<JScrollPane, BookDataDisplay>();
+ displays = new ArrayList<BookDataDisplay>();
pnlMore = new JPanel();
pnlMain = new JPanel();
@@ -170,9 +169,7 @@
*/
public void setCompareBooks(boolean compare) {
// Now go through all the known tabs and refresh each
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.setCompareBooks(compare);
}
}
@@ -182,9 +179,7 @@
*/
public void refresh() {
// Now go through all the known tabs and refresh each
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.refresh();
}
}
@@ -223,7 +218,7 @@
public void addKeyChangeListener(KeyChangeListener listener) {
// First add to our list of listeners so when we add a new tab
// we can add this new listener to the new tab
- List temp = new ArrayList();
+ List<KeyChangeListener> temp = new ArrayList<KeyChangeListener>();
if (keyEventListeners == null) {
temp.add(listener);
keyEventListeners = temp;
@@ -236,9 +231,7 @@
}
}
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.addKeyChangeListener(listener);
}
}
@@ -249,15 +242,13 @@
public void removeKeyChangeListener(KeyChangeListener listener) {
// First remove from the list of listeners
if (keyEventListeners != null && keyEventListeners.contains(listener)) {
- List temp = new ArrayList();
+ List<KeyChangeListener> temp = new ArrayList<KeyChangeListener>();
temp.addAll(keyEventListeners);
temp.remove(listener);
keyEventListeners = temp;
}
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.removeKeyChangeListener(listener);
}
}
@@ -267,9 +258,7 @@
*/
public void propertyChange(PropertyChangeEvent evt) {
// Now go through all the known syncs and add this one in
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.propertyChange(evt);
}
}
@@ -280,7 +269,7 @@
public synchronized void addURIEventListener(URIEventListener listener) {
// First add to our list of listeners so when we add a new tab
// we can add this new listener to the new tab
- List temp = new ArrayList();
+ List<URIEventListener> temp = new ArrayList<URIEventListener>();
if (uriEventListeners == null) {
temp.add(listener);
uriEventListeners = temp;
@@ -294,9 +283,7 @@
}
// Now go through all the known syncs and add this one in
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.addURIEventListener(listener);
}
}
@@ -307,16 +294,14 @@
public synchronized void removeURIEventListener(URIEventListener listener) {
// First remove from the list of listeners
if (uriEventListeners != null && uriEventListeners.contains(listener)) {
- List temp = new ArrayList();
+ List<URIEventListener> temp = new ArrayList<URIEventListener>();
temp.addAll(uriEventListeners);
temp.remove(listener);
uriEventListeners = temp;
}
// Now remove from all the known syncs
- Iterator iter = displays.iterator();
- while (iter.hasNext()) {
- BookDataDisplay bdd = (BookDataDisplay) iter.next();
+ for (BookDataDisplay bdd : displays) {
bdd.removeURIEventListener(listener);
}
}
@@ -391,7 +376,7 @@
if (tabs) {
Object o = tabMain.getSelectedComponent();
JScrollPane sp = (JScrollPane) o;
- return (BookDataDisplay) views.get(sp);
+ return views.get(sp);
}
return bookDataDisplay;
}
@@ -405,18 +390,14 @@
// Add all the known listeners to this new BookDataDisplay
if (uriEventListeners != null) {
- Iterator iter = uriEventListeners.iterator();
- while (iter.hasNext()) {
- URIEventListener li = (URIEventListener) iter.next();
+ for (URIEventListener li : uriEventListeners) {
display.addURIEventListener(li);
}
}
// Add all the known listeners to this new BookDataDisplay
if (keyEventListeners != null) {
- Iterator iter = keyEventListeners.iterator();
- while (iter.hasNext()) {
- KeyChangeListener li = (KeyChangeListener) iter.next();
+ for (KeyChangeListener li : keyEventListeners) {
display.addKeyChangeListener(li);
}
}
@@ -468,12 +449,12 @@
/**
* A list of all the URIEventListeners
*/
- private List uriEventListeners;
+ private List<URIEventListener> uriEventListeners;
/**
* A list of all the keyEventListeners
*/
- private List keyEventListeners;
+ private List<KeyChangeListener> keyEventListeners;
/**
* The passage that we are displaying (in one or more tabs)
@@ -508,12 +489,12 @@
/**
* An map of components to their views
*/
- private Map views;
+ private Map<JScrollPane, BookDataDisplay> views;
/**
* A list of all the InnerDisplayPanes so we can control listeners
*/
- private List displays;
+ private List<BookDataDisplay> displays;
/**
* Pointer to whichever of the above is currently in use
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeySidebar.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeySidebar.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeySidebar.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,8 +26,6 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import javax.swing.Action;
@@ -137,18 +135,16 @@
*/
private void doBlur(int amount) {
// Remember what was selected
- List selected = new ArrayList(Arrays.asList(list.getSelectedValues()));
+ Key[] selected = (Key[]) list.getSelectedValues();
// Make sure that key changes are not visible until blur is done.
Key copy = (Key) key.clone();
// Either blur the entire unselected list or just the selected elements.
- if (selected.isEmpty()) {
+ if (selected.length == 0) {
copy.blur(amount, RestrictionType.getDefaultBlurRestriction());
} else {
- Iterator iter = selected.iterator();
- while (iter.hasNext()) {
- Key k = (Key) iter.next();
+ for (Key k : selected) {
// Create a copy so the selection can be restored
Key keyCopy = (Key) k.clone();
keyCopy.blur(amount, RestrictionType.getDefaultBlurRestriction());
@@ -159,21 +155,20 @@
// Restore the selection
int total = model.getSize();
+ int selectionSize = selected.length;
for (int i = 0; i < total; i++) {
Key listedKey = (Key) model.getElementAt(i);
// As keys are found, remove them
- Iterator iter = selected.iterator();
- while (iter.hasNext()) {
- Key selectedKey = (Key) iter.next();
+ for (Key selectedKey : selected) {
if (listedKey.contains(selectedKey)) {
list.addSelectionInterval(i, i);
- iter.remove();
+ --selectionSize;
}
}
// If the list is empty then we are done.
- if (selected.isEmpty()) {
+ if (selectionSize == 0) {
break;
}
}
@@ -292,7 +287,7 @@
* Add a command listener
*/
public synchronized void addKeyChangeListener(KeyChangeListener listener) {
- List temp = new ArrayList(2);
+ List<KeyChangeListener> temp = new ArrayList<KeyChangeListener>(2);
if (keyChangeListeners != null) {
temp.addAll(keyChangeListeners);
@@ -309,7 +304,7 @@
*/
public synchronized void removeKeyChangeListener(KeyChangeListener listener) {
if (keyChangeListeners != null && keyChangeListeners.contains(listener)) {
- List temp = new ArrayList();
+ List<KeyChangeListener> temp = new ArrayList<KeyChangeListener>();
temp.addAll(keyChangeListeners);
temp.remove(listener);
@@ -322,8 +317,7 @@
*/
/*private*/final synchronized void fireKeyChanged(KeyChangeEvent ev) {
if (keyChangeListeners != null) {
- for (int i = 0; i < keyChangeListeners.size(); i++) {
- KeyChangeListener li = (KeyChangeListener) keyChangeListeners.get(i);
+ for (KeyChangeListener li : keyChangeListeners) {
li.keyChanged(ev);
}
}
@@ -365,7 +359,7 @@
/**
* The listener for KeyChangeEvents
*/
- private transient List keyChangeListeners;
+ private transient List<KeyChangeListener> keyChangeListeners;
/*
* GUI Components
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeyTreeNode.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeyTreeNode.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/KeyTreeNode.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -69,11 +69,11 @@
/* (non-Javadoc)
* @see javax.swing.tree.TreeNode#children()
*/
- public Enumeration children() {
+ public Enumeration<Key> children() {
if (key != null) {
- return new IteratorEnumeration(key.iterator());
+ return new IteratorEnumeration<Key>(key.iterator());
}
- return new IteratorEnumeration(new EmptyIterator());
+ return new IteratorEnumeration<Key>(new EmptyIterator<Key>());
}
/* (non-Javadoc)
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/RangeListModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/RangeListModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/RangeListModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -27,6 +27,7 @@
import javax.swing.AbstractListModel;
+import org.crosswire.jsword.passage.Key;
import org.crosswire.jsword.passage.Passage;
import org.crosswire.jsword.passage.RestrictionType;
@@ -48,7 +49,7 @@
*/
public RangeListModel(RestrictionType theRestriction) {
restrict = theRestriction;
- ranges = new ArrayList();
+ ranges = new ArrayList<Key>();
}
/**
@@ -118,7 +119,7 @@
private void refresh() {
ranges.clear();
if (ref != null) {
- Iterator iter = ref.rangeIterator(restrict);
+ Iterator<Key> iter = ref.rangeIterator(restrict);
while (iter.hasNext()) {
ranges.add(iter.next());
}
@@ -133,7 +134,7 @@
/**
* The list of ranges in the passage.
*/
- private List ranges;
+ private List<Key> ranges;
/**
* If we are modeling in groups, do we break at chapter/book boundaries
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -228,23 +228,27 @@
/**
* @see javax.swing.tree.TreeNode#children()
*/
- public Enumeration children() {
- return new WholeBibleEnumeration();
+ public Enumeration<TreeNode> children() {
+ return new WholeBibleEnumeration(this);
}
/**
* Iterate over the Books
*/
- public class WholeBibleEnumeration implements Enumeration {
+ private class WholeBibleEnumeration implements Enumeration<TreeNode> {
+ public WholeBibleEnumeration(WholeBibleTreeNode treeNode) {
+ this.treeNode = treeNode;
+ }
public boolean hasMoreElements() {
- return count < getChildCount();
+ return count < treeNode.getChildCount();
}
- public Object nextElement() {
+ public TreeNode nextElement() {
count++;
- return getChildAt(count);
+ return treeNode.getChildAt(count);
}
+ private WholeBibleTreeNode treeNode;
private int count;
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -27,7 +27,6 @@
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import javax.swing.ImageIcon;
@@ -79,10 +78,7 @@
});
// For each of the Fields put it in a FieldPanel
- Iterator it = config.iterator();
- while (it.hasNext()) {
- Choice model = (Choice) it.next();
-
+ for (Choice model : config) {
addChoice(model);
}
@@ -208,7 +204,7 @@
fields.put(key, field);
// Get or create a FieldPanel
- FormPane card = (FormPane) decks.get(path);
+ FormPane card = decks.get(path);
if (card == null) {
card = new FormPane();
@@ -234,10 +230,10 @@
String key = model.getKey();
String path = Config.getPath(model.getFullPath());
- Field field = (Field) fields.get(key);
+ Field field = fields.get(key);
if (field != null) {
fields.remove(field);
- FormPane card = (FormPane) decks.get(path);
+ FormPane card = decks.get(path);
// Remove field from card.
String name = Config.getLeaf(model.getFullPath()) + ':';
@@ -263,15 +259,13 @@
* Take the data displayed on screen an copy it to the local storage area.
*/
protected void screenToLocal() {
- Iterator it = config.iterator();
- while (it.hasNext()) {
- Choice choice = (Choice) it.next();
+ for (Choice choice : config) {
if (choice.isHidden()) {
continue;
}
String key = choice.getKey();
- Field field = (Field) fields.get(key);
+ Field field = fields.get(key);
String value = field.getValue();
if (value == null) {
@@ -286,16 +280,14 @@
* Take the data in the local storage area and copy it on screen.
*/
protected void localToScreen() {
- Iterator it = config.iterator();
- while (it.hasNext()) {
- Choice choice = (Choice) it.next();
+ for (Choice choice : config) {
if (choice.isHidden()) {
continue;
}
String key = choice.getKey();
- Field field = (Field) fields.get(key);
+ Field field = fields.get(key);
String value = config.getLocal(key);
if (field == null) {
@@ -335,12 +327,12 @@
/**
* A fast way to get at the configuration panels
*/
- protected Map decks = new HashMap();
+ protected Map<String,FormPane> decks = new HashMap<String,FormPane>();
/**
* The set of fields that we are displaying
*/
- protected Map fields = new HashMap();
+ protected Map<String,Field> fields = new HashMap<String,Field>();
/**
* The large task icon
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AdvancedConfigEditor.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AdvancedConfigEditor.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AdvancedConfigEditor.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -27,7 +27,6 @@
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -59,7 +58,7 @@
scroll.setPreferredSize(new Dimension(150, 150));
CustomTreeCellRenderer render = new CustomTreeCellRenderer();
- comps = new HashMap();
+ comps = new HashMap<String,Component>();
// Hack: tree depends on it being a Color not a sub of it.
Color orig = UIManager.getColor("control");
@@ -124,12 +123,12 @@
@Override
protected void removeChoice(Choice choice) {
String key = choice.getKey();
- Field field = (Field) fields.get(key);
+ Field field = fields.get(key);
if (field != null) {
fields.remove(field);
}
- Component comp = (Component) comps.get(key);
+ Component comp = comps.get(key);
if (comp != null) {
comps.remove(key);
}
@@ -175,7 +174,7 @@
/**
* A hash of components
*/
- protected Map comps;
+ protected Map<String,Component> comps;
/**
* Serialization ID
@@ -196,12 +195,10 @@
* #getChildren(java.lang.String)
*/
@Override
- protected List getChildren(String path) {
- List retcode = new ArrayList();
+ protected List<String> getChildren(String path) {
+ List<String> retcode = new ArrayList<String>();
- Iterator it = config.iterator();
- while (it.hasNext()) {
- Choice choice = (Choice) it.next();
+ for (Choice choice : config) {
if (choice.isHidden()) {
continue;
}
@@ -243,13 +240,13 @@
}
String path = ((Node) parent).getFullName();
- List children = getChildren(path);
+ List<String> children = getChildren(path);
if (children.isEmpty()) {
return new CompNode(path);
}
- String name = (String) children.get(index);
+ String name = children.get(index);
return new Node(path, name);
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ConfigEditorFactory.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ConfigEditorFactory.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/ConfigEditorFactory.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -61,7 +61,7 @@
public static void showDialog(Config config, Component parent, ActionListener al) {
Exception ex = null;
try {
- ConfigEditor base = (ConfigEditor) PluginUtil.getImplementation(ConfigEditor.class);
+ ConfigEditor base = PluginUtil.getImplementation(ConfigEditor.class);
base.construct(config);
base.showDialog(parent, al);
} catch (ClassCastException e) {
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FieldMap.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FieldMap.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/FieldMap.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -63,9 +63,9 @@
if (type instanceof MultipleChoice) {
field = new OptionsField();
} else {
- Class clazz = (Class) map.get(type.getType());
+ Class<Field> clazz = map.get(type.getType());
if (clazz != null) {
- field = (Field) clazz.newInstance();
+ field = clazz.newInstance();
} else {
log.warn("field type (" + type + ") unregistered.");
field = new TextField();
@@ -93,7 +93,7 @@
/**
* The configuration table
*/
- private static Map map;
+ private static Map<String,Class<Field>> map;
/**
* Default map configuration
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/MappedOptionsField.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -65,11 +65,11 @@
* The options provided by the Choice
*/
public void setChoice(Choice param) {
- if (!(param instanceof MappedChoice)) {
+ if (!(param instanceof MappedChoice<?,?>)) {
throw new IllegalArgumentException("Illegal type for Choice. Not a MappedChoice. " + param.getKey());
}
- MappedChoice mc = (MappedChoice) param;
- Map map = mc.getOptions();
+ MappedChoice<?,?> mc = (MappedChoice<?,?>) param;
+ Map<?,?> map = mc.getOptions();
if (map == null) {
throw new IllegalArgumentException("getOptions() returns null for option: " + param.getKey());
}
@@ -85,8 +85,8 @@
public String getValue() {
Object reply = combo.getSelectedItem();
- if (reply instanceof Map.Entry) {
- return ((Map.Entry) reply).getKey().toString();
+ if (reply instanceof Map.Entry<?,?>) {
+ return ((Map.Entry<?,?>) reply).getKey().toString();
}
return reply == null ? "" : reply.toString();
}
@@ -102,8 +102,8 @@
int size = model.getSize();
for (int i = 0; i < size; i++) {
Object match = model.getElementAt(i);
- if (match instanceof Map.Entry) {
- Map.Entry mapEntry = (Map.Entry) match;
+ if (match instanceof Map.Entry<?,?>) {
+ Map.Entry<?,?> mapEntry = (Map.Entry<?,?>) match;
if (mapEntry.getKey().toString().equals(value) || mapEntry.getValue().toString().equals(value)) {
combo.setSelectedItem(mapEntry);
return;
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/OptionsField.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/OptionsField.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/OptionsField.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -88,8 +88,8 @@
public String getValue() {
Object reply = combo.getSelectedItem();
- if (reply instanceof Map.Entry) {
- return ((Map.Entry) reply).getKey().toString();
+ if (reply instanceof Map.Entry<?,?>) {
+ return ((Map.Entry<?,?>) reply).getKey().toString();
}
return reply == null ? "" : reply.toString();
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/TreeConfigEditor.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/TreeConfigEditor.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/TreeConfigEditor.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -159,7 +159,7 @@
// Sort the tree out
String path = Config.getPath(model.getFullPath());
- FormPane card = (FormPane) decks.get(path);
+ FormPane card = decks.get(path);
if (card != null && card.getParent() == null) {
JScrollPane scroll = new CWScrollPane(card);
scroll.setBorder(BorderFactory.createEmptyBorder());
@@ -176,7 +176,7 @@
// Sort the tree out
String path = Config.getPath(model.getFullPath());
- FormPane card = (FormPane) decks.get(path);
+ FormPane card = decks.get(path);
if (card != null && card.isEmpty()) {
deck.remove(card.getParent());
}
@@ -273,12 +273,12 @@
/**
* Get a List of the children rooted at path
*/
- protected List getChildren(String path) {
- List retcode = new ArrayList();
+ protected List<String> getChildren(String path) {
+ List<String> retcode = new ArrayList<String>();
- Iterator it = config.iterator();
+ Iterator<Choice> it = config.iterator();
while (it.hasNext()) {
- Choice choice = (Choice) it.next();
+ Choice choice = it.next();
if (choice.isHidden()) {
continue;
}
@@ -316,7 +316,7 @@
*/
public Object getChild(Object parent, int index) {
String path = ((Node) parent).getFullName();
- String name = (String) getChildren(path).get(index);
+ String name = getChildren(path).get(index);
return new Node(path, name);
}
@@ -358,7 +358,7 @@
*/
public int getIndexOfChild(Object parent, Object child) {
String path = ((Node) parent).getFullName();
- List children = getChildren(path);
+ List<String> children = getChildren(path);
return children.indexOf(child);
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -30,7 +30,6 @@
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -64,8 +63,8 @@
* Simple ctor
*/
public JobsProgressBar(boolean small) {
- jobs = new HashMap();
- positions = new ArrayList();
+ jobs = new HashMap<Progress,JobData>();
+ positions = new ArrayList<JobData>();
shaper = new NumberShaper();
actions = new ActionFactory(JobsProgressBar.class, this);
@@ -76,10 +75,8 @@
JobManager.addWorkListener(this);
- Set current = JobManager.getJobs();
- Iterator it = current.iterator();
- while (it.hasNext()) {
- Progress job = (Job) it.next();
+ Set<Progress> current = JobManager.getJobs();
+ for (Progress job : current) {
addJob(job);
}
@@ -133,7 +130,7 @@
*/
public void workStateChanged(WorkEvent ev) {
Progress job = (Job) ev.getSource();
- JobData jobdata = (JobData) jobs.get(job);
+ JobData jobdata = jobs.get(job);
jobdata.workStateChanged(ev);
}
@@ -181,7 +178,7 @@
* Update the job details because it has just progressed
*/
protected synchronized void updateJob(Progress job) {
- JobData jobdata = (JobData) jobs.get(job);
+ JobData jobdata = jobs.get(job);
// At 99% the progress bar animates nicely.
int percent = 99;
@@ -202,7 +199,7 @@
protected synchronized void removeJob(Progress job) {
((Job) job).removeWorkListener(this);
- JobData jobdata = (JobData) jobs.get(job);
+ JobData jobdata = jobs.get(job);
positions.set(jobdata.getIndex(), null);
jobs.remove(job);
@@ -248,12 +245,12 @@
/**
* Where we store the currently displayed jobs
*/
- protected Map jobs;
+ protected Map<Progress,JobData> jobs;
/**
* Array telling us what y position the jobs have in the window
*/
- private List positions;
+ private List<JobData> positions;
/**
* The font for the progress-bars
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/ActionFactory.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/ActionFactory.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/ActionFactory.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -142,9 +142,9 @@
* @param type the class against which properties are looked up.
* @param bean the object to which the actions belong
*/
- public ActionFactory(Class type, Object bean) {
+ public ActionFactory(Class<?> type, Object bean) {
this.bean = bean;
- actions = new HashMap();
+ actions = new HashMap<String,CWAction>();
if (type != null) {
buildActionMap(type);
}
@@ -234,7 +234,7 @@
* @return CWAction null if it does not exist
*/
public Action getAction(String key, ActionListener listener) {
- CWAction action = (CWAction) actions.get(key);
+ CWAction action = actions.get(key);
if (action != null) {
if (listener != null) {
@@ -383,7 +383,7 @@
log.warn("Acronymn is missing for CWAction");
}
- CWAction cwAction = (CWAction) actions.get(key);
+ CWAction cwAction = actions.get(key);
if (cwAction != null) {
return cwAction;
@@ -421,7 +421,7 @@
/**
* Build the map of actions from resources
*/
- private void buildActionMap(Class basis) {
+ private void buildActionMap(Class<?> basis) {
try {
StringBuilder basisName = new StringBuilder(basis.getName());
ResourceBundle resources = ResourceBundle.getBundle(basisName.toString(), Locale.getDefault(), CWClassLoader.instance(basis));
@@ -435,9 +435,9 @@
}
// Get all the keys but we only need those that end with .Name
- Enumeration en = resources.getKeys();
+ Enumeration<String> en = resources.getKeys();
while (en.hasMoreElements()) {
- String key = (String) en.nextElement();
+ String key = en.nextElement();
if (key.endsWith(TEST)) {
String actionName = key.substring(0, key.length() - TEST.length());
@@ -559,5 +559,5 @@
/**
* The map of known CWActions
*/
- private Map actions;
+ private Map<String,CWAction> actions;
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/ExceptionPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -124,13 +124,13 @@
upper.add(banner, BorderLayout.NORTH);
upper.add(buttons, BorderLayout.CENTER);
- List causes = new ArrayList();
+ List<Throwable> causes = new ArrayList<Throwable>();
Throwable throwable = ex;
while (throwable != null) {
causes.add(throwable);
throwable = throwable.getCause();
}
- Throwable[] exs = (Throwable[]) causes.toArray(new Throwable[causes.size()]);
+ Throwable[] exs = causes.toArray(new Throwable[causes.size()]);
JComboBox traces = new JComboBox();
traces.setModel(new DefaultComboBoxModel(exs));
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/FontStore.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/FontStore.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/FontStore.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -24,7 +24,6 @@
import java.awt.Font;
import java.io.IOException;
import java.net.URI;
-import java.util.Properties;
import org.crosswire.common.util.FileUtil;
import org.crosswire.common.util.Language;
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/FormPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/FormPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/FormPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -89,12 +89,9 @@
* The name for the field
*/
public void removeEntry(String prompt) {
- JLabel label = (JLabel) comps.get(prompt + SUFFIX_LABEL);
- Component comp = (Component) comps.get(prompt + SUFFIX_COMP);
+ inner.remove(comps.get(prompt + SUFFIX_LABEL));
+ inner.remove(comps.get(prompt + SUFFIX_COMP));
- inner.remove(label);
- inner.remove(comp);
-
comps.remove(prompt + SUFFIX_LABEL);
comps.remove(prompt + SUFFIX_COMP);
}
@@ -149,5 +146,5 @@
/**
* A store of the available components
*/
- protected Hashtable comps = new Hashtable();
+ protected Hashtable<String,Component> comps = new Hashtable<String,Component>();
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -63,7 +63,7 @@
/**
* The Options customization
*/
- public static Class getLookAndFeel() {
+ public static Class<?> getLookAndFeel() {
if (currentLAF == null) {
return defaultLAF;
}
@@ -73,8 +73,8 @@
/**
* Set the look and feel to a new class.
*/
- public static void setLookAndFeel(Class newLaFClass) throws InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
- LookAndFeel laf = (LookAndFeel) newLaFClass.newInstance();
+ public static void setLookAndFeel(Class<LookAndFeel> newLaFClass) throws InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
+ LookAndFeel laf = newLaFClass.newInstance();
// newLaFClass is null if the user enters a bogus value
if (currentLAF != null && !currentLAF.equals(newLaFClass)) {
@@ -118,7 +118,7 @@
* the font to use
*/
public static void setUIFont(FontUIResource f) {
- Enumeration keys = UIManager.getDefaults().keys();
+ Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
@@ -133,12 +133,12 @@
/**
* The current PLAF
*/
- private static Class currentLAF;
+ private static Class<LookAndFeel> currentLAF;
/**
* The default PLAF (and the default value)
*/
- private static Class defaultLAF;
+ private static Class<?> defaultLAF;
/**
* The font to be used for the application
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/MapComboBoxModel.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/MapComboBoxModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/MapComboBoxModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -39,8 +39,8 @@
/**
* Simple ctor for an entry from a map.
*/
- public MapComboBoxModel(Map map) {
- list = new ArrayList(map.entrySet());
+ public MapComboBoxModel(Map<?,?> map) {
+ list = new ArrayList<Object>(map.entrySet());
}
/*
@@ -80,7 +80,7 @@
return list.get(index);
}
- private List list;
+ private List<?> list;
/**
* What is currently selected?
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/MapEntryRenderer.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/MapEntryRenderer.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/MapEntryRenderer.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -23,6 +23,7 @@
import java.awt.Component;
import java.util.Map;
+import java.util.Map.Entry;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
@@ -45,8 +46,8 @@
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean selected, boolean focus) {
Object displayObject = value;
- if (value instanceof Map.Entry) {
- Map.Entry mapEntry = (Map.Entry) value;
+ if (value instanceof Map.Entry<?,?>) {
+ Map.Entry<?,?> mapEntry = (Entry<?,?>) value;
displayObject = mapEntry.getValue();
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/MapTableModel.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/MapTableModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/MapTableModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -56,7 +56,7 @@
* The table to model
*/
public MapTableModel(Map map) {
- list = new ArrayList();
+ list = new ArrayList<StringPair>();
setMap(map);
}
@@ -70,9 +70,9 @@
this.map = map;
list.clear();
if (map != null) {
- Iterator iter = map.entrySet().iterator();
+ Iterator<Map.Entry<Object,Object>> iter = map.entrySet().iterator();
while (iter.hasNext()) {
- Map.Entry me = (Map.Entry) iter.next();
+ Map.Entry<Object,Object> me = iter.next();
Object k = me.getKey();
Object v = me.getValue();
if (k == null || v == null) {
@@ -185,7 +185,7 @@
return null;
}
- StringPair entry = (StringPair) list.get(row);
+ StringPair entry = list.get(row);
if (col == 0) {
return entry.getKey();
}
@@ -200,7 +200,7 @@
* @return String.class
*/
@Override
- public Class getColumnClass(int col) {
+ public Class<String> getColumnClass(int col) {
return String.class;
}
@@ -232,7 +232,7 @@
* The List that is a copy of the list. A list is used for direct access
* performance.
*/
- private List list;
+ private List<StringPair> list;
/**
* The backing map
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/AbstractViewLayout.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/AbstractViewLayout.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/AbstractViewLayout.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -51,7 +51,7 @@
protected AbstractViewLayout() {
panel = new JPanel(new BorderLayout());
GuiUtil.applyDefaultOrientation(panel);
- views = new ArrayList();
+ views = new ArrayList<Component>();
listenerList = new EventListenerList();
}
@@ -191,7 +191,7 @@
* @return the requested view.
*/
public Component getView(int i) {
- return (Component) views.get(i);
+ return views.get(i);
}
/**
@@ -293,7 +293,7 @@
/**
* The list of views.
*/
- private List views;
+ private List<Component> views;
/**
* The listeners for handling ViewEvent Listeners
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/ViewManager.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -56,7 +56,7 @@
* @param generator a ViewGenerator that this ViewManager manages.
* @param msg the class for which i18n properties are defined
*/
- public ViewManager(ViewGenerator generator, Class msg) {
+ public ViewManager(ViewGenerator generator, Class<?> msg) {
this.generator = generator;
panel = new JPanel(new GridBagLayout());
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -186,9 +186,9 @@
* the thing to convert
* @return the converted data
*/
- public static String map2String(Map<Object,Object> commands) {
+ public static String map2String(Map<? extends Object,? extends Object> commands) {
StringBuilder retcode = new StringBuilder();
- for (Map.Entry<Object,Object> entry : commands.entrySet()) {
+ for (Map.Entry<? extends Object,? extends Object> entry : commands.entrySet()) {
retcode.append(entry.getKey());
retcode.append('=');
retcode.append(entry.getValue());
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/Reporter.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/Reporter.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/Reporter.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -27,21 +27,26 @@
* This package looks after Exceptions and messages as they happen. It would be
* nice not to need this class - the principle being that any library that
* encounters an error can throw an exception to indicate that there is a
- * problem. However this is not always the case. For example: <li>static class
- * constructors should not throw, unless the class really is of no use given the
- * error, and yet we may want to tell the user that there was a (non-critical)
- * error.</li> <li>Any library routine that works in a loop, applying some
- * (potentially failing) functionality, may want to continue the work without
- * throwing in response to a single error.</li> <li>The class being implemented
- * may implement an interface that disallows nested exceptions and yet does not
- * want to loose the root cause error information. (This is the weakest of the
- * above arguments, but probably still valid.)</li> However in many of the times
- * this class is used, this is the reason: <li>Within UI specific code - to
- * throw up a dialog box (or whatever). Now this use is currently tolerated,
- * however it is probably a poor idea to use GUI agnostic messaging in a GUI
- * specific context. But I'm not bothered enough to change it now. Specifically
- * this use is deprecated because it makes the app more susceptible to the
- * configuration of the things that listen to reports.</li>
+ * problem. However this is not always the case. For example:
+ * <ul>
+ * <li>static class constructors should not throw, unless the class really is of
+ * no use given the error, and yet we may want to tell the user that there was a
+ * (non-critical) error.</li>
+ * <li>Any library routine that works in a loop, applying some (potentially
+ * failing) functionality, may want to continue the work without throwing in
+ * response to a single error.</li>
+ * <li>The class being implemented may implement an interface that disallows
+ * nested exceptions and yet does not want to loose the root cause error
+ * information. (This is the weakest of the above arguments, but probably still
+ * valid.)</li> However in many of the times this class is used, this is the
+ * reason:
+ * <li>Within UI specific code - to throw up a dialog box (or whatever). Now
+ * this use is currently tolerated, however it is probably a poor idea to use
+ * GUI agnostic messaging in a GUI specific context. But I'm not bothered enough
+ * to change it now. Specifically this use is deprecated because it makes the
+ * app more susceptible to the configuration of the things that listen to
+ * reports.</li>
+ * </ul>
*
* @see gnu.lgpl.License for license details.<br>
* The copyright to this program is held by it's authors.
@@ -63,10 +68,6 @@
* @param source
* The cause of the problem, a Component if possible.
* @param prob
- * The Exception that was thrown TODO(joe): think about this -
- * isn't this method useful? deprecated use either
- * informUser(Object source, LucidException prob) or
- * informUser(Object source, LucidRuntimeException prob)
*/
public static void informUser(Object source, Throwable prob) {
Class<?> cat = (source != null) ? source.getClass() : Reporter.class;
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -220,7 +220,7 @@
* returned Properties will be read-only so any attempts to alter it will
* fail.
*/
- Map<String, Object> getProperties();
+ Map<String,Object> getProperties();
/**
* @param key
Modified: trunk/jsword/src/test/java/Bench.java
===================================================================
--- trunk/jsword/src/test/java/Bench.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword/src/test/java/Bench.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,7 +26,7 @@
}
List<Book> dicts = Books.installed().getBooks(BookFilters.getOnlyBibles());
- version = (Book) dicts.get(0);
+ version = dicts.get(0);
Speed speed = new Speed(version);
speed.run();
Modified: trunk/jsword/src/test/java/org/crosswire/common/util/PropertyMapTest.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/common/util/PropertyMapTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword/src/test/java/org/crosswire/common/util/PropertyMapTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -48,6 +48,7 @@
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
m = new PropertyMap();
@@ -56,6 +57,7 @@
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
}
Modified: trunk/jsword-limbo/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsword-limbo/.settings/org.eclipse.jdt.core.prefs 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/.settings/org.eclipse.jdt.core.prefs 2010-12-12 04:34:41 UTC (rev 2056)
@@ -11,23 +11,23 @@
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
@@ -59,9 +59,8 @@
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=disabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
@@ -71,19 +70,19 @@
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/CompareResultsPane.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/CompareResultsPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/CompareResultsPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -125,7 +125,7 @@
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
frame.addWindowListener(new WindowAdapter() {
- /* @Override */
+ @Override
public void windowClosed(WindowEvent ev) {
if (work != null)
startStop();
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/DebugPane.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/DebugPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/DebugPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -169,7 +169,7 @@
*
* @see java.lang.Thread#run()
*/
- /* @Override */
+ @Override
public synchronized void run() {
Progress job = JobManager.createJob(predictbase, Thread.currentThread());
job.beginJob(predictbase, predicturl);
@@ -258,7 +258,7 @@
* javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing
* .JList, java.lang.Object, int, boolean, boolean)
*/
- /* @Override */
+ @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Method) {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/GeneratorPane.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/GeneratorPane.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/desktop/GeneratorPane.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -169,7 +169,7 @@
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
frame.addWindowListener(new WindowAdapter() {
- /* @Override */
+ @Override
public void windowClosed(WindowEvent ev) {
if (work != null)
work.interrupt();
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -74,7 +74,7 @@
*
* @see java.net.URLConnection#connect()
*/
- /* @Override */
+ @Override
public void connect() throws IOException {
try {
BookData data = new BookData(book, key);
@@ -98,7 +98,7 @@
*
* @see java.net.URLConnection#getInputStream()
*/
- /* @Override */
+ @Override
public InputStream getInputStream() throws IOException {
if (!connected) {
connect();
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLStreamHandler.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLStreamHandler.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLStreamHandler.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -39,7 +39,7 @@
*
* @see java.net.URLStreamHandler#openConnection(java.net.URL)
*/
- /* @Override */
+ @Override
protected URLConnection openConnection(URL url) throws IOException {
return new JDTBURLConnection(url);
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -46,7 +46,7 @@
public BlogEntriesPanel() {
initComponents();
mBlogEntries.addMouseListener(new MouseAdapter() {
- /* @Override */
+ @Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int row = mBlogEntries.rowAtPoint(e.getPoint());
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -28,7 +28,7 @@
}
}
- /* @Override */
+ @Override
public Object getValueAt(int row, int col) {
if (entries != null) {
BlogEntry entry = (BlogEntry) entries.get(row);
@@ -47,17 +47,17 @@
return "ERROR";
}
- /* @Override */
+ @Override
public int getColumnCount() {
return BlogEntriesPanel.COLUMN_COUNT;
}
- /* @Override */
+ @Override
public int getRowCount() {
return (entries != null) ? entries.size() : 0;
}
- /* @Override */
+ @Override
public String getColumnName(int column) {
switch (column) {
case BlogEntriesPanel.TITLE_COLUMN:
@@ -73,7 +73,7 @@
return "ERROR: Invalid column index";
}
- /* @Override */
+ @Override
public boolean isCellEditable(int row, int col) {
return false;
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceBookTreeNode.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceBookTreeNode.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceBookTreeNode.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -62,7 +62,7 @@
*
* @see java.lang.Object#toString()
*/
- /* @Override */
+ @Override
public String toString() {
return book.getName();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceKeyTreeNode.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceKeyTreeNode.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/reference/ReferenceKeyTreeNode.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -55,7 +55,7 @@
*
* @see java.lang.Object#toString()
*/
- /* @Override */
+ @Override
public String toString() {
return key.getName();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/io/BrowserOutputStream.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/io/BrowserOutputStream.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/io/BrowserOutputStream.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,7 +26,7 @@
* @param b
* The byte to be written, as normal.
*/
- /* @Override */
+ @Override
public void write(int b) {
char ch = (char) b;
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/io/ConnectedReader.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/io/ConnectedReader.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/io/ConnectedReader.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -31,7 +31,7 @@
*
* @return The byte read, as normal.
*/
- /* @Override */
+ @Override
public int read() throws IOException {
if (out != null)
out.flush();
@@ -44,7 +44,7 @@
*
* @return The byte read, as normal.
*/
- /* @Override */
+ @Override
public int read(char[] cbuf, int off, int len) throws IOException {
if (out != null)
out.flush();
@@ -55,7 +55,7 @@
/**
* Shutdown
*/
- /* @Override */
+ @Override
public void close() throws IOException {
in.close();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/io/NullWriter.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/io/NullWriter.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/io/NullWriter.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -12,7 +12,7 @@
/**
* Override write to ask the listed Streams.
*/
- /* @Override */
+ @Override
public void write(char[] cbuf, int off, int len) throws IOException {
}
@@ -22,14 +22,14 @@
* @param b
* The byte to be written, as normal.
*/
- /* @Override */
+ @Override
public void write(int b) throws IOException {
}
/**
* Override flush to flush the listed Streams.
*/
- /* @Override */
+ @Override
public void flush() throws IOException {
}
@@ -37,7 +37,7 @@
* If someone closes the TeeWriter then we go round and close all the
* Streams on the stack.
*/
- /* @Override */
+ @Override
public void close() throws IOException {
}
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/io/TimeoutReader.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/io/TimeoutReader.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/io/TimeoutReader.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -47,7 +47,7 @@
/**
* @return The byte to be read, as normal.
*/
- /* @Override */
+ @Override
public int read(char[] cbuf, int off, int len) throws IOException {
calling = Thread.currentThread();
@@ -65,7 +65,7 @@
} catch (Exception ex) {
// I would like to catch InterruptedException however the stupid
// compiler thinks that InterruptedException can never be
- // thrown in the preceeding block. Dumb compiler in my opinion.
+ // thrown in the preceding block. Dumb compiler in my opinion.
if (ex instanceof IOException)
throw (IOException) ex;
@@ -78,7 +78,7 @@
* If someone closes the TimeoutReader then we close the original, but leave
* the others, as they might not have finished yet.
*/
- /* @Override */
+ @Override
public void close() throws IOException {
if (work == null) {
// Kill Thread
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Cookie.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Cookie.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Cookie.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -361,7 +361,7 @@
/**
* Returns a text version of this cookie
*/
- /* @Override */
+ @Override
public String toString() {
return name + ": " + value;
}
@@ -393,7 +393,7 @@
*
* @see java.lang.Object#clone()
*/
- /* @Override */
+ @Override
public Object clone() {
Object clone = null;
try {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Header.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Header.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/net/Header.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -71,7 +71,7 @@
/**
* Returns a text version of this cookie
*/
- /* @Override */
+ @Override
public String toString() {
if (name == null)
return value;
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/AppletFrame.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/AppletFrame.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/AppletFrame.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -58,7 +58,7 @@
*/
public AppletFrame(String name, Applet app, int width, int height) {
addWindowListener(new WindowAdapter() {
- /* @Override */
+ @Override
public void windowClosing(WindowEvent e) {
close();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/BeanPanel.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/BeanPanel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/BeanPanel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -97,7 +97,7 @@
try {
Method reader = property.getReadMethod();
- Object reply = reader.invoke(bean, null);
+ Object reply = reader.invoke(bean, (Object[]) null);
if (reply == null) {
text.setText("");
} else {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DeckLayout.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DeckLayout.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DeckLayout.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -71,7 +71,7 @@
* @param constraints
* A name that identifies the component
*/
- /* @Override */
+ @Override
public void addLayoutComponent(Component comp, Object constraints) {
if (constraints instanceof String || constraints == null) {
addLayoutComponent((String) constraints, comp);
@@ -86,7 +86,7 @@
* @param comp
* The component to be removed.
*/
- /* @Override */
+ @Override
public void removeLayoutComponent(Component comp) {
Iterator it = tab.keySet().iterator();
while (it.hasNext()) {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -86,7 +86,7 @@
*
* @see java.io.Writer#write(char[], int, int)
*/
- /* @Override */
+ @Override
public void write(char[] cbuf, int off, int len) {
synchronized (lock) {
queue = queue + new String(cbuf, off, len);
@@ -99,7 +99,7 @@
*
* @see java.io.Writer#write(int)
*/
- /* @Override */
+ @Override
public void write(int c) {
synchronized (lock) {
queue = queue + (char) c;
@@ -112,7 +112,7 @@
*
* @see java.io.Writer#write(char[])
*/
- /* @Override */
+ @Override
public void write(char[] cbuf) {
synchronized (lock) {
queue = queue + new String(cbuf);
@@ -125,7 +125,7 @@
*
* @see java.io.Writer#write(java.lang.String)
*/
- /* @Override */
+ @Override
public void write(String str) {
synchronized (lock) {
queue = queue + str;
@@ -138,7 +138,7 @@
*
* @see java.io.Writer#write(java.lang.String, int, int)
*/
- /* @Override */
+ @Override
public void write(String str, int off, int len) {
synchronized (lock) {
queue = queue + str.substring(off, off + len);
@@ -162,7 +162,7 @@
*
* @see java.io.Writer#flush()
*/
- /* @Override */
+ @Override
public void flush() throws IOException {
if (updater != null) {
// Changes are outstanding. It is OK to force an update using
@@ -185,7 +185,7 @@
*
* @see java.io.Writer#close()
*/
- /* @Override */
+ @Override
public void close() {
closed = true;
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/EirPanel.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/EirPanel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/EirPanel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -83,7 +83,7 @@
dlgMain.setTitle(title);
dlgMain.setModal(modal);
dlgMain.addWindowListener(new WindowAdapter() {
- /* @Override */
+ @Override
public void windowClosed(WindowEvent ev) {
close();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapCellRenderer.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapCellRenderer.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapCellRenderer.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -60,7 +60,7 @@
* @param c
* set the foreground color to this value
*/
- /* @Override */
+ @Override
public void setForeground(Color c) {
super.setForeground(c);
unselectedForeground = c;
@@ -73,7 +73,7 @@
* @param c
* set the background color to this value
*/
- /* @Override */
+ @Override
public void setBackground(Color c) {
super.setBackground(c);
unselectedBackground = c;
@@ -86,7 +86,7 @@
*
* @see javax.swing.JComponent#updateUI()
*/
- /* @Override */
+ @Override
public void updateUI() {
super.updateUI();
setForeground(null);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapTable.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapTable.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MapTable.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -58,7 +58,7 @@
*
* @see javax.swing.JTable#setModel(javax.swing.table.TableModel)
*/
- /* @Override */
+ @Override
public void setModel(TableModel dm) {
assert !initialized || dm instanceof MapTableModel;
@@ -72,7 +72,7 @@
* @see javax.swing.JTable#setDefaultRenderer(java.lang.Class,
* javax.swing.table.TableCellRenderer)
*/
- /* @Override */
+ @Override
public void setDefaultRenderer(Class columnclass, TableCellRenderer renderer) {
assert renderer instanceof MapCellRenderer;
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MoneyDocument.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MoneyDocument.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/MoneyDocument.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -19,7 +19,7 @@
* @see javax.swing.text.Document#insertString(int, java.lang.String,
* javax.swing.text.AttributeSet)
*/
- /* @Override */
+ @Override
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
if (str == null)
return;
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTable.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTable.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTable.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -62,7 +62,7 @@
setColumnWidths(columns.getCharacterWidths(), columns.getFixedWidths());
getTableHeader().addMouseListener(new MouseAdapter() {
- /* @Override */
+ @Override
public void mouseClicked(MouseEvent e) {
sort(getColumnModel().getColumnIndexAtX(e.getX()));
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTableModel.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTableModel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/RowTableModel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -109,7 +109,7 @@
* @return Class
* @see javax.swing.table.TableModel#getColumnClass(int)
*/
- /* @Override */
+ @Override
public Class getColumnClass(int columnIndex) {
return rowColumnModel.getClass(columnIndex);
}
@@ -133,7 +133,7 @@
* @return String
* @see javax.swing.table.TableModel#getColumnName(int)
*/
- /* @Override */
+ @Override
public String getColumnName(int columnIndex) {
return rowColumnModel.getName(columnIndex);
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/SortRenderer.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/SortRenderer.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/SortRenderer.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -69,7 +69,7 @@
* int
* @return Component
*/
- /* @Override */
+ @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (table != null) {
setToolTipText(model.getHeaderToolTip(column));
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanel.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanel.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanel.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -309,7 +309,7 @@
* @param li
* The property change listener to add
*/
- /* @Override */
+ @Override
public synchronized void removePropertyChangeListener(PropertyChangeListener li) {
super.removePropertyChangeListener(li);
listeners.removePropertyChangeListener(li);
@@ -321,7 +321,7 @@
* @param li
* The property change listener to remove
*/
- /* @Override */
+ @Override
public synchronized void addPropertyChangeListener(PropertyChangeListener li) {
super.addPropertyChangeListener(li);
listeners.addPropertyChangeListener(li);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanelBeanInfo.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanelBeanInfo.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/TextViewPanelBeanInfo.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -22,7 +22,7 @@
*
* @return an array of property descriptors
*/
- /* @Override */
+ @Override
public PropertyDescriptor[] getPropertyDescriptors() {
try {
// The header property
@@ -49,7 +49,7 @@
/**
* Get additional information from the superclass, in this case JPanel
*/
- /* @Override */
+ @Override
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = TextViewPanel.class.getSuperclass();
try {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/UpperCaseDocument.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/UpperCaseDocument.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/UpperCaseDocument.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -17,7 +17,7 @@
/**
* Override insertString to force upper case
*/
- /* @Override */
+ @Override
public void insertString(int offs, String str, AttributeSet att) throws BadLocationException {
if (str == null)
return;
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/util/OldStringUtilTest.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/util/OldStringUtilTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/util/OldStringUtilTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -14,11 +14,11 @@
super(s);
}
- /* @Override */
+ @Override
protected void setUp() throws Exception {
}
- /* @Override */
+ @Override
protected void tearDown() throws Exception {
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/util/RobustList.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/util/RobustList.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/util/RobustList.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -40,7 +40,7 @@
* element whose presence in this list is to be tested.
* @return true if this list contains the specified element.
*/
- /* @Override */
+ @Override
public boolean contains(Object o) {
return indexOf(o) != -1;
}
@@ -50,7 +50,7 @@
*
* @return the number of elements in this list.
*/
- /* @Override */
+ @Override
public int size() {
return size;
}
@@ -61,7 +61,7 @@
* @param o
* element to be appended to this list.
*/
- /* @Override */
+ @Override
public boolean add(Object o) {
// debug("pre-add "+o);
new Entry(o);
@@ -78,7 +78,7 @@
* the index of the element to removed.
* @return the element previously at the specified position.
*/
- /* @Override */
+ @Override
public Object remove(int index) {
// debug("pre-remove "+index);
Entry e = findEntry(index);
@@ -96,7 +96,7 @@
* element to be removed from this list, if present.
* @return true if the list contained the specified element.
*/
- /* @Override */
+ @Override
public boolean remove(Object o) {
// debug("pre-remove "+o);
if (o == null) {
@@ -130,7 +130,7 @@
/**
* Removes all of the elements from this list.
*/
- /* @Override */
+ @Override
public void clear() {
debug("pre-clear");
head = null;
@@ -146,7 +146,7 @@
* index of element to return.
* @return the element at the specified position in this list.
*/
- /* @Override */
+ @Override
public Object get(int index) {
return findEntry(index).object;
}
@@ -183,7 +183,7 @@
* element to search for.
* @return the index of the first occurrence or -1
*/
- /* @Override */
+ @Override
public int indexOf(Object o) {
int index = 0;
if (o == null) {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/xml/DOMDefaultHandler.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/xml/DOMDefaultHandler.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/xml/DOMDefaultHandler.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -42,7 +42,7 @@
/**
* Processing instruction
*/
- /* @Override */
+ @Override
public void processingInstruction(String target, String data) {
if (base == null) {
doc.createProcessingInstruction(target, data);
@@ -52,7 +52,7 @@
/**
* Start document.
*/
- /* @Override */
+ @Override
public void startDocument() {
// TODO(joe): what should I do here?
// out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
@@ -64,7 +64,7 @@
* @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,
* java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
- /* @Override */
+ @Override
public void startElement(String uri, String name, String qName, Attributes attrs) throws SAXException {
Element ele = doc.createElement(name);
current.appendChild(ele);
@@ -83,7 +83,7 @@
/**
* Some text data
*/
- /* @Override */
+ @Override
public void characters(char[] ch, int start, int length) {
current.appendChild(doc.createTextNode(new String(ch, start, length)));
}
@@ -91,7 +91,7 @@
/**
* Ignorable whitespace
*/
- /* @Override */
+ @Override
public void ignorableWhitespace(char[] ch, int start, int length) {
current.appendChild(doc.createTextNode(new String(ch, start, length)));
}
@@ -102,7 +102,7 @@
* @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
* java.lang.String, java.lang.String)
*/
- /* @Override */
+ @Override
public void endElement(String uri, String localName, String qName) {
current = (Node) stack.pop();
}
@@ -110,14 +110,14 @@
/**
* End document
*/
- /* @Override */
+ @Override
public void endDocument() {
}
/**
* Warning
*/
- /* @Override */
+ @Override
public void warning(SAXParseException ex) {
Reporter.informUser(this, ex);
}
@@ -125,7 +125,7 @@
/**
* Error
*/
- /* @Override */
+ @Override
public void error(SAXParseException ex) {
Reporter.informUser(this, ex);
}
@@ -133,7 +133,7 @@
/**
* Fatal error
*/
- /* @Override */
+ @Override
public void fatalError(SAXParseException ex) throws SAXException {
Reporter.informUser(this, ex);
throw ex;
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/Strongs.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/Strongs.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/Strongs.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -178,7 +178,7 @@
*
* @return A descriptive String
*/
- /* @Override */
+ @Override
public String toString() {
return getOLBName();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/install/sword/FtpSwordInstaller.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/install/sword/FtpSwordInstaller.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/install/sword/FtpSwordInstaller.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -30,7 +30,6 @@
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import org.crosswire.common.progress.Progress;
-import org.crosswire.common.util.Logger;
import org.crosswire.common.util.NetUtil;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookMetaData;
@@ -71,7 +70,7 @@
*
* @see org.crosswire.jsword.book.install.Installer#getURL()
*/
- /* @Override */
+ @Override
public String getInstallerDefinition() {
return PROTOCOL_SWORD + "://" + username + ":" + password + "@" + host + packageDirectory;
}
@@ -106,7 +105,7 @@
* org.crosswire.jsword.book.install.sword.AbstractSwordInstaller#download
* (java.lang.String, java.lang.String, java.net.URI)
*/
- /* @Override */
+ @Override
protected void download(Progress job, String dir, String file, URI dest) throws InstallException {
FTPClient ftp = new FTPClient();
@@ -220,7 +219,7 @@
* @see FtpSwordInstaller#getInstallerDefinition()
* @see java.lang.Object#toString()
*/
- /* @Override */
+ @Override
public String toString() {
return getInstallerDefinition();
}
@@ -230,7 +229,7 @@
*
* @see java.lang.Object#equals(java.lang.Object)
*/
- /* @Override */
+ @Override
public boolean equals(Object object) {
if (!(object instanceof FtpSwordInstaller)) {
return false;
@@ -257,7 +256,7 @@
*
* @see java.lang.Object#hashCode()
*/
- /* @Override */
+ @Override
public int hashCode() {
return super.hashCode() + username.hashCode() + password.hashCode();
}
@@ -277,8 +276,4 @@
*/
private static final String PROTOCOL_SWORD = "sword-ftp";
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(FtpSwordInstaller.class);
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBook.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBook.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBook.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -30,8 +30,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
+import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Properties;
import org.crosswire.common.util.Logger;
import org.crosswire.jsword.book.BookDriver;
@@ -56,7 +56,7 @@
/**
* Simple ctor
*/
- public JDBCBook(BookDriver driver, Properties prop) throws BookException {
+ public JDBCBook(BookDriver driver, Map<String,Object> prop) throws BookException {
super(null); // set BookMetaData later
setBookMetaData(new DefaultBookMetaData(driver, this, prop));
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBookDriver.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBookDriver.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/jdbc/JDBCBookDriver.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,7 +26,7 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
-import java.util.Properties;
+import java.util.Map;
import org.crosswire.common.util.Logger;
import org.crosswire.common.util.NetUtil;
@@ -76,7 +76,7 @@
URI url = NetUtil.lengthenURI(dir, names[i]);
URI propUri = NetUtil.lengthenURI(url, "bible.properties");
try {
- Properties prop = NetUtil.loadProperties(propUri);
+ Map prop = NetUtil.loadProperties(propUri);
Book book = new JDBCBook(this, prop);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/CaseInstsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/CaseInstsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/CaseInstsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -76,7 +76,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#load(java.io.InputStream)
*/
- /* @Override */
+ @Override
public void load(InputStream in) throws IOException {
DataInputStream din = new DataInputStream(in);
@@ -108,7 +108,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#save(java.io.OutputStream)
*/
- /* @Override */
+ @Override
public void save(OutputStream out) throws IOException {
DataOutputStream dout = new DataOutputStream(out);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/InstsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/InstsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/InstsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -70,7 +70,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#init()
*/
- /* @Override */
+ @Override
public void init() {
array = new int[BibleInfo.versesInBible()][];
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ItemsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ItemsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ItemsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -80,7 +80,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#init()
*/
- /* @Override */
+ @Override
public void init() {
hash = new HashMap(getMaxItems());
array = new String[getMaxItems()];
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ParaInstsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ParaInstsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/ParaInstsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -69,7 +69,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#init()
*/
- /* @Override */
+ @Override
public void init() {
key = raw.createEmptyKeyList();
}
@@ -79,7 +79,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#load(java.io.InputStream)
*/
- /* @Override */
+ @Override
public void load(InputStream in) throws IOException {
ObjectInputStream oin = new ObjectInputStream(in);
@@ -103,7 +103,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#save(java.io.OutputStream)
*/
- /* @Override */
+ @Override
public void save(OutputStream out) throws IOException {
ObjectOutputStream oout = new ObjectOutputStream(out);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsDisk.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsDisk.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsDisk.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -70,7 +70,7 @@
*
* @see org.crosswire.jsword.book.raw.InstsDisk#load()
*/
- /* @Override */
+ @Override
public void load() throws IOException {
URI uri = NetUtil.lengthenURI(raw.getURI(), leafname);
raf = new RandomAccessFile(uri.getPath(), FileUtil.MODE_READ);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncInstsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -70,7 +70,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#load(java.io.InputStream)
*/
- /* @Override */
+ @Override
public void load(InputStream in) throws IOException {
DataInputStream din = new DataInputStream(in);
@@ -96,7 +96,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#save(java.io.OutputStream)
*/
- /* @Override */
+ @Override
public void save(OutputStream out) throws IOException {
DataOutputStream dout = new DataOutputStream(out);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncItemsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncItemsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/PuncItemsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -69,7 +69,7 @@
*
* @see org.crosswire.jsword.book.raw.ItemsMem#getMaxItems()
*/
- /* @Override */
+ @Override
public int getMaxItems() {
return 1000;
}
@@ -79,7 +79,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#load(java.io.InputStream)
*/
- /* @Override */
+ @Override
public void load(InputStream in) throws IOException {
DataInputStream din = new DataInputStream(in);
@@ -111,7 +111,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#save(java.io.OutputStream)
*/
- /* @Override */
+ @Override
public void save(OutputStream out) throws IOException {
DataOutputStream dout = new DataOutputStream(out);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/RawBookDriver.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/RawBookDriver.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/RawBookDriver.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,10 +26,10 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
-import java.util.Properties;
import org.crosswire.common.util.Logger;
import org.crosswire.common.util.NetUtil;
+import org.crosswire.common.util.PropertyMap;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.basic.AbstractBookDriver;
import org.crosswire.jsword.book.basic.BookRoot;
@@ -76,7 +76,7 @@
URI uri = NetUtil.lengthenURI(dir, names[i]);
URI propURI = NetUtil.lengthenURI(uri, RawConstants.FILE_BIBLE_PROPERTIES);
- Properties prop = NetUtil.loadProperties(propURI);
+ PropertyMap prop = NetUtil.loadProperties(propURI);
Book book = new RawBook(this, prop, uri);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsDisk.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsDisk.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsDisk.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -70,7 +70,7 @@
*
* @see org.crosswire.jsword.book.raw.InstsDisk#load()
*/
- /* @Override */
+ @Override
public void load() throws IOException {
URI uri = NetUtil.lengthenURI(raw.getURI(), leafname);
raf = new RandomAccessFile(uri.getPath(), FileUtil.MODE_READ);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordInstsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -75,7 +75,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#load(java.io.InputStream)
*/
- /* @Override */
+ @Override
public void load(InputStream in) throws IOException {
DataInputStream din = new DataInputStream(in);
@@ -101,7 +101,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#save(java.io.OutputStream)
*/
- /* @Override */
+ @Override
public void save(OutputStream out) throws IOException {
DataOutputStream dout = new DataOutputStream(out);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordItemsMem.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordItemsMem.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/raw/WordItemsMem.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -120,7 +120,7 @@
*
* @see org.crosswire.jsword.book.raw.Items#getIndex(java.lang.String)
*/
- /* @Override */
+ @Override
public int getIndex(String data) {
return super.getIndex(data.toLowerCase());
}
@@ -130,7 +130,7 @@
*
* @see org.crosswire.jsword.book.raw.ItemsMem#getMaxItems()
*/
- /* @Override */
+ @Override
public int getMaxItems() {
return 20000;
}
@@ -168,7 +168,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#load(java.io.InputStream)
*/
- /* @Override */
+ @Override
public void load(InputStream in) throws IOException {
DataInputStream din = new DataInputStream(in);
@@ -200,7 +200,7 @@
*
* @see org.crosswire.jsword.book.raw.Mem#save(java.io.OutputStream)
*/
- /* @Override */
+ @Override
public void save(OutputStream out) throws IOException {
DataOutputStream dout = new DataOutputStream(out);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/HttpRemoteBookDriver.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/HttpRemoteBookDriver.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/HttpRemoteBookDriver.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -53,7 +53,7 @@
*
* @see org.crosswire.jsword.book.remote.RemoteBookDriver#getRemoter()
*/
- /* @Override */
+ @Override
protected Remoter getRemoter() {
return remoter;
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoteBookDriver.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoteBookDriver.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoteBookDriver.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -44,7 +44,7 @@
* @return The remoter or null if none is available.
* @see org.crosswire.jsword.book.remote.RemoteBookDriver#getRemoter()
*/
- /* @Override */
+ @Override
protected Remoter getRemoter() {
return remoter;
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoteBook.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoteBook.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoteBook.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -156,7 +156,7 @@
* org.crosswire.jsword.book.Bible#findPassage(org.crosswire.jsword.book
* .Search)
*/
- /* @Override */
+ @Override
public Key find(String search) throws BookException {
try {
RemoteMethod method = new RemoteMethod(MethodName.FINDPASSAGE);
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoterException.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoterException.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/RemoterException.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -65,7 +65,7 @@
/**
* Accessor for the cause of this exception
*/
- /* @Override */
+ @Override
public Throwable getCause() {
return cause;
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/DefaultWord.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/DefaultWord.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/DefaultWord.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -60,7 +60,7 @@
*
* @see java.lang.Object#toString()
*/
- /* @Override */
+ @Override
public String toString() {
return text;
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -26,9 +26,9 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import org.crosswire.common.util.Logger;
+import org.crosswire.common.util.PropertyMap;
import org.crosswire.common.util.ReflectionUtil;
import org.crosswire.common.util.ResourceUtil;
import org.crosswire.jsword.book.BookException;
@@ -261,14 +261,14 @@
public static Map getWordMap() {
if (wordMap == null) {
try {
- Properties prop = ResourceUtil.getProperties(Word.class);
+ PropertyMap prop = ResourceUtil.getProperties(Word.class);
wordMap = new HashMap();
preferredMap = new HashMap();
for (Iterator it = prop.keySet().iterator(); it.hasNext();) {
String key = (String) it.next();
- String value = prop.getProperty(key);
+ String value = prop.get(key);
if (key.startsWith(PACKAGE_NAME)) {
try {
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/ser/SerBook.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/ser/SerBook.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/ser/SerBook.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -22,7 +22,7 @@
package org.crosswire.jsword.book.ser;
import java.net.URI;
-import java.util.Properties;
+import java.util.Map;
import org.crosswire.jsword.book.BookDriver;
import org.crosswire.jsword.book.BookException;
@@ -149,7 +149,7 @@
/**
* Simple ctor
*/
- public SerBook(BookDriver driver, Properties prop, URI uri) throws BookException {
+ public SerBook(BookDriver driver, Map<String,Object> prop, URI uri) throws BookException {
super(null); // set the BookMetaData later
setBookMetaData(new DefaultBookMetaData(driver, this, prop));
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/stub/StubBook.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/stub/StubBook.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/stub/StubBook.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -50,7 +50,7 @@
*
* @see org.crosswire.jsword.book.basic.AbstractPassageBook#getFilter()
*/
- /* @Override */
+ @Override
protected Filter getFilter() {
return FilterFactory.getDefaultFilter();
}
@@ -72,7 +72,6 @@
* org.crosswire.jsword.book.basic.AbstractPassageBook#getRawText(org.crosswire
* .jsword.passage.Key)
*/
- /* @Override */
public String getRawText(Key key) {
return "stub implementation";
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/passage/PassageSet.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/passage/PassageSet.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/passage/PassageSet.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -301,7 +301,7 @@
*
* @see java.lang.Object#equals(java.lang.Object)
*/
- /* @Override */
+ @Override
public boolean equals(Object o) {
return ref.equals(o);
}
@@ -311,7 +311,7 @@
*
* @see java.lang.Object#hashCode()
*/
- /* @Override */
+ @Override
public int hashCode() {
return ref.hashCode();
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -33,7 +33,7 @@
/**
* @see javax.servlet.Servlet#init(ServletConfig)
*/
- /* @Override */
+ @Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
@@ -52,7 +52,7 @@
* javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest
* , javax.servlet.http.HttpServletResponse)
*/
- /* @Override */
+ @Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Key key = null;
@@ -118,7 +118,7 @@
* javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest
* , javax.servlet.http.HttpServletResponse)
*/
- /* @Override */
+ @Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/RemoterServlet.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/RemoterServlet.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/RemoterServlet.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -35,7 +35,7 @@
*
* @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
*/
- /* @Override */
+ @Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
@@ -49,7 +49,7 @@
* javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest
* , javax.servlet.http.HttpServletResponse)
*/
- /* @Override */
+ @Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
XMLOutputter output = new XMLOutputter();
Modified: trunk/jsword-limbo/src/test/java/org/crosswire/common/util/ThreadUtilTest.java
===================================================================
--- trunk/jsword-limbo/src/test/java/org/crosswire/common/util/ThreadUtilTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/test/java/org/crosswire/common/util/ThreadUtilTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -37,11 +37,11 @@
String NEWLINE = System.getProperty("line.separator", "\r\n");
- /* @Override */
+ @Override
protected void setUp() throws Exception {
}
- /* @Override */
+ @Override
protected void tearDown() throws Exception {
}
Modified: trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/CustomTokenizerTest.java
===================================================================
--- trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/CustomTokenizerTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/CustomTokenizerTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -39,11 +39,11 @@
super(s);
}
- /* @Override */
+ @Override
protected void setUp() throws Exception {
}
- /* @Override */
+ @Override
protected void tearDown() throws Exception {
}
Modified: trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/DictionaryTest.java
===================================================================
--- trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/DictionaryTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/DictionaryTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -37,11 +37,11 @@
super(s);
}
- /* @Override */
+ @Override
protected void setUp() throws Exception {
}
- /* @Override */
+ @Override
protected void tearDown() throws Exception {
}
Modified: trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/ParserTest.java
===================================================================
--- trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/ParserTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/ParserTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -37,11 +37,11 @@
super(s);
}
- /* @Override */
+ @Override
protected void setUp() throws Exception {
}
- /* @Override */
+ @Override
protected void tearDown() throws Exception {
}
Modified: trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/WordsTest.java
===================================================================
--- trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/WordsTest.java 2010-12-11 04:18:12 UTC (rev 2055)
+++ trunk/jsword-limbo/src/test/java/org/crosswire/jsword/book/search/parse/WordsTest.java 2010-12-12 04:34:41 UTC (rev 2056)
@@ -39,7 +39,7 @@
private IndexSearcher engine = null;
- /* @Override */
+ @Override
protected void setUp() throws Exception {
Map commands = IndexSearcher.getWordMap();
@@ -56,7 +56,7 @@
engine.setSearchMap(commands);
}
- /* @Override */
+ @Override
protected void tearDown() throws Exception {
}
More information about the jsword-svn
mailing list