rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public abstract int write(ByteBuffer src) throws IOException;
public final long write(ByteBuffer[] srcs) throws IOException { long b = 0; for (int i = 0; i < srcs.length; i++) b += write(srcs[i]); return b; }
public abstract int write(ByteBuffer src) throws IOException;
Level.toLevel(Level.OFF_INT);
log.setLevel((Level)Level.OFF);
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
Level.toLevel(org.apache.log4j.Level.DEBUG_INT);
log.setLevel((Level)Level.DEBUG);
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
Level.toLevel(org.apache.log4j.Level.INFO_INT);
log.setLevel((Level)Level.INFO);
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
Level.toLevel(org.apache.log4j.Level.WARN_INT);
log.setLevel((Level)Level.WARN);
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
Level.toLevel(org.apache.log4j.Level.ERROR_INT);
log.setLevel((Level)Level.ERROR);
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
Level.toLevel(org.apache.log4j.Level.FATAL_INT);
log.setLevel((Level)Level.FATAL);
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
if ((mY % 2) == 0)
if (((mY - y) % 2) == 0)
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if ((mY % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
for (i = lo; i < hi; ++i)
for (i = lo; i <= hi; ++i)
public int[] getSelectedIndices() { int lo, hi, n, i, j; if (selectionModel.isSelectionEmpty()) return new int[0]; lo = selectionModel.getMinSelectionIndex(); hi = selectionModel.getMaxSelectionIndex(); n = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) n++; int [] v = new int[n]; j = 0; for (i = lo; i < hi; ++i) if (selectionModel.isSelectedIndex(i)) v[j++] = i; return v; }
.getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION)
.getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION)
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
.getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION)
.getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION)
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
BasicTreeUI.this.tree.getSelectionModel().setSelectionMode( TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
}
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
BasicTreeUI.this.tree.repaint();
public void treeCollapsed(TreeExpansionEvent event) { }
BasicTreeUI.this.tree.repaint();
public void treeExpanded(TreeExpansionEvent event) { }
return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm .getHeight());
return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm.getHeight()); } return null;
private Rectangle getCellBounds(int x, int y, Object cell) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm .getHeight()); }
return new Dimension(200, 900);
return getPreferredSize(c);
public Dimension getMaximumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
return new Dimension(200, 900);
return getPreferredSize(c);
public Dimension getMinimumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot());
DefaultMutableTreeNode node = ((DefaultMutableTreeNode) (tree.getModel()) .getRoot());
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
{ if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
node = getNextVisibleNode(node); if (node == null) return null; return new TreePath(node.getPath()); }
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
return treeState.getRowCount();
DefaultMutableTreeNode node = ((DefaultMutableTreeNode) (tree.getModel()) .getRoot()); int count = 0; while (node != null) { count++; node = getNextVisibleNode(node); } return count;
public int getRowCount(JTree tree) { return treeState.getRowCount(); }
return false;
TreePath pathForRow = getPathForRow(tree, row); if (pathForRow == null) return true; Object node = pathForRow.getLastPathComponent(); if (node instanceof TreeNode) return ((TreeNode) node).isLeaf(); else return true;
protected boolean isLeaf(int row) { return false; // FIXME: not implemented }
TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp);
TreePath curr = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(curr);
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp);
TreePath curr = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(curr); boolean expanded = tree.isExpanded(curr);
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
.getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf));
.getTreeCellRendererComponent(tree, nonLeaf, true, expanded, false, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf));
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false);
Component c = tree.getCellRenderer().getTreeCellRendererComponent( tree, nonLeaf, false, expanded, false, 0, false);
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight);
heightOfLine = descent + halfHeight; g.drawLine(indentation + halfWidth, heightOfLine, indentation + rightChildIndent, heightOfLine);
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
int y1 = descent - halfHeight; if (y0 != y1)
if (tree.isExpanded(new TreePath(((DefaultMutableTreeNode) curr) .getPath()))) if (y0 != heightOfLine)
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1);
g.drawLine(indentation + halfWidth, y0, indentation + halfWidth, heightOfLine);
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
final Point screen = new Point(location); final Component parent = component.getParent(); if (parent != null) { final Point parentScreen = parent.getLocationOnScreen(); screen.translate(parentScreen.x, parentScreen.y); } return screen; }
return computeLocationOnScreen(component); }
public Point getLocationOnScreen() { final Point screen = new Point(location); final Component parent = component.getParent(); if (parent != null) { final Point parentScreen = parent.getLocationOnScreen(); screen.translate(parentScreen.x, parentScreen.y); } return screen; }
public Image createImage(ImageProducer producer) { return new JNodeImage(producer);
public Image createImage(byte[] data, int offset, int len) { if (len >= 4 && data[offset + 0] == 'G' && data[offset + 1] == 'I' && data[offset + 2] == 'F' && data[offset + 3] == '8') { try { return createImage(new GIFDecoder(new ByteArrayInputStream( data, offset, len))); } catch (LinkageError err) { } } return new ErrorImage();
public Image createImage(ImageProducer producer) { return new JNodeImage(producer); }
else string = getClass ().getName () + "[" + paramString () + "] on " + source;
public String toString () { String string = null; if (source instanceof Component) string = getClass ().getName () + "[" + paramString () + "] on " + ((Component) source).getName (); else if (source instanceof MenuComponent) string = getClass ().getName () + "[" + paramString () + "] on " + ((MenuComponent) source).getName (); return string; }
s1.setMacroRunning(false);
public void executeScriptFile(Session session, String scriptFile) throws InterpreterDriver.InterpreterException { try { final Session s1 = session; final String s2 = scriptFile; s1.setMacroRunning(true); Runnable interpretIt = new Runnable() { public void run() { _interpreter = new PythonInterpreter(); _interpreter.set("_session",s1); _interpreter.execfile(s2); } }; // lets start interpreting it. Thread interpThread = new Thread(interpretIt); interpThread.setDaemon(true); interpThread.start(); } catch (PyException ex) { throw new InterpreterDriver.InterpreterException(ex); } catch (Exception ex2) { throw new InterpreterDriver.InterpreterException(ex2); } }
s1.setMacroRunning(false);
public void run() { _interpreter = new PythonInterpreter(); _interpreter.set("_session",s1); _interpreter.execfile(s2); }
assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" );
assertEquals( "Unable to retrieve localized text for locale: default", s0, "[] value1" );
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" );
assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "[en_US] value2" );
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" );
assertEquals( "Unable to retrieve localized text for locale: fr", s4, "[fr] value3" );
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" );
String s5 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr", "FR" ), "key3" );
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
assertEquals( "value1", s5 );
assertEquals( "Unable to retrieve localized text for locale: fr-FR", s5, "[fr] value3" ); String s6 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "Unable to retrieve localized properties for locale: default", "[] value1", s6 ); Locale old = Locale.getDefault(); Locale.setDefault(Locale.FRENCH); try { String s7 = i18n.getString( "org.codehaus.plexus.i18n.i18n", Locale.ENGLISH, "key1" ); assertEquals( "Not picking up new default locale: fr", "[fr] value1", s7 ); String s8 = i18n.getString( "org.codehaus.plexus.i18n.i18n", Locale.ITALIAN, "key1" ); assertEquals( "Unable to retrieve localized properties for locale: it", "[it] value1", s8 ); } finally { Locale.setDefault(old); }
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
sew.show();
sew.setVisible(true);
private void showPopupMenu(MouseEvent me) { JPopupMenu jpm = new JPopupMenu(); JMenuItem menuItem; Action action; final int row = spools.rowAtPoint(me.getPoint()); final int col = spools.convertColumnIndexToModel( spools.columnAtPoint(me.getPoint()));// System.out.println(" column clicked " + col);// System.out.println(" column clicked to model " + spools.convertColumnIndexToModel(col)); action = new AbstractAction(LangTool.getString("spool.optionView")) { public void actionPerformed(ActionEvent e) { System.out.println(row + " is selected "); spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater( new Runnable () { public void run() { displayViewer(getSpooledFile(row)); } } ); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionProps")) { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null,"Not Available yet","Not yet", JOptionPane.WARNING_MESSAGE); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionExport")) { public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); } }; jpm.add(action); jpm.addSeparator(); switch (col) { case 0: case 3: case 6: action = new AbstractAction(LangTool.getString("spool.labelFilter")) { public void actionPerformed(ActionEvent e) { setFilter(row,col); } }; jpm.add(action); jpm.addSeparator(); break; } action = new AbstractAction(LangTool.getString("spool.optionHold")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionRelease")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionDelete")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); GUIGraphicsUtils.positionPopup(spools,jpm,me.getX(),me.getY()); }
sew.show();
sew.setVisible(true);
public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); }
public NoSuchMethodException() { super();
public NoSuchMethodException() {
public NoSuchMethodException() { super(); }
public NoSuchAlgorithmException(String msg)
public NoSuchAlgorithmException()
public NoSuchAlgorithmException(String msg) { super(msg); }
super(msg);
public NoSuchAlgorithmException(String msg) { super(msg); }
SecureSet (final Subject subject, final int type, final Collection elements)
SecureSet (final Subject subject, final int type, final Collection inElements)
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
for (Iterator it = elements.iterator(); it.hasNext(); )
for (Iterator it = inElements.iterator(); it.hasNext(); )
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
if (!elements.contains (o))
if (!this.elements.contains (o))
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
elements.add (o);
this.elements.add (o);
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
return elements.remove (element);
return elements.contains (element);
public synchronized boolean contains (final Object element) { return elements.remove (element); }
g.setColor(Color.black);
y = y + getShift(); g.setColor(MetalLookAndFeel.getBlack());
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
g.setColor(new Color(204, 204, 255));
g.setColor(MetalLookAndFeel.getPrimaryControl());
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
g.setColor(Color.black); g.drawLine(x, y + 3, x, y + 12); g.drawLine(x, y + 12, x + 15, y + 12); g.drawLine(x + 15, y + 12, x + 15, y + 2); g.drawLine(x + 14, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 2, x + 1, y + 2); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 4, 7, 8); g.fillRect(x + 9, y + 5, 6, 7); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 9, y + 2, x + 14, y + 2); g.setColor(new Color(50, 50, 120)); g.drawLine(x + 9, y + 1, x + 15, y + 1); g.drawLine(x + 10, y, x + 15, y);
y = y + getShift(); g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x, y + 6, x, y + 15); g.drawLine(x, y + 15, x + 15, y + 15); g.drawLine(x + 15, y + 15, x + 15, y + 5); g.drawLine(x + 14, y + 6, x + 9, y + 6); g.drawLine(x + 8, y + 5, x + 1, y + 5); g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 7, 7, 8); g.fillRect(x + 9, y + 8, 6, 7); g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); g.drawLine(x + 9, y + 5, x + 14, y + 5); g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(x + 9, y + 4, x + 15, y + 4); g.drawLine(x + 10, y + 3, x + 15, y + 3);
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y + 3, x, y + 12); g.drawLine(x, y + 12, x + 15, y + 12); g.drawLine(x + 15, y + 12, x + 15, y + 2); g.drawLine(x + 14, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 2, x + 1, y + 2); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 4, 7, 8); g.fillRect(x + 9, y + 5, 6, 7); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 9, y + 2, x + 14, y + 2); g.setColor(new Color(50, 50, 120)); g.drawLine(x + 9, y + 1, x + 15, y + 1); g.drawLine(x + 10, y, x + 15, y); }
g.setColor(new Color(102, 102, 153));
g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
g.setColor(new Color(204, 204, 255));
g.setColor(MetalLookAndFeel.getPrimaryControl());
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
g.setColor(Color.white);
g.setColor(MetalLookAndFeel.getWhite());
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
(obj instanceof SmallAttributeSet)
(obj instanceof AttributeSet)
public boolean equals(Object obj) { return (obj instanceof SmallAttributeSet) && this.isEqual((AttributeSet)obj); }
while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true;
if (macrosExist && getMacroByName(name) != null) { Set macroSet = macros.keySet(); Iterator macroIterator = macroSet.iterator(); String byName = null; String prefix = null; while (macroIterator.hasNext()) { byName = (String)macroIterator.next(); if (byName.endsWith(name)) { prefix = byName.substring(0,byName.indexOf(name)); macros.put(prefix + name,keyStrokes); } } } else { while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; }
public final static void setMacro(String name, String keyStrokes) { int x = 0; while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; saveMacros(); }
if (txt != null) {
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
}
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
checkLocation(where, nitems);
checkLocation(where, nitems + 1);
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
super();
public CannotRedoException() { }
super();
public CannotUndoException() { }
public DatagramSocket(SocketAddress address) throws SocketException
protected DatagramSocket(DatagramSocketImpl impl)
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); }
if (impl == null) throw new NullPointerException("impl may not be null");
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
if (address != null) bind(address);
this.impl = impl; this.remoteAddress = null; this.remotePort = -1;
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
public AccessibleJWindow()
protected AccessibleJWindow()
public AccessibleJWindow() { super(); // Nothing to do here. }
break;
private void parseConditionalSect(char[] saved) throws Exception { skipWhitespace(); if (tryRead("INCLUDE")) { skipWhitespace(); require('['); // VC: Proper Conditional Section/PE Nesting if (readBuffer != saved) { handler.verror("Illegal Conditional Section/PE nesting"); } skipWhitespace(); while (!tryRead("]]>")) { parseMarkupdecl(); skipWhitespace(); } } else if (tryRead("IGNORE")) { skipWhitespace(); require('['); // VC: Proper Conditional Section/PE Nesting if (readBuffer != saved) { handler.verror("Illegal Conditional Section/PE nesting"); } int nesting = 1; char c; expandPE = false; for (int nest = 1; nest > 0; ) { c = readCh(); switch (c) { case '<': if (tryRead("![")) { nest++; } case ']': if (tryRead("]>")) { nest--; } } } expandPE = true; } else { error("conditional section must begin with INCLUDE or IGNORE"); } }
XDF.setDefaultDataArraySize(value);
Specification.getInstance().setDefaultDataArraySize(value);
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // The root node is just a "structure" node, // but is always the first one. XDF.setXMLAttributes(attrs); // set XML attributes from passed list CurrentStructure = XDF; // current working structure is now the root // structure // if this global option is set in the reader, we use it if(Options.contains("DefaultDataDimensionSize")) { int value = ((Integer) Options.get("DefaultDataDimensionSize")).intValue(); XDF.setDefaultDataArraySize(value); } return CurrentStructure; }
protected synchronized void create(boolean stream) throws IOException { throw new SocketException("Not implemented");
protected synchronized void create(boolean stream) throws IOException { channel = new SocketChannelImpl(false); VMChannel vmchannel = channel.getVMChannel(); vmchannel.initSocket(stream); channel.configureBlocking(true); impl.getState().setChannelFD(vmchannel.getState());
protected synchronized void create(boolean stream) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
super("bdf");
public BDFFontProvider() { log.debug("new BDFFontProvider"); }
{ final BDFFont bdfFont = (BDFFont) font;
{ final BDFFont bdfFont = getBDFFont(font);
protected FontMetrics createFontMetrics(Font font) throws IOException { final BDFFont bdfFont = (BDFFont) font; return bdfFont.getFontMetrics(); }
final BDFFont bdfFont = (BDFFont) font;
final BDFFont bdfFont = getBDFFont(font);
protected TextRenderer createTextRenderer(RenderCache renderCache, Font font) { final BDFFont bdfFont = (BDFFont) font; final TextRenderer renderer = new BDFTextRenderer(bdfFont.getContainer()); log.debug("created TextRenderer for BDF"); return renderer; }
protected GnuRSAKey(final BigInteger n, final BigInteger e)
protected GnuRSAKey(int defaultFormat, BigInteger n, BigInteger e)
protected GnuRSAKey(final BigInteger n, final BigInteger e) { super(); this.n = n; this.e = e; }
this.defaultFormat = defaultFormat <= 0 ? Registry.RAW_ENCODING_ID : defaultFormat;
protected GnuRSAKey(final BigInteger n, final BigInteger e) { super(); this.n = n; this.e = e; }
return null;
return KeyPairCodecFactory.getEncodingShortName(defaultFormat);
public String getFormat() { return null; }
input.mark(2000);
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
String uxId = input.read_string(); input.reset();
gnuAny exc = new gnuAny();
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
UserException uex = ObjectCreator.readUserException(uxId, input);
exc.insert_Streamable(new streamReadyHolder(input));
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex);
UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex);
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
setBigEndian(ior.Big_Endian);
public void setIor(IOR an_ior) { ior = an_ior; }
Socket socket = new Socket(ior.Internet.host, ior.Internet.port);
long pause = PAUSE_INITIAL; if (socket == null) { Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true);
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
n = socketInput.read(r, n, r.length - n);
n += socketInput.read(r, n, r.length - n);
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
socketInput.close();
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
catch (IOException ex1)
catch (IOException io_ex)
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
ex1.printStackTrace();
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket ); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } }
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
public static SystemException readSystemException(InputStream input)
public static SystemException readSystemException(InputStream input, ServiceContext[] contexts)
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
CompletionStatus status = CompletionStatusHelper.read(input);
CompletionStatus completed = CompletionStatusHelper.read(input);
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
SystemException exception = ObjectCreator.createSystemException(idl, minor, status);
try { exception = (SystemException) createObject(idl, null); exception.minor = minor; exception.completed = completed; } catch (Exception ex) { UNKNOWN u = new UNKNOWN("Unsupported system exception " + idl, minor, completed); u.initCause(ex); throw u; } try { ServiceContext uEx = ServiceContext.find( ServiceContext.UnknownExceptionInfo, contexts); if (uEx != null) { cdrBufInput in = new cdrBufInput(uEx.context_data); in.setOrb(in.orb()); if (input instanceof cdrInput) { ((cdrInput) input).cloneSettings(in); } Throwable t = UnknownExceptionCtxHandler.read(in, contexts); exception.initCause(t); } } catch (Exception ex) { }
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
String helper = toHelperName(idl); Class helperClass = Class.forName(helper);
Class helperClass = findHelper(idl);
public static UserException readUserException(String idl, InputStream input) { try { String helper = toHelperName(idl); Class helperClass = Class.forName(helper); Method read = helperClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
t.minor = Minor.Header;
public void write(java.io.OutputStream out) { try { abstractDataOutputStream dout; if (isBigEndian()) dout = new BigEndianOutputStream(out); else dout = new LittleEndianOutputStream(out); // Write magic sequence. dout.write(MAGIC); // Write version number. version.write((OutputStream) dout); dout.write(flags); dout.write(message_type); dout.writeInt(message_size); } catch (IOException ex) { MARSHAL t = new MARSHAL(); t.initCause(ex); throw t; } }
throw new MARSHAL("Not a GIOP message");
{ MARSHAL m = new MARSHAL("Not a GIOP message"); m.minor = Minor.Giop; throw m; }
public void read(java.io.InputStream istream) throws MARSHAL { try { byte[] xMagic = new byte[ MAGIC.length ]; istream.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); version = Version.read_version(istream); abstractDataInputStream din; flags = (byte) istream.read(); // This checks the bit in the byte we have just received. if (isBigEndian()) din = new BigEndianInputStream(istream); else din = new LittleEndianInputStream(istream); message_type = (byte) din.read(); message_size = din.readInt(); } catch (IOException ex) { MARSHAL t = new MARSHAL(); t.initCause(ex); throw t; } }
t.minor = Minor.Header;
public void read(java.io.InputStream istream) throws MARSHAL { try { byte[] xMagic = new byte[ MAGIC.length ]; istream.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); version = Version.read_version(istream); abstractDataInputStream din; flags = (byte) istream.read(); // This checks the bit in the byte we have just received. if (isBigEndian()) din = new BigEndianInputStream(istream); else din = new LittleEndianInputStream(istream); message_type = (byte) din.read(); message_size = din.readInt(); } catch (IOException ex) { MARSHAL t = new MARSHAL(); t.initCause(ex); throw t; } }
public UnsatisfiedLinkError(String s) { super(s);
public UnsatisfiedLinkError() {
public UnsatisfiedLinkError(String s) { super(s); }
public void checkRead(String filename)
public void checkRead(FileDescriptor desc)
public void checkRead(String filename) { checkPermission(new FilePermission(filename, "read")); }
checkPermission(new FilePermission(filename, "read"));
if (desc == null) throw new NullPointerException(); checkPermission(new RuntimePermission("readFileDescriptor"));
public void checkRead(String filename) { checkPermission(new FilePermission(filename, "read")); }
for (Iterator i = provider ().charsets (); i.hasNext (); )
CharsetProvider[] providers = providers(); for (int j = 0; j < providers.length; j++)
public static SortedMap availableCharsets () { TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER); for (Iterator i = provider ().charsets (); i.hasNext (); ) { Charset cs = (Charset) i.next (); charsets.put (cs.name (), cs); } return Collections.unmodifiableSortedMap (charsets); }
Charset cs = (Charset) i.next (); charsets.put (cs.name (), cs); }
for (Iterator i = providers[j].charsets(); i.hasNext(); ) { Charset cs = (Charset) i.next(); charsets.put(cs.name(), cs); } }
public static SortedMap availableCharsets () { TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER); for (Iterator i = provider ().charsets (); i.hasNext (); ) { Charset cs = (Charset) i.next (); charsets.put (cs.name (), cs); } return Collections.unmodifiableSortedMap (charsets); }
return provider ().charsetForName (charsetName);
Charset cs = null; CharsetProvider[] providers = providers(); for (int i = 0; i < providers.length; i++) { cs = providers[i].charsetForName(charsetName); if (cs != null) break;
private static Charset charsetForName (String charsetName) { checkName (charsetName); return provider ().charsetForName (charsetName); }
return cs; }
private static Charset charsetForName (String charsetName) { checkName (charsetName); return provider ().charsetForName (charsetName); }