rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
public String nextToken() throws NoSuchElementException | public String nextToken(String delim) throws 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(); } |
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(); | this.delim = delim; return nextToken(); | 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 ClassNotFoundException(String s) | public ClassNotFoundException() | public ClassNotFoundException(String s) { this(s, null); } |
this(s, null); | this(null); | public ClassNotFoundException(String s) { this(s, null); } |
textComponent.setBackground(defaults.getColor(prefix + ".background")); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); | 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")); } |
|
background = defaults.getColor(prefix + ".background"); inactiveBackground = defaults.getColor(prefix + ".inactiveBackground"); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setDisabledTextColor (defaults.getColor(prefix + ".inactiveForeground")); | 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")); } |
|
if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); | protected void paintBackground(Graphics g) { g.setColor(textComponent.getBackground()); g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); } |
|
Ext2Debugger.debug("FSEntryIterator()",2); | log.debug("FSEntryIterator()"); | 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); } |
Ext2Debugger.debug("FSEntryIterator.hasNext()",3); | log.debug("FSEntryIterator.hasNext()"); | 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; } } |
Ext2Debugger.debug("FSEntryIterator.hasNext(): null inode",2); | log.debug("FSEntryIterator.hasNext(): null inode"); | 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; } } |
Ext2Debugger.debug("FSEntryIterator.next()",2); | log.debug("FSEntryIterator.next()"); | 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(); } } |
Ext2Debugger.debug("Ext2Directory.Iterator()",2); | log.debug("Ext2Directory.Iterator()"); | public Iterator iterator() { Ext2Debugger.debug("Ext2Directory.Iterator()",2); return new FSEntryIterator(iNode); } |
public UnsupportedOperationException(String s) { super(s); | public UnsupportedOperationException() { | public UnsupportedOperationException(String s) { super(s); } |
public Object copyObject(Object obj, javax.rmi.ORB orb) | public Object copyObject(Object obj, ORB orb) | public Object copyObject(Object obj, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | 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; | public Object copyObject(Object obj, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); } |
public Object[] copyObjects(Object obj[], javax.rmi.ORB orb) | public Object[] copyObjects(Object[] obj, ORB orb) | public Object[] copyObjects(Object obj[], javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | return (Object[]) copyObject(obj, orb); | public Object[] copyObjects(Object obj[], javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | if (m_ValueHandler == null) m_ValueHandler = (ValueHandler) DelegateFactory.getInstance(DelegateFactory.VALUEHANDLER); return m_ValueHandler; | public ValueHandler createValueHandler() { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | return RMIClassLoader.getClassAnnotation(clz); | public String getCodebase(Class clz) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | 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; } | public Tie getTie(Remote target) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | try { return stub._is_local(); } catch (SystemException e) { RemoteException rex = new RemoteException(); rex.initCause(e); throw rex; } | public boolean isLocal(Stub stub) throws RemoteException { throw new Error("Not implemented for UtilDelegate"); } |
try{ if (remoteCodebase == null) return RMIClassLoader.loadClass(className); else | if (loader == null) loader = Thread.currentThread().getContextClassLoader(); String p_useCodebaseOnly = System.getProperty("java.rmi.server.useCodebaseOnly"); boolean useCodebaseOnly = p_useCodebaseOnly != null && p_useCodebaseOnly.trim().equalsIgnoreCase("true"); try { if (remoteCodebase != null && !useCodebaseOnly) | 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; } } |
catch (MalformedURLException e1) | catch (Exception e) | 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; } } |
throw new ClassNotFoundException(className, e1); | 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; } } |
|
catch(ClassNotFoundException e2) | try | 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; } } |
if(loader != null) return loader.loadClass(className); else return null; | if (remoteCodebase == null || useCodebaseOnly) return RMIClassLoader.loadClass(remoteCodebase, className); | 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; } } |
catch (Exception e) { } if (loader != null) return Class.forName(className, true, loader); throw new ClassNotFoundException(className + " at " + remoteCodebase); | 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; } } |
|
throw new Error("Not implemented for UtilDelegate"); | 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(); | public RemoteException mapSystemException(SystemException ex) { throw new Error("Not implemented for UtilDelegate"); } |
String name = ex.getClass().getName(); if (name.startsWith(m_StandardPackage)) name = name.substring(m_StandardPackage.length()); String message = "CORBA " + name + " 0x" + Integer.toHexString(ex.minor) + " " + status; if (ex instanceof COMM_FAILURE) rex = new MarshalException(message, ex); else if (ex instanceof INV_OBJREF) { rex = new NoSuchObjectException(message); rex.initCause(ex); } else if (ex instanceof NO_PERMISSION) rex = new AccessException(message, ex); else if (ex instanceof MARSHAL) rex = new MarshalException(message, ex); else if (ex instanceof BAD_PARAM) rex = new MarshalException(message, ex); else if (ex instanceof OBJECT_NOT_EXIST) { rex = new NoSuchObjectException(message); rex.initCause(ex); } else if (ex instanceof TRANSACTION_REQUIRED) { rex = new TransactionRequiredException(message); rex.initCause(ex); } else if (ex instanceof TRANSACTION_ROLLEDBACK) { rex = new TransactionRolledbackException(message); rex.initCause(ex); } else if (ex instanceof INVALID_TRANSACTION) { rex = new InvalidTransactionException(message); rex.initCause(ex); } else if (ex instanceof UNKNOWN) rex = wrapException(ex.getCause()); else rex = new RemoteException(message, ex); return rex; } | public RemoteException mapSystemException(SystemException ex) { throw new Error("Not implemented for UtilDelegate"); } |
|
public Object readAny(InputStream in) | public Object readAny(InputStream input) | public Object readAny(InputStream in) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | return input.read_any(); | public Object readAny(InputStream in) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | 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); | public void registerTarget(Tie tie, Remote target) { throw new Error("Not implemented for UtilDelegate"); } |
} } } | public void registerTarget(Tie tie, Remote target) { throw new Error("Not implemented for UtilDelegate"); } |
|
throw new Error("Not implemented for UtilDelegate"); | 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; } } } } } } } | public void unexportObject(Remote target) { throw new Error("Not implemented for UtilDelegate"); } |
public RemoteException wrapException(Throwable orig) | public RemoteException wrapException(Throwable ex) throws RuntimeException | public RemoteException wrapException(Throwable orig) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | 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); | public RemoteException wrapException(Throwable orig) { throw new Error("Not implemented for UtilDelegate"); } |
public void writeAbstractObject(OutputStream out, Object obj) | public void writeAbstractObject(OutputStream output, Object object) | public void writeAbstractObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | ((org.omg.CORBA_2_3.portable.OutputStream) output).write_abstract_interface(object); | public void writeAbstractObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); } |
public void writeAny(OutputStream out, Object obj) | public void writeAny(OutputStream output, Object object) | public void writeAny(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | 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; } | public void writeAny(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); } |
public void writeRemoteObject(OutputStream out, Object obj) | public void writeRemoteObject(OutputStream an_output, Object object) | public void writeRemoteObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); } |
throw new Error("Not implemented for UtilDelegate"); | 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); | public void writeRemoteObject(OutputStream out, Object obj) { throw new Error("Not implemented for UtilDelegate"); } |
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException | public static Object getInstance(String type) throws InternalError | 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); } } |
Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); | String propertyName = "javax.rmi.CORBA." + type + "Class"; String dcname = System.getProperty(propertyName); | 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); } } |
Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; | Class dclass = ObjectCreator.forName(dcname); return dclass.newInstance(); | 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); } } |
throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); | InternalError ierr = new InternalError("Exception when trying to get " + type + "delegate instance:" + dcname); ierr.initCause(e); throw ierr; | 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); } } |
if(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"); } |
|
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"); } |
|
public boolean startsWith(String prefix) | public boolean startsWith(String prefix, int toffset) | public boolean startsWith(String prefix) { return regionMatches(false, 0, prefix, 0, prefix.count); } |
return regionMatches(false, 0, prefix, 0, prefix.count); | return regionMatches(false, toffset, prefix, 0, prefix.count); | public boolean startsWith(String prefix) { return regionMatches(false, 0, prefix, 0, prefix.count); } |
void unexportObject(Remote target); | void unexportObject(Remote target) throws NoSuchObjectException; | void unexportObject(Remote target); |
javax.rmi.ORB orb(); | ORB orb(); | javax.rmi.ORB orb(); |
void deactivate(); | void deactivate() throws NoSuchObjectException; | void deactivate(); |
Class helperClass = Class.forName(helperClassName); | Class helperClass = forName(helperClassName); | 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 abstract void insert_Value(Serializable x); | public abstract void insert_Value(Serializable x, TypeCode typecode); | public abstract void insert_Value(Serializable x); |
(Frame)me.frame); | (Frame)me.getParentView((Session)this)); | 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; } |
XTFRFile xtrf = new XTFRFile(me.frame,vt); | XTFRFile xtrf = new XTFRFile(me.getParentView((Session)this),vt); | private void doMeTransfer() { XTFRFile xtrf = new XTFRFile(me.frame,vt); } |
kc = new KeyConfigure(me.frame,macrosList,vt.getCodePage()); | kc = new KeyConfigure(me.getParentView((Session)this),macrosList,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.frame,null,vt.getCodePage()); } |
kc = new KeyConfigure(me.frame,null,vt.getCodePage()); | kc = new KeyConfigure(me.getParentView((Session)this),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.frame,null,vt.getCodePage()); } |
SendEMailDialog semd = new SendEMailDialog(me.frame,screen); | SendEMailDialog semd = new SendEMailDialog(me.getParentView((Session)this),screen); | private void sendScreenEMail() { SendEMailDialog semd = new SendEMailDialog(me.frame,screen); } |
me.frame, | me.getParentView((Session)this), | 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; } } |
public String toLowerCase() | public String toLowerCase(Locale loc) | public String toLowerCase() { return toLowerCase(Locale.getDefault()); } |
return toLowerCase(Locale.getDefault()); | 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); | public String toLowerCase() { return toLowerCase(Locale.getDefault()); } |
public int indexOf(String str) | public int indexOf(int ch) | public int indexOf(String str) { return indexOf(str, 0); } |
return indexOf(str, 0); | return indexOf(ch, 0); | public int indexOf(String str) { return indexOf(str, 0); } |
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); | public final static String getKeyStrokeText(KeyEvent ke) { if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); | 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; } |
System.out.println("getKeyStrokeText " + 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; } |
|
return matched.length() == 0 ? ((match.group(group - 1).length() == 0) ? null : "") : matched; | if (matched == null || matched.length() == 0) { String prevMatched = match.group(group -1); if (prevMatched == null || prevMatched.length() == 0) return null; else return ""; } return 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; } |
public static String valueOf(int i) | public static String valueOf(Object obj) | public static String valueOf(int i) { // See Integer to understand why we call the two-arg variant. return Integer.toString(i, 10); } |
return Integer.toString(i, 10); | return obj == null ? "null" : obj.toString(); | public static String valueOf(int i) { // See Integer to understand why we call the two-arg variant. return Integer.toString(i, 10); } |
public byte[] getBytes(String enc) throws UnsupportedEncodingException | public void getBytes(int srcBegin, int srcEnd, byte dst[], int dstBegin) | 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; } } |
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(); 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){ return null; } | if (srcBegin < 0 || srcBegin > srcEnd || srcEnd > count) throw new StringIndexOutOfBoundsException(); int i = srcEnd - srcBegin; srcBegin += offset; while (--i >= 0) dst[dstBegin++] = (byte) value[srcBegin++]; | 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 InternalError(String s) { super(s); | public InternalError() { | public InternalError(String s) { super(s); } |
public synchronized int indexOf(String str, int fromIndex) | public int indexOf(String str) | 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; } |
if (fromIndex < 0) fromIndex = 0; int limit = count - str.count; for ( ; fromIndex <= limit; fromIndex++) if (regionMatches(fromIndex, str)) return fromIndex; return -1; | return indexOf(str, 0); | 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 String substring(int beginIndex, int endIndex) | public String substring(int beginIndex) | 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); } |
int len = endIndex - beginIndex; if (beginIndex < 0 || endIndex > count || endIndex < beginIndex) throw new StringIndexOutOfBoundsException(); if (len == 0) return ""; boolean share_buffer = ((len << 2) >= value.length); if (share_buffer) this.shared = true; return new String(value, beginIndex, len, share_buffer); | return substring(beginIndex, count); | 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(byte[] data, int offset, int count, String encoding) throws UnsupportedEncodingException | public String() | 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."); } } |
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 { 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."); } | value = "".value; offset = 0; count = 0; | 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."); } } |
if ((subElements[j].getComponent()).equals(c)) | MenuElement me = subElements[j]; if (me != null && (me.getComponent()).equals(c)) | 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; } |
else if (y > r.y + r.height) return y - (r.y + r.height); | else if (y > r.y + r.height - 1) return y - (r.y + r.height - 1); | 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; } |
public void setRect(Rectangle2D r) { setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } | public abstract void setRect(double x, double y, double w, double h); | public void setRect(Rectangle2D r) { setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } |
calculateTiledPositions(allocated, total, children, offsets, spans, true); | calculateAlignedPositions(allocated, total, children, offsets, spans, true); | public static void calculateAlignedPositions(int allocated, SizeRequirements total, SizeRequirements[] children, int[] offsets, int[] spans) { calculateTiledPositions(allocated, total, children, offsets, spans, true); } |
public void setDividerLocation(int location) | public void setDividerLocation(double proportionalLocation) | public void setDividerLocation(int location) { if (ui != null && location != getDividerLocation()) { int oldLocation = getDividerLocation(); ((SplitPaneUI) ui).setDividerLocation(this, location); firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldLocation, location); } } |
if (ui != null && location != getDividerLocation()) { int oldLocation = getDividerLocation(); ((SplitPaneUI) ui).setDividerLocation(this, location); firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldLocation, location); } | if (proportionalLocation > 1 || proportionalLocation < 0) throw new IllegalArgumentException("proportion has to be between 0 and 1."); int max = (orientation == HORIZONTAL_SPLIT) ? getWidth() : getHeight(); setDividerLocation((int) (proportionalLocation * max)); | public void setDividerLocation(int location) { if (ui != null && location != getDividerLocation()) { int oldLocation = getDividerLocation(); ((SplitPaneUI) ui).setDividerLocation(this, location); firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldLocation, location); } } |
public PlainDatagramSocketImpl() | public PlainDatagramSocketImpl() throws IOException | public PlainDatagramSocketImpl() { } |
channel = new VMChannel(); impl = new VMPlainSocketImpl(channel); | public PlainDatagramSocketImpl() { } |
|
throw new SocketException("Not implemented"); | try { impl.bind(new InetSocketAddress(addr, port)); } catch (SocketException se) { throw se; } catch (IOException ioe) { SocketException se = new SocketException(); se.initCause(ioe); throw se; } | protected synchronized void bind(int port, InetAddress addr) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); } |
protected synchronized void close() { throw new RuntimeException("Not implemented"); | protected synchronized void close() { try { if (channel.getState().isValid()) channel.close(); } catch (IOException ioe) { } | protected synchronized void close() { // @vm-specific no natives //TODO implement me throw new RuntimeException("Not implemented"); } |
protected synchronized void create() throws SocketException { throw new SocketException("Not implemented"); | protected synchronized void create() throws SocketException { try { channel.initSocket(false); } catch (SocketException se) { throw se; } catch (IOException ioe) { SocketException se = new SocketException(); se.initCause(ioe); throw se; } | protected synchronized void create() throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); } |
public synchronized Object getOption(int option_id) throws SocketException { throw new SocketException("Not implemented"); | public synchronized Object getOption(int optionId) throws SocketException { if (optionId == SO_BINDADDR) { try { InetSocketAddress local = channel.getLocalAddress(); if (local == null) return null; return local.getAddress(); } catch (SocketException se) { throw se; } catch (IOException ioe) { SocketException se = new SocketException(); se.initCause(ioe); throw se; } } if (optionId == IP_MULTICAST_IF || optionId == IP_MULTICAST_IF2) return impl.getMulticastInterface(optionId); return impl.getOption(optionId); | public synchronized Object getOption(int option_id) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); } |
Object obj = getOption(IP_TTL); if (! (obj instanceof Integer)) throw new IOException("Internal Error"); return ((Integer) obj).intValue(); | return impl.getTimeToLive(); | protected synchronized int getTimeToLive() throws IOException { Object obj = getOption(IP_TTL); if (! (obj instanceof Integer)) throw new IOException("Internal Error"); return ((Integer) obj).intValue(); } |
protected synchronized void join(InetAddress addr) throws IOException { throw new SocketException("Not implemented"); | protected synchronized void join(InetAddress addr) throws IOException { impl.join(addr); | protected synchronized void join(InetAddress addr) throws IOException { // @vm-specific no natives throw new SocketException("Not implemented"); } |
throw new InternalError ("PlainDatagramSocketImpl::joinGroup is not implemented"); | if (address == null) throw new NullPointerException(); if (!(address instanceof InetSocketAddress)) throw new SocketException("unknown address type"); impl.joinGroup((InetSocketAddress) address, netIf); | public void joinGroup(SocketAddress address, NetworkInterface netIf) { throw new InternalError ("PlainDatagramSocketImpl::joinGroup is not implemented"); } |
protected synchronized void leave(InetAddress addr) throws IOException { throw new SocketException("Not implemented"); | protected synchronized void leave(InetAddress addr) throws IOException { impl.leave(addr); | protected synchronized void leave(InetAddress addr) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); } |
throw new InternalError ("PlainDatagramSocketImpl::leaveGroup is not implemented"); | if (address == null) throw new NullPointerException(); if (!(address instanceof InetSocketAddress)) throw new SocketException("unknown address type"); impl.leaveGroup((InetSocketAddress) address, netIf); | public void leaveGroup(SocketAddress address, NetworkInterface netIf) { throw new InternalError ("PlainDatagramSocketImpl::leaveGroup is not implemented"); } |
synchronized(RECEIVE_LOCK) { receive0(packet); } | synchronized(RECEIVE_LOCK) { ByteBuffer buf = ByteBuffer.wrap(packet.getData(), packet.getOffset(), packet.getLength()); SocketAddress addr = null; while (true) { try { addr = channel.receive(buf); break; } catch (SocketTimeoutException ste) { throw ste; } catch (InterruptedIOException iioe) { } } if (addr != null) packet.setSocketAddress(addr); packet.setLength(buf.position() - packet.getOffset()); } | protected void receive(DatagramPacket packet) throws IOException { synchronized(RECEIVE_LOCK) { receive0(packet); } } |
sendto(packet.getAddress(), packet.getPort(), packet.getData(), packet.getOffset(), packet.getLength()); | ByteBuffer buf = ByteBuffer.wrap(packet.getData(), packet.getOffset(), packet.getLength()); InetAddress remote = packet.getAddress(); int port = packet.getPort(); if (remote == null) throw new NullPointerException(); if (port <= 0) throw new SocketException("invalid port " + port); while (true) { try { channel.send(buf, new InetSocketAddress(remote, port)); break; } catch (InterruptedIOException ioe) { } } | protected void send(DatagramPacket packet) throws IOException { synchronized(SEND_LOCK) { sendto(packet.getAddress(), packet.getPort(), packet.getData(), packet.getOffset(), packet.getLength()); } } |
public synchronized void setOption(int option_id, Object val) throws SocketException { throw new SocketException("Not implemented"); | public synchronized void setOption(int optionId, Object value) throws SocketException { switch (optionId) { case IP_MULTICAST_IF: case IP_MULTICAST_IF2: impl.setMulticastInterface(optionId, (InetAddress) value); break; case IP_MULTICAST_LOOP: case SO_BROADCAST: case SO_KEEPALIVE: case SO_OOBINLINE: case TCP_NODELAY: case IP_TOS: case SO_LINGER: case SO_RCVBUF: case SO_SNDBUF: case SO_TIMEOUT: case SO_REUSEADDR: impl.setOption(optionId, value); return; default: throw new SocketException("cannot set option " + optionId); } | public synchronized void setOption(int option_id, Object val) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); } |
setOption(IP_TTL, new Integer(ttl)); | impl.setTimeToLive(ttl); | protected synchronized void setTimeToLive(int ttl) throws IOException { setOption(IP_TTL, new Integer(ttl)); } |