rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; } for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj);
|
cols[i].setWidth(cols[i].getWidth() + average);
|
private void distributeSpill(TableColumn[] cols, int spill) { int MIN = 0; int MAX = 0; int PREF = 0; int[] min = new int[cols.length]; int[] max = new int[cols.length]; int[] pref = new int[cols.length]; for (int i = 0; i < cols.length; ++i) { pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; } for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c5671ff077399b85034dffa0f9635da50cef54a9/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
|
int spill = prefSum - getWidth();
|
int spill = getWidth() - prefSum;
|
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int[] pref = new int[ncols]; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getWidth(); pref[i] = p; prefSum += p; if (resizingColumn == col) rCol = i; } int spill = prefSum - getWidth(); if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: cols = new TableColumn[ncols]; for (int i = rCol; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_OFF: default: } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c5671ff077399b85034dffa0f9635da50cef54a9/JTable.java/clean/core/src/classpath/javax/javax/swing/JTable.java
|
Unsafe.die();
|
public static Throwable systemException(int nr, int address) throws PragmaUninterruptible { //Unsafe.getCurrentProcessor().getArchitecture().getStackReader().debugStackTrace(); String hexAddress = NumberUtils.hex(address, 8); switch (nr) { case EX_NULLPOINTER: return new NullPointerException("NPE at address " + hexAddress); case EX_PAGEFAULT: return new InternalError("Page fault at " + hexAddress); case EX_INDEXOUTOFBOUNDS: return new ArrayIndexOutOfBoundsException("Out of bounds at index " + address); case EX_DIV0: return new ArithmeticException("Division by zero at address " + hexAddress); case EX_ABSTRACTMETHOD: return new AbstractMethodError("Abstract method at " + hexAddress); case EX_STACKOVERFLOW: return new StackOverflowError(); case EX_CLASSCAST: return new ClassCastException(); default: return new UnknownError("Unknown system-exception at " + hexAddress); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/SoftByteCodes.java/clean/core/src/core/org/jnode/vm/SoftByteCodes.java
|
|
public TreeUI() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/TreeUI.java/clean/core/src/classpath/javax/javax/swing/plaf/TreeUI.java
|
||
Object attr = element.getAttributes().getAttribute( StyleConstants.NameAttribute);
|
Object attr = element.getAttributes().getAttribute(StyleConstants.NameAttribute);
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute( StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } if (view == null) { String name = element.getName(); if (name.equals(AbstractDocument.ContentElementName)) view = new LabelView(element); else if (name.equals(AbstractDocument.ParagraphElementName)) view = new ParagraphView(element); else if (name.equals(AbstractDocument.SectionElementName)) view = new BoxView(element, View.Y_AXIS); else if (name.equals(StyleConstants.ComponentElementName)) view = new ComponentView(element); else if (name.equals(StyleConstants.IconElementName)) view = new IconView(element); } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
if (view == null) { String name = element.getName(); if (name.equals(AbstractDocument.ContentElementName)) view = new LabelView(element); else if (name.equals(AbstractDocument.ParagraphElementName)) view = new ParagraphView(element); else if (name.equals(AbstractDocument.SectionElementName)) view = new BoxView(element, View.Y_AXIS); else if (name.equals(StyleConstants.ComponentElementName)) view = new ComponentView(element); else if (name.equals(StyleConstants.IconElementName)) view = new IconView(element); }
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute( StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } if (view == null) { String name = element.getName(); if (name.equals(AbstractDocument.ContentElementName)) view = new LabelView(element); else if (name.equals(AbstractDocument.ParagraphElementName)) view = new ParagraphView(element); else if (name.equals(AbstractDocument.SectionElementName)) view = new BoxView(element, View.Y_AXIS); else if (name.equals(StyleConstants.ComponentElementName)) view = new ComponentView(element); else if (name.equals(StyleConstants.IconElementName)) view = new IconView(element); } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
bad.minor = Minor.Any;
|
public static InconsistentTypeCode extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (InconsistentTypeCode) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("InconsistentTypeCode expected"); bad.initCause(cex); throw bad; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/InconsistentTypeCodeHelper.java/clean/core/src/classpath/org/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java
|
|
ndx = new Random ().nextInt (256);
|
while (ndx < 1 || ndx > 255) ndx = (byte) nextByte();
|
static final KDF getInstance(final byte[] K) { int ndx = -1; final byte[] keyMaterial; if (K != null) { keyMaterial = K; ndx = 0; } else { keyMaterial = new byte[AES_BLOCK_SIZE]; ndx = new Random ().nextInt (256); // XXX does this need to be secure? } return new KDF(keyMaterial, ndx); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/KDF.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/sasl/srp/KDF.java
|
public RootPaneUI() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/RootPaneUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/RootPaneUI.java
|
||
if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return ((Integer) componentToLayer.get(c)).intValue();
|
Component myComp = c; while(! componentToLayer.containsKey(myComp)) { myComp = myComp.getParent(); if (myComp == null) break; } if (myComp == null) throw new IllegalArgumentException ("component is not in this JLayeredPane"); Integer layerObj = (Integer) componentToLayer.get(myComp); return layerObj.intValue();
|
public int getLayer(Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return ((Integer) componentToLayer.get(c)).intValue(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JLayeredPane.java/clean/core/src/classpath/javax/javax/swing/JLayeredPane.java
|
{
|
{
|
public JPanel() { this(new FlowLayout(), true); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
}
|
}
|
public JPanel() { this(new FlowLayout(), true); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
{
|
{
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJPanel(); return accessibleContext; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
}
|
}
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJPanel(); return accessibleContext; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
}
|
}
|
public PanelUI getUI() { return (PanelUI) ui; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
{
|
{
|
protected String paramString() { return "JPanel"; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
}
|
}
|
protected String paramString() { return "JPanel"; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
super.setUI(ui); }
|
super.setUI(ui); }
|
public void setUI(PanelUI ui) { super.setUI(ui); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
}
|
}
|
public void updateUI() { setUI((PanelUI) UIManager.getUI(this)); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
|
if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionJumpListener target =
|
if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionJumpListener target =
|
protected void fireSessionJump(int dir) { if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionJumpListener target = (SessionJumpListener)listeners.elementAt(i); jumpEvent.setJumpDirection(dir); target.onSessionJump(jumpEvent); } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/cdfc0cdb37f9d8cf16532dd36ba85d21aabdfacf/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
|
target.onSessionJump(jumpEvent); } }
|
target.onSessionJump(jumpEvent); } }
|
protected void fireSessionJump(int dir) { if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionJumpListener target = (SessionJumpListener)listeners.elementAt(i); jumpEvent.setJumpDirection(dir); target.onSessionJump(jumpEvent); } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/cdfc0cdb37f9d8cf16532dd36ba85d21aabdfacf/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
|
setRubberBand(new TNRubberBand(this));
|
setRubberBand(new TNRubberBand(this));
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/cdfc0cdb37f9d8cf16532dd36ba85d21aabdfacf/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
|
rubberband = newValue;
|
rubberband = newValue;
|
protected final void setRubberBand(TNRubberBand newValue) { rubberband = newValue; }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/cdfc0cdb37f9d8cf16532dd36ba85d21aabdfacf/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
|
public void stateChanged(ChangeEvent e) { // FIXME: It seems that this class is not used anywhere }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicMenuUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuUI.java
|
||
it will be selected)
|
it will be selected)
|
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicMenuUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuUI.java
|
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicMenuUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuUI.java
|
||
manager.clearSelectedPath();
|
manager.clearSelectedPath();
|
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicMenuUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuUI.java
|
return new ChangeHandler();
|
return new ChangeHandler((JMenu) c, this);
|
protected ChangeListener createChangeListener(JComponent c) { return new ChangeHandler(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicMenuUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicMenuUI.java
|
me.yield();
|
public void run () { boolean keepTrucking = true; while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming(); screen52.setKeyboardLocked(false); cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try { screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground me.yield(); pthread.yield(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/b424408b7c5f668455972e5e401cbeda3a3ff25a/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
|
|
screen52.checkHotSpots();
|
screen52.checkHotSpots();
|
public void run () { boolean keepTrucking = true; while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming(); screen52.setKeyboardLocked(false); cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try { screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground me.yield(); pthread.yield(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/b424408b7c5f668455972e5e401cbeda3a3ff25a/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
|
me.yield();
|
public void run () { boolean keepTrucking = true; while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming(); screen52.setKeyboardLocked(false); cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try { screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground me.yield(); pthread.yield(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/b424408b7c5f668455972e5e401cbeda3a3ff25a/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
|
|
updateChildren(ec, ev, vf);
|
{ if (! updateChildren(ec, ev, vf)) ec = null; }
|
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
}
|
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
|
int endOffset = startOffset + ev.getLength();
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
|
int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null)
|
if (startIndex == -1 && ev.getType() == DocumentEvent.EventType.REMOVE && startOffset >= getEndOffset())
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
index = ec.getIndex(); addLength = ec.getChildrenAdded().length;
|
startIndex = getViewCount() - 1;
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
if (startIndex >= 0 && endIndex >= 0)
|
if (startIndex >= 0)
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
if (index >= 0 && i >= index && i < (index+addLength)) continue;
|
if (! (i >= startAdded && i <= endAdded)) {
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
forwardUpdateToView(child, ev, shape, vf);
|
if (child != null) { Shape childAlloc = getChildAllocation(i, shape); forwardUpdateToView(child, ev, childAlloc, vf); }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
updateChildren(ec, ev, vf);
|
{ if (! updateChildren(ec, ev, vf)) ec = null; }
|
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/View.java/clean/core/src/classpath/javax/javax/swing/text/View.java
|
return java.lang.reflect.Array.getInt(longDataArray.get(longIndex), shortIndex);
|
return java.lang.reflect.Array.getInt(longDataArray.get(longIndex+1), shortIndex);
|
public int getIntData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getInt(longDataArray.get(longIndex), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/7829c1e6b0c38cc610aa1c76af7f8f8c5c1e19e2/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
return java.lang.reflect.Array.getLong(longDataArray.get(longIndex), shortIndex);
|
return java.lang.reflect.Array.getLong(longDataArray.get(longIndex+1), shortIndex);
|
public long getLongData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getLong(longDataArray.get(longIndex), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/7829c1e6b0c38cc610aa1c76af7f8f8c5c1e19e2/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
return java.lang.reflect.Array.getShort(longDataArray.get(longIndex), shortIndex);
|
return java.lang.reflect.Array.getShort(longDataArray.get(longIndex+1), shortIndex);
|
public short getShortData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getShort(longDataArray.get(longIndex), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/7829c1e6b0c38cc610aa1c76af7f8f8c5c1e19e2/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
if (isShowing ()) {
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Container.java/clean/core/src/classpath/java/java/awt/Container.java
|
|
}
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Container.java/clean/core/src/classpath/java/java/awt/Container.java
|
|
if (isShowing ()) {
|
public void remove(int index) { synchronized (getTreeLock ()) { Component r = component[index]; 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; // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_REMOVED, r); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Container.java/clean/core/src/classpath/java/java/awt/Container.java
|
|
}
|
public void remove(int index) { synchronized (getTreeLock ()) { Component r = component[index]; 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; // Post event to notify of adding the container. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_REMOVED, r); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Container.java/clean/core/src/classpath/java/java/awt/Container.java
|
|
jComponent.getContentPane().setLayout(new SwingFrameLayout(this));
|
jComponent.getContentPane().setLayout(new SwingContainerLayout(this));
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame awtFrame) { super(toolkit, awtFrame, new SwingFrame(awtFrame)); jComponent.initialize(this); SwingToolkit.copyAwtProperties(awtFrame, this.jComponent); jComponent.getContentPane().setLayout(new SwingFrameLayout(this)); jComponent.setLocation(awtFrame.getLocation()); jComponent.setSize(awtFrame.getSize()); setResizable(awtFrame.isResizable()); jComponent.setIconifiable(true); jComponent.setMaximizable(true); jComponent.setClosable(true); try { jComponent.setIcon(awtFrame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(awtFrame.getState()); jComponent.setTitle(awtFrame.getTitle()); //frame.setIconImage(awtFrame.getIconImage()); setMenuBar(awtFrame.getMenuBar()); desktopPane.add(jComponent); desktopPane.setSelectedFrame(jComponent); jComponent.toFront(); desktopPane.doLayout(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c772b17b7fb843d3870d0fbcde37f457a2948dbf/SwingFramePeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingFramePeer.java
|
lock.notify();
|
lock.notifyAll();
|
public void clear() { synchronized (lock) { vector.clear(); lock.notify(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/DataStreamQueue.java/clean/tn5250j/src/org/tn5250j/DataStreamQueue.java
|
while (isEmpty())
|
while (isEmpty()) {
|
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); /** * @todo here is the throttling code to look at * * just something here to try. OK it works but we need to be a little * more intelligent with the throttling. */ if (vector.size() >= 20) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);// System.out.println(vector.size()); } // we have the lock and state we're seeking return vector.remove(0); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/DataStreamQueue.java/clean/tn5250j/src/org/tn5250j/DataStreamQueue.java
|
}
|
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); /** * @todo here is the throttling code to look at * * just something here to try. OK it works but we need to be a little * more intelligent with the throttling. */ if (vector.size() >= 20) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);// System.out.println(vector.size()); } // we have the lock and state we're seeking return vector.remove(0); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/DataStreamQueue.java/clean/tn5250j/src/org/tn5250j/DataStreamQueue.java
|
|
lock.notify();
|
lock.notifyAll();
|
public void put(Object o) { synchronized (lock) { vector.addElement(o);// if (vector.size() > 5)// System.out.println(vector.size()); // tell waiting threads to wake up lock.notify(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/bc7e11ab017c3feeba41d87e99dba276258b7c41/DataStreamQueue.java/clean/tn5250j/src/org/tn5250j/DataStreamQueue.java
|
void visitParameter(Parameter p);
|
public void visitParameter(Parameter p);
|
void visitParameter(Parameter p);
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
String visitValue(String s, boolean last, int tokenType);
|
public String visitValue(String s, boolean last, int tokenType);
|
String visitValue(String s, boolean last, int tokenType);
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
return line; }
|
return line; }
|
String getCompletedLine() { return line; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
this.param = p; String s = p.getName(); if( !Parameter.ANONYMOUS.equals(s) ) { line += "-" + s + " "; } }
|
this.param = p; if (!p.isAnonymous()) { line += "-" + p.getName() + " "; } }
|
public void visitParameter(Parameter p) { this.param = p; String s = p.getName(); if( !Parameter.ANONYMOUS.equals(s) ) { line += "-" + s + " "; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
String result = ""; if (last) { result = param.complete(s); line += result; } else { result = ((tokenType & CommandLine.STRING) != 0 ? CommandLine.escape(s, true) : s); line += result + " "; } return result; }
|
String result = ""; if (last) { result = param.complete(s); line += result; } else { result = ((tokenType & CommandLine.STRING) != 0 ? CommandLine .escape(s, true) : s); line += result + " "; } return result; }
|
public String visitValue(String s, boolean last, int tokenType) { String result = ""; if (last) { // we're not yet at the end of the command line // token to be completed result = param.complete(s); line += result; } else { result = ((tokenType & CommandLine.STRING) != 0 ? CommandLine.escape(s, true) : s); line += result + " "; } return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
if( param == null ) return;
|
if (param == null) return;
|
void finishParameter() { if( param == null ) return; if( valued || !param.hasArgument() ) result.put(param, null); // mark it as "set" if( param.hasArgument() ) { Argument arg = param.getArgument(); result.put(arg, arg.getValues()); } param = null; valued = false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
if( valued || !param.hasArgument() ) result.put(param, null); if( param.hasArgument() ) { Argument arg = param.getArgument(); result.put(arg, arg.getValues()); } param = null; valued = false; }
|
if (valued || !param.hasArgument()) result.put(param, null); if (param.hasArgument()) { Argument arg = param.getArgument(); result.put(arg, arg.getValues()); } param = null; valued = false; }
|
void finishParameter() { if( param == null ) return; if( valued || !param.hasArgument() ) result.put(param, null); // mark it as "set" if( param.hasArgument() ) { Argument arg = param.getArgument(); result.put(arg, arg.getValues()); } param = null; valued = false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
finishParameter(); return result; }
|
finishParameter(); return result; }
|
Map getArgumentMap() { finishParameter(); return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
finishParameter(); this.param = p; }
|
finishParameter(); this.param = p; }
|
public void visitParameter(Parameter p) { finishParameter(); this.param = p; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
if( last && "".equals(s) ) return null; valued = true; return s; }
|
if (last && "".equals(s)) return null; valued = true; return s; }
|
public String visitValue(String s, boolean last, int tokenType) { if( last && "".equals(s) ) return null; valued = true; return s; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
this.description = description; this.params = params; }
|
this.description = description; this.params = params; }
|
public Syntax(String description, Parameter[] params) { this.description = description; this.params = params; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
private void clearArguments() { for (int i = 0; i < params.length; i++) if (params[i].hasArgument()) params[i].getArgument().clear(); }
|
final void clearArguments() { for (int i = 0; i < params.length; i++) if (params[ i].hasArgument()) params[ i].getArgument().clear(); }
|
private void clearArguments() { for (int i = 0; i < params.length; i++) if (params[i].hasArgument()) params[i].getArgument().clear(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
CompletionVisitor visitor = new CompletionVisitor(); try { visitCommandLine(partial, visitor); } catch(SyntaxError ex) { throw new CompletionException(ex.getMessage()); } return visitor.getCompletedLine(); }
|
CompletionVisitor visitor = new CompletionVisitor(); try { visitCommandLine(partial, visitor); } catch (SyntaxErrorException ex) { throw new CompletionException(ex.getMessage()); } return visitor.getCompletedLine(); }
|
public String complete(CommandLine partial) throws CompletionException { CompletionVisitor visitor = new CompletionVisitor(); try { visitCommandLine(partial, visitor); } catch(SyntaxError ex) { throw new CompletionException(ex.getMessage()); } return visitor.getCompletedLine(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
return description; }
|
return description; }
|
public String getDescription() { return description; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
return params; }
|
return params; }
|
public Parameter[] getParams() { return params; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); }
|
synchronized ParsedArguments parse(String[] args) throws SyntaxErrorException { if (params.length == 0) { if (args.length == 0) { return new ParsedArguments(new HashMap()); } throw new SyntaxErrorException("Syntax takes no parameter"); }
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap());
|
final CommandLine cmdLine = new CommandLine(args); final ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); final ParsedArguments result = new ParsedArguments(visitor .getArgumentMap());
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
for (int i = 0; i < params.length; i++) { final Parameter p = params[ i]; if (!p.isOptional()) { if (!p.isSet(result)) { throw new SyntaxErrorException( "Mandatory parameter " + p.getName() + " not set"); } } } return result; }
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next();
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) throws SyntaxErrorException { clearArguments(); Parameter param = null; final AnonymousIterator anonIterator = new AnonymousIterator(); do { String s = ""; if (cmdLine.hasNext()) s = cmdLine.next();
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
/*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { if (param != null) throw new SyntaxError("Unexpected Parameter " + s);
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
|
param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { if (param == null) { param = getAnonymousParameter(); if (param == null) { throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); }
|
/* * if (s.startsWith("-") && (cmdLine.getTokenType() == * CommandLine.LITERAL)) { * (param != null) * given throw new SyntaxError("Unexpected Parameter " + s); * * param = getParameter(s.substring(1)); if (param == null) throw * new SyntaxError("Unknown Parameter \"" + s + "\""); * visitor.visitParameter(param); } else { */ if (param == null) { if (anonIterator.hasNext()) { param = (Parameter) anonIterator.next(); visitor.visitParameter(param); } else { throw new SyntaxErrorException("Unexpected argument \"" + s + "\""); }
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
final boolean last = !cmdLine.hasNext(); Argument arg = param.getArgument(); String value = visitor.visitValue(s, last, cmdLine.getTokenType()); if (value != null) { if (visitor.isValueValid(arg, value, last)) { arg.setValue(value); } else { throw new SyntaxErrorException("Invalid value for argument"); } } } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java
|
try { helper.getVmClass(child); } catch (NullPointerException ex) { Unsafe.debug("\nObject type "); Unsafe.debug(vmClass.getName()); Unsafe.debug("\nChild addr "); Unsafe.debug(helper.addressOf32(child)); Unsafe.debug("\nField offset "); Unsafe.debug(offset); Unsafe.debug("\nC.IsObject? "); Unsafe.debug(heapManager.isObject(helper.addressOf(child)) ? "Yes" : "No"); Unsafe.debug("\nO.IsObject? "); Unsafe.debug(heapManager.isObject(helper.addressOf(object)) ? "Yes" : "No"); Unsafe.debug('\n'); helper.die("NPE in processChild; probably corrupted heap"); }
|
private void markObject(Object object, VmNormalClass vmClass) { final int[] referenceOffsets = vmClass.getReferenceOffsets(); final int cnt = referenceOffsets.length; final int size = vmClass.getObjectSize(); for (int i = 0; i < cnt; i++) { int offset = referenceOffsets[ i]; if ((offset < 0) || (offset >= size)) { Unsafe.debug("reference offset out of range!"); Unsafe.debug(vmClass.getName()); helper.die("Class internal error"); } else { final Object child = helper.getObject(object, offset); if (child != null) { processChild(child); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/GCMarkVisitor.java/buggy/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java
|
|
stack.push(child);
|
try { helper.getVmClass(child); stack.push(child); } catch (NullPointerException ex) { Unsafe.debug("\nObject address "); Unsafe.debug(helper.addressOf32(child)); Unsafe.debug("\nObject TIB "); Unsafe.debug(helper.addressOf32(helper.getTib(child))); helper.die("NPE in processChild; probably corrupted heap"); }
|
private void processChild(Object child) { final int gcColor = helper.getObjectColor(child); if (gcColor <= GC_WHITE) { // Yellow or White helper.atomicChangeObjectColor(child, gcColor, GC_GREY); stack.push(child); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/GCMarkVisitor.java/buggy/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java
|
try { helper.getVmClass(object); } catch (NullPointerException ex) { Unsafe.debug("\nObject address "); Unsafe.debug(helper.addressOf32(object)); Unsafe.debug("\nObject TIB "); Unsafe.debug(helper.addressOf32(helper.getTib(object))); helper.die("NPE in processChild; probably corrupted heap"); }
|
public boolean visit(Object object) { // Be very paranoia for now /* * if (!heapManager.isObject(helper.addressOf(object))) { * Unsafe.debug("visit got non-object"); * Unsafe.debug(helper.addressToLong(helper.addressOf(object))); * Unsafe.getCurrentProcessor().getArchitecture().getStackReader() * .debugStackTrace(); helper.die("Internal error"); return false; */ //testObject(object, Unsafe.getVmClass(object)); // Check the current color first, since a stackoverflow of // the mark stack results in another iteration of visits. final int gcColor = helper.getObjectColor(object); if (gcColor == GC_BLACK) { return true; } else if (rootSet || (gcColor == GC_GREY)) { switch (gcColor) { case GC_WHITE: case GC_YELLOW: { final boolean ok; ok = helper.atomicChangeObjectColor(object, gcColor, GC_GREY); if (!ok) { Unsafe.debug("Could not change object color. "); } } break; case GC_GREY: break; default: { Unsafe.debug("color"); Unsafe.debug(gcColor); helper.die("Unknown GC color on object"); } } stack.push(object); mark(); } final boolean rc = (!stack.isOverflow()); return rc; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/GCMarkVisitor.java/buggy/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java
|
|
if (result == null) { throw new IllegalStateException("Null object found on GCStack"); }
|
public Object pop() { if (stackPtr == 0) { return null; } else { stackPtr--; Object result = stack[stackPtr]; stack[stackPtr] = null; return result; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/GCStack.java/buggy/core/src/core/org/jnode/vm/memmgr/def/GCStack.java
|
|
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory fv)
|
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory vf)
|
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory fv) { setPropertiesFromAttributes(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/ParagraphView.java/clean/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
layoutChanged(X_AXIS); layoutChanged(Y_AXIS); super.changedUpdate(ev, a, vf);
|
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory fv) { setPropertiesFromAttributes(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/ParagraphView.java/clean/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
|
align = super.getAlignment(axis);
|
align = 0.5F;
|
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/ParagraphView.java/clean/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
align = 0.0F;
|
align = 0.5F;
|
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/ParagraphView.java/clean/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
throw new IllegalArgumentException("classname: " + e.getMessage());
|
IllegalArgumentException iae; iae = new IllegalArgumentException("mimeString: " + mimeString + " classLoader: " + classLoader); iae.initCause(e); throw iae;
|
private static Class getRepresentationClassFromMime(String mimeString, ClassLoader classLoader) { String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException("classname: " + e.getMessage()); } } else return java.io.InputStream.class; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
return(Class.forName(className));
|
return Class.forName(className);
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
catch(Exception e) { ; } /*
|
catch(ClassNotFoundException cnfe) { }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
return(className.getClass().getClassLoader().findClass(className));
|
ClassLoader loader = ClassLoader.getSystemClassLoader(); return Class.forName(className, true, loader); } catch(ClassNotFoundException cnfe) {
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
catch(Exception e) { ; }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
|
return(ClassLoader.getSystemClassLoader().findClass(className));
|
ClassLoader loader = Thread.currentThread().getContextClassLoader(); return Class.forName(className, true, loader); } catch(ClassNotFoundException cnfe) {
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
catch(Exception e) { ; } */ /* try { } catch(Exception e) { ; } */
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
|
return(classLoader.loadClass(className)); else
|
return Class.forName(className, true, classLoader);
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/DataFlavor.java/clean/core/src/classpath/java/java/awt/datatransfer/DataFlavor.java
|
FSDriverUtils.getIDEDeviceFactory();
|
IDEDriverUtils.getIDEDeviceFactory();
|
public void init(TestConfig config, MockObjectTestCase testCase) throws NameAlreadyBoundException, NamingException, IllegalArgumentException, DriverException, ResourceNotFreeException { IDEDiskDriver driver = new IDEDiskDriver(); // set the current testCase for our factory MockIDEDeviceFactory factory = (MockIDEDeviceFactory) FSDriverUtils.getIDEDeviceFactory(); factory.setTestCase(testCase); // create stub resource manager MockObjectFactory.createResourceManager(testCase); // create stub IDE device Device parent = createParentDevice(DEVICE_SIZE); IDEDevice device = MockObjectFactory.createIDEDevice(parent, testCase, true, SLOW_DEVICE_SIZE); init(null, driver, device); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5f20db8806d47252a697922a7da3255a442e6bdf/IDEDiskDriverContext.java/buggy/fs/src/test/org/jnode/test/fs/driver/context/IDEDiskDriverContext.java
|
Class cls = Class.forName(toolkit_name);
|
ClassLoader cl = Thread.currentThread().getContextClassLoader(); Class cls = cl.loadClass(toolkit_name);
|
public static Toolkit getDefaultToolkit() { if (toolkit != null) return toolkit; String toolkit_name = System.getProperty("awt.toolkit", default_toolkit_name); try { Class cls = Class.forName(toolkit_name); Object obj = cls.newInstance(); if (!(obj instanceof Toolkit)) throw new AWTError(toolkit_name + " is not a subclass of " + "java.awt.Toolkit"); toolkit = (Toolkit) obj; return toolkit; } catch (ThreadDeath death) { throw death; } catch (Throwable t) { AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name); throw (AWTError) e.initCause(t); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ed7b7a082329cd6e3d753039343918c06af82e24/Toolkit.java/buggy/core/src/classpath/java/java/awt/Toolkit.java
|
System.out.println("args IS -------------'" + args);
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/607e874365701949961b57dd03874e51f80b4f30/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
|
|
System.out.println("DNNAME IS -------------'" + dnParam);
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/607e874365701949961b57dd03874e51f80b4f30/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
|
|
System.out.println("Got param" + getParm("-dn",args));
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/607e874365701949961b57dd03874e51f80b4f30/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
|
|
else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element);
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute(StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); else if (tag == HTML.Tag.HEAD) view = new NullView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
if (view == null) { System.err.println("missing tag->view mapping for: " + element); view = new NullView(element); }
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute(StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); else if (tag == HTML.Tag.HEAD) view = new NullView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
if (editorPane != null)
|
public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException { if (doc instanceof HTMLDocument) { Parser parser = getParser(); if (pos < 0 || pos > doc.getLength()) throw new BadLocationException("Bad location", pos); if (parser == null) throw new IOException("Parser is null."); HTMLDocument hd = ((HTMLDocument) doc); hd.setBase(editorPane.getPage()); ParserCallback pc = hd.getReader(pos); // FIXME: What should ignoreCharSet be set to? // parser.parse inserts html into the buffer parser.parse(in, pc, false); pc.flush(); } else // read in DefaultEditorKit is called. // the string is inserted in the document as usual. super.read(in, doc, pos); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/HTMLEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
validateFileCache();
|
public BasicDirectoryModel(JFileChooser filechooser) { this.filechooser = filechooser; filechooser.addPropertyChangeListener(this); listingMode = filechooser.getFileSelectionMode(); contents = new Vector(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
|
Vector tmp = new Vector(); for (int i = 0; i < directories; i++) tmp.add(contents.get(i)); return tmp;
|
synchronized (contents) { Vector dirs = directories; if (dirs == null) { getFiles(); dirs = directories; } return dirs; }
|
public Vector getDirectories() { Vector tmp = new Vector(); for (int i = 0; i < directories; i++) tmp.add(contents.get(i)); return tmp; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicDirectoryModel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicDirectoryModel.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.