rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
public final Set selectedKeys() | public final Set<SelectionKey> selectedKeys() | public final Set selectedKeys() { if (!isOpen()) throw new ClosedSelectorException(); return selected; } |
POA poa; | gnuPOA poa; | protected IOR createIOR(cObject ref) throws BAD_OPERATION { IOR ior = super.createIOR(ref); if (iIor != null) { AOM.Obj obj = rootPOA.findIorKey(ior.key); POA poa; // Null means that the object was connected to the ORB directly. if (obj == null) poa = rootPOA; ... |
iIor.components_established(info); | protected IOR createIOR(cObject ref) throws BAD_OPERATION { IOR ior = super.createIOR(ref); if (iIor != null) { AOM.Obj obj = rootPOA.findIorKey(ior.key); POA poa; // Null means that the object was connected to the ORB directly. if (obj == null) poa = rootPOA; ... | |
throw new DomEx(DomEx.NOT_SUPPORTED_ERR, | throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, | protected DomIterator(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) { if (!root.isSupported("MutationEvents", "2.0")) { throw new DomEx(DomEx.NOT_SUPPORTED_ERR, "Iterator need... |
throw new DomEx(DomEx.INVALID_STATE_ERR); | throw new DomDOMException(DOMException.INVALID_STATE_ERR); | public Node nextNode() { if (done) { throw new DomEx(DomEx.INVALID_STATE_ERR); } right = true; return walk(true); } |
throw new DomEx(DomEx.INVALID_STATE_ERR); | throw new DomDOMException(DOMException.INVALID_STATE_ERR); | public Node previousNode() { if (done) { throw new DomEx(DomEx.INVALID_STATE_ERR); } Node previous = reference; right = false; walk(false); return previous; } |
pred.addSuccessor(succ); | branchTargets.put(new Integer(getInstructionAddress()), new Integer(target)); | private final void addBranch(int target, byte flags) { IRBasicBlock pred = this.currentBlock; IRBasicBlock succ = startBB(target); pred.addSuccessor(succ); endBB(flags); } |
Iterator it = branchTargets.keySet().iterator(); while (it.hasNext()) { Integer from = (Integer) it.next(); Integer to = (Integer) branchTargets.get(from); findBB(list, from.intValue()).addSuccessor(findBB(list, to.intValue())); } | public IRBasicBlock[] createBasicBlocks() { // Sort the blocks on start PC Collections.sort(blocks, this); // Create the array final IRBasicBlock[] list = (IRBasicBlock[])blocks.toArray(new IRBasicBlock[blocks.size()]); // Set the EndPC's and flags final byte[] opcodeFlags = this.opcodeFlags; final byte[] branc... | |
case EX_CLASSCAST: return new ClassCastException(); | public static Throwable systemException(int nr, int address) throws UninterruptiblePragma, LoadStaticsPragma, PrivilegedActionPragma { //Unsafe.getCurrentProcessor().getArchitecture().getStackReader().debugStackTrace(); if (false) { Unsafe.debug(nr); Unsafe.debug(address); Unsafe.die("System exception"); ... | |
getLocalName().equals(other.getLocalName()); | equal(getLocalName(), other.getLocalName()); | public boolean nameAndTypeEquals(Node other) { if (other == this) { return true; } // node types must match if (nodeType != other.getNodeType()) { return false; } // if both have namespaces, do a "full" comparision // this is a "global" partition String ns1 = this.... |
if (loader != null) | if (loader == null) loader = ClassLoader.getSystemClassLoader(); | public Class getUIClass(String id, ClassLoader loader) { String className = (String) get (id); if (className == null) return null; try { if (loader != null) return loader.loadClass (className); return Class.forName (className); } catch (Exception e) { ... |
return Class.forName (className); | public Class getUIClass(String id, ClassLoader loader) { String className = (String) get (id); if (className == null) return null; try { if (loader != null) return loader.loadClass (className); return Class.forName (className); } catch (Exception e) { ... | |
int x2 = x1 + w.width + hgap; | int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_... |
x3 = x2 + w.width + hgap; | x3 = x2 + w.width + (w.width == 0 ? 0 : hgap); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_... |
int y2 = y1 + n.height + vgap; | int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_... |
int hh = y3-y2-vgap; | int hh = y3-y2-(s.height == 0 ? 0 : vgap); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_... |
setBounds(center, x2, y2, x3-x2-hgap, hh); | setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_... |
"FormattedTextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractU... | |
ex.printStackTrace(); | log.error("Error in FBTest", ex); | public static void main(String[] args) throws Exception { final String devId = (args.length > 0) ? args[0] : "fb0"; final int count = (args.length > 1) ? Integer.parseInt(args[1]) : 100; final String tests = (args.length > 2) ? args[2] : "plrREQ"; Surface g = null; try { ... |
log.info("End of FBTest"); | public static void main(String[] args) throws Exception { final String devId = (args.length > 0) ? args[0] : "fb0"; final int count = (args.length > 1) ? Integer.parseInt(args[1]) : 100; final String tests = (args.length > 2) ? args[2] : "plrREQ"; Surface g = null; try { ... | |
System.out.println("Loop count " + count); | log.info("Loop count " + count); | protected void perform() { System.out.println("Loop count " + count); if (tests.indexOf('l') >= 0) { System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawSha... |
System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawShapeLineTest(), Surface.XOR_MODE)); | log.info("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); log.info("Shape Line XOR " + performTest(new DrawShapeLineTest(), Surface.XOR_MODE)); | protected void perform() { System.out.println("Loop count " + count); if (tests.indexOf('l') >= 0) { System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawSha... |
System.out.println("Shape Rect PAINT " + performTest(new DrawShapeRectTest(), Surface.PAINT_MODE)); System.out.println("Shape Rect XOR " + performTest(new DrawShapeRectTest(), Surface.XOR_MODE)); | log.info("Shape Rect PAINT " + performTest(new DrawShapeRectTest(), Surface.PAINT_MODE)); log.info("Shape Rect XOR " + performTest(new DrawShapeRectTest(), Surface.XOR_MODE)); | protected void perform() { System.out.println("Loop count " + count); if (tests.indexOf('l') >= 0) { System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawSha... |
System.out.println("Shape Ellipse PAINT " + performTest(new DrawShapeEllipseTest(), Surface.PAINT_MODE)); | log.info("Shape Ellipse PAINT " + performTest(new DrawShapeEllipseTest(), Surface.PAINT_MODE)); | protected void perform() { System.out.println("Loop count " + count); if (tests.indexOf('l') >= 0) { System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawSha... |
System.out.println("Shape Arc PAINT " + performTest(new DrawShapeArcTest(), Surface.PAINT_MODE)); | log.info("Shape Arc PAINT " + performTest(new DrawShapeArcTest(), Surface.PAINT_MODE)); | protected void perform() { System.out.println("Loop count " + count); if (tests.indexOf('l') >= 0) { System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawSha... |
System.out.println("Shape QuadCurve PAINT " + performTest(new DrawShapeQuadTest(), Surface.PAINT_MODE)); | log.info("Shape QuadCurve PAINT " + performTest(new DrawShapeQuadTest(), Surface.PAINT_MODE)); | protected void perform() { System.out.println("Loop count " + count); if (tests.indexOf('l') >= 0) { System.out.println("Shape Line PAINT " + performTest(new DrawShapeLineTest(), Surface.PAINT_MODE)); System.out.println("Shape Line XOR " + performTest(new DrawSha... |
public void write(byte[] buf, int off, int len) throws IOException | public synchronized void write(byte[] buf, int off, int len) throws IOException | public void write(byte[] buf, int off, int len) throws IOException { crc.update(buf, off, len); super.write(buf, off, len); } |
super.write(buf, off, len); | public void write(byte[] buf, int off, int len) throws IOException { crc.update(buf, off, len); super.write(buf, off, len); } | |
ButtonModel m = b.getModel(); | public void update(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; ButtonModel m = b.getModel(); if (b.isContentAreaFilled() && (UIManager.get(getPropertyPrefix() + "gradient") != null) && ! m.isPressed() && ! m.isArmed() && b.isEnabled() && (b.getBackground() ... | |
&& ! m.isPressed() && ! m.isArmed() | public void update(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; ButtonModel m = b.getModel(); if (b.isContentAreaFilled() && (UIManager.get(getPropertyPrefix() + "gradient") != null) && ! m.isPressed() && ! m.isArmed() && b.isEnabled() && (b.getBackground() ... | |
{ MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, getPropertyPrefix() + "gradient"); paint(g, c); } | updateWidthGradient(g, b, b.getParent()); | public void update(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; ButtonModel m = b.getModel(); if (b.isContentAreaFilled() && (UIManager.get(getPropertyPrefix() + "gradient") != null) && ! m.isPressed() && ! m.isArmed() && b.isEnabled() && (b.getBackground() ... |
public void addChangeListener(ChangeListener listener) { } | public void addChangeListener (ChangeListener listener) { listenerList.add (ChangeListener.class, listener); } | public void addChangeListener(ChangeListener listener) { // TODO } // addChangeListener() |
protected void fireStateChanged() { } | protected void fireStateChanged() { ChangeListener[] listeners = getChangeListeners(); for (int i = 0; i < listeners.length; i++) listeners [i].stateChanged (changeEvent); } | protected void fireStateChanged() { // TODO } // fireStateChanged() |
public Color getSelectedColor() { return null; } | public Color getSelectedColor() { return selectedColor; } | public Color getSelectedColor() { return null; // TODO } // getSelectedColor() |
public void removeChangeListener(ChangeListener listener) { } | public void removeChangeListener (ChangeListener listener) { listenerList.remove (ChangeListener.class, listener); } | public void removeChangeListener(ChangeListener listener) { // TODO } // removeChangeListener() |
public void setSelectedColor(Color color) { } | public void setSelectedColor (Color color) { this.selectedColor = color; } | public void setSelectedColor(Color color) { // TODO } // setSelectedColor() |
public InetAddress(byte[] ipaddr) { this(ipaddr, null, null); } | InetAddress(byte[] ipaddr, String hostname) { addr = new byte[ipaddr.length]; for (int i = 0; i < ipaddr.length; i++) addr[i] = ipaddr[i]; this.hostName = hostname; lookup_time = System.currentTimeMillis(); family = 2; } | public InetAddress(byte[] ipaddr) { this(ipaddr, null, null); } |
if (cache_size == 0) return (null); | if (cache_size == 0) return null; | private static synchronized InetAddress[] checkCacheFor(String hostname) { InetAddress[] addresses = null; if (cache_size == 0) return (null); Object obj = cache.get(hostname); if (obj == null) return (null); if (obj instanceof InetAddress[]) addresses = (InetAddress[]) obj; ... |
Object obj = cache.get(hostname); if (obj == null) return (null); | Object obj = cache.get(hostname); if (obj == null) return null; | private static synchronized InetAddress[] checkCacheFor(String hostname) { InetAddress[] addresses = null; if (cache_size == 0) return (null); Object obj = cache.get(hostname); if (obj == null) return (null); if (obj instanceof InetAddress[]) addresses = (InetAddress[]) obj; ... |
if (addresses == null) return (null); | if (addresses == null) return null; | private static synchronized InetAddress[] checkCacheFor(String hostname) { InetAddress[] addresses = null; if (cache_size == 0) return (null); Object obj = cache.get(hostname); if (obj == null) return (null); if (obj instanceof InetAddress[]) addresses = (InetAddress[]) obj; ... |
if (cache_period != -1) if ((System.currentTimeMillis() - addresses[ 0].lookup_time) > cache_period) { cache.remove(hostname); return (null); } | if (cache_period != -1) if ((System.currentTimeMillis() - addresses[0].lookup_time) > cache_period) { cache.remove(hostname); return null; } | private static synchronized InetAddress[] checkCacheFor(String hostname) { InetAddress[] addresses = null; if (cache_size == 0) return (null); Object obj = cache.get(hostname); if (obj == null) return (null); if (obj instanceof InetAddress[]) addresses = (InetAddress[]) obj; ... |
byte[] test_ip = ((InetAddress) obj).getAddress(); | byte[] addr2 = ((InetAddress) obj).addr; | public boolean equals(Object obj) { if (!(obj instanceof InetAddress)) return false; byte[] test_ip = ((InetAddress) obj).getAddress(); if (test_ip.length != addr.length) return (false); for (int i = 0; i < addr.length; i++) if (test_ip[ i] != (byte) addr[ i]) return (false); ... |
if (test_ip.length != addr.length) return (false); | if (addr.length != addr2.length) return false; | public boolean equals(Object obj) { if (!(obj instanceof InetAddress)) return false; byte[] test_ip = ((InetAddress) obj).getAddress(); if (test_ip.length != addr.length) return (false); for (int i = 0; i < addr.length; i++) if (test_ip[ i] != (byte) addr[ i]) return (false); ... |
if (test_ip[ i] != (byte) addr[ i]) return (false); | if (addr[i] != addr2[i]) return false; | public boolean equals(Object obj) { if (!(obj instanceof InetAddress)) return false; byte[] test_ip = ((InetAddress) obj).getAddress(); if (test_ip.length != addr.length) return (false); for (int i = 0; i < addr.length; i++) if (test_ip[ i] != (byte) addr[ i]) return (false); ... |
return (true); | return true; | public boolean equals(Object obj) { if (!(obj instanceof InetAddress)) return false; byte[] test_ip = ((InetAddress) obj).getAddress(); if (test_ip.length != addr.length) return (false); for (int i = 0; i < addr.length; i++) if (test_ip[ i] != (byte) addr[ i]) return (false); ... |
public byte[] getAddress() { byte[] ipaddr = new byte[ addr.length]; for (int i = 0; i < addr.length; i++) { ipaddr[ i] = (byte) addr[ i]; } return ipaddr; | public byte[] getAddress() { return (byte[]) addr.clone(); | public byte[] getAddress() { byte[] ipaddr = new byte[ addr.length]; for (int i = 0; i < addr.length; i++) { ipaddr[ i] = (byte) addr[ i]; } return ipaddr; } |
throws UnknownHostException { if (hostname == null) { InetAddress local = getLocalHost(); return getAllByName(local.getHostName()); } | throws UnknownHostException { SecurityManager s = System.getSecurityManager(); if (s != null) s.checkConnect(hostname, -1); | public static InetAddress[] getAllByName(String hostname) throws UnknownHostException { // Default to current host if necessary if (hostname == null) { InetAddress local = getLocalHost(); return getAllByName(local.getHostName()); } // Check the cache for ... |
InetAddress[] addresses = checkCacheFor(hostname); if (addresses != null) return (addresses); | InetAddress[] addresses; | public static InetAddress[] getAllByName(String hostname) throws UnknownHostException { // Default to current host if necessary if (hostname == null) { InetAddress local = getLocalHost(); return getAllByName(local.getHostName()); } // Check the cache for ... |
addresses = getHostByName(hostname); if ((addresses == null) || (addresses.length == 0)) { throw new UnknownHostException( hostname); } | if (hostname == null) { addresses = new InetAddress[1]; addresses[0] = LOCALHOST; return addresses; } | public static InetAddress[] getAllByName(String hostname) throws UnknownHostException { // Default to current host if necessary if (hostname == null) { InetAddress local = getLocalHost(); return getAllByName(local.getHostName()); } // Check the cache for ... |
addToCache(hostname, addresses); | addresses = checkCacheFor(hostname); | public static InetAddress[] getAllByName(String hostname) throws UnknownHostException { // Default to current host if necessary if (hostname == null) { InetAddress local = getLocalHost(); return getAllByName(local.getHostName()); } // Check the cache for ... |
return addresses; | if (addresses != null) return addresses; byte[][] iplist = VMInetAddress.getHostByName(hostname); if (iplist.length == 0) throw new UnknownHostException(hostname); addresses = new InetAddress[iplist.length]; for (int i = 0; i < iplist.length; i++) { if (iplist[i].length != 4) throw new UnknownHostException(hostnam... | public static InetAddress[] getAllByName(String hostname) throws UnknownHostException { // Default to current host if necessary if (hostname == null) { InetAddress local = getLocalHost(); return getAllByName(local.getHostName()); } // Check the cache for ... |
throws UnknownHostException { if (addr.length != 4 && addr.length != 16) throw new UnknownHostException("IP address has illegal length"); if (addr.length == 4) return new Inet4Address(addr, null); return new Inet6Address(addr, null); | throws UnknownHostException { return getByAddress(null, addr); | public static InetAddress getByAddress(byte[] addr) throws UnknownHostException { if (addr.length != 4 && addr.length != 16) throw new UnknownHostException("IP address has illegal length"); if (addr.length == 4) // return new Inet4Address(null,addr); ... |
throws UnknownHostException { if (hostname == null) return getLocalHost(); StringTokenizer st = new StringTokenizer(hostname, "."); if (st.countTokens() == 4) { int i; byte[] ip = new byte[ 4]; for (i = 0; i < 4; i++) { try { ip[ i] = Byte.parseByte(st.nextToken()); if ((ip[ i] < 0) || (ip[ 1] > 255)) break; } catc... | throws UnknownHostException { InetAddress[] addresses = getAllByName(hostname); return addresses[0]; | public static InetAddress getByName(String hostname) throws UnknownHostException { // Default to current host if necessary if (hostname == null) return getLocalHost(); // First, check to see if it is an IP address. If so, then don't // do a DNS lookup. StringTokenizer s... |
public String getHostAddress() { StringBuffer sb = new StringBuffer(); | public String getHostAddress() { StringBuffer sb = new StringBuffer(40); | public String getHostAddress() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < addr.length; i++) { sb.append(addr[ i] & 0xff); if (i < (addr.length - 1)) sb.append("."); } return sb.toString(); } |
for (int i = 0; i < addr.length; i++) { sb.append(addr[ i] & 0xff); if (i < (addr.length - 1)) sb.append("."); } | int len = addr.length; int i = 0; | public String getHostAddress() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < addr.length; i++) { sb.append(addr[ i] & 0xff); if (i < (addr.length - 1)) sb.append("."); } return sb.toString(); } |
return sb.toString(); | for ( ; ; ) { sb.append(addr[i] & 0xff); i++; if (i == len) break; sb.append('.'); | public String getHostAddress() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < addr.length; i++) { sb.append(addr[ i] & 0xff); if (i < (addr.length - 1)) sb.append("."); } return sb.toString(); } |
return sb.toString(); } | public String getHostAddress() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < addr.length; i++) { sb.append(addr[ i] & 0xff); if (i < (addr.length - 1)) sb.append("."); } return sb.toString(); } | |
public String getHostName() { if (hostName != null) return (hostName); | public String getHostName() { if (hostName != null) return hostName; | public String getHostName() { if (hostName != null) return (hostName); try { hostName = getHostByAddr(addr); return (hostName); } catch (UnknownHostException e) { if (hostname_alias != null) return (hostname_alias); else ... |
try { hostName = getHostByAddr(addr); return (hostName); } catch (UnknownHostException e) { if (hostname_alias != null) return (hostname_alias); else return (getHostAddress()); } } | try { hostName = VMInetAddress.getHostByAddr(addr); return hostName; } catch (UnknownHostException e) { return getHostAddress(); } } | public String getHostName() { if (hostName != null) return (hostName); try { hostName = getHostByAddr(addr); return (hostName); } catch (UnknownHostException e) { if (hostname_alias != null) return (hostname_alias); else ... |
static InetAddress getInaddrAny() throws UnknownHostException { if (inaddr_any == null) { byte[] tmp = new byte[] { 0, 0, 0, 0}; inaddr_any = new InetAddress(tmp); } | static InetAddress getInaddrAny() throws UnknownHostException { if (inaddr_any == null) { byte[] tmp = VMInetAddress.lookupInaddrAny(); inaddr_any = new Inet4Address(tmp, null); } | static InetAddress getInaddrAny() throws UnknownHostException { if (inaddr_any == null) { byte[] tmp = new byte[] { 0, 0, 0, 0}; inaddr_any = new InetAddress(tmp); } return (inaddr_any); } |
return (inaddr_any); } | return inaddr_any; } | static InetAddress getInaddrAny() throws UnknownHostException { if (inaddr_any == null) { byte[] tmp = new byte[] { 0, 0, 0, 0}; inaddr_any = new InetAddress(tmp); } return (inaddr_any); } |
public static InetAddress getLocalHost() throws UnknownHostException { return VMNetUtils.getAPI().getLocalAddress(); | public static InetAddress getLocalHost() throws UnknownHostException { String hostname = VMInetAddress.getLocalHostname(); return getByName(hostname); | public static InetAddress getLocalHost() throws UnknownHostException { return VMNetUtils.getAPI().getLocalAddress(); // return Ifconfig.getLocalAddress().toInetAddress(); /* * String hostname = getLocalHostName(); */ } |
public int hashCode() { long val1 = 0, val2 = 0; | public int hashCode() { int hash = 0; int len = addr.length; int i = len > 4 ? len - 4 : 0; | public int hashCode() { long val1 = 0, val2 = 0; // Its obvious here that I have no idea how to generate a good // hash key for (int i = 0; i < addr.length; i++) val1 = val1 + (addr[ i] << ((addr.length - i) / 8)); for (int i = 0; i < addr.length; i++) val2 =... |
for (int i = 0; i < addr.length; i++) val1 = val1 + (addr[ i] << ((addr.length - i) / 8)); | for (; i < len; i++) hash = (hash << 8) | (addr[i] & 0xff); | public int hashCode() { long val1 = 0, val2 = 0; // Its obvious here that I have no idea how to generate a good // hash key for (int i = 0; i < addr.length; i++) val1 = val1 + (addr[ i] << ((addr.length - i) / 8)); for (int i = 0; i < addr.length; i++) val2 =... |
for (int i = 0; i < addr.length; i++) val2 = val2 + (addr[ i] * 10 * i); val1 = (val1 >> 1) ^ val2; return ((int) val1); } | return hash; } | public int hashCode() { long val1 = 0, val2 = 0; // Its obvious here that I have no idea how to generate a good // hash key for (int i = 0; i < addr.length; i++) val1 = val1 + (addr[ i] << ((addr.length - i) / 8)); for (int i = 0; i < addr.length; i++) val2 =... |
public boolean isAnyLocalAddress() { return (this.equals(ANY_IF)); } | public boolean isAnyLocalAddress() { return equals(ANY_IF); } | public boolean isAnyLocalAddress() { return (this.equals(ANY_IF)); } |
public boolean isMulticastAddress() { if (addr.length == 0) return (false); | public boolean isMulticastAddress() { if (addr.length == 4) return (addr[0] & 0xf0) == 0xe0; | public boolean isMulticastAddress() { if (addr.length == 0) return (false); // Mask against high order bits of 1110 if ((addr[ 0] & 0xF0) == 224) return (true); return (false); } |
if ((addr[ 0] & 0xF0) == 224) return (true); return (false); | return false; | public boolean isMulticastAddress() { if (addr.length == 0) return (false); // Mask against high order bits of 1110 if ((addr[ 0] & 0xF0) == 224) return (true); return (false); } |
public String toString() { StringBuffer sb; if (hostName != null) sb = new StringBuffer(hostName).append('/'); else if (hostname_alias != null) sb = new StringBuffer(hostname_alias).append('/'); else sb = new StringBuffer(); sb.append(getHostAddress()); return (sb.toString()); } | public String toString() { String addr = getHostAddress(); String host = (hostName != null) ? hostName : ""; return host + "/" + addr; } | public String toString() { StringBuffer sb; if (hostName != null) sb = new StringBuffer(hostName).append('/'); else if (hostname_alias != null) sb = new StringBuffer(hostname_alias).append('/'); else sb = new StringBuffer(); sb.append(getHostAddres... |
this.tests = new Test[tests.size()]; | int len = tests.size(); this.tests = new Test[(len == 0) ? 1 : len]; if (len > 0) | public Selector(int axis, List tests) { this.axis = axis; this.tests = new Test[tests.size()]; tests.toArray(this.tests); if (axis == NAMESPACE && this.tests.length > 0 && this.tests[0] instanceof NameTest) { NameTest nt = (NameTest) this.tests[0]; this.tests[0] = new Nam... |
if (axis == NAMESPACE && this.tests.length > 0 && this.tests[0] instanceof NameTest) | else this.tests[0] = new NodeTypeTest((short) 0); if (axis == NAMESPACE && this.tests[0] instanceof NameTest) | public Selector(int axis, List tests) { this.axis = axis; this.tests = new Test[tests.size()]; tests.toArray(this.tests); if (axis == NAMESPACE && this.tests.length > 0 && this.tests[0] instanceof NameTest) { NameTest nt = (NameTest) this.tests[0]; this.tests[0] = new Nam... |
{ | void addChildNodes(Node context, Collection acc, boolean recurse) { Node child = context.getFirstChild(); while (child != null) { acc.add(child); if (recurse) { addChildNodes(child, acc, recurse); } child = child.getNextSibling(); } } | |
} | void addChildNodes(Node context, Collection acc, boolean recurse) { Node child = context.getFirstChild(); while (child != null) { acc.add(child); if (recurse) { addChildNodes(child, acc, recurse); } child = child.getNextSibling(); } } | |
Node cur = context.getNextSibling(); | if (context != null && recurse) addChildNodes(context, acc, true); Node cur = (context.getNodeType() == Node.ATTRIBUTE_NODE) ? null : context.getNextSibling(); | void addFollowingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getNextSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getNextSibling(); } if (recurse) { ... |
{ | void addFollowingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getNextSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getNextSibling(); } if (recurse) { ... | |
} | void addFollowingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getNextSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getNextSibling(); } if (recurse) { ... | |
addFollowingNodes(context, acc, recurse); | cur = context.getNextSibling(); while (cur != null) { acc.add(cur); if (recurse) addChildNodes(cur, acc, true); cur = cur.getNextSibling(); } } | void addFollowingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getNextSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getNextSibling(); } if (recurse) { ... |
{ | void addNamespaceAttributes(Node context, Collection acc) { NamedNodeMap attrs = context.getAttributes(); if (attrs != null) { int attrLen = attrs.getLength(); for (int i = 0; i < attrLen; i++) { Node attr = attrs.item(i); if (isNamespaceAttribute(attr)) ... | |
} | void addNamespaceAttributes(Node context, Collection acc) { NamedNodeMap attrs = context.getAttributes(); if (attrs != null) { int attrLen = attrs.getLength(); for (int i = 0; i < attrLen; i++) { Node attr = attrs.item(i); if (isNamespaceAttribute(attr)) ... | |
{ | void addParentNode(Node context, Collection acc, boolean recurse) { Node parent = (context.getNodeType() == Node.ATTRIBUTE_NODE) ? ((Attr) context).getOwnerElement() : context.getParentNode(); if (parent != null) { acc.add(parent); if (recurse) { addParentNode(parent... | |
} | void addParentNode(Node context, Collection acc, boolean recurse) { Node parent = (context.getNodeType() == Node.ATTRIBUTE_NODE) ? ((Attr) context).getOwnerElement() : context.getParentNode(); if (parent != null) { acc.add(parent); if (recurse) { addParentNode(parent... | |
Node cur = context.getPreviousSibling(); | Node cur = (context.getNodeType() == Node.ATTRIBUTE_NODE) ? null : context.getPreviousSibling(); | void addPrecedingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getPreviousSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getPreviousSibling(); } if (recurse) ... |
{ | void addPrecedingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getPreviousSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getPreviousSibling(); } if (recurse) ... | |
} | void addPrecedingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getPreviousSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getPreviousSibling(); } if (recurse) ... | |
context = (context.getNodeType() == Node.ATTRIBUTE_NODE) ? ((Attr) context).getOwnerElement() : context.getParentNode(); if (context != null) { addPrecedingNodes(context, acc, recurse); } | cur = context; cur = (cur.getNodeType() == Node.ATTRIBUTE_NODE) ? ((Attr) cur).getOwnerElement() : cur.getParentNode(); if (cur != null) addPrecedingNodes(cur, acc, recurse); | void addPrecedingNodes(Node context, Collection acc, boolean recurse) { Node cur = context.getPreviousSibling(); while (cur != null) { acc.add(cur); if (recurse) { addChildNodes(cur, acc, true); } cur = cur.getPreviousSibling(); } if (recurse) ... |
{ | public Expr clone(Object context) { int len = tests.length; List tests2 = new ArrayList(len); for (int i = 0; i < len; i++) { tests2.add(tests[i].clone(context)); } return new Selector(axis, tests2); } | |
} | public Expr clone(Object context) { int len = tests.length; List tests2 = new ArrayList(len); for (int i = 0; i < len; i++) { tests2.add(tests[i].clone(context)); } return new Selector(axis, tests2); } | |
{ | List filterCandidates(List candidates, boolean cascade) { int len = candidates.size(); int tlen = tests.length; if (tlen > 0 && len > 0) { // Present the result of each successful generation to the next test for (int j = 0; j < tlen && len > 0; j++) { Test test = tests... | |
} | List filterCandidates(List candidates, boolean cascade) { int len = candidates.size(); int tlen = tests.length; if (tlen > 0 && len > 0) { // Present the result of each successful generation to the next test for (int j = 0; j < tlen && len > 0; j++) { Test test = tests... | |
{ | private int getContextPosition(Node ctx) { int pos = 1; for (ctx = ctx.getPreviousSibling(); ctx != null; ctx = ctx.getPreviousSibling()) { pos++; } return pos; } | |
} | private int getContextPosition(Node ctx) { int pos = 1; for (ctx = ctx.getPreviousSibling(); ctx != null; ctx = ctx.getPreviousSibling()) { pos++; } return pos; } | |
Node parent = ((Attr) ctx).getOwnerElement(); return parent.getAttributes().getLength(); | Node owner = ((Attr) ctx).getOwnerElement(); return owner.getAttributes().getLength(); | private int getContextSize(Node ctx) { if (ctx.getNodeType() == Node.ATTRIBUTE_NODE) { Node parent = ((Attr) ctx).getOwnerElement(); return parent.getAttributes().getLength(); } Node parent = ctx.getParentNode(); if (parent != null) { return parent.getChildNodes().getLeng... |
Node parent = ctx.getParentNode(); if (parent != null) { return parent.getChildNodes().getLength(); } return 1; | int count = 1; Node sib = ctx.getPreviousSibling(); for (; sib != null; sib = sib.getPreviousSibling()) count++; sib = ctx.getNextSibling(); for (; sib != null; sib = sib.getNextSibling()) count++; return count; | private int getContextSize(Node ctx) { if (ctx.getNodeType() == Node.ATTRIBUTE_NODE) { Node parent = ((Attr) ctx).getOwnerElement(); return parent.getAttributes().getLength(); } Node parent = ctx.getParentNode(); if (parent != null) { return parent.getChildNodes().getLeng... |
{ | public boolean matches(Node context) { short nodeType = context.getNodeType(); switch (axis) { case CHILD: if (nodeType == Node.ATTRIBUTE_NODE) { return false; } break; case ATTRIBUTE: case NAMESPACE: if (nodeType != Node.ATTRIBUTE_NODE) ... | |
} | public boolean matches(Node context) { short nodeType = context.getNodeType(); switch (axis) { case CHILD: if (nodeType == Node.ATTRIBUTE_NODE) { return false; } break; case ATTRIBUTE: case NAMESPACE: if (nodeType != Node.ATTRIBUTE_NODE) ... | |
{ | public boolean references(QName var) { for (int i = 0; i < tests.length; i++) { if (tests[i].references(var)) { return true; } } return false; } | |
} | public boolean references(QName var) { for (int i = 0; i < tests.length; i++) { if (tests[i].references(var)) { return true; } } return false; } | |
{ | public String toString() { StringBuffer buf = new StringBuffer(); switch (axis) { case ANCESTOR: buf.append("ancestor::"); break; case ANCESTOR_OR_SELF: buf.append("ancestor-or-self::"); break; case ATTRIBUTE: if (tests.length == 0 || (tests[0] ... | |
} | public String toString() { StringBuffer buf = new StringBuffer(); switch (axis) { case ANCESTOR: buf.append("ancestor::"); break; case ANCESTOR_OR_SELF: buf.append("ancestor-or-self::"); break; case ATTRIBUTE: if (tests.length == 0 || (tests[0] ... | |
{ buf.append('*'); } | buf.append("[error]"); | public String toString() { StringBuffer buf = new StringBuffer(); switch (axis) { case ANCESTOR: buf.append("ancestor::"); break; case ANCESTOR_OR_SELF: buf.append("ancestor-or-self::"); break; case ATTRIBUTE: if (tests.length == 0 || (tests[0] ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.