bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void setOrientation(int orientation) { if (orientation != SwingConstants.HORIZONTAL && orientation != SwingConstants.VERTICAL) throw new IllegalArgumentException("orientation must be one of HORIZONTAL or VERTICAL"); if (orientation != this.orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, this.orientation); } }
public void setOrientation(int orientation) { if (orientation != SwingConstants.HORIZONTAL && orientation != SwingConstants.VERTICAL) throw new IllegalArgumentException("orientation must be one of HORIZONTAL or VERTICAL"); if (orientation != this.orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, this.orientation); } }
607
public void setUnitIncrement(int unitIncrement) { if (unitIncrement != this.unitIncrement) { int oldInc = this.unitIncrement; this.unitIncrement = unitIncrement; firePropertyChange(UNIT_INCREMENT_CHANGED_PROPERTY, oldInc, this.unitIncrement); } }
public void setUnitIncrement(int unitIncrement) { if (unitIncrement != this.unitIncrement) { int oldInc = this.unitIncrement; this.unitIncrement = unitIncrement; firePropertyChange(UNIT_INCREMENT_CHANGED_PROPERTY, oldInc, this.unitIncrement); } }
608
public static Class loadClass (String codebases, String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); }
public static Class loadClass (String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); }
609
public static Class loadClass (String codebases, String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); }
public static Class loadClass (String codebases, String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); }
610
public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(parent); this.factory = null; this.securityContext = null; addURLs(urls); }
public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(parent); this.factory = null; this.securityContext = null; addURLs(urls); }
611
public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(parent); this.factory = null; this.securityContext = null; addURLs(urls); }
public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(); this.factory = null; this.securityContext = null; addURLs(urls); }
612
public StringTokenizer(String str, String delim) { this(str, delim, false); }
public StringTokenizer(String str) { this(str, delim, false); }
613
public StringTokenizer(String str, String delim) { this(str, delim, false); }
public StringTokenizer(String str, String delim) { this(str, delim, false); }
614
public String nextToken() throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); }
public String nextToken(String delim) throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); }
615
public String nextToken() throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); }
public String nextToken() throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); }
616
public ClassNotFoundException(String s) { this(s, null); }
public ClassNotFoundException() { this(s, null); }
617
public ClassNotFoundException(String s) { this(s, null); }
public ClassNotFoundException(String s) { this(null); }
618
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); textComponent.setBackground(defaults.getColor(prefix + ".background")); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setMargin(defaults.getInsets(prefix + ".margin")); textComponent.setBorder(defaults.getBorder(prefix + ".border")); textComponent.setFont(defaults.getFont(prefix + ".font")); caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); }
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); textComponent.setBackground(defaults.getColor(prefix + ".background")); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setMargin(defaults.getInsets(prefix + ".margin")); textComponent.setBorder(defaults.getBorder(prefix + ".border")); textComponent.setFont(defaults.getFont(prefix + ".font")); caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); }
619
public View(Element elem) { elt = elem; }
public View(Element elem) { elt = elem; }
622
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
623
public Container getContainer() { View parent = getParent(); if (parent == null) throw new AssertionError("The parent of a View must not be null."); return parent.getContainer(); }
public Container getContainer() { View parent = getParent(); if (parent == null) throw new AssertionError("The parent of a View must not be null."); return parent.getContainer(); }
624
public Container getContainer() { View parent = getParent(); if (parent == null) throw new AssertionError("The parent of a View must not be null."); return parent.getContainer(); }
public Container getContainer() { View parent = getParent(); if (parent == null) throw new AssertionError("The parent of a View must not be null."); return parent.getContainer(); }
625
public View getView(int index) { return null; }
public View getView(int index) { return null; }
626
public View getView(int index) { return null; }
public View getView(int index) { return null; }
627
public int getViewCount() { return 0; }
public int getViewCount() { return 0; }
628
public int getViewCount() { return 0; }
public int getViewCount() { return 0; }
629
public ViewFactory getViewFactory() { View parent = getParent(); return parent != null ? parent.getViewFactory() : null; }
public ViewFactory getViewFactory() { View parent = getParent(); return parent != null ? parent.getViewFactory() : null; }
630
public void setParent(View parent) { this.parent = parent; }
public void setParent(View parent) { this.parent = parent; }
631
public void setParent(View parent) { this.parent = parent; }
public void setParent(View parent) { this.parent = parent; }
632
public FSEntryIterator(INode iNode) { //this.iNode = iNode; lastBlockIndex = -1; blockIndex = 0; //the byte index where the directory parsing has reached index=0; //the Ext2DirectoryRecord that has been read last current = null; Ext2Debugger.debug("FSEntryIterator()",2); }
public FSEntryIterator(INode iNode) { //this.iNode = iNode; lastBlockIndex = -1; blockIndex = 0; //the byte index where the directory parsing has reached index=0; //the Ext2DirectoryRecord that has been read last current = null; Ext2Debugger.debug("FSEntryIterator()",2); }
634
public boolean hasNext() { Ext2Debugger.debug("FSEntryIterator.hasNext()",3); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { Ext2Debugger.debug("FSEntryIterator.hasNext(): null inode",2); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
public boolean hasNext() { Ext2Debugger.debug("FSEntryIterator.hasNext()",3); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { Ext2Debugger.debug("FSEntryIterator.hasNext(): null inode",2); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
635
public boolean hasNext() { Ext2Debugger.debug("FSEntryIterator.hasNext()",3); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { Ext2Debugger.debug("FSEntryIterator.hasNext(): null inode",2); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
public boolean hasNext() { Ext2Debugger.debug("FSEntryIterator.hasNext()",3); if(noMoreEntries) return false; if(index>=iNode.getSize()) return false; //read the inode number of the next entry: blockIndex = Ext2Directory.this.translateToBlock( index ); blockOffset= Ext2Directory.this.translateToOffset( index ); try{ //read a new block if needed if(blockIndex != lastBlockIndex) { blockData = iNode.getDataBlock(blockIndex); lastBlockIndex = blockIndex; } //get the next directory record Ext2DirectoryRecord dr = new Ext2DirectoryRecord(blockData, blockOffset); index+=dr.getRecLen(); //inode nr=0 means the end of the directory if(dr.getINodeNr()!=0) { current = dr; return true; } else { Ext2Debugger.debug("FSEntryIterator.hasNext(): null inode",2); current = null; noMoreEntries=true; return false; } }catch(IOException e) { return false; } }
636
public Object next() { Ext2Debugger.debug("FSEntryIterator.next()",2); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
public Object next() { Ext2Debugger.debug("FSEntryIterator.next()",2); if(current == null) { //hasNext actually reads the next element if(!hasNext()) throw new NoSuchElementException(); } Ext2DirectoryRecord dr = current; current = null; try{ return new Ext2Entry( ((Ext2FileSystem)getFileSystem()).getINode(dr.getINodeNr()), dr.getName(), dr.getType() ); }catch(IOException e) { throw new NoSuchElementException(); }catch(FileSystemException e) { throw new NoSuchElementException(); } }
637
public Iterator iterator() { Ext2Debugger.debug("Ext2Directory.Iterator()",2); return new FSEntryIterator(iNode); }
public Iterator iterator() { Ext2Debugger.debug("Ext2Directory.Iterator()",2); return new FSEntryIterator(iNode); }
638
public UnsupportedOperationException(String s) { super(s); }
public UnsupportedOperationException(String s) { super(s); }
639
public Object copyObject(Object obj, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
public Object copyObject(Object obj, ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
640
public Object copyObject(Object obj, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
public Object copyObject(Object obj, javax.rmi.ORB orb) throws RemoteException { if (obj instanceof String) return obj; else if (obj == null) return null; else if (obj instanceof String[] || obj instanceof String[][] || obj instanceof String[][][]) { return ((Object[]) obj).clone(); } else if (obj instanceof Serializable) { try { ByteArrayOutputStream a = new ByteArrayOutputStream(); ObjectOutputStream ou = new ObjectOutputStream(a); ou.writeObject(obj); ou.close(); ObjectInputStream input = new ObjectInputStream( new ByteArrayInputStream(a.toByteArray())); return input.readObject(); } catch (Exception ex) { RemoteException rex = new RemoteException("Cannot copy " + obj); throw rex; } } else return obj; }
641
public Object[] copyObjects(Object obj[], javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
public Object[] copyObjects(Object[] obj, ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
642
public Object[] copyObjects(Object obj[], javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
public Object[] copyObjects(Object obj[], javax.rmi.ORB orb) throws RemoteException { return (Object[]) copyObject(obj, orb); }
643
public ValueHandler createValueHandler() { throw new Error("Not implemented for UtilDelegate"); }
public ValueHandler createValueHandler() { if (m_ValueHandler == null) m_ValueHandler = (ValueHandler) DelegateFactory.getInstance(DelegateFactory.VALUEHANDLER); return m_ValueHandler; }
644
public String getCodebase(Class clz) { throw new Error("Not implemented for UtilDelegate"); }
public String getCodebase(Class clz) { return RMIClassLoader.getClassAnnotation(clz); }
645
public Tie getTie(Remote target) { throw new Error("Not implemented for UtilDelegate"); }
public Tie getTie(Remote target) { synchronized (m_Targets) { Tie tie; TieTargetRecord r = ((TieTargetRecord) m_Targets.get(target)); if (r == null) { if (target instanceof Stub) { tie = StubDelegateImpl.getTieFromStub(target); registerTarget(tie, target); } else { String tieClassName = getTieClassName(target.getClass().getName()); try { Class tieClass = Util.loadClass(tieClassName, null, target.getClass().getClassLoader()); tie = (Tie) tieClass.newInstance(); } catch (Exception e) { MARSHAL m = new MARSHAL("Unable to instantiate " + tieClassName); m.minor = Minor.TargetConversion; m.initCause(e); throw m; } tie.setTarget(target); registerTarget(tie, target); } } else tie = r.tie; return tie; } }
646
public boolean isLocal(Stub stub) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); }
public boolean isLocal(Stub stub) throws RemoteException { try { return stub._is_local(); } catch (SystemException e) { RemoteException rex = new RemoteException(); rex.initCause(e); throw rex; } }
647
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
648
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (Exception e) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
649
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
650
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } try { if(loader != null) return loader.loadClass(className); else return null; } }
651
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
public Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else return RMIClassLoader.loadClass(remoteCodebase, className); } catch (MalformedURLException e1) { throw new ClassNotFoundException(className, e1); } catch(ClassNotFoundException e2) { if(loader != null) return loader.loadClass(className); else return null; } }
652
public RemoteException mapSystemException(SystemException ex) { throw new Error("Not implemented for UtilDelegate"); }
public RemoteException mapSystemException(SystemException ex) { RemoteException rex; String status; switch (ex.completed.value()) { case CompletionStatus._COMPLETED_MAYBE: status = "Maybe"; break; case CompletionStatus._COMPLETED_NO: status = "No"; break; case CompletionStatus._COMPLETED_YES: status = "Yes"; break; default: status = "Unexpected completion status " + ex.completed.value(); }
654
public Object readAny(InputStream in) { throw new Error("Not implemented for UtilDelegate"); }
public Object readAny(InputStream input) { throw new Error("Not implemented for UtilDelegate"); }
656
public Object readAny(InputStream in) { throw new Error("Not implemented for UtilDelegate"); }
public Object readAny(InputStream in) { return input.read_any(); }
657
public void registerTarget(Tie tie, Remote target) { throw new Error("Not implemented for UtilDelegate"); }
public void registerTarget(Tie tie, Remote target) { synchronized (m_Ties) { synchronized (m_Targets) { TieTargetRecord r = (TieTargetRecord) m_Ties.get(tie); if (r == null) { r = new TieTargetRecord(tie); m_Ties.put(tie, r); } if (target != null) { r.add(target); m_Targets.put(target, r); }
658
public void unexportObject(Remote target) { throw new Error("Not implemented for UtilDelegate"); }
public void unexportObject(Remote target) { synchronized (m_Ties) { synchronized (m_Targets) { TieTargetRecord r = ((TieTargetRecord) m_Targets.get(target)); if (r != null) { if (target instanceof org.omg.CORBA.Object) r.tie.orb().disconnect((org.omg.CORBA.Object) target); if (r.unused()) { m_Targets.remove(target); m_Ties.remove(r.tie); r.tie.deactivate(); if (r.tie.orb() instanceof ORB_1_4) { ORB_1_4 orb = (ORB_1_4) r.tie.orb(); if (target instanceof org.omg.CORBA.Object) { activeObjectMap.Obj record = orb.rootPOA.findObject((org.omg.CORBA.Object) target); if (record != null && record.servant == r.tie && record.poa instanceof gnuPOA) { ((gnuPOA) record.poa).aom.remove(record.key); record.deactivated = true; record.servant = null; } } } } } } } }
660
public RemoteException wrapException(Throwable orig) { throw new Error("Not implemented for UtilDelegate"); }
public RemoteException wrapException(Throwable ex) throws RuntimeException { throw new Error("Not implemented for UtilDelegate"); }
661
public RemoteException wrapException(Throwable orig) { throw new Error("Not implemented for UtilDelegate"); }
public RemoteException wrapException(Throwable orig) { if (ex instanceof RuntimeException) throw (RuntimeException) ex; else if (ex instanceof Error) return new ServerError(ex.getMessage(), (Error) ex); else if (ex instanceof RemoteException) return new ServerException(ex.getMessage(), (Exception) ex); else if (ex instanceof SystemException) return wrapException(mapSystemException((SystemException) ex)); else return new UnexpectedException("Unexpected", (Exception) ex); }
662
public void writeAbstractObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); }
public void writeAbstractObject(OutputStream output, Object object) { throw new Error("Not implemented for UtilDelegate"); }
663
public void writeAbstractObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); }
public void writeAbstractObject(OutputStream out, Object obj) { ((org.omg.CORBA_2_3.portable.OutputStream) output).write_abstract_interface(object); }
664
public void writeAny(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); }
public void writeAny(OutputStream output, Object object) { throw new Error("Not implemented for UtilDelegate"); }
665
public void writeAny(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); }
public void writeAny(OutputStream out, Object obj) { Any any = output.orb().create_any(); if (object == null) { generalTypeCode t = new generalTypeCode(TCKind.tk_abstract_interface); t.setId("IDL:omg.org/CORBA/AbstractBase:1.0"); t.setName(""); any.type(t); output.write_any(any); return; } else if (object instanceof org.omg.CORBA.Object && !(object instanceof Remote)) { boolean inserted = ObjectCreator.insertWithHelper(any, object); if (inserted) { output.write_any(any); return; } } if (object instanceof org.omg.CORBA.Object) writeAnyAsRemote(output, object); else if (object instanceof Serializable) { any.insert_Value((Serializable) object); output.write_any(any); } else { MARSHAL m = new MARSHAL(object.getClass().getName() + " must be CORBA Object, Remote or Serializable"); m.minor = Minor.NonSerializable; throw m; } }
666
public void writeRemoteObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); }
public void writeRemoteObject(OutputStream an_output, Object object) { throw new Error("Not implemented for UtilDelegate"); }
667
public void writeRemoteObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); }
public void writeRemoteObject(OutputStream out, Object obj) { org.omg.CORBA_2_3.portable.OutputStream output = (org.omg.CORBA_2_3.portable.OutputStream) an_output; if (object == null) an_output.write_Object(null); else if (isTieRequired(object)) { Class fc = getExportedInterface(object); exportTie(output, object, fc); } else if (object instanceof org.omg.CORBA.Object) { ensureOrbRunning(output); an_output.write_Object((org.omg.CORBA.Object) object); } else if (object != null && object instanceof Serializable) writeFields(an_output, (Serializable) object); }
668
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
669
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
670
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
671
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
672
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
673
public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { if(delegate != null) return delegate.loadClass(className, remoteCodebase, loader); else throw new ClassNotFoundException(className + ": delegate == null"); }
public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { if(delegate != null) return delegate.loadClass(className, remoteCodebase, loader); else throw new ClassNotFoundException(className + ": delegate == null"); }
674
public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { if(delegate != null) return delegate.loadClass(className, remoteCodebase, loader); else throw new ClassNotFoundException(className + ": delegate == null"); }
public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { return delegate.loadClass(className, remoteCodebase, loader); else throw new ClassNotFoundException(className + ": delegate == null"); }
675
public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { if(delegate != null) return delegate.loadClass(className, remoteCodebase, loader); else throw new ClassNotFoundException(className + ": delegate == null"); }
public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException { if(delegate != null) return delegate.loadClass(className, remoteCodebase, loader); else throw new ClassNotFoundException(className + ": delegate == null"); }
676
boolean isLocal(Stub stub) throws RemoteException;
boolean isLocal(Stub stub) throws RemoteException;
677
Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException;
Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException;
678
public boolean startsWith(String prefix) { return regionMatches(false, 0, prefix, 0, prefix.count); }
public boolean startsWith(String prefix, int toffset) { return regionMatches(false, 0, prefix, 0, prefix.count); }
679
public boolean startsWith(String prefix) { return regionMatches(false, 0, prefix, 0, prefix.count); }
public boolean startsWith(String prefix) { return regionMatches(false, toffset, prefix, 0, prefix.count); }
680
void unexportObject(Remote target);
void unexportObject(Remote target);
681
javax.rmi.ORB orb();
javax.rmi.ORB orb();
682
void deactivate();
void deactivate();
683
public static boolean insertWithHelper(Any into, Object object) { try { String helperClassName = object.getClass().getName() + "Helper"; Class helperClass = Class.forName(helperClassName); Method insert = helperClass.getMethod("insert", new Class[] { Any.class, object.getClass() } ); insert.invoke(null, new Object[] { into, object }); return true; } catch (Exception exc) { // Failed due some reason. return false; } }
public static boolean insertWithHelper(Any into, Object object) { try { String helperClassName = object.getClass().getName() + "Helper"; Class helperClass = forName(helperClassName); Method insert = helperClass.getMethod("insert", new Class[] { Any.class, object.getClass() } ); insert.invoke(null, new Object[] { into, object }); return true; } catch (Exception exc) { // Failed due some reason. return false; } }
684
public static boolean insertWithHelper(Any into, Object object) { try { String helperClassName = object.getClass().getName() + "Helper"; Class helperClass = Class.forName(helperClassName); Method insert = helperClass.getMethod("insert", new Class[] { Any.class, object.getClass() } ); insert.invoke(null, new Object[] { into, object }); return true; } catch (Exception exc) { // Failed due some reason. return false; } }
public static boolean insertWithHelper(Any into, Object object) { try { String helperClassName = object.getClass().getName() + "Helper"; Class helperClass = Class.forName(helperClassName); Method insert = helperClass.getMethod("insert", new Class[] { Any.class, object.getClass() } ); insert.invoke(null, new Object[] { into, object }); return true; } catch (Exception exc) { // Failed due some reason. return false; } }
685
public abstract void insert_Value(Serializable x);
public abstract void insert_Value(Serializable x);
686
private void doAttributes() { SessionAttributes sa = new SessionAttributes(propFileName, defaultProps, (Frame)me.frame); sa.addPropertyChangeListener(screen); sa.addPropertyChangeListener(this); sa.showIt(); defaultProps = sa.getProperties(); sa.removePropertyChangeListener(screen); sa.removePropertyChangeListener(this); getFocusForMe(); sa = null; }
private void doAttributes() { SessionAttributes sa = new SessionAttributes(propFileName, defaultProps, (Frame)me.getParentView((Session)this)); sa.addPropertyChangeListener(screen); sa.addPropertyChangeListener(this); sa.showIt(); defaultProps = sa.getProperties(); sa.removePropertyChangeListener(screen); sa.removePropertyChangeListener(this); getFocusForMe(); sa = null; }
687
private void doMeTransfer() { XTFRFile xtrf = new XTFRFile(me.frame,vt); }
private void doMeTransfer() { XTFRFile xtrf = new XTFRFile(me.getParentView((Session)this),vt); }
688
private void mapMeKeys() { KeyConfigure kc; if (macros.isMacrosExist()) { String[] macrosList = macros.getMacroList(); kc = new KeyConfigure(me.frame,macrosList,vt.getCodePage()); } else kc = new KeyConfigure(me.frame,null,vt.getCodePage()); }
private void mapMeKeys() { KeyConfigure kc; if (macros.isMacrosExist()) { String[] macrosList = macros.getMacroList(); kc = new KeyConfigure(me.getParentView((Session)this),macrosList,vt.getCodePage()); } else kc = new KeyConfigure(me.frame,null,vt.getCodePage()); }
689
private void mapMeKeys() { KeyConfigure kc; if (macros.isMacrosExist()) { String[] macrosList = macros.getMacroList(); kc = new KeyConfigure(me.frame,macrosList,vt.getCodePage()); } else kc = new KeyConfigure(me.frame,null,vt.getCodePage()); }
private void mapMeKeys() { KeyConfigure kc; if (macros.isMacrosExist()) { String[] macrosList = macros.getMacroList(); kc = new KeyConfigure(me.frame,macrosList,vt.getCodePage()); } else kc = new KeyConfigure(me.getParentView((Session)this),null,vt.getCodePage()); }
690
private void sendScreenEMail() { SendEMailDialog semd = new SendEMailDialog(me.frame,screen); }
private void sendScreenEMail() { SendEMailDialog semd = new SendEMailDialog(me.getParentView((Session)this),screen); }
691
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x); char ac = vt.getASCIIChar(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; result = JOptionPane.showOptionDialog( me.frame, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x); char ac = vt.getASCIIChar(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; result = JOptionPane.showOptionDialog( me.getParentView((Session)this), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
692
public String toLowerCase() { return toLowerCase(Locale.getDefault()); }
public String toLowerCase(Locale loc) { return toLowerCase(Locale.getDefault()); }
693
public String toLowerCase() { return toLowerCase(Locale.getDefault()); }
public String toLowerCase() { boolean turkish = "tr".equals(loc.getLanguage()); int i = count; int x = offset - 1; while (--i >= 0) { char ch = value[++x]; if ((turkish && ch == '\u0049') || ch != Character.toLowerCase(ch)) break; } if (i < 0) return this; char[] newStr = (char[]) value.clone(); do { char ch = value[x]; newStr[x++] = (turkish && ch == '\u0049') ? '\u0131' : Character.toLowerCase(ch); } while (--i >= 0); return new String(newStr, offset, count, true); }
694
public int indexOf(String str) { return indexOf(str, 0); }
public int indexOf(int ch) { return indexOf(str, 0); }
695
public int indexOf(String str) { return indexOf(str, 0); }
public int indexOf(String str) { return indexOf(ch, 0); }
696
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic; }
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic; }
697
private static String getURIGroup(Matcher match, int group) { String matched = match.group(group); return matched.length() == 0 ? ((match.group(group - 1).length() == 0) ? null : "") : matched; }
private static String getURIGroup(Matcher match, int group) { String matched = match.group(group); return matched.length() == 0 ? ((match.group(group - 1).length() == 0) ? null : "") : matched; }
699
public static String valueOf(int i) { // See Integer to understand why we call the two-arg variant. return Integer.toString(i, 10); }
public static String valueOf(Object obj) { // See Integer to understand why we call the two-arg variant. return Integer.toString(i, 10); }
700
public static String valueOf(int i) { // See Integer to understand why we call the two-arg variant. return Integer.toString(i, 10); }
public static String valueOf(int i) { // See Integer to understand why we call the two-arg variant. return obj == null ? "null" : obj.toString(); }
701
public byte[] getBytes(String enc) throws UnsupportedEncodingException { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(CharacterCodingException e){ // XXX - Ignore coding exceptions? They shouldn't really happen. return null; } }
public void getBytes(int srcBegin, int srcEnd, byte dst[], int dstBegin) { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(CharacterCodingException e){ // XXX - Ignore coding exceptions? They shouldn't really happen. return null; } }
702
public byte[] getBytes(String enc) throws UnsupportedEncodingException { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(CharacterCodingException e){ // XXX - Ignore coding exceptions? They shouldn't really happen. return null; } }
public byte[] getBytes(String enc) throws UnsupportedEncodingException { try { CharsetEncoder cse = Charset.forName(enc).newEncoder(); cse.onMalformedInput(CodingErrorAction.REPLACE); cse.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer bbuf = cse.encode(CharBuffer.wrap(value, offset, count)); if(bbuf.hasArray()) return bbuf.array(); // Doubt this will happen. But just in case. byte[] bytes = new byte[bbuf.remaining()]; bbuf.get(bytes); return bytes; } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+enc+ " not found."); } catch(CharacterCodingException e){ // XXX - Ignore coding exceptions? They shouldn't really happen. return null; } }
703
public InternalError(String s) { super(s); }
public InternalError(String s) { super(s); }
704
public synchronized int indexOf(String str, int fromIndex) { if (fromIndex < 0) fromIndex = 0; int limit = count - str.count; for ( ; fromIndex <= limit; fromIndex++) if (regionMatches(fromIndex, str)) return fromIndex; return -1; }
public int indexOf(String str) { if (fromIndex < 0) fromIndex = 0; int limit = count - str.count; for ( ; fromIndex <= limit; fromIndex++) if (regionMatches(fromIndex, str)) return fromIndex; return -1; }
705
public synchronized int indexOf(String str, int fromIndex) { if (fromIndex < 0) fromIndex = 0; int limit = count - str.count; for ( ; fromIndex <= limit; fromIndex++) if (regionMatches(fromIndex, str)) return fromIndex; return -1; }
public synchronized int indexOf(String str, int fromIndex) { if (fromIndex < 0) fromIndex = 0; int limit = count - str.count; for ( ; fromIndex <= limit; fromIndex++) if (regionMatches(fromIndex, str)) return fromIndex; return -1; }
706
public synchronized String substring(int beginIndex, int endIndex) { int len = endIndex - beginIndex; if (beginIndex < 0 || endIndex > count || endIndex < beginIndex) throw new StringIndexOutOfBoundsException(); if (len == 0) return ""; // Don't copy unless substring is smaller than 1/4 of the buffer. boolean share_buffer = ((len << 2) >= value.length); if (share_buffer) this.shared = true; // Package constructor avoids an array copy. return new String(value, beginIndex, len, share_buffer); }
public String substring(int beginIndex) { int len = endIndex - beginIndex; if (beginIndex < 0 || endIndex > count || endIndex < beginIndex) throw new StringIndexOutOfBoundsException(); if (len == 0) return ""; // Don't copy unless substring is smaller than 1/4 of the buffer. boolean share_buffer = ((len << 2) >= value.length); if (share_buffer) this.shared = true; // Package constructor avoids an array copy. return new String(value, beginIndex, len, share_buffer); }
707
public synchronized String substring(int beginIndex, int endIndex) { int len = endIndex - beginIndex; if (beginIndex < 0 || endIndex > count || endIndex < beginIndex) throw new StringIndexOutOfBoundsException(); if (len == 0) return ""; // Don't copy unless substring is smaller than 1/4 of the buffer. boolean share_buffer = ((len << 2) >= value.length); if (share_buffer) this.shared = true; // Package constructor avoids an array copy. return new String(value, beginIndex, len, share_buffer); }
public synchronized String substring(int beginIndex, int endIndex) { int len = endIndex - beginIndex; if (beginIndex < 0 || endIndex > count || endIndex < beginIndex) throw new StringIndexOutOfBoundsException(); if (len == 0) return ""; // Don't copy unless substring is smaller than 1/4 of the buffer. boolean share_buffer = ((len << 2) >= value.length); if (share_buffer) this.shared = true; // Package constructor avoids an array copy. return new String(value, beginIndex, len, share_buffer); }
708
public String(byte[] data, int offset, int count, String encoding) throws UnsupportedEncodingException { if (offset < 0 || count < 0 || offset + count > data.length) throw new StringIndexOutOfBoundsException(); try { CharsetDecoder csd = Charset.forName(encoding).newDecoder(); csd.onMalformedInput(CodingErrorAction.REPLACE); csd.onUnmappableCharacter(CodingErrorAction.REPLACE); CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); if(cbuf.hasArray()) { value = cbuf.array(); this.offset = cbuf.position(); this.count = cbuf.remaining(); } else { // Doubt this will happen. But just in case. value = new char[cbuf.remaining()]; cbuf.get(value); this.offset = 0; this.count = value.length; } } catch(CharacterCodingException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } }
public String(byte[] data, int offset, int count, String encoding) throws UnsupportedEncodingException { if (offset < 0 || count < 0 || offset + count > data.length) throw new StringIndexOutOfBoundsException(); try { CharsetDecoder csd = Charset.forName(encoding).newDecoder(); csd.onMalformedInput(CodingErrorAction.REPLACE); csd.onUnmappableCharacter(CodingErrorAction.REPLACE); CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); if(cbuf.hasArray()) { value = cbuf.array(); this.offset = cbuf.position(); this.count = cbuf.remaining(); } else { // Doubt this will happen. But just in case. value = new char[cbuf.remaining()]; cbuf.get(value); this.offset = 0; this.count = value.length; } } catch(CharacterCodingException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } }
709
public String(byte[] data, int offset, int count, String encoding) throws UnsupportedEncodingException { if (offset < 0 || count < 0 || offset + count > data.length) throw new StringIndexOutOfBoundsException(); try { CharsetDecoder csd = Charset.forName(encoding).newDecoder(); csd.onMalformedInput(CodingErrorAction.REPLACE); csd.onUnmappableCharacter(CodingErrorAction.REPLACE); CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); if(cbuf.hasArray()) { value = cbuf.array(); this.offset = cbuf.position(); this.count = cbuf.remaining(); } else { // Doubt this will happen. But just in case. value = new char[cbuf.remaining()]; cbuf.get(value); this.offset = 0; this.count = value.length; } } catch(CharacterCodingException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } }
public String(byte[] data, int offset, int count, String encoding) throws UnsupportedEncodingException { if (offset < 0 || count < 0 || offset + count > data.length) throw new StringIndexOutOfBoundsException(); try { CharsetDecoder csd = Charset.forName(encoding).newDecoder(); csd.onMalformedInput(CodingErrorAction.REPLACE); csd.onUnmappableCharacter(CodingErrorAction.REPLACE); CharBuffer cbuf = csd.decode(ByteBuffer.wrap(data, offset, count)); if(cbuf.hasArray()) { value = cbuf.array(); this.offset = cbuf.position(); this.count = cbuf.remaining(); } else { // Doubt this will happen. But just in case. value = new char[cbuf.remaining()]; cbuf.get(value); this.offset = 0; this.count = value.length; } } catch(CharacterCodingException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(IllegalCharsetNameException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } catch(UnsupportedCharsetException e){ throw new UnsupportedEncodingException("Encoding: "+encoding+ " not found."); } }
710
public boolean isComponentPartOfCurrentMenu(Component c) { MenuElement[] subElements; for (int i = 0; i < selectedPath.size(); i++) { subElements = ((MenuElement) selectedPath.get(i)).getSubElements(); for (int j = 0; j < subElements.length; j++) { if ((subElements[j].getComponent()).equals(c)) return true; } } return false; }
public boolean isComponentPartOfCurrentMenu(Component c) { MenuElement[] subElements; for (int i = 0; i < selectedPath.size(); i++) { subElements = ((MenuElement) selectedPath.get(i)).getSubElements(); for (int j = 0; j < subElements.length; j++) { MenuElement me = subElements[j]; if (me != null && (me.getComponent()).equals(c)) return true; } } return false; }
711
void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager);
void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager);
712
int distance(Rectangle r, int x, int y) { if (y < r.y) return r.y - y; else if (y > r.y + r.height) return y - (r.y + r.height); else return 0; }
int distance(Rectangle r, int x, int y) { if (y < r.y) return r.y - y; else if (y > r.y + r.height) return y - (r.y + r.height); else return 0; }
713