rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
if (bb.isDirect()) this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
|
CharViewBufferImpl (ByteBuffer bb, int capacity) { super (capacity, capacity, 0, -1); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); }
|
|
if (bb.isDirect()) this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
|
DoubleViewBufferImpl (ByteBuffer bb, int capacity) { super (capacity, capacity, 0, -1); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); }
|
|
if (bb.isDirect()) this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
|
FloatViewBufferImpl (ByteBuffer bb, int capacity) { super (capacity, capacity, 0, -1); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); }
|
|
if (bb.isDirect()) this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
|
IntViewBufferImpl (ByteBuffer bb, int capacity) { super (capacity, capacity, 0, -1); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); }
|
|
if (bb.isDirect()) this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
|
LongViewBufferImpl (ByteBuffer bb, int capacity) { super (capacity, capacity, 0, -1); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); }
|
|
if (bb.isDirect()) this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
|
ShortViewBufferImpl (ByteBuffer bb, int capacity) { super (capacity, capacity, 0, -1); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); }
|
|
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); p.setBackground(defaults.getColor("Panel.background"));
|
LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", "Panel.font");
|
public void installDefaults(JPanel p) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); p.setBackground(defaults.getColor("Panel.background")); p.setOpaque(true); }
|
MonitorManager.initialize();
|
public static void initialize() { if (!inited) { // Initialize resource manager final ResourceManager rm = ResourceManagerImpl.initialize(); VmSystem.out = getSystemOut(); /* Initialize the system classloader */ VmSystemClassLoader loader = (VmSystemClassLoader) (getVmClass(VmProcessor.current()).getLoader()); systemLoader = loader; loader.initialize(); // Initialize VmThread VmThread.initialize(); /* Initialize the monitor system */ MonitorManager.initialize(); final Vm vm = Vm.getVm(); // Initialize the monitors for the heap manager Vm.getHeapManager().start(); // Find & start all processors vm.initializeProcessors(rm); /* We're done initializing */ inited = true; VmProcessor.current().systemReadyForThreadSwitch(); // Load the command line final Properties props = System.getProperties(); props.setProperty("jnode.cmdline", getCmdLine()); // Make sure that we have the default locale, // otherwise String.toLowerCase fails because it needs itself // via Locale.getDefault. Locale.getDefault(); // Calibrate the processors VmProcessor.current().calibrate(); // Load the initial jarfile initJar = loadInitJar(rm); // Initialize log4j final Logger root = Logger.getRootLogger(); final ConsoleAppender infoApp = new ConsoleAppender( new PatternLayout(LAYOUT)); root.addAppender(infoApp); } }
|
|
static public List<String> getEntryNames(Iterator<FSEntry> it) {
|
static public List<String> getEntryNames(Iterator<? extends FSEntry> it) {
|
static public List<String> getEntryNames(Iterator<FSEntry> it) { List<String> names = new ArrayList<String>(); while (it.hasNext()) { FSEntry entry = it.next(); names.add((entry == null) ? null : entry.getName()); } return names; }
|
static public void listEntries(Iterator<FSEntry> iterator) throws Exception {
|
static public void listEntries(Iterator<? extends FSEntry> iterator) throws Exception {
|
static public void listEntries(Iterator<FSEntry> iterator) throws Exception { log.debug("<<< BEGIN listEntries >>>"); int i = 0; log.debug("------- entries ------"); while (iterator.hasNext()) { FSEntry entry = iterator.next(); log.debug(i + ":" + entry); i++; } log.debug("--- End of entries ---"); log.debug("<<< END listEntries >>>"); }
|
static public String toString(List<String> list) { StringBuffer sb = new StringBuffer("["); for (int i = 0; i < list.size(); i++) { if (i > 0) { sb.append(", "); } sb.append(list.get(i)); } sb.append("]"); return sb.toString();
|
static public String toString(String filename, int offset, int length) throws IOException { File file = new File(filename); FileInputStream input = new FileInputStream(file); byte[] data = new byte[length]; int nb = input.read(data); String dump = FSUtils.toString(data, 0, nb); input.close(); return dump;
|
static public String toString(List<String> list) { StringBuffer sb = new StringBuffer("["); for (int i = 0; i < list.size(); i++) { if (i > 0) { sb.append(", "); } sb.append(list.get(i)); } sb.append("]"); return sb.toString(); }
|
columnModel.addColumnModelListener(this);
|
public void setColumnModel(TableColumnModel c) { columnModel = c; }
|
|
public void addActionListener(ActionListener l) { actions.addElement(l); }
|
public void addActionListener(ActionListener l) { listenerList.add(ActionListener.class, l); }
|
public void addActionListener(ActionListener l) { // comp.enableEvents( AWTEvent.ACTION_EVENT_MASK ); actions.addElement(l); }
|
public void addChangeListener(ChangeListener l) { changes.addElement(l); }
|
public void addChangeListener(ChangeListener l) { listenerList.add(ChangeListener.class, l); }
|
public void addChangeListener(ChangeListener l) { changes.addElement(l); }
|
public void addItemListener(ItemListener l) { items.addElement(l); }
|
public void addItemListener(ItemListener l) { listenerList.add(ItemListener.class, l); }
|
public void addItemListener(ItemListener l) { items.addElement(l); }
|
public void fireItemStateChanged(ItemEvent event) { for (int i = 0; i < items.size(); i++) { ItemListener a = (ItemListener) items.get(i); a.itemStateChanged(event); } }
|
public void fireItemStateChanged(ItemEvent e) { EventListener[] ll = listenerList.getListeners(ItemListener.class); for (int i = 0; i < ll.length; i++) ((ItemListener)ll[i]).itemStateChanged(e); }
|
public void fireItemStateChanged(ItemEvent event) { for (int i = 0; i < items.size(); i++) { ItemListener a = (ItemListener) items.get(i); a.itemStateChanged(event); } }
|
public void fireStateChanged(ChangeEvent event) { for (int i = 0; i < changes.size(); i++) { ChangeListener a = (ChangeListener) changes.get(i); a.stateChanged(event); } }
|
public void fireStateChanged(ChangeEvent e) { EventListener[] ll = listenerList.getListeners(ChangeListener.class); for (int i = 0; i < ll.length; i++) ((ChangeListener)ll[i]).stateChanged(e); }
|
public void fireStateChanged(ChangeEvent event) { for (int i = 0; i < changes.size(); i++) { ChangeListener a = (ChangeListener) changes.get(i); a.stateChanged(event); } }
|
public String getActionCommand() { return com; }
|
public String getActionCommand() { return actionCommand; }
|
public String getActionCommand() { return com; }
|
public int getMnemonic() { return mne; }
|
public int getMnemonic() { return mnemonic; }
|
public int getMnemonic() { return mne; }
|
public boolean isRollover() { return roll; }
|
public boolean isRollover() { return (stateMask & ROLLOVER) == ROLLOVER; }
|
public boolean isRollover() { return roll; }
|
public void removeActionListener(ActionListener l) { actions.removeElement(l); }
|
public void removeActionListener(ActionListener l) { listenerList.remove(ActionListener.class, l); }
|
public void removeActionListener(ActionListener l) { actions.removeElement(l); }
|
public void removeChangeListener(ChangeListener l) { changes.removeElement(l); }
|
public void removeChangeListener(ChangeListener l) { listenerList.remove(ChangeListener.class, l); }
|
public void removeChangeListener(ChangeListener l) { changes.removeElement(l); }
|
public void removeItemListener(ItemListener l) { items.removeElement(l); }
|
public void removeItemListener(ItemListener l) { listenerList.remove(ItemListener.class, l); }
|
public void removeItemListener(ItemListener l) { items.removeElement(l); }
|
public void setActionCommand(String s) { com = s; }
|
public void setActionCommand(String s) { if (actionCommand != s) { actionCommand = s; fireStateChanged(changeEvent); } }
|
public void setActionCommand(String s) { com = s; }
|
public void setArmed(boolean b) { arm = b; }
|
public void setArmed(boolean a) { changeState(ARMED, a); }
|
public void setArmed(boolean b) { arm = b; }
|
public void setEnabled(boolean b) { enabled = b; }
|
public void setEnabled(boolean e) { changeState(ENABLED, e); }
|
public void setEnabled(boolean b) { enabled = b; }
|
public void setGroup(ButtonGroup group) { this.group = group; }
|
public void setGroup(ButtonGroup g) { if (group != g) { group = g; fireStateChanged(changeEvent); } }
|
public void setGroup(ButtonGroup group) { this.group = group; }
|
public void setMnemonic(int key) { mne = key; }
|
public void setMnemonic(int key) { if (mnemonic != key) { mnemonic = key; fireStateChanged(changeEvent); } }
|
public void setMnemonic(int key) { mne = key; }
|
public void setRollover(boolean b) { roll = b; }
|
public void setRollover(boolean r) { changeState(ROLLOVER, r); }
|
public void setRollover(boolean b) { roll = b; }
|
vstack.loadLocal(eContext, disp);
|
public final void visit_astore(int index) { int disp = stackFrame.getEbpOffset(index); RefItem i = vstack.popRef(); //TODO: implement writeMOV_Const(reg, disp, object); i.load(eContext);// i.loadIf(eContext, ~Item.CONSTANT);//// if (i.getKind() == Item.CONSTANT) {// os.writeMOV_Const(FP, disp, i.getValue());// } else { os.writeMOV(INTSIZE, FP, disp, i.getRegister()); i.release(eContext);// } }
|
|
vstack.loadLocal(eContext, ebpOfs);
|
public final void visit_dstore(int index) { //TODO: port to orp-style Item val = vstack.popItem(Item.DOUBLE); val.push(eContext); val.release(eContext); int ebpOfs = stackFrame.getWideEbpOffset(index); helper.writePOP64(Register.EAX, Register.EDX); os.writeMOV(INTSIZE, FP, ebpOfs, Register.EAX); os.writeMOV(INTSIZE, FP, ebpOfs + 4, Register.EDX); }
|
|
vstack.loadLocal(eContext, ebpOfs);
|
public final void visit_fstore(int index) { //TODO: port to orp-style vstack.push(eContext); Item v1 = vstack.popItem(Item.FLOAT); v1.release(eContext); int ebpOfs = stackFrame.getEbpOffset(index); helper.writePOP(FP, ebpOfs); }
|
|
vstack.loadLocal(eContext, index);
|
final int ebpOfs = stackFrame.getEbpOffset(index);
|
public final void visit_iinc(int index, int incValue) { vstack.loadLocal(eContext, index); // avoid aliasing throubles final int ebpOfs = stackFrame.getEbpOffset(index); X86RegisterPool pool = eContext.getPool(); final Register r = (Register)pool.request(Item.INT); //IMPROVE: use INC or ADD reg, 1 os.writeMOV_Const(r, incValue); os.writeADD(FP, ebpOfs, r); pool.release(r); }
|
final int ebpOfs = stackFrame.getEbpOffset(index);
|
vstack.loadLocal(eContext, ebpOfs);
|
public final void visit_iinc(int index, int incValue) { vstack.loadLocal(eContext, index); // avoid aliasing throubles final int ebpOfs = stackFrame.getEbpOffset(index); X86RegisterPool pool = eContext.getPool(); final Register r = (Register)pool.request(Item.INT); //IMPROVE: use INC or ADD reg, 1 os.writeMOV_Const(r, incValue); os.writeADD(FP, ebpOfs, r); pool.release(r); }
|
vstack.loadLocal(eContext, disp);
|
public final void visit_istore(int index) { final int disp = stackFrame.getEbpOffset(index); IntItem i = vstack.popInt(); i.loadIf(eContext, ~Item.CONSTANT); if (i.getKind() == Item.CONSTANT) { os.writeMOV_Const(FP, disp, i.getValue()); } else { os.writeMOV(INTSIZE, FP, disp, i.getRegister()); i.release(eContext); } }
|
|
vstack.loadLocal(eContext, ebpOfs);
|
public final void visit_lstore(int index) { //TODO: port to orp-style vstack.push(eContext); Item v = vstack.popItem(Item.LONG); v.release(eContext); int ebpOfs = stackFrame.getWideEbpOffset(index); helper.writePOP64(T0, T1); os.writeMOV(INTSIZE, FP, ebpOfs, T0); os.writeMOV(INTSIZE, FP, ebpOfs + 4, T1); }
|
|
os.writeLEA(Register.ESP, Register.EBP, -(noLocalVars * 4));
|
if (noLocalVars < 0) { System.out.println("@#@#@#@# noLocalVars = " + noLocalVars); } final int ofs = Math.max(0, noLocalVars) * 4; os.writeLEA(Register.ESP, Register.EBP, -ofs);
|
public void emitTrailer(int maxLocals) { final int argSlotCount = method.getArgSlotCount(); final Label stackOverflowLabel = helper.genLabel("$$stack-overflow"); // Begin footer // Now start the actual footer os.setObjectRef(footerLabel); /* Go restore the previous current frame */ emitSynchronizationCode(context.getMonitorExitMethod()); os.writeLEA(Register.ESP, Register.EBP, EbpFrameRefOffset); os.writePOP(Register.EBP); restoreRegisters(); // Return if (argSlotCount > 0) { os.writeRET(argSlotCount * 4); } else { os.writeRET(); } // End footer // Begin header // Init starts here os.setObjectRef(initLabel); // Test stack overflow final int stackEndOffset = context.getVmProcessorStackEnd().getOffset(); os.writePrefix(X86Constants.FS_PREFIX); os.writeCMP_MEM(Register.ESP, stackEndOffset); os.writeJCC(stackOverflowLabel, X86Constants.JLE); // Create class initialization code (if needed) helper.writeClassInitialize(method, EAX, ECX); // Increment the invocation count helper.writeIncInvocationCount(EAX); // Fixed framelayout saveRegisters(); os.writePUSH(Register.EBP); os.writePUSH(context.getMagic()); //os.writePUSH(0); // PC, which is only used in interpreted methods /** EAX MUST contain the VmMethod structure upon entry of the method */ os.writePUSH(Register.EAX); os.writeMOV(INTSIZE, Register.EBP, Register.ESP); // Emit the code to create the locals final int noLocalVars = maxLocals - argSlotCount; // Create and clear all local variables if (noLocalVars > 0) { os.writeXOR(Register.EAX, Register.EAX); for (int i = 0; i < noLocalVars; i++) { os.writePUSH(Register.EAX); } } // Load the statics table reference if (method.canThrow(LoadStaticsPragma.class)) { helper.writeLoadSTATICS(helper.genLabel("$$edi"), "init", false); } /* Create the synchronization enter code */ emitSynchronizationCode(context.getMonitorEnterMethod()); // And jump back to the actual code start os.writeJMP(startCodeLabel); // Write stack overflow code os.setObjectRef(stackOverflowLabel); os.writeINT(0x31); // End header // No set the exception start&endPtr's //final int noLocals = bc.getNoLocals(); //final int noLocalVars = noLocals - noArgs; final int count = bc.getNoExceptionHandlers(); CompiledExceptionHandler[] ceh = new CompiledExceptionHandler[count]; for (int i = 0; i < count; i++) { final VmInterpretedExceptionHandler eh = bc.getExceptionHandler(i); final Label handlerLabel = helper.genLabel("$$ex-handler" + i); final ObjectRef handlerRef = os.setObjectRef(handlerLabel); /** Clear the calculation stack (only locals are left) */ os.writeLEA(Register.ESP, Register.EBP, -(noLocalVars * 4)); /** Push the exception in EAX */ os.writePUSH(Register.EAX); /** Goto the real handler */ os.writeJMP(helper.getInstrLabel(eh.getHandlerPC())); ceh[i] = new CompiledExceptionHandler(); ceh[i].setStartPc(os.getObjectRef(helper.getInstrLabel(eh .getStartPC()))); ceh[i].setEndPc(os .getObjectRef(helper.getInstrLabel(eh.getEndPC()))); ceh[i].setHandler(handlerRef); } cm.setExceptionHandlers(ceh); // Now create the default exception handler Label handlerLabel = helper.genLabel("$$def-ex-handler"); cm.setDefExceptionHandler(os.setObjectRef(handlerLabel)); emitSynchronizationCode(context.getMonitorExitMethod()); os.writeLEA(Register.ESP, Register.EBP, EbpFrameRefOffset); os.writePOP(Register.EBP); restoreRegisters(); /** * Do not do a ret here, this way the return address will be used by * vm_athrow as its return address */ helper.writeJumpTableJMP(X86JumpTable.VM_ATHROW_NOTRACE_OFS); //os.writeJMP(helper.VM_ATHROW_NOTRACE); codeObject.markEnd(); cm.setCodeEnd(os.setObjectRef(helper.genLabel("$$end-code-object"))); }
|
this.labelPrefix = curInstrLabel + "_" + inlinedMethod + "_";
|
this.labelPrefix = curInstrLabel + "_" + inlinedMethod.getName() + "_";
|
public void startInlinedMethod(VmMethod inlinedMethod, Label curInstrLabel) { this.labelPrefix = curInstrLabel + "_" + inlinedMethod + "_"; this.instrLabelPrefix = labelPrefix + "_bci_"; this.addressLabels.clear(); }
|
void loadLocal(EmitterContext ec, int index) {
|
void loadLocal(EmitterContext ec, int offsetToFP) {
|
void loadLocal(EmitterContext ec, int index) { for (int i = 0; i < tos; i++) { final Item item = stack[i]; if ((item.getKind() == Item.LOCAL) && (item.getOffsetToFP() == index)) item.load(ec); } }
|
if ((item.getKind() == Item.LOCAL) && (item.getOffsetToFP() == index))
|
if ((item.getKind() == Item.LOCAL) && (item.getOffsetToFP() == offsetToFP))
|
void loadLocal(EmitterContext ec, int index) { for (int i = 0; i < tos; i++) { final Item item = stack[i]; if ((item.getKind() == Item.LOCAL) && (item.getOffsetToFP() == index)) item.load(ec); } }
|
"Button.margin", new InsetsUIResource(2, 14, 2, 14),
|
"Button.margin", new InsetsUIResource(2, 2, 2, 2),
|
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x66, 0x66, 0x99); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.lightGray), "Button.border", BorderUIResource.getEtchedBorderUIResource(), "Button.darkShadow", new ColorUIResource(Color.darkGray), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.focus", midPurple, "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.black), "Button.highlight", new ColorUIResource(Color.white), "Button.light", new ColorUIResource(Color.lightGray.brighter()), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.shadow", new ColorUIResource(Color.gray), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(Color.lightGray), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.darkShadow", new ColorUIResource(Color.darkGray), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(Color.black), "CheckBox.highlight", new ColorUIResource(Color.white), "CheckBox.icon", BasicIconFactory.getCheckBoxIcon(), "CheckBox.light", new ColorUIResource(Color.lightGray.brighter()), "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.shadow", new ColorUIResource(Color.gray), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(Color.black), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(Color.lightGray), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(Color.black), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(lightPurple), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.black), "ColorChooser.background", new ColorUIResource(Color.lightGray), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(Color.black), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(Color.lightGray), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(Color.white), "ComboBox.disabledBackground", new ColorUIResource(Color.lightGray), "ComboBox.disabledForeground", new ColorUIResource(Color.gray), "ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(lightPurple), "ComboBox.selectionForeground", new ColorUIResource(Color.black), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(175, 163, 236), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.red), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.lightGray), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "FocusManagerClassName", "TODO", "FormView.resetButtonText", "Reset", "FormView.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(162, 167, 241), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.black), "InternalFrame.border", new BorderUIResource.CompoundBorderUIResource(null, null), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // XXX Don't use gif "InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")), "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.lightGray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.black), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(Color.lightGray), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(Color.gray), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(Color.black), "List.background", new ColorUIResource(Color.white), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(Color.black), "List.selectionBackground", new ColorUIResource(0xCC, 0xCC, 0xFF), "List.selectionForeground", new ColorUIResource(Color.black), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(Color.black), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(Color.lightGray), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(Color.black), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(lightPurple), "Menu.selectionForeground", new ColorUIResource(Color.black), "MenuBar.background", new ColorUIResource(Color.lightGray), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(Color.black), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(Color.black), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(Color.lightGray), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(Color.black), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(lightPurple), "MenuItem.selectionForeground", new ColorUIResource(Color.black), "OptionPane.background", new ColorUIResource(Color.lightGray), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif "OptionPane.errorIcon", new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(Color.black), // XXX Don't use gif "OptionPane.informationIcon", new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(Color.black), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif "OptionPane.questionIcon", new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif "OptionPane.warningIcon", new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(Color.lightGray), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(Color.white), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(lightPurple), "PasswordField.selectionForeground", new ColorUIResource(Color.black), "PopupMenu.background", new ColorUIResource(Color.lightGray), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(Color.black), "ProgressBar.background", new ColorUIResource(Color.lightGray), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(midPurple), "ProgressBar.selectionBackground", new ColorUIResource(lightPurple), "ProgressBar.selectionForeground", new ColorUIResource(Color.lightGray), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(Color.lightGray), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(Color.darkGray), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(Color.black), "RadioButton.highlight", new ColorUIResource(Color.white), "RadioButton.icon", BasicIconFactory.getRadioButtonIcon(), "RadioButton.light", new ColorUIResource(Color.lightGray.brighter()), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(Color.gray), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(Color.black), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(Color.lightGray), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(Color.black), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(lightPurple), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.black), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(Color.lightGray), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(Color.lightGray), "ScrollBar.thumbDarkShadow", new ColorUIResource(Color.black), "ScrollBar.thumbHighlight", new ColorUIResource(Color.white), "ScrollBar.thumbLightShadow", new ColorUIResource(Color.gray), "ScrollBar.track", new ColorUIResource(224, 224, 224), "ScrollBar.trackHighlight", new ColorUIResource(Color.black), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(Color.lightGray), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(Color.black), "Separator.background", new ColorUIResource(Color.white), "Separator.foreground", new ColorUIResource(Color.gray), "Separator.highlight", new ColorUIResource(Color.white), "Separator.shadow", new ColorUIResource(Color.gray), "Slider.background", new ColorUIResource(Color.lightGray), "Slider.focus", new ColorUIResource(Color.black), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(Color.lightGray), "Slider.highlight", new ColorUIResource(Color.white), "Slider.shadow", new ColorUIResource(Color.gray), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(10), "Slider.tickHeight", new Integer(12), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(Color.lightGray), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(Color.white), "SplitPane.shadow", new ColorUIResource(Color.gray), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(Color.LIGHT_GRAY), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(Color.darkGray), "TabbedPane.focus", new ColorUIResource(Color.black), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(Color.black), "TabbedPane.highlight", new ColorUIResource(Color.lightGray), "TabbedPane.lightHighlight", new ColorUIResource(Color.white), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(Color.gray), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(Color.white), "Table.focusCellBackground", new ColorUIResource(Color.white), "Table.focusCellForeground", new ColorUIResource(Color.black), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(Color.white), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(Color.black), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(lightPurple), "Table.selectionForeground", new ColorUIResource(Color.black), "TableHeader.background", new ColorUIResource(Color.lightGray), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(Color.black), "TextArea.background", new ColorUIResource(Color.white), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(lightPurple), "TextArea.selectionForeground", new ColorUIResource(Color.black), "TextField.background", new ColorUIResource(Color.white), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(lightPurple), "TextField.selectionForeground", new ColorUIResource(Color.black), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.lightGray), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(Color.black), "ToggleButton.background", new ColorUIResource(Color.lightGray), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(Color.black), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(Color.lightGray), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.dockingBackground", new ColorUIResource(Color.lightGray), "ToolBar.dockingForeground", new ColorUIResource(11, 30, 143), "ToolBar.floatingBackground", new ColorUIResource(Color.lightGray), "ToolBar.floatingForeground", new ColorUIResource(113, 171, 212), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(Color.black), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolTip.background", new ColorUIResource(122, 178, 241), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(Color.black), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(Color.white), "Tree.changeSelectionWithFocus", Boolean.TRUE, "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")), "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.expandedIcon", new IconUIResource(new ImageIcon("icons/TreeExpanded.png")), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(Color.gray), "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.png")), "Tree.leftChildIndent", new Integer(7), "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.png")), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(lightPurple), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(Color.black), "Tree.textBackground", new ColorUIResource(Color.lightGray), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(Color.lightGray), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12), }; defaults.putDefaults(uiDefaults); }
|
public static Border getEtchedBorderUIResource() { return null; }
|
public static Border getEtchedBorderUIResource() { if (etchedBorderUIResource == null) etchedBorderUIResource = new EtchedBorderUIResource(); return etchedBorderUIResource; }
|
public static Border getEtchedBorderUIResource() { return null; }
|
if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTreeUI instance; if (o == null) { instance = new MetalTreeUI(); instances.put(component, instance); } else instance = (MetalTreeUI) o; return instance;
|
return new MetalTreeUI();
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTreeUI instance; if (o == null) { instance = new MetalTreeUI(); instances.put(component, instance); } else instance = (MetalTreeUI) o; return instance; }
|
public final void copy(Address src, Address dst, int size) {
|
public final void copy(Address src, Address dst, Extent size) {
|
public final void copy(Address src, Address dst, int size) { Unsafe.copy(src, dst, size); }
|
throw new IOException(ex);
|
final IOException ioe = new IOException("BlockDeviceAPI not found on device"); ioe.initCause(ex); throw ioe;
|
public MappedFSBlockDeviceSupport(Device parent, long offset, long length) throws IOException { super(parent, offset, length); try { this.parentApi = (FSBlockDeviceAPI) parent.getAPI(FSBlockDeviceAPI.class); } catch (ApiNotFoundException ex) { throw new IOException(ex); } registerAPI(FSBlockDeviceAPI.class, this); }
|
public Iterator iterator() {
|
public Iterator<IndexEntry> iterator() {
|
public Iterator iterator() { return new IndexEntryIterator(parentFileRecord, this, getHeader() .getFirstEntryOffset() + 0x18); }
|
public MarshalException(String s, Exception e)
|
public MarshalException(String s)
|
public MarshalException(String s, Exception e) { super(s, e); }
|
super(s, e);
|
super(s);
|
public MarshalException(String s, Exception e) { super(s, e); }
|
if (e instanceof ItemEvent) { synchronized (this) { state = (((ItemEvent) e).getStateChange() == ItemEvent.SELECTED); } }
|
dispatchEventImpl(AWTEvent e){ if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e);}
|
|
}
|
private void checkLegalVersion (String version) throws SAXException { int len = version.length (); for (int i = 0; i < len; i++) { char c = version.charAt (i); if ('0' <= c && c <= '9') continue; if (c == '_' || c == '.' || c == ':' || c == '-') continue; if ('a' <= c && c <= 'z') continue; if ('A' <= c && c <= 'Z') continue; error ("illegal character in version", version, "1.0"); } }
|
|
throw new CharConversionException ("non-ASCII character U+" + Integer.toHexString (c));
|
{ throw new CharConversionException("non-ASCII character U+" + Integer.toHexString(c)); }
|
private void copyIso8859_1ReadBuffer (int count, char mask) throws IOException { int i, j; for (i = 0, j = readBufferPos; i < count; i++, j++) { char c = (char) (rawReadBuffer [i] & 0xff); if ((c & mask) != 0) throw new CharConversionException ("non-ASCII character U+" + Integer.toHexString (c)); if (c == 0x0085 && xmlVersion == XML_11) c = '\r'; readBuffer [j] = c; if (c == '\r') { sawCR = true; } } readBufferLength = j; }
|
readBuffer [j] = c; if (c == '\r') {
|
} readBuffer[j] = c; if (c == '\r') {
|
private void copyIso8859_1ReadBuffer (int count, char mask) throws IOException { int i, j; for (i = 0, j = readBufferPos; i < count; i++, j++) { char c = (char) (rawReadBuffer [i] & 0xff); if ((c & mask) != 0) throw new CharConversionException ("non-ASCII character U+" + Integer.toHexString (c)); if (c == 0x0085 && xmlVersion == XML_11) c = '\r'; readBuffer [j] = c; if (c == '\r') { sawCR = true; } } readBufferLength = j; }
|
} else { for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer [i] << 8); c |= 0xff & rawReadBuffer [i + 1]; readBuffer [j++] = c;
|
} } else { for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer[i] << 8); c |= 0xff & rawReadBuffer[i + 1]; readBuffer[j++] = c;
|
private void copyUcs2ReadBuffer (int count, int shift1, int shift2) throws SAXException { int j = readBufferPos; if (count > 0 && (count % 2) != 0) { encodingError ("odd number of bytes in UCS-2 encoding", -1, count); } // The loops are faster with less internal brancing; hence two if (shift1 == 0) { // "UTF-16-LE" for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer [i + 1] << 8); c |= 0xff & rawReadBuffer [i]; readBuffer [j++] = c; if (c == '\r') sawCR = true; } } else { // "UTF-16-BE" for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer [i] << 8); c |= 0xff & rawReadBuffer [i + 1]; readBuffer [j++] = c; if (c == '\r') sawCR = true; } } readBufferLength = j; }
|
}
|
private void copyUcs2ReadBuffer (int count, int shift1, int shift2) throws SAXException { int j = readBufferPos; if (count > 0 && (count % 2) != 0) { encodingError ("odd number of bytes in UCS-2 encoding", -1, count); } // The loops are faster with less internal brancing; hence two if (shift1 == 0) { // "UTF-16-LE" for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer [i + 1] << 8); c |= 0xff & rawReadBuffer [i]; readBuffer [j++] = c; if (c == '\r') sawCR = true; } } else { // "UTF-16-BE" for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer [i] << 8); c |= 0xff & rawReadBuffer [i + 1]; readBuffer [j++] = c; if (c == '\r') sawCR = true; } } readBufferLength = j; }
|
|
if (count > 0 && (count % 4) != 0) { encodingError ( "number of bytes in UCS-4 encoding not divisible by 4",
|
if (count > 0 && (count % 4) != 0) { encodingError("number of bytes in UCS-4 encoding " + "not divisible by 4",
|
private void copyUcs4ReadBuffer (int count, int shift1, int shift2, int shift3, int shift4) throws SAXException { int j = readBufferPos; if (count > 0 && (count % 4) != 0) { encodingError ( "number of bytes in UCS-4 encoding not divisible by 4", -1, count); } for (int i = 0; i < count; i += 4) { int value = (((rawReadBuffer [i] & 0xff) << shift1) | ((rawReadBuffer [i + 1] & 0xff) << shift2) | ((rawReadBuffer [i + 2] & 0xff) << shift3) | ((rawReadBuffer [i + 3] & 0xff) << shift4)); if (value < 0x0000ffff) { readBuffer [j++] = (char) value; if (value == (int) '\r') { sawCR = true; } } else if (value < 0x0010ffff) { value -= 0x010000; readBuffer [j++] = (char) (0xd8 | ((value >> 10) & 0x03ff)); readBuffer [j++] = (char) (0xdc | (value & 0x03ff)); } else { encodingError ("UCS-4 value out of range for Unicode", value, i); } } readBufferLength = j; }
|
encodingError ("Illegal two byte UTF-8 sequence",
|
{ encodingError("Illegal two byte UTF-8 sequence",
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
if(c == 0x0085 && xmlVersion == XML_11)
|
if (c == 0x0085 && xmlVersion == XML_11) {
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
} else if ((b1 & 0xf0) == 0xe0) {
|
} } else if ((b1 & 0xf0) == 0xe0) {
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
encodingError ("Illegal three byte UTF-8 sequence",
|
{ encodingError("Illegal three byte UTF-8 sequence",
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
} else if ((b1 & 0xf8) == 0xf0) {
|
} } else if ((b1 & 0xf8) == 0xf0) {
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
encodingError ( "UTF-8 value out of range for Unicode",
|
{ encodingError("UTF-8 value out of range for Unicode",
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
}
|
private void copyUtf8ReadBuffer (int count) throws SAXException, IOException { int i = 0; int j = readBufferPos; int b1; char c = 0; /* // check once, so the runtime won't (if it's smart enough) if (count < 0 || count > rawReadBuffer.length) throw new ArrayIndexOutOfBoundsException (Integer.toString (count)); */ while (i < count) { b1 = rawReadBuffer [i++]; // Determine whether we are dealing // with a one-, two-, three-, or four- // byte sequence. if (b1 < 0) { if ((b1 & 0xe0) == 0xc0) { // 2-byte sequence: 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx c = (char) (((b1 & 0x1f) << 6) | getNextUtf8Byte (i++, count)); if (c < 0x0080) encodingError ("Illegal two byte UTF-8 sequence", c, 0); //Sec 2.11 // [1] the two-character sequence #xD #xA // [2] the two-character sequence #xD #x85 if ((c == 0x0085 || c == 0x000a) && sawCR) continue; // Sec 2.11 // [3] the single character #x85 if(c == 0x0085 && xmlVersion == XML_11) readBuffer[j++] = '\r'; } else if ((b1 & 0xf0) == 0xe0) { // 3-byte sequence: // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx // most CJKV characters c = (char) (((b1 & 0x0f) << 12) | (getNextUtf8Byte (i++, count) << 6) | getNextUtf8Byte (i++, count)); //sec 2.11 //[4] the single character #x2028 if(c == 0x2028 && xmlVersion == XML_11){ readBuffer[j++] = '\r'; sawCR = true; continue; } if (c < 0x0800 || (c >= 0xd800 && c <= 0xdfff)) encodingError ("Illegal three byte UTF-8 sequence", c, 0); } else if ((b1 & 0xf8) == 0xf0) { // 4-byte sequence: 11101110wwwwzzzzyy + 110111yyyyxxxxxx // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx // (uuuuu = wwww + 1) // "Surrogate Pairs" ... from the "Astral Planes" // Unicode 3.1 assigned the first characters there int iso646 = b1 & 07; iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); iso646 = (iso646 << 6) + getNextUtf8Byte (i++, count); if (iso646 <= 0xffff) { encodingError ("Illegal four byte UTF-8 sequence", iso646, 0); } else { if (iso646 > 0x0010ffff) encodingError ( "UTF-8 value out of range for Unicode", iso646, 0); iso646 -= 0x010000; readBuffer [j++] = (char) (0xd800 | (iso646 >> 10)); readBuffer [j++] = (char) (0xdc00 | (iso646 & 0x03ff)); continue; } } else { // The five and six byte encodings aren't supported; // they exceed the Unicode (and XML) range. encodingError ( "unsupported five or six byte UTF-8 sequence", 0xff & b1, i); // NOTREACHED c = 0; } } else { // 1-byte sequence: 000000000xxxxxxx = 0xxxxxxx // (US-ASCII character, "common" case, one branch to here) c = (char) b1; } readBuffer [j++] = c; if (c == '\r') sawCR = true; } // How many characters have we read? readBufferLength = j; }
|
|
dataBuffer = (char[]) extendArray (dataBuffer,
|
{ dataBuffer = (char[]) extendArray(dataBuffer,
|
private void dataBufferAppend (char c) { // Expand buffer if necessary. if (dataBufferPos >= dataBuffer.length) dataBuffer = (char[]) extendArray (dataBuffer, dataBuffer.length, dataBufferPos); dataBuffer [dataBufferPos++] = c; }
|
dataBuffer [dataBufferPos++] = c;
|
private void dataBufferAppend (char c) { // Expand buffer if necessary. if (dataBufferPos >= dataBuffer.length) dataBuffer = (char[]) extendArray (dataBuffer, dataBuffer.length, dataBufferPos); dataBuffer [dataBufferPos++] = c; }
|
|
dataBuffer[dataBufferPos++] = c; }
|
private void dataBufferAppend (char c) { // Expand buffer if necessary. if (dataBufferPos >= dataBuffer.length) dataBuffer = (char[]) extendArray (dataBuffer, dataBuffer.length, dataBufferPos); dataBuffer [dataBufferPos++] = c; }
|
|
if (c == ' ') { while (j < end && dataBuffer [j++] == ' ')
|
if (c == ' ') { while (j < end && dataBuffer[j++] == ' ') {
|
private void dataBufferNormalize () { int i = 0; int j = 0; int end = dataBufferPos; // Skip spaces at the start. while (j < end && dataBuffer [j] == ' ') { j++; } // Skip whitespace at the end. while (end > j && dataBuffer [end - 1] == ' ') { end --; } // Start copying to the left. while (j < end) { char c = dataBuffer [j++]; // Normalise all other spaces to // a single space. if (c == ' ') { while (j < end && dataBuffer [j++] == ' ') continue; dataBuffer [i++] = ' '; dataBuffer [i++] = dataBuffer [j - 1]; } else { dataBuffer [i++] = c; } } // The new length is <= the old one. dataBufferPos = i; }
|
dataBuffer [i++] = ' '; dataBuffer [i++] = dataBuffer [j - 1]; } else { dataBuffer [i++] = c;
|
} dataBuffer[i++] = ' '; dataBuffer[i++] = dataBuffer[j - 1]; } else { dataBuffer[i++] = c;
|
private void dataBufferNormalize () { int i = 0; int j = 0; int end = dataBufferPos; // Skip spaces at the start. while (j < end && dataBuffer [j] == ' ') { j++; } // Skip whitespace at the end. while (end > j && dataBuffer [end - 1] == ' ') { end --; } // Start copying to the left. while (j < end) { char c = dataBuffer [j++]; // Normalise all other spaces to // a single space. if (c == ' ') { while (j < end && dataBuffer [j++] == ' ') continue; dataBuffer [i++] = ' '; dataBuffer [i++] = dataBuffer [j - 1]; } else { dataBuffer [i++] = c; } } // The new length is <= the old one. dataBufferPos = i; }
|
private Enumeration declaredAttributes (Object element [])
|
private Iterator declaredAttributes(ElementDecl element)
|
private Enumeration declaredAttributes (Object element []) { Hashtable attlist; if (element == null) return null; if ((attlist = (Hashtable) element [2]) == null) return null; return attlist.keys (); }
|
Hashtable attlist;
|
HashMap attlist;
|
private Enumeration declaredAttributes (Object element []) { Hashtable attlist; if (element == null) return null; if ((attlist = (Hashtable) element [2]) == null) return null; return attlist.keys (); }
|
if ((attlist = (Hashtable) element [2]) == null)
|
} if ((attlist = element.attributes) == null) {
|
private Enumeration declaredAttributes (Object element []) { Hashtable attlist; if (element == null) return null; if ((attlist = (Hashtable) element [2]) == null) return null; return attlist.keys (); }
|
return attlist.keys ();
|
} return attlist.keySet().iterator();
|
private Enumeration declaredAttributes (Object element []) { Hashtable attlist; if (element == null) return null; if ((attlist = (Hashtable) element [2]) == null) return null; return attlist.keys (); }
|
byte signature[] = new byte [4];
|
byte[] signature = new byte[4];
|
private void detectEncoding () throws SAXException, IOException { byte signature[] = new byte [4]; // Read the first four bytes for // autodetection. is.mark (4); is.read (signature); is.reset (); // // FIRST: four byte encodings (who uses these?) // if (tryEncoding (signature, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x3c)) { // UCS-4 must begin with "<?xml" // 0x00 0x00 0x00 0x3c: UCS-4, big-endian (1234) // "UTF-32BE" encoding = ENCODING_UCS_4_1234; } else if (tryEncoding (signature, (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00)) { // 0x3c 0x00 0x00 0x00: UCS-4, little-endian (4321) // "UTF-32LE" encoding = ENCODING_UCS_4_4321; } else if (tryEncoding (signature, (byte) 0x00, (byte) 0x00, (byte) 0x3c, (byte) 0x00)) { // 0x00 0x00 0x3c 0x00: UCS-4, unusual (2143) encoding = ENCODING_UCS_4_2143; } else if (tryEncoding (signature, (byte) 0x00, (byte) 0x3c, (byte) 0x00, (byte) 0x00)) { // 0x00 0x3c 0x00 0x00: UCS-4, unusual (3421) encoding = ENCODING_UCS_4_3412; // 00 00 fe ff UCS_4_1234 (with BOM) // ff fe 00 00 UCS_4_4321 (with BOM) } // // SECOND: two byte encodings // note ... with 1/14/2000 errata the XML spec identifies some // more "broken UTF-16" autodetection cases, with no XML decl, // which we don't handle here (that's legal too). // else if (tryEncoding (signature, (byte) 0xfe, (byte) 0xff)) { // UCS-2 with a byte-order marker. (UTF-16) // 0xfe 0xff: UCS-2, big-endian (12) encoding = ENCODING_UCS_2_12; is.read (); is.read (); } else if (tryEncoding (signature, (byte) 0xff, (byte) 0xfe)) { // UCS-2 with a byte-order marker. (UTF-16) // 0xff 0xfe: UCS-2, little-endian (21) encoding = ENCODING_UCS_2_21; is.read (); is.read (); } else if (tryEncoding (signature, (byte) 0x00, (byte) 0x3c, (byte) 0x00, (byte) 0x3f)) { // UTF-16BE (otherwise, malformed UTF-16) // 0x00 0x3c 0x00 0x3f: UCS-2, big-endian, no byte-order mark encoding = ENCODING_UCS_2_12; error ("no byte-order mark for UCS-2 entity"); } else if (tryEncoding (signature, (byte) 0x3c, (byte) 0x00, (byte) 0x3f, (byte) 0x00)) { // UTF-16LE (otherwise, malformed UTF-16) // 0x3c 0x00 0x3f 0x00: UCS-2, little-endian, no byte-order mark encoding = ENCODING_UCS_2_21; error ("no byte-order mark for UCS-2 entity"); } // // THIRD: ASCII-derived encodings, fixed and variable lengths // else if (tryEncoding (signature, (byte) 0x3c, (byte) 0x3f, (byte) 0x78, (byte) 0x6d)) { // ASCII derived // 0x3c 0x3f 0x78 0x6d: UTF-8 or other 8-bit markup (read ENCODING) encoding = ENCODING_UTF_8; prefetchASCIIEncodingDecl (); } else if (signature [0] == (byte) 0xef && signature [1] == (byte) 0xbb && signature [2] == (byte) 0xbf) { // 0xef 0xbb 0xbf: UTF-8 BOM (not part of document text) // this un-needed notion slipped into XML 2nd ed through a // "non-normative" erratum; now required by MSFT and UDDI, // and E22 made it normative. encoding = ENCODING_UTF_8; is.read (); is.read (); is.read (); } else { // 4c 6f a7 94 ... we don't understand EBCDIC flavors // ... but we COULD at least kick in some fixed code page // (default) UTF-8 without encoding/XML declaration encoding = ENCODING_UTF_8; } }
|
Integer.toHexString (value) + ')'; error (message);
|
Integer.toHexString(value) + ')'; error(message); }
|
private void encodingError (String message, int value, int offset) throws SAXException { if (value != -1) message = message + " (character code: 0x" + Integer.toHexString (value) + ')'; error (message); }
|
private Object extendArray (Object array, int currentSize, int requiredSize)
|
private Object extendArray(Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize)
|
private Object extendArray (Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize) { return array; } else { Object newArray = null; int newSize = currentSize * 2; if (newSize <= requiredSize) newSize = requiredSize + 1; if (array instanceof char[]) newArray = new char [newSize]; else if (array instanceof Object[]) newArray = new Object [newSize]; else throw new RuntimeException (); System.arraycopy (array, 0, newArray, 0, currentSize); return newArray; } }
|
if (requiredSize < currentSize) {
|
private Object extendArray (Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize) { return array; } else { Object newArray = null; int newSize = currentSize * 2; if (newSize <= requiredSize) newSize = requiredSize + 1; if (array instanceof char[]) newArray = new char [newSize]; else if (array instanceof Object[]) newArray = new Object [newSize]; else throw new RuntimeException (); System.arraycopy (array, 0, newArray, 0, currentSize); return newArray; } }
|
|
newArray = new char [newSize];
|
{ newArray = new char[newSize]; }
|
private Object extendArray (Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize) { return array; } else { Object newArray = null; int newSize = currentSize * 2; if (newSize <= requiredSize) newSize = requiredSize + 1; if (array instanceof char[]) newArray = new char [newSize]; else if (array instanceof Object[]) newArray = new Object [newSize]; else throw new RuntimeException (); System.arraycopy (array, 0, newArray, 0, currentSize); return newArray; } }
|
newArray = new Object [newSize];
|
{ newArray = new Object[newSize]; }
|
private Object extendArray (Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize) { return array; } else { Object newArray = null; int newSize = currentSize * 2; if (newSize <= requiredSize) newSize = requiredSize + 1; if (array instanceof char[]) newArray = new char [newSize]; else if (array instanceof Object[]) newArray = new Object [newSize]; else throw new RuntimeException (); System.arraycopy (array, 0, newArray, 0, currentSize); return newArray; } }
|
throw new RuntimeException ();
|
{ throw new RuntimeException(); }
|
private Object extendArray (Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize) { return array; } else { Object newArray = null; int newSize = currentSize * 2; if (newSize <= requiredSize) newSize = requiredSize + 1; if (array instanceof char[]) newArray = new char [newSize]; else if (array instanceof Object[]) newArray = new Object [newSize]; else throw new RuntimeException (); System.arraycopy (array, 0, newArray, 0, currentSize); return newArray; } }
|
} else readBuffer [i++] = '\n';
|
} else { readBuffer[i++] = '\n'; }
|
private void filterCR (boolean moreData) { int i, j; readBufferOverflow = -1;loop: for (i = j = readBufferPos; j < readBufferLength; i++, j++) { switch (readBuffer [j]) { case '\r': if (j == readBufferLength - 1) { if (moreData) { readBufferOverflow = '\r'; readBufferLength--; } else // CR at end of buffer readBuffer [i++] = '\n'; break loop; } else if (readBuffer [j + 1] == '\n') { j++; } readBuffer [i] = '\n'; break; case '\n': default: readBuffer [i] = readBuffer [j]; break; } } readBufferLength = i; }
|
private Object[] getAttribute (String elName, String name)
|
private AttributeDecl getAttribute(String elName, String name)
|
private Object[] getAttribute (String elName, String name) { Hashtable attlist; attlist = getElementAttributes (elName); if (attlist == null) return null; return (Object[]) attlist.get (name); }
|
Hashtable attlist; attlist = getElementAttributes (elName); if (attlist == null) return null; return (Object[]) attlist.get (name);
|
HashMap attlist = getElementAttributes(elName); return (attlist == null) ? null : (AttributeDecl) attlist.get(name);
|
private Object[] getAttribute (String elName, String name) { Hashtable attlist; attlist = getElementAttributes (elName); if (attlist == null) return null; return (Object[]) attlist.get (name); }
|
Object attribute[] = getAttribute (name, aname); if (attribute == null) { return null; } else { return (String) attribute [1]; }
|
AttributeDecl attribute = getAttribute(name, aname); return (attribute == null) ? null : attribute.value;
|
public String getAttributeDefaultValue (String name, String aname) { Object attribute[] = getAttribute (name, aname); if (attribute == null) { return null; } else { return (String) attribute [1]; } }
|
Object attribute[] = getAttribute (name, aname); if (attribute == null) { return ATTRIBUTE_DEFAULT_UNDECLARED; } else { return ((Integer) attribute [2]).intValue (); }
|
AttributeDecl attribute = getAttribute(name, aname); return (attribute == null) ? ATTRIBUTE_DEFAULT_UNDECLARED : attribute.valueType;
|
public int getAttributeDefaultValueType (String name, String aname) { Object attribute[] = getAttribute (name, aname); if (attribute == null) { return ATTRIBUTE_DEFAULT_UNDECLARED; } else { return ((Integer) attribute [2]).intValue (); } }
|
Object attribute[] = getAttribute (name, aname); if (attribute == null) { return null; } else { return (String) attribute [3]; }
|
AttributeDecl attribute = getAttribute(name, aname); return (attribute == null) ? null : attribute.enumeration;
|
public String getAttributeEnumeration (String name, String aname) { Object attribute[] = getAttribute (name, aname); if (attribute == null) { return null; } else { // assert: attribute [0] is "ENUMERATION" or "NOTATION" return (String) attribute [3]; } }
|
private int getContentType (Object element [], int defaultType)
|
private int getContentType(ElementDecl element, int defaultType)
|
private int getContentType (Object element [], int defaultType) { int retval; if (element == null) return defaultType; retval = ((Integer) element [0]).intValue (); if (retval == CONTENT_UNDECLARED) retval = defaultType; return retval; }
|
retval = ((Integer) element [0]).intValue ();
|
} retval = element.contentType;
|
private int getContentType (Object element [], int defaultType) { int retval; if (element == null) return defaultType; retval = ((Integer) element [0]).intValue (); if (retval == CONTENT_UNDECLARED) retval = defaultType; return retval; }
|
}
|
private int getContentType (Object element [], int defaultType) { int retval; if (element == null) return defaultType; retval = ((Integer) element [0]).intValue (); if (retval == CONTENT_UNDECLARED) retval = defaultType; return retval; }
|
|
private Hashtable getElementAttributes (String name)
|
private HashMap getElementAttributes(String name)
|
private Hashtable getElementAttributes (String name) { Object element[] = (Object[]) elementInfo.get (name); if (element == null) return null; else return (Hashtable) element [2]; }
|
Object element[] = (Object[]) elementInfo.get (name); if (element == null) return null; else return (Hashtable) element [2];
|
ElementDecl element = (ElementDecl) elementInfo.get(name); return (element == null) ? null : element.attributes;
|
private Hashtable getElementAttributes (String name) { Object element[] = (Object[]) elementInfo.get (name); if (element == null) return null; else return (Hashtable) element [2]; }
|
Object element [] = (Object []) elementInfo.get (name); return getContentType (element, CONTENT_UNDECLARED);
|
ElementDecl element = (ElementDecl) elementInfo.get(name); return getContentType(element, CONTENT_UNDECLARED);
|
public int getElementContentType (String name) { Object element [] = (Object []) elementInfo.get (name); return getContentType (element, CONTENT_UNDECLARED); }
|
public String [] getEntityIds (String ename)
|
public ExternalIdentifiers getEntityIds(String ename)
|
public String [] getEntityIds (String ename) { Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return null; } else { return (String []) entity [1]; } }
|
Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return null; } else { return (String []) entity [1]; }
|
EntityInfo entity = (EntityInfo) entityInfo.get(ename); return (entity == null) ? null : entity.ids;
|
public String [] getEntityIds (String ename) { Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return null; } else { return (String []) entity [1]; } }
|
Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return ENTITY_UNDECLARED; } else { return ((Integer) entity [0]).intValue ();
|
EntityInfo entity = (EntityInfo) entityInfo.get(ename); return (entity == null) ? ENTITY_UNDECLARED : entity.type;
|
public int getEntityType (String ename) { Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return ENTITY_UNDECLARED; } else { return ((Integer) entity [0]).intValue (); } }
|
}
|
public int getEntityType (String ename) { Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return ENTITY_UNDECLARED; } else { return ((Integer) entity [0]).intValue (); } }
|
|
Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return null; } else { return (String) entity [3];
|
EntityInfo entity = (EntityInfo) entityInfo.get(ename); return (entity == null) ? null : entity.value;
|
public String getEntityValue (String ename) { Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return null; } else { return (String) entity [3]; } }
|
}
|
public String getEntityValue (String ename) { Object entity[] = (Object[]) entityInfo.get (ename); if (entity == null) { return null; } else { return (String) entity [3]; } }
|
|
elementInfo = new Hashtable (); entityInfo = new Hashtable (); notationInfo = new Hashtable ();
|
elementInfo = new HashMap(); entityInfo = new HashMap(); notationInfo = new HashMap();
|
private void initializeVariables () { // First line line = 1; column = 0; // Set up the buffers for data and names dataBufferPos = 0; dataBuffer = new char [DATA_BUFFER_INITIAL]; nameBufferPos = 0; nameBuffer = new char [NAME_BUFFER_INITIAL]; // Set up the DTD hash tables elementInfo = new Hashtable (); entityInfo = new Hashtable (); notationInfo = new Hashtable (); skippedPE = false; // Set up the variables for the current // element context. currentElement = null; currentElementContent = CONTENT_UNDECLARED; // Set up the input variables sourceType = INPUT_NONE; inputStack = new Stack (); entityStack = new Stack (); externalEntity = null; tagAttributePos = 0; tagAttributes = new String [100]; rawReadBuffer = new byte [READ_BUFFER_MAX]; readBufferOverflow = -1; scratch = new InputSource (); inLiteral = false; expandPE = false; peIsError = false; doReport = false; inCDATA = false; symbolTable = new Object [SYMBOL_TABLE_LENGTH][]; }
|
inputStack = new Stack (); entityStack = new Stack ();
|
inputStack = new LinkedList(); entityStack = new LinkedList();
|
private void initializeVariables () { // First line line = 1; column = 0; // Set up the buffers for data and names dataBufferPos = 0; dataBuffer = new char [DATA_BUFFER_INITIAL]; nameBufferPos = 0; nameBuffer = new char [NAME_BUFFER_INITIAL]; // Set up the DTD hash tables elementInfo = new Hashtable (); entityInfo = new Hashtable (); notationInfo = new Hashtable (); skippedPE = false; // Set up the variables for the current // element context. currentElement = null; currentElementContent = CONTENT_UNDECLARED; // Set up the input variables sourceType = INPUT_NONE; inputStack = new Stack (); entityStack = new Stack (); externalEntity = null; tagAttributePos = 0; tagAttributes = new String [100]; rawReadBuffer = new byte [READ_BUFFER_MAX]; readBufferOverflow = -1; scratch = new InputSource (); inLiteral = false; expandPE = false; peIsError = false; doReport = false; inCDATA = false; symbolTable = new Object [SYMBOL_TABLE_LENGTH][]; }
|
public String intern (char ch[], int start, int length)
|
public String intern(char[] ch, int start, int length)
|
public String intern (char ch[], int start, int length) { int index = 0; int hash = 0; Object bucket []; // Generate a hash code. This is a widely used string hash, // often attributed to Brian Kernighan. for (int i = start; i < start + length; i++) hash = 31 * hash + ch [i]; hash = (hash & 0x7fffffff) % SYMBOL_TABLE_LENGTH; // Get the bucket -- consists of {array,String} pairs if ((bucket = symbolTable [hash]) == null) { // first string in this bucket bucket = new Object [8]; // Search for a matching tuple, and // return the string if we find one. } else { while (index < bucket.length) { char chFound [] = (char []) bucket [index]; // Stop when we hit an empty entry. if (chFound == null) break; // If they're the same length, check for a match. if (chFound.length == length) { for (int i = 0; i < chFound.length; i++) { // continue search on failure if (ch [start + i] != chFound [i]) { break; } else if (i == length - 1) { // That's it, we have a match! return (String) bucket [index + 1]; } } } index += 2; } // Not found -- we'll have to add it. // Do we have to grow the bucket? bucket = (Object []) extendArray (bucket, bucket.length, index); } symbolTable [hash] = bucket; // OK, add it to the end of the bucket -- "local" interning. // Intern "globally" to let applications share interning benefits. // That is, "!=" and "==" work on our strings, not just equals(). String s = new String (ch, start, length).intern (); bucket [index] = s.toCharArray (); bucket [index + 1] = s; return s; }
|
Object bucket [];
|
Object[] bucket;
|
public String intern (char ch[], int start, int length) { int index = 0; int hash = 0; Object bucket []; // Generate a hash code. This is a widely used string hash, // often attributed to Brian Kernighan. for (int i = start; i < start + length; i++) hash = 31 * hash + ch [i]; hash = (hash & 0x7fffffff) % SYMBOL_TABLE_LENGTH; // Get the bucket -- consists of {array,String} pairs if ((bucket = symbolTable [hash]) == null) { // first string in this bucket bucket = new Object [8]; // Search for a matching tuple, and // return the string if we find one. } else { while (index < bucket.length) { char chFound [] = (char []) bucket [index]; // Stop when we hit an empty entry. if (chFound == null) break; // If they're the same length, check for a match. if (chFound.length == length) { for (int i = 0; i < chFound.length; i++) { // continue search on failure if (ch [start + i] != chFound [i]) { break; } else if (i == length - 1) { // That's it, we have a match! return (String) bucket [index + 1]; } } } index += 2; } // Not found -- we'll have to add it. // Do we have to grow the bucket? bucket = (Object []) extendArray (bucket, bucket.length, index); } symbolTable [hash] = bucket; // OK, add it to the end of the bucket -- "local" interning. // Intern "globally" to let applications share interning benefits. // That is, "!=" and "==" work on our strings, not just equals(). String s = new String (ch, start, length).intern (); bucket [index] = s.toCharArray (); bucket [index + 1] = s; return s; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.