bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
void connect(Stub self, javax.rmi.ORB orb) throws RemoteException;
void connect(Stub self, ORB orb) throws RemoteException;
1,208
getSubType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(""); String subtype = mimeType.substring(idx + 1); idx = subtype.indexOf(" "); if (idx == -1) return(subtype); else return(subtype.substring(0, idx));}
getSubType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(""); String subtype = mimeType.substring(idx + 1); idx = subtype.indexOf(" "); if (idx == -1) return(subtype); else return(subtype.substring(0, idx));}
1,210
getSubType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(""); String subtype = mimeType.substring(idx + 1); idx = subtype.indexOf(" "); if (idx == -1) return(subtype); else return(subtype.substring(0, idx));}
getSubType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(""); String subtype = mimeType.substring(idx + 1); idx = subtype.indexOf(" "); if (idx == -1) return(subtype); else return(subtype.substring(0, idx));}
1,211
getSubType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(""); String subtype = mimeType.substring(idx + 1); idx = subtype.indexOf(" "); if (idx == -1) return(subtype); else return(subtype.substring(0, idx));}
getSubType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(""); String subtype = mimeType.substring(idx + 1); idx = subtype.indexOf(" "); if (idx == -1) return(subtype); else return mimeType.substring(start + 1, end);}
1,212
isMimeTypeEqual(String mimeType){ // FIXME: Need to handle default attributes and parameters return(this.mimeType.equals(mimeType));}
isMimeTypeEqual(String mimeType){ // FIXME: Need to handle default attributes and parameters i = mimeType.indexOf(";"); if (i != -1) mimeType = mimeType.substring(0, i); return mime.equals(mimeType);}
1,214
isRepresentationClassRemote(){ // FIXME: Implement throw new RuntimeException("Not implemented");}
isRepresentationClassRemote(){ // FIXME: Implement return Remote.class.isAssignableFrom (representationClass);}
1,215
toString(){ return("DataFlavor[representationClass=" + representationClass.getName() + ",mimeType=" + mimeType + "humanPresentableName=" + humanPresentableName);}
toString(){ return("DataFlavor[representationClass=" + representationClass.getName() + ",mimeType=" + mimeType + "humanPresentableName=" + humanPresentableName);}
1,216
public File createFileObject(String path) { return new File(path); }
public File createFileObject(File dir, String filename) { return new File(path); }
1,217
public File createFileObject(String path) { return new File(path); }
public File createFileObject(String path) { return new File(dir, filename); }
1,218
public String getDescription(File value0) { return null; // TODO } // getDescription()
public String getDescription(File value0) { return null; // TODO } // getDescription()
1,219
public Icon getIcon(File value0) { return null; // TODO } // getIcon()
public Icon getIcon(File value0) { return null; // TODO } // getIcon()
1,220
public String getTypeDescription(File value0) { return null; // TODO } // getTypeDescription()
public String getTypeDescription(File value0) { return null; // TODO } // getTypeDescription()
1,221
private static double scale(double x, int n) { if (x == 0 || x == Double.NEGATIVE_INFINITY || !(x < Double.POSITIVE_INFINITY) || n == 0) return x; long bits = Double.doubleToLongBits(x); int exp = (int) (bits >> 52) & 0x7ff; if (exp == 0) // Subnormal x. { x *= TWO_54; exp = ((int) (Double.doubleToLongBits(x) >> 52) & 0x7ff) - 54; } exp += n; if (exp > 0x7fe) // Overflow. return Double.POSITIVE_INFINITY * x; if (exp > 0) // Normal. return Double.longBitsToDouble((bits & 0x800fffffffffffffL) | ((long) exp << 52)); if (exp <= -54) return 0 * x; // Underflow. exp += 54; // Subnormal result. x = Double.longBitsToDouble((bits & 0x800fffffffffffffL) | ((long) exp << 52)); return x * (1 / TWO_54); }
private static double scale(double x, int n) { if (x == 0 || x == Double.NEGATIVE_INFINITY || !(x < Double.POSITIVE_INFINITY) || n == 0) return x; long bits = Double.doubleToLongBits(x); int exp = (int) (bits >> 52) & 0x7ff; if (exp == 0) // Subnormal x. { x *= TWO_54; exp = ((int) (Double.doubleToLongBits(x) >> 52) & 0x7ff) - 54; } exp += n; if (exp > 0x7fe) // Overflow. return Double.POSITIVE_INFINITY * x; if (exp > 0) // Normal. return Double.longBitsToDouble((bits & 0x800fffffffffffffL) | ((long) exp << 52)); if (exp <= -54) return 0 * x; // Underflow. exp += 54; // Subnormal result. x = Double.longBitsToDouble((bits & 0x800fffffffffffffL) | ((long) exp << 52)); return x * (1 / TWO_54); }
1,223
public static double toDegrees(double rads) { return rads * (180 / PI); }
public static double toDegrees(double rads) { return rads * (180 / PI); }
1,224
public static double toRadians(double degrees) { return degrees * (PI / 180); }
public static double toRadians(double degrees) { return degrees * (PI / 180); }
1,225
getCursorType(){ return(getCursor().getType());}
getCursorType(){ return(getCursor().getType());}
1,226
remove(MenuComponent menu){ menuBar.remove(menu);}
remove(MenuComponent menu){ menuBar.remove(menu);}
1,227
setCursor(int type){ setCursor(new Cursor(type));}
setCursor(int type){ setCursor(new Cursor(type));}
1,228
setMenuBar(MenuBar menuBar){ if (peer != null) { if (this.menuBar != null) this.menuBar.removeNotify(); if (menuBar != null) menuBar.addNotify(); invalidateTree (); ((FramePeer) peer).setMenuBar(menuBar); } this.menuBar = menuBar;}
setMenuBar(MenuBar menuBar){ if (peer != null) { if (this.menuBar != null) this.menuBar.removeNotify(); if (menuBar != null) menuBar.addNotify(); invalidateTree (); ((FramePeer) peer).setMenuBar(menuBar); } this.menuBar = menuBar;}
1,229
setResizable(boolean resizable){ this.resizable = resizable; if (peer != null) ((FramePeer) peer).setResizable(resizable);}
setResizable(boolean resizable){ this.resizable = resizable; if (peer != null) ((FramePeer) peer).setResizable(resizable);}
1,230
public static CompletionStatus from_int(int completion) { try { return states [ completion ]; } catch (ArrayIndexOutOfBoundsException ex) { throw new BAD_OPERATION("Invalid completion status " + completion); } }
public static CompletionStatus from_int(int completion) { try { return states [ completion ]; } catch (ArrayIndexOutOfBoundsException ex) { BAD_OPERATION bad = new BAD_OPERATION("Invalid completion status " + completion); bad.minor = Minor.Enumeration; throw bad; } }
1,231
UTF_16BE () { super ("UTF-16BE", null); }
UTF_16BE () { super ("UTF-16BE", new String[] { "UTF16BE", "x-utf-16be", "ibm-1200", "ibm-1201", "ibm-5297", "ibm-13488", "ibm-17584", "windows-1201", "cp1200", "cp1201", "UTF16_BigEndian", "UnicodeBigUnmarked" }); }
1,232
public VirtualMachineError(String s) { super(s); }
public VirtualMachineError(String s) { super(s); }
1,233
public ThreadNameArgument(String name, String description) { super(name, description); }
public ThreadNameArgument(String name, String description) { super(name, description); }
1,234
public ImageIcon(URL url) { this(url, null); }
public ImageIcon() { this(url, null); }
1,236
public ImageIcon(URL url) { this(url, null); }
public ImageIcon(URL url) { this(url, null); }
1,237
public AxisInterface addAxis(AxisInterface axis) { if (axis instanceof FieldAxis) { setFieldAxis((FieldAxis) axis); } else if (canAddAxisObjToArray((Axis) axis)) { //check if the axis can be added getDataCube().incrementDimension((Axis) axis); //increment the DataCube dimension by 1 getAxes().add((Axis) axis); updateChildLocators((Axis) axis, "add"); updateNotesLocationOrder(); // reset to the current order of the axes } else { return null; } return axis; }
public AxisInterface addAxis(AxisInterface axis) { if (axis instanceof FieldAxis) { setFieldAxis((FieldAxis) axis); } else if (canAddAxisObjToArray((Axis) axis)) { //check if the axis can be added //increment the DataCube dimension by 1 getAxes().add((Axis) axis); updateChildLocators((Axis) axis, "add"); updateNotesLocationOrder(); // reset to the current order of the axes } else { return null; } return axis; }
1,239
public Field addField (Field field) { if (field == null) { Log.warn("in FieldAxis.addField(),Field passed in is null"); return null; } getFieldList().add(field); length++; return field; }
public Field addField (Field field) { if (field == null) { Log.warn("in FieldAxis.addField(),Field passed in is null"); return null; } getFieldList().add(field); length++; return field; }
1,240
public Note addNote(Note n) { if (n == null) { Log.warn("in Field.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
public Note addNote(Note n) { if (n == null) { Log.warn("in Field.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
1,241
public void setAxisTag(String tag, String axisId) { if (tag == null || axisId== null) { Log.error("Missing information: need tag AND axisId for addAxisTag. Ignoring request. returning null"); return; } //insert in hash table, return tag value tagHash.put(axisId, tag); }
public void setAxisTag(String tag, String axisId) { if (tag == null || axisId== null) { Log.error("Missing information: need tag AND axisId for addAxisTag. Ignoring request. returning null"); return; } //insert in hash table, return tag value tagHash.put(axisId, tag); }
1,242
public Unit addUnit(Unit unit) { if (unit == null) { Log.warn("in Array.addUnit(), the Unit passed in is null"); return null; } Units u = getUnits(); if (u == null) { u = new Units(); setUnits(u); } return u.addUnit(unit); }
public Unit addUnit(Unit unit) { if (unit == null) { Log.warn("in Array.addUnit(), the Unit passed in is null"); return null; } Units u = getUnits(); if (u == null) { u = new Units(); setUnits(u); } return u.addUnit(unit); }
1,243
public Value () { init(); }
public Value (String strValue) { init(); }
1,244
public void setData (Locator locator, String strValue ) throws SetDataException { getDataCube().setData(locator, strValue); }
public void setData (Locator locator, String strValue ) throws SetDataException { getDataCube().setData(locator, strValue); }
1,246
public void setData (Locator locator, String strValue ) throws SetDataException { getDataCube().setData(locator, strValue); }
public void setData (Locator locator, String strValue ) throws SetDataException { if (dataObj.getClass().isArray()) { if (dataObj instanceof int[] ) this.setData (locator, (int[])dataObj); else if (dataObj instanceof long[]) this.setData (locator, (long[])dataObj); else if (dataObj instanceof float[]) this.setData (locator, (float[])dataObj); else if (dataObj instanceof double[]) this.setData (locator, (double[])dataObj); else if (dataObj instanceof String[]) this.setData (locator, (String[])dataObj); else { String msg = "Data array: " + dataObj.getClass().getName() + " is not implemented"; Log.errorln(msg); throw new SetDataException (msg); } } else { if (dataObj instanceof Double ) this.setData (locator, (Double) dataObj); else if (dataObj instanceof Integer ) this.setData (locator, (Integer) dataObj); else { String msg = "Primiary data wrapper type: " + dataObj.getClass().getName() + " is not implemented"; Log.errorln(msg); throw new SetDataException (msg); } } }
1,247
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
public int getNextMatch(String prefix, int startIndex, Position.Bias direction) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1,248
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex >= model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1,249
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1,250
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1,251
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1,252
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
1,253
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else { Point p = new Point(visibleRect.x, visibleRect.y - visibleRect.height); int newFirst = locationToIndex(p); if (newFirst != -1) { int first = getFirstVisibleIndex(); if (first == -1) first = locationToIndex(visibleRect.getLocation()); Rectangle newFirstR = getCellBounds(newFirst, newFirst); Rectangle firstR = getCellBounds(first, first); if (newFirstR != null && firstR != null) { while (newFirstR.y + visibleRect.height < firstR.y + firstR.height && newFirstR.y < firstR.y) { newFirst++; newFirstR = getCellBounds(newFirst, newFirst); } block = visibleRect.y - newFirstR.y; if (block <= 0 && newFirstR.y > 0) { newFirst--; newFirstR = getCellBounds(newFirst, newFirst); if (newFirstR != null) block = visibleRect.y - newFirstR.y; } } } } } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { block = visibleRect.width; if (direction > 0) { Point p = new Point(visibleRect.x + visibleRect.width + 1, visibleRect.y); int last = locationToIndex(p); if (last != -1) { Rectangle lastR = getCellBounds(last, last); if (lastR != null) { block = lastR.x - visibleRect.x; if (block < 0) block += lastR.width; else if (block == 0 && last < getModel().getSize() - 1) block = lastR.width; } } } else { Point p = new Point(visibleRect.x - visibleRect.width, visibleRect.y); int first = locationToIndex(p); if (first != -1) { Rectangle firstR = getCellBounds(first, first); if (firstR != null) { if (firstR.x < visibleRect.x - visibleRect.width) { if (firstR.x + firstR.width > visibleRect.x) block = visibleRect.x - firstR.x; else block = visibleRect.x - firstR.x - firstR.width; } else block = visibleRect.x - firstR.x; } } } } return block; }
1,254
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int unit = -1; if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,255
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { int row = getFirstVisibleIndex(); if (row == -1) unit = 0; else if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,256
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,257
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,258
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,259
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { // no next item, no advance possible return 0; } } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { // no previous item, no advance possible return 0; } } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,260
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,261
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (b.x != visibleRect.x) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,262
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,263
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1,264
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) if (unit == -1) { Font f = getFont(); unit = f != null ? f.getSize() : 1; } return unit; }
1,265
public boolean getValueIsAdjusting() { return valueIsAdjusting; }
public boolean getValueIsAdjusting() { return selectionModel.getValueIsAdjusting(); }
1,266
private void init(ListModel m) { if (m == null) throw new IllegalArgumentException("Null model not permitted."); dragEnabled = false; fixedCellHeight = -1; fixedCellWidth = -1; layoutOrientation = VERTICAL; opaque = true; valueIsAdjusting = false; visibleRowCount = 7; cellRenderer = new DefaultListCellRenderer(); listListener = new ListListener(); model = m; if (model != null) model.addListDataListener(listListener); selectionModel = createSelectionModel(); if (selectionModel != null) { selectionModel.addListSelectionListener(listListener); selectionModel.setSelectionMode (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } setLayout(null); updateUI(); }
private void init(ListModel m) { if (m == null) throw new IllegalArgumentException("Null model not permitted."); dragEnabled = false; fixedCellHeight = -1; fixedCellWidth = -1; layoutOrientation = VERTICAL; opaque = true; valueIsAdjusting = false; visibleRowCount = 7; cellRenderer = new DefaultListCellRenderer(); listListener = new ListListener(); model = m; if (model != null) model.addListDataListener(listListener); selectionModel = createSelectionModel(); if (selectionModel != null) { selectionModel.addListSelectionListener(listListener); selectionModel.setSelectionMode (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } setLayout(null); updateUI(); }
1,267
public void setValueIsAdjusting(boolean isAdjusting) { valueIsAdjusting = isAdjusting; }
public void setValueIsAdjusting(boolean isAdjusting) { selectionModel.setValueIsAdjusting(isAdjusting); }
1,269
public void setVisibleRowCount(int vc) { visibleRowCount = vc; revalidate(); repaint(); }
public void setVisibleRowCount(int vc) { if (visibleRowCount != vc) { int oldValue = visibleRowCount; visibleRowCount = Math.max(vc, 0); firePropertyChange("visibleRowCount", oldValue, vc); revalidate(); repaint(); }
1,270
public AnyHolder(Any initial_value) { value = initial_value; }
public AnyHolder() { value = initial_value; }
1,272
public AnyHolder(Any initial_value) { value = initial_value; }
public AnyHolder(Any initial_value) { }
1,273
private void readHeader() throws IOException { /* 1. Check the two magic bytes */ CRC32 headCRC = new CRC32(); int magic = in.read(); if (magic < 0) { eos = true; return; } int magic2 = in.read(); if ((magic + (magic2 << 8)) != GZIP_MAGIC) throw new IOException("Error in GZIP header, bad magic code"); headCRC.update(magic); headCRC.update(magic2); /* 2. Check the compression type (must be 8) */ int CM = in.read(); if (CM != 8) throw new IOException("Error in GZIP header, data not in deflate format"); headCRC.update(CM); /* 3. Check the flags */ int flags = in.read(); if (flags < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(flags); /* This flag byte is divided into individual bits as follows: bit 0 FTEXT bit 1 FHCRC bit 2 FEXTRA bit 3 FNAME bit 4 FCOMMENT bit 5 reserved bit 6 reserved bit 7 reserved */ /* 3.1 Check the reserved bits are zero */ if ((flags & 0xd0) != 0) throw new IOException("Reserved flag bits in GZIP header != 0"); /* 4.-6. Skip the modification time, extra flags, and OS type */ for (int i=0; i< 6; i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } /* 7. Read extra field */ if ((flags & FEXTRA) != 0) { /* Skip subfield id */ for (int i=0; i< 2; i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } if (in.read() < 0 || in.read() < 0) throw new EOFException("Early EOF in GZIP header"); int len1, len2, extraLen; len1 = in.read(); len2 = in.read(); if ((len1 < 0) || (len2 < 0)) throw new EOFException("Early EOF in GZIP header"); headCRC.update(len1); headCRC.update(len2); extraLen = (len1 << 8) | len2; for (int i = 0; i < extraLen;i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } } /* 8. Read file name */ if ((flags & FNAME) != 0) { int readByte; while ( (readByte = in.read()) > 0) headCRC.update(readByte); if (readByte < 0) throw new EOFException("Early EOF in GZIP file name"); headCRC.update(readByte); } /* 9. Read comment */ if ((flags & FCOMMENT) != 0) { int readByte; while ( (readByte = in.read()) > 0) headCRC.update(readByte); if (readByte < 0) throw new EOFException("Early EOF in GZIP comment"); headCRC.update(readByte); } /* 10. Read header CRC */ if ((flags & FHCRC) != 0) { int tempByte; int crcval = in.read(); if (crcval < 0) throw new EOFException("Early EOF in GZIP header"); tempByte = in.read(); if (tempByte < 0) throw new EOFException("Early EOF in GZIP header"); crcval = (crcval << 8) | tempByte; if (crcval != ((int) headCRC.getValue() & 0xffff)) throw new IOException("Header CRC value mismatch"); } readGZIPHeader = true; //System.err.println("Read GZIP header"); }
private void readHeader() throws IOException { /* 1. Check the two magic bytes */ CRC32 headCRC = new CRC32(); int magic = in.read(); if (magic < 0) { eos = true; return; } int magic2 = in.read(); if ((magic + (magic2 << 8)) != GZIP_MAGIC) throw new IOException("Error in GZIP header, bad magic code"); headCRC.update(magic); headCRC.update(magic2); /* 2. Check the compression type (must be 8) */ int CM = in.read(); if (CM != Deflater.DEFLATED) throw new IOException("Error in GZIP header, data not in deflate format"); headCRC.update(CM); /* 3. Check the flags */ int flags = in.read(); if (flags < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(flags); /* This flag byte is divided into individual bits as follows: bit 0 FTEXT bit 1 FHCRC bit 2 FEXTRA bit 3 FNAME bit 4 FCOMMENT bit 5 reserved bit 6 reserved bit 7 reserved */ /* 3.1 Check the reserved bits are zero */ if ((flags & 0xd0) != 0) throw new IOException("Reserved flag bits in GZIP header != 0"); /* 4.-6. Skip the modification time, extra flags, and OS type */ for (int i=0; i< 6; i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } /* 7. Read extra field */ if ((flags & FEXTRA) != 0) { /* Skip subfield id */ for (int i=0; i< 2; i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } if (in.read() < 0 || in.read() < 0) throw new EOFException("Early EOF in GZIP header"); int len1, len2, extraLen; len1 = in.read(); len2 = in.read(); if ((len1 < 0) || (len2 < 0)) throw new EOFException("Early EOF in GZIP header"); headCRC.update(len1); headCRC.update(len2); extraLen = (len1 << 8) | len2; for (int i = 0; i < extraLen;i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } } /* 8. Read file name */ if ((flags & FNAME) != 0) { int readByte; while ( (readByte = in.read()) > 0) headCRC.update(readByte); if (readByte < 0) throw new EOFException("Early EOF in GZIP file name"); headCRC.update(readByte); } /* 9. Read comment */ if ((flags & FCOMMENT) != 0) { int readByte; while ( (readByte = in.read()) > 0) headCRC.update(readByte); if (readByte < 0) throw new EOFException("Early EOF in GZIP comment"); headCRC.update(readByte); } /* 10. Read header CRC */ if ((flags & FHCRC) != 0) { int tempByte; int crcval = in.read(); if (crcval < 0) throw new EOFException("Early EOF in GZIP header"); tempByte = in.read(); if (tempByte < 0) throw new EOFException("Early EOF in GZIP header"); crcval = (crcval << 8) | tempByte; if (crcval != ((int) headCRC.getValue() & 0xffff)) throw new IOException("Header CRC value mismatch"); } readGZIPHeader = true; //System.err.println("Read GZIP header"); }
1,275
public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size]; //Create the buffer }
public InflaterInputStream(InputStream in) { super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size]; //Create the buffer }
1,276
public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size]; //Create the buffer }
public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size]; //Create the buffer }
1,277
public void close() throws IOException { in.close(); }
public synchronized void close() throws IOException { in.close(); }
1,278
public int read(byte[] b, int off, int len) throws IOException { for (;;) { int count; try { count = inf.inflate(b, off, len); } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } if (count > 0) return count; if (inf.needsDictionary()) throw new ZipException("Need a dictionary"); else if (inf.finished()) return -1; else if (inf.needsInput()) fill(); else throw new InternalError("Don't know what to do"); } }
public int read(byte[] b, int off, int len) throws IOException { for (;;) { int count; try { count = inf.inflate(b, off, len); } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } if (count > 0) return count; if (inf.needsDictionary()) throw new ZipException("Need a dictionary"); else if (inf.finished()) return -1; else if (inf.needsInput()) fill(); else throw new InternalError("Don't know what to do"); } }
1,280
public SwingLabelPeer(SwingToolkit toolkit, Label label) { super(toolkit, label, new JLabel()); final JLabel jLabel = (JLabel)jComponent; this.label = label; SwingToolkit.add(label, jLabel); SwingToolkit.copyAwtProperties(label, jLabel); setText(label.getText()); }
public SwingLabelPeer(SwingToolkit toolkit, Label label) { super(toolkit, label, new JLabel()); final JLabel jLabel = (JLabel)jComponent; this.label = label; SwingToolkit.add(label, jLabel); SwingToolkit.copyAwtProperties(label, jLabel); setText(label.getText()); }
1,281
private static boolean checkScripts() { File directory = new File("scripts"); File directory2 = new File(GlobalConfigure.instance().getProperty( "emulator.settingsDirectory") + "scripts"); return directory.isDirectory() || directory2.isDirectory(); }
private static boolean checkScripts() { File directory = new File("scripts"); File directory2 = new File(GlobalConfigure.getInstance().getProperty( "emulator.settingsDirectory") + "scripts"); return directory.isDirectory() || directory2.isDirectory(); }
1,282
public String getProperty(String key) { return ""; }
public String getProperty(String key) { return ""; }
1,283
public Array setParentArray(Array parentArray) { Log.debug("in XMLDataIOStyle, setParentArray()"); this.parentArray = parentArray; return parentArray; }
protected Array setParentArray(Array parentArray) { Log.debug("in XMLDataIOStyle, setParentArray()"); this.parentArray = parentArray; return parentArray; }
1,284
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
1,285
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //get attribute info //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
1,286
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
1,288
protected void formatDevice(Device device) throws IOException { /* Format the MBR & partitiontable */ GrubBootSector mbr = (GrubBootSector) (createFormatter() .getBootSector()); mbr.getPartition(0).clear(); mbr.getPartition(1).clear(); mbr.getPartition(2).clear(); mbr.getPartition(3).clear(); IBMPartitionTableEntry pte = mbr.getPartition(0); pte.setBootIndicator(true); pte.setStartLba(1); pte.setNrSectors(geom.getTotalSectors() - 1); pte.setSystemIndicator(IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); pte.setStartCHS(geom.getCHS(pte.getStartLba())); pte.setEndCHS(geom.getCHS(pte.getStartLba() + pte.getNrSectors() - 1)); /* * System.out.println("partition table:"); for (int i = 0; i < 4; i++) { * System.out.println("" + i + " " + mbr.getPartition(i)); } */ /* Format partition 0 */ part0 = new MappedBlockDeviceSupport(device, pte.getStartLba() * bytesPerSector, pte.getNrSectors() * bytesPerSector); GrubFatFormatter ff = createFormatter(); ff.setInstallPartition(0x0000FFFF); ff.format(part0); GrubBootSector part0bs = (GrubBootSector) ff.getBootSector(); /* Fixup stage2 sector in MBR */ mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); try { mbr.write((BlockDeviceAPI) device.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on device", ex); } //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); }
protected void formatDevice(Device device) throws IOException { /* Format the MBR & partitiontable */ GrubBootSector mbr = (GrubBootSector) (createFormatter() .getBootSector()); mbr.getPartition(0).clear(); mbr.getPartition(1).clear(); mbr.getPartition(2).clear(); mbr.getPartition(3).clear(); IBMPartitionTableEntry pte = mbr.getPartition(0); pte.setBootIndicator(true); pte.setStartLba(1); pte.setNrSectors(geom.getTotalSectors() - 1); pte.setSystemIndicator(IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); pte.setStartCHS(geom.getCHS(pte.getStartLba())); pte.setEndCHS(geom.getCHS(pte.getStartLba() + pte.getNrSectors() - 1)); /* * System.out.println("partition table:"); for (int i = 0; i < 4; i++) { * System.out.println("" + i + " " + mbr.getPartition(i)); } */ /* Format partition 0 */ part0 = new MappedFSBlockDeviceSupport(device, pte.getStartLba() * bytesPerSector, pte.getNrSectors() * bytesPerSector); GrubFatFormatter ff = createFormatter(); ff.setInstallPartition(0x0000FFFF); ff.format(part0); GrubBootSector part0bs = (GrubBootSector) ff.getBootSector(); /* Fixup stage2 sector in MBR */ mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); try { mbr.write((BlockDeviceAPI) device.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on device", ex); } //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); }
1,289
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolvedFound = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
1,290
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolvedFound++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
1,291
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
1,293
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolved; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
private final void emitObjects(NativeStream os, VmArchitecture arch, Set blockObjects) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); PrintWriter debugOut = null; try { if (debug) { debugOut = new PrintWriter(new FileWriter(debugFile)); } final ObjectEmitter emitter = new ObjectEmitter(clsMgr, os, debugOut, legalInstanceClasses); final long start = System.currentTimeMillis(); int cnt = 0; int lastUnresolved = -1; int loops = 0; while (true) { loops++; compileClasses(os, arch); final Collection objectRefs = new ArrayList(os.getObjectRefs()); int unresolved = 0; // Number of unresolved references found in the following loop int emitted = 0; // Number of emitted objects in the following loop for (Iterator i = objectRefs.iterator(); i.hasNext();) { X86Stream.ObjectRef ref = (X86Stream.ObjectRef) i.next(); if (!ref.isResolved()) { final Object obj = ref.getObject(); if (!(obj instanceof Label)) { unresolved++; if (obj instanceof VmType) { ((VmType) obj).link(); } final boolean skip; if (blockObjects == null) { skip = false; } else { skip = blockObjects.contains(obj); } if (!skip) { //if (obj != skipMe) { emitter.emitObject(obj); emitted++; X86Stream.ObjectRef newRef = os.getObjectRef(obj); if (ref != newRef) { throw new RuntimeException("Object has changed during emitObject! type=" + obj.getClass().getName()); } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? "null" : obj.getClass().getName())); } } } } } if (unresolved == lastUnresolved) { if ((unresolved == 0) || (blockObjects != null)) { break; } } lastUnresolved = unresolvedFound; cnt += emitted; } final long end = System.currentTimeMillis(); log("Emitted " + cnt + " objects, took " + (end - start) + "ms in " + loops + " loops"); if (debugOut != null) { debugOut.close(); debugOut = null; } } catch (ClassNotFoundException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } }
1,294
public final void execute() throws BuildException { final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); // Create the VM final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr)); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[i].getName(), systemClasses[i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(vm.getHeapManager().getClass()); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } for (Iterator i = BootClasses.values().iterator(); i.hasNext();) { BootClassInfo bci = (BootClassInfo) i.next(); if (!bci.isPackage()) { clsMgr.loadClass(bci.getName(), true); } } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); // Turn auto-compilation on clsMgr.setCompileRequired(); // Emit the remaining objects emitObjects(os, arch, null); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os.startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(); log("Done."); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
public final void execute() throws BuildException { final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); // Create the VM final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr)); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[i].getName(), systemClasses[i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(vm.getHeapManager().getClass()); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } for (Iterator i = BootClasses.values().iterator(); i.hasNext();) { BootClassInfo bci = (BootClassInfo) i.next(); if (!bci.isPackage()) { clsMgr.loadClass(bci.getName(), true); } } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); // Turn auto-compilation on clsMgr.setCompileRequired(); // Emit the remaining objects emitObjects(os, arch, null); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os.startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(); log("Done."); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
1,296
public final void execute() throws BuildException { final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); // Create the VM final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr)); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[i].getName(), systemClasses[i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(vm.getHeapManager().getClass()); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } for (Iterator i = BootClasses.values().iterator(); i.hasNext();) { BootClassInfo bci = (BootClassInfo) i.next(); if (!bci.isPackage()) { clsMgr.loadClass(bci.getName(), true); } } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); // Turn auto-compilation on clsMgr.setCompileRequired(); // Emit the remaining objects emitObjects(os, arch, null); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os.startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(); log("Done."); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
public final void execute() throws BuildException { final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); // Create the VM final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr)); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[i].getName(), systemClasses[i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(vm.getHeapManager().getClass()); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } for (Iterator i = BootClasses.values().iterator(); i.hasNext();) { BootClassInfo bci = (BootClassInfo) i.next(); if (!bci.isPackage()) { clsMgr.loadClass(bci.getName(), true); } } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); // Turn auto-compilation on clsMgr.setCompileRequired(); // Emit the remaining objects emitObjects(os, arch, null); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os.startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses, clsMgr.getStatics()); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(); log("Done."); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
1,297
protected final void printLabels(NativeStream os, VmType[] bootClasses) throws BuildException, UnresolvedObjectRefException { try { int unresolvedCount = 0; final PrintWriter w = new PrintWriter(new FileWriter(listFile)); // Print a list of boot classes. for (int i = 0; i < bootClasses.length; i++) { final VmType vmClass = bootClasses[i]; w.print("bootclass "); w.print(i); w.print(": "); w.print(vmClass.getName()); if (vmClass instanceof VmClassType) { final int cnt = ((VmClassType) vmClass).getInstanceCount(); if (cnt > 0) { w.print(", "); w.print(cnt); w.print(" instances"); } } int cnt = vmClass.getNoInterfaces(); if (cnt > 0) { w.print(", "); w.print(cnt); w.print(" interfaces"); } w.print(vmClass.isInitialized() ? "" : ", not initialized"); w.println(); } w.println(); // Look for unresolved labels and put all resolved // label into the sorted map. This will be used later // to print to the listing file. final Collection xrefs = os.getObjectRefs(); final SortedMap map = new TreeMap(); for (Iterator i = xrefs.iterator(); i.hasNext();) { NativeStream.ObjectRef ref; ref = (NativeStream.ObjectRef) i.next(); if (!ref.isResolved()) { StringBuffer buf = new StringBuffer(); buf.append(" $" + Integer.toHexString(ref.getOffset())); buf.append("\t" + ref.getObject()); System.err.println("Unresolved label " + buf.toString()); unresolvedCount++; } else { map.put(new Integer(ref.getOffset()), ref); } } if (unresolvedCount > 0) { throw new BuildException("There are " + unresolvedCount + " unresolved labels"); } // Print the listing file. for (Iterator i = map.values().iterator(); i.hasNext();) { final NativeStream.ObjectRef ref; ref = (NativeStream.ObjectRef) i.next(); final Object object = ref.getObject(); w.print('$'); w.print(hex(ref.getOffset() + os.getBaseAddr())); w.print('\t'); w.print(object); w.print(" ("); if (object instanceof VmSystemObject) { final String info = ((VmSystemObject) object).getExtraInfo(); if (info != null) { w.print(info); w.print(", "); } } w.print(object.getClass().getName()); w.println(')'); } w.close(); } catch (IOException ex) { throw new BuildException("Writing list", ex); } }
protected final void printLabels(NativeStream os, VmType[] bootClasses, VmStatics statics) throws BuildException, UnresolvedObjectRefException { try { int unresolvedCount = 0; final PrintWriter w = new PrintWriter(new FileWriter(listFile)); // Print a list of boot classes. for (int i = 0; i < bootClasses.length; i++) { final VmType vmClass = bootClasses[i]; w.print("bootclass "); w.print(i); w.print(": "); w.print(vmClass.getName()); if (vmClass instanceof VmClassType) { final int cnt = ((VmClassType) vmClass).getInstanceCount(); if (cnt > 0) { w.print(", "); w.print(cnt); w.print(" instances"); } } int cnt = vmClass.getNoInterfaces(); if (cnt > 0) { w.print(", "); w.print(cnt); w.print(" interfaces"); } w.print(vmClass.isInitialized() ? "" : ", not initialized"); w.println(); } w.println(); // Look for unresolved labels and put all resolved // label into the sorted map. This will be used later // to print to the listing file. final Collection xrefs = os.getObjectRefs(); final SortedMap map = new TreeMap(); for (Iterator i = xrefs.iterator(); i.hasNext();) { NativeStream.ObjectRef ref; ref = (NativeStream.ObjectRef) i.next(); if (!ref.isResolved()) { StringBuffer buf = new StringBuffer(); buf.append(" $" + Integer.toHexString(ref.getOffset())); buf.append("\t" + ref.getObject()); System.err.println("Unresolved label " + buf.toString()); unresolvedCount++; } else { map.put(new Integer(ref.getOffset()), ref); } } if (unresolvedCount > 0) { throw new BuildException("There are " + unresolvedCount + " unresolved labels"); } // Print the listing file. for (Iterator i = map.values().iterator(); i.hasNext();) { final NativeStream.ObjectRef ref; ref = (NativeStream.ObjectRef) i.next(); final Object object = ref.getObject(); w.print('$'); w.print(hex(ref.getOffset() + os.getBaseAddr())); w.print('\t'); w.print(object); w.print(" ("); if (object instanceof VmSystemObject) { final String info = ((VmSystemObject) object).getExtraInfo(); if (info != null) { w.print(info); w.print(", "); } } w.print(object.getClass().getName()); w.println(')'); } w.close(); } catch (IOException ex) { throw new BuildException("Writing list", ex); } }
1,298
public Session openSession(Properties sesProps, String configurationResource , String sessionName) {// throws TN5250jException { sesProps.put(SESSION_NAME,sessionName); if (configurationResource == null) configurationResource = ""; sesProps.put(SESSION_CONFIG_RESOURCE ,configurationResource); Session newSession = new Session(me,sesProps,configurationResource,sessionName); sessions.addSession(newSession); return newSession; }
public Session openSession(Properties sesProps, String configurationResource , String sessionName) {// throws TN5250jException { if(sessionName == null) sesProps.put(SESSION_TERM_NAME,sesProps.getProperty(SESSION_HOST)); else sesProps.put(SESSION_TERM_NAME,sessionName); if (configurationResource == null) configurationResource = ""; sesProps.put(SESSION_CONFIG_RESOURCE ,configurationResource); Session newSession = new Session(me,sesProps,configurationResource,sessionName); sessions.addSession(newSession); return newSession; }
1,300
public Session item (String sessionName) { Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; }
public Session item (int index) { Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; }
1,301
public Session item (String sessionName) { Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; }
public Session item (String sessionName) { Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; }
1,302
public PluginException(String message, Throwable cause) { super(message, cause); }
public PluginException(String message, Throwable cause) { super(message, cause); }
1,305
public GetPropertyAction(String key, String defaultValue) { this.key = key; this.defaultValue = defaultValue; }
public GetPropertyAction(String key, String defaultValue) { this.key = key; this.defaultValue = defaultValue; }
1,306
public String getUIClassID() { return uiClassID; }
public String getUIClassID() { return "MenuItemUI"; }
1,307
protected String paramString() { return "JMenuItem"; }
protected String paramString() { return super.paramString(); }
1,308
final void pushExitStack(VirtualStack vstack) { vstack.reset(); //vstack.pushAll(outerMethodStack); vstack.pushAll(exitStack); }
final void pushExitStack(ItemFactory ifac, VirtualStack vstack) { vstack.reset(); //vstack.pushAll(outerMethodStack); vstack.pushAll(exitStack); }
1,310
final void pushExitStack(VirtualStack vstack) { vstack.reset(); //vstack.pushAll(outerMethodStack); vstack.pushAll(exitStack); }
final void pushExitStack(VirtualStack vstack) { vstack.reset(); //vstack.pushAll(outerMethodStack); vstack.pushAll(ifac, exitStack); }
1,311
final void pushOuterMethodStack(VirtualStack vstack) { vstack.pushAll(outerMethodStack); }
final void pushOuterMethodStack(VirtualStack vstack) { vstack.pushAll(outerMethodStack); }
1,312
public static ItemListener add(ItemListener a, ItemListener b) { return (ItemListener) addInternal(a, b); }
public static ComponentListener add(ComponentListener a, ComponentListener b) { return (ItemListener) addInternal(a, b); }
1,313
public static ItemListener add(ItemListener a, ItemListener b) { return (ItemListener) addInternal(a, b); }
public static ItemListener add(ItemListener a, ItemListener b) { return (ComponentListener) addInternal(a, b); }
1,314
void dispatchEventImpl(AWTEvent e) { if (eventTypeEnabled (e.id)) processEvent(e); }
void dispatchEventImpl(AWTEvent e) { if (eventTypeEnabled (e.id)) processEvent(e); }
1,315
protected String paramString() { StringBuffer param = new StringBuffer(); String name = getName(); if (name != null) param.append(name).append(","); param.append(width).append("x").append(height).append("+").append(x) .append("+").append(y); if (! isValid()) param.append(",invalid"); if (! isVisible()) param.append(",invisible"); if (! isEnabled()) param.append(",disabled"); if (! isOpaque()) param.append(",translucent"); if (isDoubleBuffered()) param.append(",doublebuffered"); return param.toString(); }
protected String paramString() { StringBuffer param = new StringBuffer(); String name = getName(); if (name != null) param.append(name).append(","); param.append(width).append("x").append(height).append("+").append(x) .append("+").append(y); if (! isValid()) param.append(",invalid"); if (! isVisible()) param.append(",invisible"); if (! isEnabled()) param.append(",disabled"); if (! isOpaque()) param.append(",translucent"); if (isDoubleBuffered()) param.append(",doublebuffered"); return param.toString(); }
1,316
public static ItemListener remove(ItemListener l, ItemListener oldl) { return (ItemListener) removeInternal(l, oldl); }
protected EventListener remove(EventListener oldl) { return (ItemListener) removeInternal(l, oldl); }
1,317
public static ItemListener remove(ItemListener l, ItemListener oldl) { return (ItemListener) removeInternal(l, oldl); }
public static ItemListener remove(ItemListener l, ItemListener oldl) { if (a == oldl) return b; if (b == oldl) return a; if (a instanceof AWTEventMulticaster) { EventListener newa = ((AWTEventMulticaster) a).remove(oldl); if (newa != a) return new AWTEventMulticaster(newa, b); } if (b instanceof AWTEventMulticaster) { EventListener newb = ((AWTEventMulticaster) b).remove(oldl); if (newb != b) return new AWTEventMulticaster(a, newb); } return this; }
1,318
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { os.set32(fldOffset, 0); } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
1,319
public static void warn(String msg) { log(WARN, System.out, msg, null); }
public static void warn(String msg) { log(WARN, System.out, msg, null); }
1,320
public Object clone() throws CloneNotSupportedException { return super.clone(); }
public Object clone() throws CloneNotSupportedException { BaseMac result = (BaseMac) super.clone(); if (this.underlyingHash != null) result.underlyingHash = (IMessageDigest) this.underlyingHash.clone(); return result; }
1,324
public Number evaluate (Number value) { //NOT IMPLEMENTED YET return (Number) new Integer("0"); }
public double evaluate (double value) { //NOT IMPLEMENTED YET return (Number) new Integer("0"); }
1,325
public Number evaluate (Number value) { //NOT IMPLEMENTED YET return (Number) new Integer("0"); }
public Number evaluate (Number value) { //NOT IMPLEMENTED YET return value; }
1,326
protected void init() { resetAttributes(); classXDFNodeName = "conversion"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,COMPONENTLIST_XML_ATTRIBUTE_NAME); attribHash.put(COMPONENTLIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); }
protected void init() { super.init(); classXDFNodeName = "conversion"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,COMPONENTLIST_XML_ATTRIBUTE_NAME); attribHash.put(COMPONENTLIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); }
1,327