Patch from Dave to excise all remaining tabs.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2759 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -95,8 +95,7 @@ class FieldDescriptor
|
||||
pstmt.setDouble(column,((Double)field.get(obj)).doubleValue());
|
||||
break;
|
||||
case tBoolean:
|
||||
pstmt.setBoolean(column,
|
||||
((Boolean)field.get(obj)).booleanValue());
|
||||
pstmt.setBoolean(column, ((Boolean)field.get(obj)).booleanValue());
|
||||
break;
|
||||
|
||||
case tDecimal:
|
||||
@@ -133,10 +132,8 @@ class FieldDescriptor
|
||||
case tClosure:
|
||||
// There is no reason to use piped streams because
|
||||
// we need to pass total number of bytes to JDBC driver
|
||||
java.io.ByteArrayOutputStream out =
|
||||
new java.io.ByteArrayOutputStream();
|
||||
java.io.ObjectOutputStream clu =
|
||||
new java.io.ObjectOutputStream(out);
|
||||
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
|
||||
java.io.ObjectOutputStream clu = new java.io.ObjectOutputStream(out);
|
||||
clu.writeObject(field.get(obj));
|
||||
clu.close();
|
||||
pstmt.setBytes(column, out.toByteArray());
|
||||
@@ -160,8 +157,7 @@ class FieldDescriptor
|
||||
return true;
|
||||
}
|
||||
|
||||
protected final boolean updateVariable (
|
||||
ResultSet result, Object obj, int column)
|
||||
protected final boolean updateVariable (ResultSet result, Object obj, int column)
|
||||
throws SQLException
|
||||
{
|
||||
try {
|
||||
@@ -192,8 +188,7 @@ class FieldDescriptor
|
||||
result.updateByte(column, ((Byte)field.get(obj)).byteValue());
|
||||
break;
|
||||
case tShort:
|
||||
result.updateShort(column,
|
||||
((Short)field.get(obj)).shortValue());
|
||||
result.updateShort(column, ((Short)field.get(obj)).shortValue());
|
||||
break;
|
||||
case tInteger:
|
||||
result.updateInt(column, ((Integer)field.get(obj)).intValue());
|
||||
@@ -202,16 +197,13 @@ class FieldDescriptor
|
||||
result.updateLong(column, ((Long)field.get(obj)).longValue());
|
||||
break;
|
||||
case tFloat:
|
||||
result.updateFloat(column,
|
||||
((Float)field.get(obj)).floatValue());
|
||||
result.updateFloat(column, ((Float)field.get(obj)).floatValue());
|
||||
break;
|
||||
case tDouble:
|
||||
result.updateDouble(column,
|
||||
((Double)field.get(obj)).doubleValue());
|
||||
result.updateDouble(column, ((Double)field.get(obj)).doubleValue());
|
||||
break;
|
||||
case tBoolean:
|
||||
result.updateBoolean(column,
|
||||
((Boolean)field.get(obj)).booleanValue());
|
||||
result.updateBoolean(column, ((Boolean)field.get(obj)).booleanValue());
|
||||
break;
|
||||
|
||||
case tDecimal:
|
||||
@@ -230,8 +222,7 @@ class FieldDescriptor
|
||||
result.updateTime(column, (java.sql.Time)field.get(obj));
|
||||
break;
|
||||
case tTimestamp:
|
||||
result.updateTimestamp(column,
|
||||
(java.sql.Timestamp)field.get(obj));
|
||||
result.updateTimestamp(column, (java.sql.Timestamp)field.get(obj));
|
||||
break;
|
||||
case tStream:
|
||||
java.io.InputStream in = (java.io.InputStream)field.get(obj);
|
||||
@@ -239,15 +230,11 @@ class FieldDescriptor
|
||||
break;
|
||||
case tBlob:
|
||||
Blob blob = (Blob)field.get(obj);
|
||||
result.updateBinaryStream(column,
|
||||
blob.getBinaryStream(),
|
||||
(int)blob.length());
|
||||
result.updateBinaryStream(column, blob.getBinaryStream(), (int)blob.length());
|
||||
break;
|
||||
case tClob:
|
||||
Clob clob = (Clob)field.get(obj);
|
||||
result.updateCharacterStream(column,
|
||||
clob.getCharacterStream(),
|
||||
(int)clob.length());
|
||||
result.updateCharacterStream(column, clob.getCharacterStream(), (int)clob.length());
|
||||
break;
|
||||
case tAsString:
|
||||
result.updateString(column, field.get(obj).toString());
|
||||
@@ -255,10 +242,8 @@ class FieldDescriptor
|
||||
case tClosure:
|
||||
// There is no reason to use piped streams because
|
||||
// we need to pass total number of bytes to JDBC driver
|
||||
java.io.ByteArrayOutputStream out =
|
||||
new java.io.ByteArrayOutputStream();
|
||||
java.io.ObjectOutputStream clu =
|
||||
new java.io.ObjectOutputStream(out);
|
||||
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
|
||||
java.io.ObjectOutputStream clu = new java.io.ObjectOutputStream(out);
|
||||
clu.writeObject(field.get(obj));
|
||||
clu.close();
|
||||
result.updateBytes(column, out.toByteArray());
|
||||
@@ -369,8 +354,7 @@ class FieldDescriptor
|
||||
case tClosure:
|
||||
try {
|
||||
java.io.InputStream input = result.getBinaryStream(column);
|
||||
java.io.ObjectInputStream in =
|
||||
new java.io.ObjectInputStream(input);
|
||||
java.io.ObjectInputStream in = new java.io.ObjectInputStream(input);
|
||||
field.set(obj, in.readObject());
|
||||
in.close();
|
||||
} catch(ClassNotFoundException ex) {
|
||||
|
||||
@@ -60,8 +60,7 @@ public class CDDBTest
|
||||
}
|
||||
System.out.println("Extended data: " + detail.extendedData);
|
||||
for (int i = 0; i < detail.extendedTrackData.length; i++) {
|
||||
System.out.println(pad(i) + ": " +
|
||||
detail.extendedTrackData[i]);
|
||||
System.out.println(pad(i) + ": " + detail.extendedTrackData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +85,7 @@ public class CDDBTest
|
||||
test(args[0], "1b037b03");
|
||||
|
||||
} catch (CDDBException ce) {
|
||||
System.err.println("Protocol exception: " + ce.getCode() +
|
||||
": " + ce.getMessage());
|
||||
System.err.println("Protocol exception: " + ce.getCode() + ": " + ce.getMessage());
|
||||
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace(System.err);
|
||||
|
||||
@@ -48,24 +48,21 @@ public abstract class GroupLayout
|
||||
* Constructs a new constraints object with the specified weight,
|
||||
* which is only applicable with the STRETCH policy.
|
||||
*/
|
||||
public Constraints (int weight)
|
||||
{
|
||||
public Constraints (int weight) {
|
||||
_weight = weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this Constraints specifying fixed?
|
||||
*/
|
||||
public final boolean isFixed ()
|
||||
{
|
||||
public final boolean isFixed () {
|
||||
return (this == FIXED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the weight.
|
||||
*/
|
||||
public final int getWeight ()
|
||||
{
|
||||
public final int getWeight () {
|
||||
return _weight;
|
||||
}
|
||||
|
||||
@@ -197,9 +194,8 @@ public abstract class GroupLayout
|
||||
_constraints.put(comp, (Constraints)constraints);
|
||||
|
||||
} else {
|
||||
throw new RuntimeException("GroupLayout constraints " +
|
||||
"object must be of type " +
|
||||
"GroupLayout.Constraints");
|
||||
throw new RuntimeException(
|
||||
"GroupLayout constraints object must be of type GroupLayout.Constraints");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,8 +257,7 @@ public abstract class GroupLayout
|
||||
* Computes dimensions of the children widgets that are useful for the
|
||||
* group layout managers.
|
||||
*/
|
||||
protected DimenInfo computeDimens (Container parent, int type)
|
||||
{
|
||||
protected DimenInfo computeDimens (Container parent, int type) {
|
||||
int count = parent.getComponentCount();
|
||||
DimenInfo info = new DimenInfo();
|
||||
info.dimens = new Dimension[count];
|
||||
|
||||
@@ -46,10 +46,8 @@ public class GroupLayoutTest
|
||||
JButton butthree = new JButton("Three to get ready");
|
||||
panel.add(butthree, GroupLayout.FIXED);
|
||||
|
||||
frame.addWindowListener(new WindowAdapter ()
|
||||
{
|
||||
@Override public void windowClosing (WindowEvent e)
|
||||
{
|
||||
frame.addWindowListener(new WindowAdapter () {
|
||||
@Override public void windowClosing (WindowEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,8 +24,7 @@ import java.awt.*;
|
||||
|
||||
public class HGroupLayout extends GroupLayout
|
||||
{
|
||||
public HGroupLayout (Policy policy, Policy offpolicy, int gap,
|
||||
Justification justification)
|
||||
public HGroupLayout (Policy policy, Policy offpolicy, int gap, Justification justification)
|
||||
{
|
||||
_policy = policy;
|
||||
_offpolicy = offpolicy;
|
||||
@@ -62,8 +61,7 @@ public class HGroupLayout extends GroupLayout
|
||||
Dimension dims = new Dimension();
|
||||
|
||||
if (_policy == STRETCH) {
|
||||
dims.width = info.maxfreewid * (info.count - info.numfix) +
|
||||
info.fixwid;
|
||||
dims.width = info.maxfreewid * (info.count - info.numfix) + info.fixwid;
|
||||
} else if (_policy == EQUALIZE) {
|
||||
dims.width = info.maxwid * info.count;
|
||||
} else { // NONE or CONSTRAIN
|
||||
@@ -153,8 +151,7 @@ public class HGroupLayout extends GroupLayout
|
||||
if (_policy == NONE || c.isFixed()) {
|
||||
newwid = info.dimens[i].width;
|
||||
} else {
|
||||
newwid = freefrac +
|
||||
((_policy == STRETCH) ? defwid * c.getWeight() : defwid);
|
||||
newwid = freefrac + ((_policy == STRETCH) ? defwid * c.getWeight() : defwid);
|
||||
// clear out the extra pixels the first time they're used
|
||||
freefrac = 0;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ import java.awt.*;
|
||||
|
||||
public class VGroupLayout extends GroupLayout
|
||||
{
|
||||
public VGroupLayout (Policy policy, Policy offpolicy, int gap,
|
||||
Justification justification)
|
||||
public VGroupLayout (Policy policy, Policy offpolicy, int gap, Justification justification)
|
||||
{
|
||||
_policy = policy;
|
||||
_offpolicy = offpolicy;
|
||||
@@ -62,8 +61,7 @@ public class VGroupLayout extends GroupLayout
|
||||
Dimension dims = new Dimension();
|
||||
|
||||
if (_policy == STRETCH) {
|
||||
dims.height = info.maxfreehei * (info.count - info.numfix) +
|
||||
info.fixhei;
|
||||
dims.height = info.maxfreehei * (info.count - info.numfix) + info.fixhei;
|
||||
} else if (_policy == EQUALIZE) {
|
||||
dims.height = info.maxhei * info.count;
|
||||
} else { // NONE or CONSTRAIN
|
||||
@@ -153,8 +151,7 @@ public class VGroupLayout extends GroupLayout
|
||||
if (_policy == NONE || c.isFixed()) {
|
||||
newhei = info.dimens[i].height;
|
||||
} else {
|
||||
newhei = freefrac +
|
||||
((_policy == STRETCH) ? defhei * c.getWeight() : defhei);
|
||||
newhei = freefrac + ((_policy == STRETCH) ? defhei * c.getWeight() : defhei);
|
||||
// clear out the extra pixels the first time they're used
|
||||
freefrac = 0;
|
||||
}
|
||||
|
||||
@@ -127,16 +127,13 @@ public class MenuUtil
|
||||
* @param name the item name.
|
||||
* @param mnem the mnemonic key for the item.
|
||||
* @param accel the keystroke for the item or null if none.
|
||||
* @param target the object on which to invoke a method when the menu
|
||||
* is selected.
|
||||
* @param callbackName the name of the method to invoke when the menu
|
||||
* is selected.
|
||||
* @param target the object on which to invoke a method when the menu is selected.
|
||||
* @param callbackName the name of the method to invoke when the menu is selected.
|
||||
*
|
||||
* @return the new menu item.
|
||||
*/
|
||||
public static JMenuItem addMenuItem (
|
||||
JMenu menu, String name, int mnem, KeyStroke accel,
|
||||
Object target, String callbackName)
|
||||
JMenu menu, String name, int mnem, KeyStroke accel, Object target, String callbackName)
|
||||
{
|
||||
JMenuItem item = createItem(name, Integer.valueOf(mnem), accel);
|
||||
item.addActionListener(new ReflectedAction(target, callbackName));
|
||||
@@ -152,10 +149,8 @@ public class MenuUtil
|
||||
*
|
||||
* @param menu the menu to add the item to.
|
||||
* @param name the item name.
|
||||
* @param target the object on which to invoke a method when the menu
|
||||
* is selected.
|
||||
* @param callbackName the name of the method to invoke when the menu
|
||||
* is selected.
|
||||
* @param target the object on which to invoke a method when the menu is selected.
|
||||
* @param callbackName the name of the method to invoke when the menu is selected.
|
||||
*
|
||||
* @return the new menu item.
|
||||
*/
|
||||
@@ -181,10 +176,8 @@ public class MenuUtil
|
||||
*
|
||||
* @param menu the menu to add the item to.
|
||||
* @param name the item name.
|
||||
* @param target the object on which to invoke a method when the menu
|
||||
* is selected.
|
||||
* @param callbackName the name of the method to invoke when the menu
|
||||
* is selected.
|
||||
* @param target the object on which to invoke a method when the menu is selected.
|
||||
* @param callbackName the name of the method to invoke when the menu is selected.
|
||||
*
|
||||
* @return the new menu item.
|
||||
*/
|
||||
@@ -200,8 +193,7 @@ public class MenuUtil
|
||||
/**
|
||||
* Creates and configures a menu item.
|
||||
*/
|
||||
protected static JMenuItem createItem (
|
||||
String name, Integer mnem, KeyStroke accel)
|
||||
protected static JMenuItem createItem (String name, Integer mnem, KeyStroke accel)
|
||||
{
|
||||
JMenuItem item = new JMenuItem(name);
|
||||
if (mnem != null) {
|
||||
@@ -218,8 +210,7 @@ public class MenuUtil
|
||||
*/
|
||||
protected static class ReflectedAction implements ActionListener
|
||||
{
|
||||
public ReflectedAction (Object target, String methodName)
|
||||
{
|
||||
public ReflectedAction (Object target, String methodName) {
|
||||
try {
|
||||
// look up the method we'll be calling
|
||||
_method = target.getClass().getMethod(methodName, METHOD_ARGS);
|
||||
@@ -231,8 +222,7 @@ public class MenuUtil
|
||||
}
|
||||
}
|
||||
|
||||
public void actionPerformed (ActionEvent event)
|
||||
{
|
||||
public void actionPerformed (ActionEvent event) {
|
||||
if (_method != null) {
|
||||
try {
|
||||
_method.invoke(_target, new Object[] { event });
|
||||
|
||||
@@ -231,9 +231,8 @@ public class ProximityTracker
|
||||
*/
|
||||
protected int binarySearch (int x)
|
||||
{
|
||||
// copied from java.util.Arrays which I wouldn't have to have done
|
||||
// had the provided a means by which to binarySearch in a subset
|
||||
// of an array. alas.
|
||||
// copied from java.util.Arrays which I wouldn't have to have done had the provided a
|
||||
// means by which to binarySearch in a subset of an array. alas.
|
||||
int low = 0;
|
||||
int high = _size-1;
|
||||
|
||||
|
||||
@@ -47,8 +47,7 @@ public class TaskMaster
|
||||
* subsequent dealings with the task master. The supplied observer (if
|
||||
* non-null) will be notified when the task has completed.
|
||||
*/
|
||||
public static void invokeTask (String name, Task task,
|
||||
TaskObserver observer)
|
||||
public static void invokeTask (String name, Task task, TaskObserver observer)
|
||||
{
|
||||
// create a task runner and stick it in our task table
|
||||
TaskRunner runner = new TaskRunner(name, task, observer);
|
||||
@@ -65,8 +64,7 @@ public class TaskMaster
|
||||
* <code>invoke</code> method of the <code>Task</code> interface.
|
||||
* Aborting tasks run in this way is not supported.
|
||||
*/
|
||||
public static void invokeMethodTask (String name, Object source,
|
||||
TaskObserver observer)
|
||||
public static void invokeMethodTask (String name, Object source, TaskObserver observer)
|
||||
{
|
||||
// create a method task instance to invoke the named method and
|
||||
// then run that through the normal task invocation mechanism
|
||||
@@ -84,8 +82,7 @@ public class TaskMaster
|
||||
|
||||
protected static class TaskRunner extends Thread
|
||||
{
|
||||
public TaskRunner (String name, Task task, TaskObserver observer)
|
||||
{
|
||||
public TaskRunner (String name, Task task, TaskObserver observer) {
|
||||
_name = name;
|
||||
_task = task;
|
||||
_observer = observer;
|
||||
@@ -93,15 +90,12 @@ public class TaskMaster
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the task and then reports completion or failure later
|
||||
* on the swing event dispatcher thread. We need to ensure that
|
||||
* _mode and _result are visible to the various threads that
|
||||
* invoke this runnable so run() is synchronized. Oh how I love
|
||||
* Chapter 17.
|
||||
* Invokes the task and then reports completion or failure later on the swing event
|
||||
* dispatcher thread. We need to ensure that _mode and _result are visible to the various
|
||||
* threads that invoke this runnable so run() is synchronized. Oh how I love Chapter 17.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void run ()
|
||||
{
|
||||
public synchronized void run () {
|
||||
switch (_mode) {
|
||||
default:
|
||||
case INVOKE:
|
||||
@@ -141,8 +135,7 @@ public class TaskMaster
|
||||
}
|
||||
}
|
||||
|
||||
public void abort ()
|
||||
{
|
||||
public void abort () {
|
||||
log.warning("abort() not currently supported.");
|
||||
}
|
||||
|
||||
@@ -160,22 +153,19 @@ public class TaskMaster
|
||||
|
||||
protected static class MethodTask implements Task
|
||||
{
|
||||
public MethodTask (String name, Object source)
|
||||
{
|
||||
public MethodTask (String name, Object source) {
|
||||
_name = name;
|
||||
_source = source;
|
||||
}
|
||||
|
||||
public Object invoke () throws Exception
|
||||
{
|
||||
public Object invoke () throws Exception {
|
||||
// look up the named method on the source object and invoke it
|
||||
Method meth = _source.getClass().getMethod(_name, (Class<?>[]) null);
|
||||
meth.setAccessible(true);
|
||||
return meth.invoke(_source, (Object[]) null);
|
||||
}
|
||||
|
||||
public boolean abort ()
|
||||
{
|
||||
public boolean abort () {
|
||||
// aborting not supported
|
||||
return false;
|
||||
}
|
||||
@@ -184,6 +174,5 @@ public class TaskMaster
|
||||
protected Object _source;
|
||||
}
|
||||
|
||||
protected static Hashtable<String,TaskRunner> _tasks =
|
||||
new Hashtable<String,TaskRunner>();
|
||||
protected static Hashtable<String, TaskRunner> _tasks = new Hashtable<String, TaskRunner>();
|
||||
}
|
||||
|
||||
@@ -90,8 +90,7 @@ public class ConfigUtil
|
||||
* Like {@link #loadProperties(String,ClassLoader)} but the properties are loaded into the
|
||||
* supplied {@link Properties} object.
|
||||
*/
|
||||
public static void loadProperties (
|
||||
String path, ClassLoader loader, Properties target)
|
||||
public static void loadProperties (String path, ClassLoader loader, Properties target)
|
||||
throws IOException
|
||||
{
|
||||
InputStream in = getStream(path, loader);
|
||||
|
||||
@@ -449,8 +449,7 @@ public class IntIntMap
|
||||
public int key;
|
||||
public int value;
|
||||
|
||||
public Record (int key, int value)
|
||||
{
|
||||
public Record (int key, int value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -176,8 +176,7 @@ public class Queue<T>
|
||||
if (_count == 0) {
|
||||
try { wait(maxwait); } catch (InterruptedException e) {}
|
||||
|
||||
// if count's still null when we pull out, we waited
|
||||
// ourmaxwait time.
|
||||
// if count's still null when we pull out, we waited ourmaxwait time.
|
||||
if (_count == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user