bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public JPopupMenu(String label) { // TODO } // JPopupMenu()
|
public JPopupMenu() { // TODO } // JPopupMenu()
| 8,945
|
public JMenuItem(String text) { // TODO } // JMenuItem()
|
public JMenuItem() { // TODO } // JMenuItem()
| 8,946
|
public void addActionListener(ActionListener l) { getModel().addActionListener(l); }
|
public void addActionListener(ActionListener l) { getModel().addActionListener(l); }
| 8,947
|
public JFrame(String title) { super(title); frameInit(); }
|
public JFrame(String title) { super(title); frameInit(); }
| 8,948
|
public JButton(String text) { this(text, null); }
|
public JButton(String text) { this(text, null); }
| 8,949
|
public abstract Object clone ();
|
Object clone();
| 8,950
|
public abstract char current ();
|
char current();
| 8,951
|
public abstract char first ();
|
char first();
| 8,952
|
public abstract char last ();
|
char last();
| 8,953
|
public abstract char previous ();
|
char previous();
| 8,954
|
public static KeyStroke getKeyStroke(String string) { return null; // TODO } // getKeyStroke()
|
public static KeyStroke getKeyStroke(String string) { return null; // TODO } // getKeyStroke()
| 8,955
|
public static ResourceBundle getBundle(String baseName, Locale locale) { ClassLoader cl = security.getCallingClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); return getBundle(baseName, locale, cl); }
|
public static ResourceBundle getBundle(String baseName) { ClassLoader cl = security.getCallingClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); return getBundle(baseName, locale, cl); }
| 8,956
|
public static ResourceBundle getBundle(String baseName, Locale locale) { ClassLoader cl = security.getCallingClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); return getBundle(baseName, locale, cl); }
|
public static ResourceBundle getBundle(String baseName, Locale locale) { ClassLoader cl = security.getCallingClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); return getBundle(baseName, Locale.getDefault(), cl); }
| 8,957
|
void showDocument(URL url, String target);
|
void showDocument(URL url);
| 8,958
|
public ErrorHandler getErrorHandler() { return errorHandler; }
|
public ErrorHandler getErrorHandler() { return errorHandler; }
| 8,959
|
public void setErrorHandler(ErrorHandler errorHandler) { this.errorHandler = errorHandler; }
|
public void setErrorHandler(ErrorHandler errorHandler) { this.errorHandler = errorHandler; }
| 8,961
|
public StreamSource(File file) { setSystemId (file); }
|
public StreamSource(File file) { setSystemId (file); }
| 8,962
|
public LinkedHashSet(Collection<? extends T> c) { super(c); }
|
public LinkedHashSet() { super(c); }
| 8,963
|
public LinkedHashSet(Collection<? extends T> c) { super(c); }
|
public LinkedHashSet(Collection<? extends T> c) { super(); }
| 8,964
|
public LinkedHashMap(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); accessOrder = false; }
|
public LinkedHashMap() { super(initialCapacity, loadFactor); accessOrder = false; }
| 8,965
|
public LinkedHashMap(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); accessOrder = false; }
|
public LinkedHashMap(int initialCapacity, float loadFactor) { super(); accessOrder = false; }
| 8,966
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new TextNode(disableOutputEscaping); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
TemplateNode clone(Stylesheet stylesheet) TemplateNode ret = new TextNode(disableOutputEscaping); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
| 8,967
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new TextNode(disableOutputEscaping); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new TextNode(disableOutputEscaping); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
| 8,968
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) { // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); } Text text = doc.createTextNode(value); if (disableOutputEscaping) { text.setUserData("disable-output-escaping", "yes", stylesheet); } // Insert into result tree if (nextSibling != null) { parent.insertBefore(text, nextSibling); } else { parent.appendChild(text); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); } Text text = doc.createTextNode(value); if (disableOutputEscaping) text.setUserData("disable-output-escaping", "yes", stylesheet); } // Insert into result tree if (nextSibling != null) parent.insertBefore(text, nextSibling); } else parent.appendChild(text); } if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
| 8,969
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) { // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); } Text text = doc.createTextNode(value); if (disableOutputEscaping) { text.setUserData("disable-output-escaping", "yes", stylesheet); } // Insert into result tree if (nextSibling != null) { parent.insertBefore(text, nextSibling); } else { parent.appendChild(text); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) { // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); Text text = doc.createTextNode(value); if (disableOutputEscaping) { text.setUserData("disable-output-escaping", "yes", stylesheet); // Insert into result tree if (nextSibling != null) { parent.insertBefore(text, nextSibling); else { parent.appendChild(text); if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
| 8,970
|
final void apply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (stylesheet.terminated) { return; } if (Thread.currentThread().isInterrupted()) { // Try to head off any infinite loops at the pass return; } if (stylesheet.debug) { System.err.println("Applying " + toString()); System.err.println("\twith context=" + context + ", pos=" + pos + ", len=" + len); } doApply(stylesheet, mode, context, pos, len, parent, nextSibling); }
|
final void apply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException if (stylesheet.terminated) return; } if (Thread.currentThread().isInterrupted()) // Try to head off any infinite loops at the pass return; } if (stylesheet.debug) System.err.println("Applying " + toString()); System.err.println("\twith context=" + context + ", pos=" + pos + ", len=" + len); } doApply(stylesheet, mode, context, pos, len, parent, nextSibling); }
| 8,971
|
final void apply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (stylesheet.terminated) { return; } if (Thread.currentThread().isInterrupted()) { // Try to head off any infinite loops at the pass return; } if (stylesheet.debug) { System.err.println("Applying " + toString()); System.err.println("\twith context=" + context + ", pos=" + pos + ", len=" + len); } doApply(stylesheet, mode, context, pos, len, parent, nextSibling); }
|
final void apply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (stylesheet.terminated) { return; if (Thread.currentThread().isInterrupted()) { // Try to head off any infinite loops at the pass return; if (stylesheet.debug) { System.err.println("Applying " + toString()); System.err.println("\twith context=" + context + ", pos=" + pos + ", len=" + len); doApply(stylesheet, mode, context, pos, len, parent, nextSibling);
| 8,972
|
public static String stringValue(Node node) { return stringValue(node, false); }
|
public static String stringValue(Collection nodeSet) { return stringValue(node, false); }
| 8,973
|
public static String stringValue(Node node) { return stringValue(node, false); }
|
public static String stringValue(Node node) { StringBuffer buf = new StringBuffer(); for (Iterator i = nodeSet.iterator(); i.hasNext(); ) { buf.append(stringValue((Node) i.next())); } return buf.toString(); }
| 8,974
|
public RuntimeException(String s) { super(s); }
|
public RuntimeException(String s) { super(s); }
| 8,975
|
public void remove(Component comp) { synchronized (getTreeLock ()) { for (int i = 0; i < ncomponents; ++i) { if (component[i] == comp) { remove(i); break; } } } }
|
public void remove(Component comp) { synchronized (getTreeLock ()) { Component r = component[index]; ComponentListener[] list = r.getComponentListeners(); for (int j = 0; j < list.length; j++) r.removeComponentListener(list[j]); r.removeNotify(); System.arraycopy(component, index + 1, component, index, ncomponents - index - 1); component[--ncomponents] = null; invalidate(); if (layoutMgr != null) layoutMgr.removeLayoutComponent(r); r.parent = null; if (isShowing ()) { if (component[i] == comp) { remove(i); break; } } } }
| 8,978
|
public Point(int x, int y) { this.x = x; this.y = y; }
|
public Point() { this.x = x; this.y = y; }
| 8,979
|
public Point(int x, int y) { this.x = x; this.y = y; }
|
public Point(int x, int y) { this.x = x; this.y = y; }
| 8,980
|
public static String getAlgorithmProperty(String algName, String propName) { /* TODO: Figure out what this actually does */ return null; }
|
public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) return null; String property = String.valueOf(propName) + "." + String.valueOf(algName); Provider p; for (Iterator i = providers.iterator(); i.hasNext(); ) { p = (Provider) i.next(); for (Iterator j = p.keySet().iterator(); j.hasNext(); ) { String key = (String) j.next(); if (key.equalsIgnoreCase(property)) return p.getProperty(key); } } /* TODO: Figure out what this actually does */ return null; }
| 8,981
|
public static Provider getProvider(String name) { Provider p; int max = providers.size(); for (int i = 0; i < max; i++) { p = (Provider) providers.elementAt(i); if (p.getName() == name) return p; } return null; }
|
public static Provider getProvider(String name) { Provider p; int max = providers.size(); for (int i = 0; i < max; i++) { p = (Provider) providers.elementAt(i); if (p.getName().equals(name)) return p; } return null; }
| 8,982
|
public static int insertProviderAt(Provider provider, int position) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSecurityAccess("insertProvider." + provider.getName()); position--; int max = providers.size(); for (int i = 0; i < max; i++) { if (((Provider) providers.elementAt(i)).getName() == provider .getName()) return -1; } if (position < 0) position = 0; if (position > max) position = max; providers.insertElementAt(provider, position); return position + 1; }
|
public static int insertProviderAt(Provider provider, int position) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSecurityAccess("insertProvider." + provider.getName()); position--; int max = providers.size(); for (int i = 0; i < max; i++) { if (((Provider) providers.elementAt(i)).getName() == provider .getName()) return -1; } if (position < 0) position = 0; if (position > max) position = max; providers.insertElementAt(provider, position); return position + 1; }
| 8,983
|
private static void loadProviders(String baseUrl, String vendor) { if (baseUrl == null || vendor == null) return; String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { InputStream fin = new URL(secfilestr).openStream(); secprops.load(fin); int i = 1; String name; while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; try { providers.addElement(Class.forName(name).newInstance()); } catch (ClassNotFoundException x) { exception = x; } catch (InstantiationException x) { exception = x; } catch (IllegalAccessException x) { exception = x; } if (exception != null) System.err.println("Error loading security provider " + name + ": " + exception); i++; } } catch (FileNotFoundException ignored) { // Actually we probibly shouldn't ignore these, once the security // properties file is actually installed somewhere. } catch (IOException ignored) { } }
|
private static void loadProviders(String baseUrl, String vendor) { if (baseUrl == null || vendor == null) return; String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { InputStream fin = new URL(secfilestr).openStream(); secprops.load(fin); int i = 1; String name; while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; try { providers.addElement(Class.forName(name).newInstance()); } catch (ClassNotFoundException x) { exception = x; } catch (InstantiationException x) { exception = x; } catch (IllegalAccessException x) { exception = x; } if (exception != null) System.err.println("Error loading security provider " + name + ": " + exception); i++; } } catch (FileNotFoundException ignored) { // Actually we probibly shouldn't ignore these, once the security // properties file is actually installed somewhere. } catch (IOException ignored) { } }
| 8,984
|
private static void loadProviders(String baseUrl, String vendor) { if (baseUrl == null || vendor == null) return; String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { InputStream fin = new URL(secfilestr).openStream(); secprops.load(fin); int i = 1; String name; while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; try { providers.addElement(Class.forName(name).newInstance()); } catch (ClassNotFoundException x) { exception = x; } catch (InstantiationException x) { exception = x; } catch (IllegalAccessException x) { exception = x; } if (exception != null) System.err.println("Error loading security provider " + name + ": " + exception); i++; } } catch (FileNotFoundException ignored) { // Actually we probibly shouldn't ignore these, once the security // properties file is actually installed somewhere. } catch (IOException ignored) { } }
|
private static void loadProviders(String baseUrl, String vendor) { if (baseUrl == null || vendor == null) return; String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { InputStream fin = new URL(secfilestr).openStream(); secprops.load(fin); int i = 1; String name; while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; try { providers.addElement(Class.forName(name).newInstance()); } catch (ClassNotFoundException x) { exception = x; } catch (InstantiationException x) { exception = x; } catch (IllegalAccessException x) { exception = x; } if (exception != null) { System.err.println ("WARNING: Error loading security provider " + name + ": " + exception); i++; } } catch (FileNotFoundException ignored) { // Actually we probibly shouldn't ignore these, once the security // properties file is actually installed somewhere. } catch (IOException ignored) { } }
| 8,985
|
private static void loadProviders(String baseUrl, String vendor) { if (baseUrl == null || vendor == null) return; String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { InputStream fin = new URL(secfilestr).openStream(); secprops.load(fin); int i = 1; String name; while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; try { providers.addElement(Class.forName(name).newInstance()); } catch (ClassNotFoundException x) { exception = x; } catch (InstantiationException x) { exception = x; } catch (IllegalAccessException x) { exception = x; } if (exception != null) System.err.println("Error loading security provider " + name + ": " + exception); i++; } } catch (FileNotFoundException ignored) { // Actually we probibly shouldn't ignore these, once the security // properties file is actually installed somewhere. } catch (IOException ignored) { } }
|
private static void loadProviders(String baseUrl, String vendor) { if (baseUrl == null || vendor == null) return; String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { InputStream fin = new URL(secfilestr).openStream(); secprops.load(fin); int i = 1; String name; while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; try { providers.addElement(Class.forName(name).newInstance()); } catch (ClassNotFoundException x) { exception = x; } catch (InstantiationException x) { exception = x; } catch (IllegalAccessException x) { exception = x; } if (exception != null) System.err.println("Error loading security provider " + name + ": " + exception); i++; } } catch (FileNotFoundException ignored) { // Actually we probibly shouldn't ignore these, once the security // properties file is actually installed somewhere. } catch (IOException ignored) { } }
| 8,986
|
public static void removeProvider(String name) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSecurityAccess("removeProvider." + name); Provider p = null; int max = providers.size(); for (int i = 0; i < max; i++) { if (((Provider) providers.elementAt(i)).getName() == name) { providers.remove(i); break; } } }
|
public static void removeProvider(String name) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSecurityAccess("removeProvider." + name); Provider p = null; int max = providers.size(); for (int i = 0; i < max; i++) { if (((Provider) providers.elementAt(i)).getName() == name) { providers.remove(i); break; } } }
| 8,988
|
public String getProperty(String key) { return getProperty(key, null); }
|
public String getProperty(String key) { Properties prop = this; do { String value = (String) prop.get(key); if (value != null) return value; prop = prop.defaults; } while (prop != null); return null; }
| 8,989
|
public InvalidParameterException(String msg) { super(msg); }
|
public InvalidParameterException() { super(msg); }
| 8,990
|
public InvalidParameterException(String msg) { super(msg); }
|
public InvalidParameterException(String msg) { }
| 8,991
|
public <T> T[] toArray(T[] a) { int size = size(); if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator<E> itr = iterator(); for (int pos = 0; pos < size; pos++) { try { a[pos] = (T) (itr.next()); } catch (ClassCastException exception) { throw new ArrayStoreException("The element is of the wrong type "+ "for storing in this array."); } } return a; }
|
public Object[] toArray() { int size = size(); if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator<E> itr = iterator(); for (int pos = 0; pos < size; pos++) { try { a[pos] = (T) (itr.next()); } catch (ClassCastException exception) { throw new ArrayStoreException("The element is of the wrong type "+ "for storing in this array."); } } return a; }
| 8,992
|
public <T> T[] toArray(T[] a) { int size = size(); if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator<E> itr = iterator(); for (int pos = 0; pos < size; pos++) { try { a[pos] = (T) (itr.next()); } catch (ClassCastException exception) { throw new ArrayStoreException("The element is of the wrong type "+ "for storing in this array."); } } return a; }
|
public <T> T[] toArray(T[] a) { int size = size(); if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator<E> itr = iterator(); for (int pos = 0; pos < size; pos++) { try { a[pos] = (T) (itr.next()); } catch (ClassCastException exception) { throw new ArrayStoreException("The element is of the wrong type "+ "for storing in this array."); } } return a; }
| 8,993
|
public <T> T[] toArray(T[] a) { int size = size(); if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator<E> itr = iterator(); for (int pos = 0; pos < size; pos++) { try { a[pos] = (T) (itr.next()); } catch (ClassCastException exception) { throw new ArrayStoreException("The element is of the wrong type "+ "for storing in this array."); } } return a; }
|
public <T> T[] toArray(T[] a) { int size = size(); if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator<E> itr = iterator(); for (int pos = 0; pos < size; pos++) { try { a[pos] = (T) (itr.next()); } catch (ClassCastException exception) { throw new ArrayStoreException("The element is of the wrong type "+ "for storing in this array."); } } return a; }
| 8,994
|
public final InputStream openStream() throws IOException { return openConnection().getInputStream(); }
|
public InputStream openStream() throws IOException { return openConnection().getInputStream(); }
| 8,995
|
public synchronized T remove(int index) { checkBoundExclusive(index); T temp = elementData[index]; modCount++; elementCount--; if (index < elementCount) System.arraycopy(elementData, index + 1, elementData, index, elementCount - index); elementData[elementCount] = null; return temp; }
|
public boolean remove(Object o) { checkBoundExclusive(index); T temp = elementData[index]; modCount++; elementCount--; if (index < elementCount) System.arraycopy(elementData, index + 1, elementData, index, elementCount - index); elementData[elementCount] = null; return temp; }
| 8,997
|
public synchronized T remove(int index) { checkBoundExclusive(index); T temp = elementData[index]; modCount++; elementCount--; if (index < elementCount) System.arraycopy(elementData, index + 1, elementData, index, elementCount - index); elementData[elementCount] = null; return temp; }
|
public synchronized T remove(int index) { checkBoundExclusive(index); T temp = elementData[index]; modCount++; elementCount--; if (index < elementCount) System.arraycopy(elementData, index + 1, elementData, index, elementCount - index); elementData[elementCount] = null; return temp; }
| 8,998
|
public final VmArrayClass getArrayClass() { return getArrayClass(null); }
|
public final VmArrayClass getArrayClass() { return getArrayClass(null); }
| 8,999
|
public ClassCastException(String s) { super(s); }
|
public ClassCastException() { super(s); }
| 9,000
|
public ClassCastException(String s) { super(s); }
|
public ClassCastException(String s) { }
| 9,001
|
public NoClassDefFoundError(String s) { super(s); }
|
public NoClassDefFoundError(String s) { super(s); }
| 9,002
|
public final VmField getField(VmConstFieldRef fieldRef) { return getField(fieldRef.getName(), fieldRef.getSignature()); }
|
public final VmField getField(VmConstFieldRef fieldRef) { return getField(fieldRef.getName(), fieldRef.getSignature()); }
| 9,003
|
public ArithmeticException(String s) { super(s); }
|
public ArithmeticException(String s) { super(s); }
| 9,004
|
CopyOfNode(TemplateNode children, TemplateNode next, Expr select) { super(children, next); this.select = select; }
|
CopyOfNode(Expr select) { super(children, next); this.select = select; }
| 9,005
|
CopyOfNode(TemplateNode children, TemplateNode next, Expr select) { super(children, next); this.select = select; }
|
CopyOfNode(TemplateNode children, TemplateNode next, Expr select) { this.select = select; }
| 9,006
|
TemplateNode clone(Stylesheet stylesheet) { return new CopyOfNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet)); }
|
TemplateNode clone(Stylesheet stylesheet) { return new CopyOfNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet)); }
| 9,007
|
public abstract Object evaluate(Node context, int pos, int len);
|
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { Object ret = null; Node context = null; if (item instanceof Node) { context = (Node) item; ret = evaluate(context, 1, 1); if (XPathConstants.STRING == returnType && !(ret instanceof String)) { ret = _string(context, ret); } else if (XPathConstants.NUMBER == returnType && !(ret instanceof Double)) { ret = new Double(_number(context, ret)); } else if (XPathConstants.BOOLEAN == returnType && !(ret instanceof Boolean)) { ret = _boolean(context, ret) ? Boolean.TRUE : Boolean.FALSE; } else if (XPathConstants.NODE == returnType) { if (ret instanceof Collection) { Collection ns = (Collection) ret; switch (ns.size()) { case 0: ret = null; break; case 1: ret = (Node) ns.iterator().next(); break; default: throw new XPathExpressionException("multiple nodes in node-set"); } } else if (ret != null) { throw new XPathExpressionException("return value is not a node-set"); } } else if (XPathConstants.NODESET == returnType) { if (ret != null && !(ret instanceof Collection)) { throw new XPathExpressionException("return value is not a node-set"); } } } return ret; }
| 9,008
|
public static <T> void sort(List<T> l, Comparator<? super T> c) { T[] a = (T[]) l.toArray(); Arrays.sort(a, c); ListIterator<T> i = l.listIterator(); for (int pos = 0, alen = a.length; pos < alen; pos++) { i.next(); i.set(a[pos]); } }
|
public static <T extends Comparable<? super T>> void sort(List<T> l) { T[] a = (T[]) l.toArray(); Arrays.sort(a, c); ListIterator<T> i = l.listIterator(); for (int pos = 0, alen = a.length; pos < alen; pos++) { i.next(); i.set(a[pos]); } }
| 9,009
|
public static <T> void sort(List<T> l, Comparator<? super T> c) { T[] a = (T[]) l.toArray(); Arrays.sort(a, c); ListIterator<T> i = l.listIterator(); for (int pos = 0, alen = a.length; pos < alen; pos++) { i.next(); i.set(a[pos]); } }
|
public static <T> void sort(List<T> l, Comparator<? super T> c) { T[] a = (T[]) l.toArray(); Arrays.sort(a, c); ListIterator<T> i = l.listIterator(); for (int pos = 0, alen = a.length; pos < alen; pos++) { i.next(); i.set(a[pos]); } }
| 9,010
|
public static String getEncodingOfClass(Class clazz) { return getEncodingOfClass(clazz.getName(), true); }
|
public static String getEncodingOfClass(String type, boolean descriptor) { return getEncodingOfClass(clazz.getName(), true); }
| 9,011
|
public static String getEncodingOfClass(Class clazz) { return getEncodingOfClass(clazz.getName(), true); }
|
public static String getEncodingOfClass(Class clazz) { if (! descriptor || type.charAt(0) == '[') return type.replace('.', '/'); if (type.equals("boolean")) return "Z"; if (type.equals("byte")) return "B"; if (type.equals("short")) return "S"; if (type.equals("char")) return "C"; if (type.equals("int")) return "I"; if (type.equals("long")) return "J"; if (type.equals("float")) return "F"; if (type.equals("double")) return "D"; if (type.equals("void")) return "V"; return 'L' + type.replace('.', '/') + ';'; }
| 9,012
|
public SecureRandom() { Provider p[] = Security.getProviders(); //Format of Key: SecureRandom.algname String key; String classname = null; int i; Enumeration e; for (i = 0; i < p.length; i++) { e = p[i].propertyNames(); while (e.hasMoreElements()) { key = (String) e.nextElement(); if (key.startsWith("SECURERANDOM.")) { if ((classname = p[i].getProperty(key)) != null) { try { secureRandomSpi = (SecureRandomSpi) Class. forName(classname).newInstance(); provider = p[i]; return; } catch (Throwable ignore) { } } } } } // Nothing found. Fall back to SHA1PRNG secureRandomSpi = new gnu.java.security.provider.SHA1PRNG(); }
|
public SecureRandom() { Provider[] p = Security.getProviders(); //Format of Key: SecureRandom.algname String key; String classname = null; int i; Enumeration e; for (i = 0; i < p.length; i++) { e = p[i].propertyNames(); while (e.hasMoreElements()) { key = (String) e.nextElement(); if (key.startsWith("SECURERANDOM.")) { if ((classname = p[i].getProperty(key)) != null) { try { secureRandomSpi = (SecureRandomSpi) Class. forName(classname).newInstance(); provider = p[i]; return; } catch (Throwable ignore) { } } } } } // Nothing found. Fall back to SHA1PRNG secureRandomSpi = new gnu.java.security.provider.SHA1PRNG(); }
| 9,013
|
public SecureRandom() { Provider p[] = Security.getProviders(); //Format of Key: SecureRandom.algname String key; String classname = null; int i; Enumeration e; for (i = 0; i < p.length; i++) { e = p[i].propertyNames(); while (e.hasMoreElements()) { key = (String) e.nextElement(); if (key.startsWith("SECURERANDOM.")) { if ((classname = p[i].getProperty(key)) != null) { try { secureRandomSpi = (SecureRandomSpi) Class. forName(classname).newInstance(); provider = p[i]; return; } catch (Throwable ignore) { } } } } } // Nothing found. Fall back to SHA1PRNG secureRandomSpi = new gnu.java.security.provider.SHA1PRNG(); }
|
public SecureRandom() { Provider p[] = Security.getProviders(); //Format of Key: SecureRandom.algname String key; String classname = null; int i; Enumeration e; for (i = 0; i < p.length; i++) { e = p[i].propertyNames(); while (e.hasMoreElements()) { key = (String) e.nextElement(); if (key.startsWith("SECURERANDOM.")) { if ((classname = p[i].getProperty(key)) != null) { try { secureRandomSpi = (SecureRandomSpi) Class. forName(classname).newInstance(); provider = p[i]; return; } catch (Throwable t) { } } } } } // Nothing found. Fall back to SHA1PRNG secureRandomSpi = new gnu.java.security.provider.SHA1PRNG(); }
| 9,014
|
public static SecureRandom getInstance(String algorithm) throws NoSuchAlgorithmException { Provider p[] = Security.getProviders(); for (int i = 0; i < p.length; i++) { try { return getInstance(algorithm, p[i]); } catch (NoSuchAlgorithmException ignored) { } } // None found. throw new NoSuchAlgorithmException(algorithm); }
|
public static SecureRandom getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { try { return getInstance(algorithm, p[i]); } catch (NoSuchAlgorithmException ignored) { } } // None found. throw new NoSuchAlgorithmException(algorithm); }
| 9,015
|
public static SecureRandom getInstance(String algorithm) throws NoSuchAlgorithmException { Provider p[] = Security.getProviders(); for (int i = 0; i < p.length; i++) { try { return getInstance(algorithm, p[i]); } catch (NoSuchAlgorithmException ignored) { } } // None found. throw new NoSuchAlgorithmException(algorithm); }
|
public static SecureRandom getInstance(String algorithm) throws NoSuchAlgorithmException { Provider p[] = Security.getProviders(); for (int i = 0; i < p.length; i++) { try { return getInstance(algorithm, p[i]); } catch (NoSuchAlgorithmException e) { } } // None found. throw new NoSuchAlgorithmException(algorithm); }
| 9,016
|
public static byte[] getSeed(int numBytes) { byte tmp[] = new byte[numBytes]; new Random().nextBytes(tmp); return tmp; //return secureRandomSpi.engineGenerateSeed( numBytes ); }
|
public static byte[] getSeed(int numBytes) { byte[] tmp = new byte[numBytes]; new Random().nextBytes(tmp); return tmp; //return secureRandomSpi.engineGenerateSeed( numBytes ); }
| 9,017
|
protected final int next(int numBits) { if (numBits == 0) return 0; byte tmp[] = new byte[numBits / 8 + (1 * (numBits % 8))]; secureRandomSpi.engineNextBytes(tmp); randomBytesUsed += tmp.length; counter++; int ret = 0; for (int i = 0; i < tmp.length; i++) ret |= (tmp[i] & 0xFF) << (8 * i); long mask = (1L << numBits) - 1; return (int) (ret & mask); }
|
protected final int next(int numBits) { if (numBits == 0) return 0; byte[] tmp = new byte[numBits / 8 + (1 * (numBits % 8))]; secureRandomSpi.engineNextBytes(tmp); randomBytesUsed += tmp.length; counter++; int ret = 0; for (int i = 0; i < tmp.length; i++) ret |= (tmp[i] & 0xFF) << (8 * i); long mask = (1L << numBits) - 1; return (int) (ret & mask); }
| 9,018
|
public void dropComplete (boolean success) { // FIXME: implement this }
|
public void dropComplete(boolean success) throws NotImplementedException { // FIXME: implement this }
| 9,019
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
| 9,020
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
| 9,021
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
| 9,022
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); } if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); } PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; } final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; } else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); } } permissions.put(name, pp); }
|
public void add(Permission permission) { if (isReadOnly()) { throw new SecurityException("readonly"); if (!(permission instanceof PropertyPermission)) { throw new IllegalArgumentException(); PropertyPermission pp = (PropertyPermission) permission; final String name = pp.getName(); if (name.equals("*")) { all_allowed = true; final PropertyPermission old = (PropertyPermission) permissions.get(name); if (old != null) { if ((pp.actions | old.actions) == old.actions) { // Old implies pp. pp = old; else if ((pp.actions | old.actions) != pp.actions) { // Here pp doesn't imply old; the only case left is both // actions. pp = new PropertyPermission(name, "read,write"); permissions.put(name, pp);
| 9,023
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
| 9,024
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) return true; } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) return true; } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
| 9,025
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) return false; int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
| 9,026
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
| 9,027
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; String name = toImply.getName(); if (name.equals("*")) { return false; int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; name = name.substring(0, prefixLength + 1) + '*';
| 9,028
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) { return false; } name = name.substring(0, prefixLength + 1) + '*'; } }
|
public boolean implies(Permission permission) { if (!(permission instanceof PropertyPermission)) { return false; } final PropertyPermission toImply = (PropertyPermission) permission; int actions = toImply.actions; if (all_allowed) { int all_actions = ((PropertyPermission) permissions.get("*")).actions; actions &= ~all_actions; if (actions == 0) { return true; } } String name = toImply.getName(); if (name.equals("*")) { return false; } int prefixLength = name.length(); if (name.endsWith("*")) { prefixLength -= 2; } while (true) { PropertyPermission forName = (PropertyPermission) permissions .get(name); if (forName != null) { actions &= ~forName.actions; if (actions == 0) { return true; } } prefixLength = name.lastIndexOf('.', prefixLength - 1); if (prefixLength < 0) return false; name = name.substring(0, prefixLength + 1) + '*'; } }
| 9,029
|
public PropertyPermission(String name, String actions) { super(name); if (actions == null) throw new IllegalArgumentException(); setActions(actions.toLowerCase()); }
|
public PropertyPermission(String name, String actions) { super(name); if (actions == null) throw new IllegalArgumentException(); setActions(actions); }
| 9,030
|
private ScrollingButton createDecreaseButton() { if (decrButton == null) decrButton = new ScrollingButton(SwingConstants.SOUTH); if (tabPane.getTabPlacement() == SwingConstants.TOP || tabPane.getTabPlacement() == SwingConstants.BOTTOM) decrButton.setDirection(SwingConstants.WEST); else decrButton.setDirection(SwingConstants.NORTH); return decrButton; }
|
ScrollingButton createDecreaseButton() { if (decrButton == null) decrButton = new ScrollingButton(SwingConstants.SOUTH); if (tabPane.getTabPlacement() == SwingConstants.TOP || tabPane.getTabPlacement() == SwingConstants.BOTTOM) decrButton.setDirection(SwingConstants.WEST); else decrButton.setDirection(SwingConstants.NORTH); return decrButton; }
| 9,031
|
private ScrollingButton createIncreaseButton() { if (incrButton == null) incrButton = new ScrollingButton(SwingConstants.NORTH); if (tabPane.getTabPlacement() == SwingConstants.TOP || tabPane.getTabPlacement() == SwingConstants.BOTTOM) incrButton.setDirection(SwingConstants.EAST); else incrButton.setDirection(SwingConstants.SOUTH); return incrButton; }
|
ScrollingButton createIncreaseButton() { if (incrButton == null) incrButton = new ScrollingButton(SwingConstants.NORTH); if (tabPane.getTabPlacement() == SwingConstants.TOP || tabPane.getTabPlacement() == SwingConstants.BOTTOM) incrButton.setDirection(SwingConstants.EAST); else incrButton.setDirection(SwingConstants.SOUTH); return incrButton; }
| 9,032
|
private Point findPointForIndex(int index) { int tabPlacement = tabPane.getTabPlacement(); int selectedIndex = tabPane.getSelectedIndex(); Insets insets = getSelectedTabPadInsets(tabPlacement); int w = 0; int h = 0; if (tabPlacement == TOP || tabPlacement == BOTTOM) { if (index > 0) { w += rects[index - 1].x + rects[index - 1].width; if (index > selectedIndex) w -= insets.left + insets.right; } } else { if (index > 0) { h += rects[index - 1].y + rects[index - 1].height; if (index > selectedIndex) h -= insets.top + insets.bottom; } } Point p = new Point(w, h); return p; }
|
Point findPointForIndex(int index) { int tabPlacement = tabPane.getTabPlacement(); int selectedIndex = tabPane.getSelectedIndex(); Insets insets = getSelectedTabPadInsets(tabPlacement); int w = 0; int h = 0; if (tabPlacement == TOP || tabPlacement == BOTTOM) { if (index > 0) { w += rects[index - 1].x + rects[index - 1].width; if (index > selectedIndex) w -= insets.left + insets.right; } } else { if (index > 0) { h += rects[index - 1].y + rects[index - 1].height; if (index > selectedIndex) h -= insets.top + insets.bottom; } } Point p = new Point(w, h); return p; }
| 9,033
|
public void setEnabled(boolean b) { super.setEnabled(b); getModel().setEnabled(b); repaint(); }
|
public void setEnabled(boolean b) { super.setEnabled(b); getModel().setEnabled(b); repaint(); }
| 9,034
|
public void show() { // We must set visible before showing the peer. Otherwise the // peer could post paint events before visible is true, in which // case lightweight components are not initially painted -- // Container.paint first calls isShowing () before painting itself // and its children. if(!isVisible()) { this.visible = true; // Avoid NullPointerExceptions by creating a local reference. ComponentPeer currentPeer=peer; if (currentPeer != null) currentPeer.setVisible(true); // The JDK repaints the component before invalidating the parent. // So do we. if (isShowing()) repaint(); // Invalidate the parent if we have one. The component itself must // not be invalidated. We also avoid NullPointerException with // a local reference here. Container currentParent = parent; if (currentParent != null) currentParent.invalidate(); ComponentEvent ce = new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
public void show() { // We must set visible before showing the peer. Otherwise the // peer could post paint events before visible is true, in which // case lightweight components are not initially painted -- // Container.paint first calls isShowing () before painting itself // and its children. if(!isVisible()) { this.visible = true; // Avoid NullPointerExceptions by creating a local reference. ComponentPeer currentPeer=peer; if (currentPeer != null) currentPeer.show(); // The JDK repaints the component before invalidating the parent. // So do we. if (isShowing()) repaint(); // Invalidate the parent if we have one. The component itself must // not be invalidated. We also avoid NullPointerException with // a local reference here. Container currentParent = parent; if (currentParent != null) currentParent.invalidate(); ComponentEvent ce = new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN); getToolkit().getSystemEventQueue().postEvent(ce); } }
| 9,035
|
public int getInt(Object key) { Object o = get(key); return o instanceof Integer ? ((Integer) o).intValue() : 0; }
|
int getInt(Object key) { Object o = get(key); return o instanceof Integer ? ((Integer) o).intValue() : 0; }
| 9,036
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
| 9,037
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
| 9,038
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
| 9,039
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
|
static public String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon i, int vert_a, int hor_i, int vert_text_pos, int hor_text_pos, Rectangle vr, Rectangle ir, Rectangle tr, int gap) { // view rect 'vr' already ok, // we need to compute ir (icon rect) and tr (text-rect) int next_x = 0;//vr.x; int next_y = 0;//vr.y; ir.height = ir.width = ir.y = ir.x = 0; if (i != null) { ir.x = vr.x; ir.y = vr.y; ir.width = i.getIconWidth(); ir.height = i.getIconWidth(); next_x += gap + i.getIconWidth(); next_y += gap + i.getIconHeight(); } tr.x = next_x; tr.y = vr.y + (vr.height/2); tr.width = fm.stringWidth(text); tr.height = fm.getHeight() + fm.getAscent()/2; return text; }
| 9,040
|
public IIOParamController getController() { return controller; }
|
public IIOParamController getController() { return controller == null ? (no_controller ? null : defaultController) : controller; }
| 9,042
|
public int[] getSourceBands() { return sourceBands; }
|
public int[] getSourceBands() { if (sourceBands == null) return null; int[] sourceBandsCopy = new int[sourceBands.length]; System.arraycopy (sourceBands, 0, sourceBandsCopy, 0, sourceBands.length); return sourceBandsCopy; }
| 9,043
|
public void setSourceBands(int[] sourceBands) { this.sourceBands = sourceBands; }
|
public void setSourceBands(int[] sourceBands) { int[] sourceBandsCopy = new int[sourceBands.length]; System.arraycopy (sourceBands, 0, sourceBandsCopy, 0, sourceBands.length); this.sourceBands = sourceBandsCopy; }
| 9,045
|
public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); System.out.println("JFrame.getPrefSize(): " + d + " , comp=" + countComponents() + ", layout=" + getLayout()); return d; }
|
public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); System.out.println("JFrame.getPrefSize(): " + d + " , comp=" + countComponents() + ", layout=" + getLayout()); return d; }
| 9,048
|
JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
|
JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
| 9,049
|
JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
|
JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
| 9,050
|
public void setContentPane(Container p) { contentPane = p; getLayeredPane().add(contentPane, 0); }
|
public void setContentPane(Container p) { contentPane = p; getLayeredPane().add(contentPane, 0); }
| 9,051
|
public void update(Graphics g) { // It seems that the JDK clears the background of containers like Panel // and Window (within this method) but not of 'plain' Containers or // JComponents. This could // lead to the assumption that it only clears heavyweight containers. // However that is not quite true. In a test with a custom Container // that overrides isLightweight() to return false, the background is // also not cleared. So we do a check on !(peer instanceof LightweightPeer) // instead. ComponentPeer p = peer; if (p != null && !(p instanceof LightweightPeer)) g.clearRect(0, 0, getWidth(), getHeight()); paint(g); }
|
public void update(Graphics g) { // It seems that the JDK clears the background of containers like Panel // and Window (within this method) but not of 'plain' Containers or // JComponents. This could // lead to the assumption that it only clears heavyweight containers. // However that is not quite true. In a test with a custom Container // that overrides isLightweight() to return false, the background is // also not cleared. So we do a check on !(peer instanceof LightweightPeer) // instead. ComponentPeer p = peer; if (p != null && ! (p instanceof LightweightPeer)) { g.clearRect(0, 0, getWidth(), getHeight()); paint(g); }
| 9,052
|
public void paint(Graphics g) { if (!isShowing()) return; // Visit heavyweights as well, in case they were // erased when we cleared the background for this container. visitChildren(g, GfxPaintVisitor.INSTANCE, false); }
|
public void paint(Graphics g) { if (!isShowing()) return; // Visit heavyweights as well, in case they were // erased when we cleared the background for this container. visitChildren(g, GfxPaintVisitor.INSTANCE, !backCleared); backCleared = false; }
| 9,054
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.