rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
t.getCaret().moveDot(Math.min(t.getCaret().getDot() + 1, t.getDocument().getEndPosition().getOffset()));
|
t.getCaret().setDot(Math.min(t.getCaret().getDot() + 1, t.getDocument().getEndPosition().getOffset()));
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); if (t != null) { t.getCaret().moveDot(Math.min(t.getCaret().getDot() + 1, t.getDocument().getEndPosition().getOffset())); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/DefaultEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/DefaultEditorKit.java
|
MyFileChooser pcFileChooser = new MyFileChooser(workingDir);
|
TN5250jFileChooser pcFileChooser = new TN5250jFileChooser(workingDir);
|
private void getPCFile() { String workingDir = System.getProperty("user.dir"); MyFileChooser pcFileChooser = new MyFileChooser(workingDir); XTFRFileFilter pngFilter = new XTFRFileFilter("png", "Portable Network Graphics"); pcFileChooser.setFileFilter(pngFilter); int ret = pcFileChooser.showSaveDialog(new JFrame()); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file; try { if (!pcFileChooser.getSelectedFile().getCanonicalPath().endsWith(".png")) file = new File(pcFileChooser.getSelectedFile().getCanonicalPath() + ".png"); else file = pcFileChooser.getSelectedFile(); EncodeComponent.encode(EncodeComponent.PNG,session, file); } catch (Exception e) { System.out.println("Error generating PNG exception caught: " + e); } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/23b9082401e6c07b6befa90f25fb355bdb4ae9b5/SendScreenImageToFile.java/clean/tn5250j/src/org/tn5250j/tools/SendScreenImageToFile.java
|
view = new HTMLTableView(element);
|
view = new javax.swing.text.html.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); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); // 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.TABLE)) view = new HTMLTableView(element); else if (tag.equals(HTML.Tag.TD)) view = new ParagraphView(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.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(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) { System.err.println("missing tag->view mapping for: " + element); view = new NullView(element); } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(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); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); // 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.TABLE)) view = new HTMLTableView(element); else if (tag.equals(HTML.Tag.TD)) view = new ParagraphView(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.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(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) { System.err.println("missing tag->view mapping for: " + element); view = new NullView(element); } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(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); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); // 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.TABLE)) view = new HTMLTableView(element); else if (tag.equals(HTML.Tag.TD)) view = new ParagraphView(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.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(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) { System.err.println("missing tag->view mapping for: " + element); view = new NullView(element); } return view; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
super(); styleContext = new StyleContext(); styleSheet = new StyleSheet(); styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS));
|
public HTMLEditorKit() { super(); styleContext = new StyleContext(); styleSheet = new StyleSheet(); styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS)); // FIXME: Set inputAttributes with default.css }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
|
parser = new ParserDelegator();
|
{ parser = new GnuParserDelegator(HTML_401Swing.getInstance()); }
|
protected Parser getParser() { if (parser == null) parser = new ParserDelegator(); return parser; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS));
|
InputStream in = getClass().getResourceAsStream(DEFAULT_CSS); InputStreamReader r = new InputStreamReader(in); styleSheet.loadRules(r, null); r.close(); } catch (IOException ex) { }
|
public StyleSheet getStyleSheet() { if (styleSheet == null) { styleSheet = new StyleSheet(); styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS)); } return styleSheet; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
ParserCallback pc = ((HTMLDocument) doc).getReader (offset, popDepth, pushDepth, insertTag);
|
ParserCallback pc = doc.getReader(offset, popDepth, pushDepth, insertTag);
|
public void insertHTML(HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag) throws BadLocationException, IOException { Parser parser = getParser(); if (offset < 0 || offset > doc.getLength()) throw new BadLocationException("Bad location", offset); if (parser == null) throw new IOException("Parser is null."); ParserCallback pc = ((HTMLDocument) doc).getReader (offset, popDepth, pushDepth, insertTag); // FIXME: What should ignoreCharSet be set to? // parser.parse inserts html into the buffer parser.parse(new StringReader(html), pc, false); pc.flush(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/HTMLEditorKit.java/clean/core/src/classpath/javax/javax/swing/text/html/HTMLEditorKit.java
|
super(nm);
|
super(nm);
|
public StyledTextAction(String nm) { super(nm); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/StyledEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/StyledEditorKit.java
|
CssParser cp = new CssParser(); cp.parse(ref, in, false, false);
|
public void loadRules(Reader in, URL ref) throws IOException { // FIXME: Not implemented. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/StyleSheet.java/buggy/core/src/classpath/javax/javax/swing/text/html/StyleSheet.java
|
|
public void read(Reader in, Document document, int offset)
|
public void read(InputStream in, Document document, int offset)
|
public void read(Reader in, Document document, int offset) throws BadLocationException, IOException { BufferedReader reader = new BufferedReader(in); String line; StringBuffer content = new StringBuffer(); while ((line = reader.readLine()) != null) { content.append(line); content.append("\n"); } document.insertString(offset, content.toString(), SimpleAttributeSet.EMPTY); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/20f5673386408fafdc5023d9aa75062c49b110c6/DefaultEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/DefaultEditorKit.java
|
BufferedReader reader = new BufferedReader(in); String line; StringBuffer content = new StringBuffer(); while ((line = reader.readLine()) != null) { content.append(line); content.append("\n"); } document.insertString(offset, content.toString(), SimpleAttributeSet.EMPTY);
|
read(new InputStreamReader(in), document, offset);
|
public void read(Reader in, Document document, int offset) throws BadLocationException, IOException { BufferedReader reader = new BufferedReader(in); String line; StringBuffer content = new StringBuffer(); while ((line = reader.readLine()) != null) { content.append(line); content.append("\n"); } document.insertString(offset, content.toString(), SimpleAttributeSet.EMPTY); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/20f5673386408fafdc5023d9aa75062c49b110c6/DefaultEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/DefaultEditorKit.java
|
public void write(Writer out, Document document, int offset, int len)
|
public void write(OutputStream out, Document document, int offset, int len)
|
public void write(Writer out, Document document, int offset, int len) throws BadLocationException, IOException { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/20f5673386408fafdc5023d9aa75062c49b110c6/DefaultEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/DefaultEditorKit.java
|
write(new OutputStreamWriter(out), document, offset, len);
|
public void write(Writer out, Document document, int offset, int len) throws BadLocationException, IOException { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/20f5673386408fafdc5023d9aa75062c49b110c6/DefaultEditorKit.java/buggy/core/src/classpath/javax/javax/swing/text/DefaultEditorKit.java
|
|
File[] value = (File[]) trim.toArray(new File[0]);
|
File[] value = (File[]) trim.toArray(new File[trim.size()]);
|
public File[] getFiles(File dir, boolean useFileHiding) { if (dir == null || dir.listFiles() == null) return null; File[] files = dir.listFiles(); if (! useFileHiding) return files; ArrayList trim = new ArrayList(); for (int i = 0; i < files.length; i++) if (! files[i].isHidden()) trim.add(files[i]); File[] value = (File[]) trim.toArray(new File[0]); return value; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/FileSystemView.java/clean/core/src/classpath/javax/javax/swing/filechooser/FileSystemView.java
|
return new Boolean(f.isDirectory());
|
return Boolean.valueOf(f.isDirectory());
|
public Boolean isTraversable(File f) { // Tested. A directory where the user has no permission to rwx is still // traversable. (No files are listed when you traverse the directory) // My best guess is that as long as it's a directory, the file is // traversable. return new Boolean(f.isDirectory()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/FileSystemView.java/clean/core/src/classpath/javax/javax/swing/filechooser/FileSystemView.java
|
AbstractButton.this.fireStateChanged(); repaint();
|
getEventHandler().stateChanged(ev);
|
public void stateChanged(ChangeEvent ev) { AbstractButton.this.fireStateChanged(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
actionListener = createActionListener(); changeListener = createChangeListener(); itemListener = createItemListener();
|
public AbstractButton() { actionListener = createActionListener(); changeListener = createChangeListener(); itemListener = createItemListener(); horizontalAlignment = CENTER; horizontalTextPosition = TRAILING; verticalAlignment = CENTER; verticalTextPosition = CENTER; borderPainted = true; contentAreaFilled = true; focusPainted = true; setFocusable(true); setAlignmentX(CENTER_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); setDisplayedMnemonicIndex(-1); setOpaque(true); text = ""; updateUI(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
return new ActionListener() { public void actionPerformed(ActionEvent e) { AbstractButton.this.fireActionPerformed(e); } };
|
return getEventHandler();
|
protected ActionListener createActionListener() { return new ActionListener() { public void actionPerformed(ActionEvent e) { AbstractButton.this.fireActionPerformed(e); } }; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
return new ButtonChangeListener();
|
return getEventHandler();
|
protected ChangeListener createChangeListener() { return new ButtonChangeListener(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
return new ItemListener() { public void itemStateChanged(ItemEvent e) { AbstractButton.this.fireItemStateChanged(e); } };
|
return getEventHandler();
|
protected ItemListener createItemListener() { return new ItemListener() { public void itemStateChanged(ItemEvent e) { AbstractButton.this.fireItemStateChanged(e); } }; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
if (disabeldIcon == null && default_icon instanceof ImageIcon)
|
if (disabledIcon == null && default_icon instanceof ImageIcon)
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
disabeldIcon = new ImageIcon(grayImage);
|
disabledIcon = new ImageIcon(grayImage);
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
return disabeldIcon;
|
return disabledIcon;
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
this.text = text;
|
setText(text);
|
protected void init(String text, Icon icon) { // If text is null, we fall back to the empty // string (which is set using AbstractButton's // constructor). // This way the behavior of the JDK is matched. if(text != null) this.text = text; if (icon != null) default_icon = icon; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
disabeldIcon = d;
|
if (disabledIcon == d) return; Icon old = disabledIcon; disabledIcon = d; firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, old, d);
|
public void setDisabledIcon(Icon d) { disabeldIcon = d; revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
if (a != LEFT && a != CENTER && a != RIGHT && a != LEADING && a != TRAILING) throw new IllegalArgumentException("Invalid alignment.");
|
public void setHorizontalAlignment(int a) { if (horizontalAlignment == a) return; int old = horizontalAlignment; horizontalAlignment = a; firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, old, a); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
if (t != LEFT && t != CENTER && t != RIGHT && t != LEADING && t != TRAILING) throw new IllegalArgumentException("Invalid alignment.");
|
public void setHorizontalTextPosition(int t) { if (horizontalTextPosition == t) return; int old = horizontalTextPosition; horizontalTextPosition = t; firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, old, t); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
itemListener = createItemListener();
|
public void setModel(ButtonModel newModel) { if (newModel == model) return; if (model != null) { model.removeActionListener(actionListener); model.removeChangeListener(changeListener); model.removeItemListener(itemListener); } ButtonModel old = model; model = newModel; if (model != null) { model.addActionListener(actionListener); model.addChangeListener(changeListener); model.addItemListener(itemListener); } firePropertyChange(MODEL_CHANGED_PROPERTY, old, model); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
setRolloverEnabled(true);
|
public void setRolloverIcon(Icon r) { if (rolloverIcon == r) return; Icon old = rolloverIcon; rolloverIcon = r; firePropertyChange(ROLLOVER_ICON_CHANGED_PROPERTY, old, rolloverIcon); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
setRolloverEnabled(true);
|
public void setRolloverSelectedIcon(Icon r) { if (rolloverSelectedIcon == r) return; Icon old = rolloverSelectedIcon; rolloverSelectedIcon = r; firePropertyChange(ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, old, r); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
if (a != TOP && a != CENTER && a != BOTTOM) throw new IllegalArgumentException("Invalid alignment.");
|
public void setVerticalAlignment(int a) { if (verticalAlignment == a) return; int old = verticalAlignment; verticalAlignment = a; firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, old, a); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
if (t != TOP && t != CENTER && t != BOTTOM) throw new IllegalArgumentException("Invalid alignment.");
|
public void setVerticalTextPosition(int t) { if (verticalTextPosition == t) return; int old = verticalTextPosition; verticalTextPosition = t; firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, old, t); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
|
public OverlayLayout(Container target) { }
|
public OverlayLayout(Container target) { }
|
public OverlayLayout(Container target) { // TODO } // OverlayLayout()
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/OverlayLayout.java/buggy/core/src/classpath/javax/javax/swing/OverlayLayout.java
|
this.operand1 = getOperand(varIndex1);
|
public ConditionalBranchQuad(int address, IRBasicBlock block, int varIndex1, int condition, int varIndex2, int targetAddress) { super(address, block, targetAddress); if (condition < IF_ICMPEQ || condition > IF_ACMPNE) { throw new IllegalArgumentException("can't use that condition here"); } this.operand1 = getOperand(varIndex1); this.condition = condition; this.commutative = condition == IF_ICMPEQ || condition == IF_ICMPNE || condition == IF_ACMPEQ || condition == IF_ACMPNE; this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
|
this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2};
|
refs = new Operand[]{ getOperand(varIndex1), getOperand(varIndex2) };
|
public ConditionalBranchQuad(int address, IRBasicBlock block, int varIndex1, int condition, int varIndex2, int targetAddress) { super(address, block, targetAddress); if (condition < IF_ICMPEQ || condition > IF_ACMPNE) { throw new IllegalArgumentException("can't use that condition here"); } this.operand1 = getOperand(varIndex1); this.condition = condition; this.commutative = condition == IF_ICMPEQ || condition == IF_ICMPNE || condition == IF_ACMPEQ || condition == IF_ACMPNE; this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1;
|
refs[0] = refs[0].simplify(); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0];
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2;
|
if (refs[1] != null) { refs[1] = refs[1].simplify(); if (refs[1] instanceof Variable) { Variable v = (Variable) refs[1];
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode();
|
int op1Mode = refs[0].getAddressingMode(); int op2Mode = refs[1].getAddressingMode();
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
Variable var = (Variable) operand1;
|
Variable var = (Variable) refs[0];
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
Variable var = (Variable) operand2;
|
Variable var = (Variable) refs[1];
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
Variable var = (Variable) operand1;
|
Variable var = (Variable) refs[0];
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
Variable var = (Variable) operand2;
|
Variable var = (Variable) refs[1];
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
c2 = (Constant) operand1;
|
c2 = (Constant) refs[0];
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
c3 = (Constant) operand2;
|
c3 = (Constant) refs[1];
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation();
|
if (refs[0] instanceof Variable) { Location varLoc = ((Variable) refs[0]).getLocation();
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
} else if (operand1 instanceof Constant) {
|
} else if (refs[0] instanceof Constant) {
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
Constant con = (Constant) operand1;
|
Constant con = (Constant) refs[0];
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
throw new IllegalArgumentException("Unknown operand: " + operand1);
|
throw new IllegalArgumentException("Unknown operand: " + refs[0]);
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
return operand1;
|
return refs[0];
|
public Operand getOperand1() { return operand1; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
return operand2;
|
return refs[1];
|
public Operand getOperand2() { return operand2; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() +
|
return getAddress() + ": if " + refs[0].toString() + " " + CONDITION_MAP[condition] + " " + refs[1].toString() +
|
public String toString() { if (condition >= IF_ICMPEQ) { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() + " goto " + getTargetAddress(); } else { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " goto " + getTargetAddress(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
return getAddress() + ": if " + operand1.toString() + " " +
|
return getAddress() + ": if " + refs[0].toString() + " " +
|
public String toString() { if (condition >= IF_ICMPEQ) { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() + " goto " + getTargetAddress(); } else { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " goto " + getTargetAddress(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/ConditionalBranchQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java
|
new OpenSameAction(session,keyMap);
|
void initKeyBindings() { KeyStroke ks; new NewSessionAction(session,keyMap); new ToggleConnectionAction(session,keyMap); new JumpNextAction(session,keyMap); new JumpPrevAction(session,keyMap); new HotspotsAction(session,keyMap); new GuiAction(session,keyMap); new DispMsgsAction(session,keyMap); new AttributesAction(session,keyMap); new PrintAction(session,keyMap); new RulerAction(session,keyMap); new CloseAction(session,keyMap); new TransferAction(session,keyMap); new EmailAction(session,keyMap); new RunScriptAction(session,keyMap); new DebugAction(session,keyMap); new CopyAction(session,keyMap); new SpoolWorkAction(session,keyMap); new QuickEmailAction(session,keyMap); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/0686de448db01a9cc1b09cae982858a4d418dae8/DefaultKeyboardHandler.java/clean/tn5250j/src/org/tn5250j/keyboard/DefaultKeyboardHandler.java
|
|
keyMap.init();
|
KeyMapper.init();
|
public KeyboardHandler(Session session) { this.session = session; this.screen = session.getScreen(); String os = System.getProperty("os.name"); if (os.toLowerCase().indexOf("linux") != -1) { System.out.println("using os " + os); isLinux = true; } keyMap = new KeyMapper(); keyMap.init(); keyMap.addKeyChangeListener(this); // initialize the keybingings of the components InputMap initKeyBindings(); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/07f06b4067597c92fa853238df838b4d56dbcf8c/KeyboardHandler.java/buggy/tn5250j/src/org/tn5250j/keyboard/KeyboardHandler.java
|
keyMap.addKeyChangeListener(this);
|
KeyMapper.addKeyChangeListener(this);
|
public KeyboardHandler(Session session) { this.session = session; this.screen = session.getScreen(); String os = System.getProperty("os.name"); if (os.toLowerCase().indexOf("linux") != -1) { System.out.println("using os " + os); isLinux = true; } keyMap = new KeyMapper(); keyMap.init(); keyMap.addKeyChangeListener(this); // initialize the keybingings of the components InputMap initKeyBindings(); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/07f06b4067597c92fa853238df838b4d56dbcf8c/KeyboardHandler.java/buggy/tn5250j/src/org/tn5250j/keyboard/KeyboardHandler.java
|
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } if (lastKeyMnemonic != null && lastKeyMnemonic.endsWith(".alt2")) { lastKeyMnemonic = lastKeyMnemonic.substring(0,lastKeyMnemonic.indexOf(".alt2")); } return lastKeyMnemonic;
|
public final static String getKeyStrokeText(KeyEvent ke) { return getKeyStrokeText(ke,false);
|
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } if (lastKeyMnemonic != null && lastKeyMnemonic.endsWith(".alt2")) { lastKeyMnemonic = lastKeyMnemonic.substring(0,lastKeyMnemonic.indexOf(".alt2")); } return lastKeyMnemonic; }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/afff7d5ba1bc03e5e4709099fbacc81757f734a1/KeyMapper.java/buggy/tn5250j/src/org/tn5250j/keyboard/KeyMapper.java
|
public void executeMeMacro(String macro) {
|
public void executeMeMacro(ActionEvent ae) {
|
public void executeMeMacro(String macro) { Macronizer.invoke(macro,(Session)this); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/0686de448db01a9cc1b09cae982858a4d418dae8/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
|
Macronizer.invoke(macro,(Session)this);
|
executeMeMacro(ae.getActionCommand());
|
public void executeMeMacro(String macro) { Macronizer.invoke(macro,(Session)this); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/0686de448db01a9cc1b09cae982858a4d418dae8/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ())
|
public void setLocationRelativeTo(Component c)
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Window.java/buggy/core/src/classpath/java/java/awt/Window.java
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint ();
|
if (c == null || !c.isShowing()) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Point center = ge.getCenterPoint();
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Window.java/buggy/core/src/classpath/java/java/awt/Window.java
|
setLocation (x, y);
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Window.java/buggy/core/src/classpath/java/java/awt/Window.java
|
|
int x = c.getX(); int y = c.getY();
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Window.java/buggy/core/src/classpath/java/java/awt/Window.java
|
|
else if (x < 0)
|
else if (x < 0 || (x - (width - cWidth) / 2) < 0)
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Window.java/buggy/core/src/classpath/java/java/awt/Window.java
|
}
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Window.java/buggy/core/src/classpath/java/java/awt/Window.java
|
|
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back,
|
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back,
|
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back, FlipContents flip) { this.front = front; this.back = back; this.flip = flip; if (front == null || back == null) throw new IllegalArgumentException(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8b7bd34f9c789e32b3e30b7431e945f2f0ff17f5/BufferCapabilities.java/buggy/core/src/classpath/java/java/awt/BufferCapabilities.java
|
if (front == null || back == null) throw new IllegalArgumentException();
|
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back, FlipContents flip) { this.front = front; this.back = back; this.flip = flip; if (front == null || back == null) throw new IllegalArgumentException(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8b7bd34f9c789e32b3e30b7431e945f2f0ff17f5/BufferCapabilities.java/buggy/core/src/classpath/java/java/awt/BufferCapabilities.java
|
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException();
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException();
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
if (next != null) { next.postEvent(evt); return; }
|
if (next != null) { next.postEvent(evt); return; }
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
/* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; }
|
/* * Check for any events already on the queue with the same source and * ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* * If there are, call coalesceEvents on the source component to * see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; }
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
queue[next_in] = evt; if (++next_in == queue.length) next_in = 0;
|
queue[next_in] = evt; if (++next_in == queue.length) next_in = 0;
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2];
|
if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2];
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out);
|
int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out);
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
next_out = 0; next_in = oldQueue.length; } notify(); }
|
next_out = 0; next_in = oldQueue.length; } if (dispatchThread == null || !dispatchThread.isAlive()) { System.out .println("Start new dispatchThread old=" + dispatchThread); dispatchThread = new EventDispatchThread(this); dispatchThread.start(); } if (!isDispatchThread() || (evt.getID() == WindowEvent.WINDOW_CLOSED) || (evt.getID() == WindowEvent.WINDOW_CLOSING)) ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue(); notify(); }
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b0bcdc7c5655d1ed77837894a9de15b7556d346b/EventQueue.java/buggy/core/src/classpath/java/java/awt/EventQueue.java
|
public boolean postEvent(Event e)
|
public boolean postEvent (Event e)
|
public boolean postEvent(Event e) { // XXX Add backward compatibility handling. return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/566e4ab93ebc97794094572536829e581d565b11/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
|
return false;
|
boolean handled = handleEvent (e); if (!handled && getParent() != null) handled = getParent ().postEvent (e); return handled;
|
public boolean postEvent(Event e) { // XXX Add backward compatibility handling. return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/566e4ab93ebc97794094572536829e581d565b11/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
|
public boolean handleEvent(Event evt)
|
public boolean handleEvent (Event evt)
|
public boolean handleEvent(Event evt) { // XXX Add backward compatibility handling. return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/566e4ab93ebc97794094572536829e581d565b11/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
|
switch (evt.id) { case Event.KEY_ACTION: case Event.KEY_PRESS: return keyDown (evt, evt.key); case Event.KEY_ACTION_RELEASE: case Event.KEY_RELEASE: return keyUp (evt, evt.key); case Event.MOUSE_DOWN: return mouseDown (evt, evt.x, evt.y); case Event.MOUSE_UP: return mouseUp (evt, evt.x, evt.y); case Event.MOUSE_MOVE: return mouseMove (evt, evt.x, evt.y); case Event.MOUSE_DRAG: return mouseDrag (evt, evt.x, evt.y); case Event.MOUSE_ENTER: return mouseEnter (evt, evt.x, evt.y); case Event.MOUSE_EXIT: return mouseExit (evt, evt.x, evt.y); case Event.GOT_FOCUS: return gotFocus (evt, evt.arg); case Event.LOST_FOCUS: return lostFocus (evt, evt.arg); case Event.ACTION_EVENT: return action (evt, evt.arg); }
|
public boolean handleEvent(Event evt) { // XXX Add backward compatibility handling. return false; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/566e4ab93ebc97794094572536829e581d565b11/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
|
|
if (instance == null) instance = new MetalRadioButtonUI(); return instance;
|
return new MetalRadioButtonUI();
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalRadioButtonUI(); return instance; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/MetalRadioButtonUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/metal/MetalRadioButtonUI.java
|
MenuBarUI ui = ((MenuBarUI) UIManager.getUI(this)); setUI(ui);
|
setUI((MenuBarUI) UIManager.getUI(this));
|
public void updateUI() { MenuBarUI ui = ((MenuBarUI) UIManager.getUI(this)); setUI(ui); invalidate(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/JMenuBar.java/clean/core/src/classpath/javax/javax/swing/JMenuBar.java
|
if (tokenizer.hasMoreTokens())
|
if (tokenizer.hasMoreTokens()) {
|
private static void parseKeyStrokes(Properties keystrokes) { String theStringList = ""; String theKey = ""; Enumeration ke = keystrokes.propertyNames(); while (ke.hasMoreElements()) { theKey = (String)ke.nextElement(); theStringList = keystrokes.getProperty(theKey); int x = 0; int kc = 0; boolean is = false; boolean ic = false; boolean ia = false; boolean iag = false; StringTokenizer tokenizer = new StringTokenizer(theStringList, ","); // first is the keycode kc = Integer.parseInt(tokenizer.nextToken()); // isShiftDown if (tokenizer.nextToken().equals("true")) is = true; else is =false; // isControlDown if (tokenizer.nextToken().equals("true")) ic = true; else ic =false; // isAltDown if (tokenizer.nextToken().equals("true")) ia = true; else ia =false; // isAltDown Gr if (tokenizer.hasMoreTokens()) if (tokenizer.nextToken().equals("true")) iag = true; else iag =false; mappedKeys.put(new KeyStroker(kc, is, ic, ia, iag),theKey); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/afff7d5ba1bc03e5e4709099fbacc81757f734a1/KeyMapper.java/clean/tn5250j/src/org/tn5250j/keyboard/KeyMapper.java
|
mappedKeys.put(new KeyStroker(kc, is, ic, ia, iag),theKey);
|
if (tokenizer.hasMoreTokens()) { location = Integer.parseInt(tokenizer.nextToken()); } } mappedKeys.put(newKeyStroker(kc, is, ic, ia, iag,location),theKey);
|
private static void parseKeyStrokes(Properties keystrokes) { String theStringList = ""; String theKey = ""; Enumeration ke = keystrokes.propertyNames(); while (ke.hasMoreElements()) { theKey = (String)ke.nextElement(); theStringList = keystrokes.getProperty(theKey); int x = 0; int kc = 0; boolean is = false; boolean ic = false; boolean ia = false; boolean iag = false; StringTokenizer tokenizer = new StringTokenizer(theStringList, ","); // first is the keycode kc = Integer.parseInt(tokenizer.nextToken()); // isShiftDown if (tokenizer.nextToken().equals("true")) is = true; else is =false; // isControlDown if (tokenizer.nextToken().equals("true")) ic = true; else ic =false; // isAltDown if (tokenizer.nextToken().equals("true")) ia = true; else ia =false; // isAltDown Gr if (tokenizer.hasMoreTokens()) if (tokenizer.nextToken().equals("true")) iag = true; else iag =false; mappedKeys.put(new KeyStroker(kc, is, ic, ia, iag),theKey); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/afff7d5ba1bc03e5e4709099fbacc81757f734a1/KeyMapper.java/clean/tn5250j/src/org/tn5250j/keyboard/KeyMapper.java
|
usingDefaults = true;
|
public String getConfigurationResource() { if (configurationResource == null || configurationResource == "") { configurationResource = "TN5250JDefaults.props"; } return configurationResource; }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/cf233bb7b435e40f202bf1f9e79caf9a1b1747bf/SessionConfig.java/buggy/tn5250j/src/org/tn5250j/SessionConfig.java
|
|
getConfigurationResource());
|
getConfigurationResource(),true, "Default Settings");
|
private void loadDefaults() { try { sesProps = ConfigureFactory.getInstance().getProperties( "dfltSessionProps", getConfigurationResource()); if (sesProps.size() == 0) { Properties schemaProps = new Properties(); java.net.URL file=null; ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); file = cl.getResource("tn5250jSchemas.properties"); schemaProps.load(file.openStream()); // we will now load the default schema String prefix = schemaProps.getProperty("schemaDefault"); sesProps.setProperty("colorBg",schemaProps.getProperty(prefix + ".colorBg")); sesProps.setProperty("colorRed",schemaProps.getProperty(prefix + ".colorRed")); sesProps.setProperty("colorTurq",schemaProps.getProperty(prefix + ".colorTurq")); sesProps.setProperty("colorCursor",schemaProps.getProperty(prefix + ".colorCursor")); sesProps.setProperty("colorGUIField",schemaProps.getProperty(prefix + ".colorGUIField")); sesProps.setProperty("colorWhite",schemaProps.getProperty(prefix + ".colorWhite")); sesProps.setProperty("colorYellow",schemaProps.getProperty(prefix + ".colorYellow")); sesProps.setProperty("colorGreen",schemaProps.getProperty(prefix + ".colorGreen")); sesProps.setProperty("colorPink",schemaProps.getProperty(prefix + ".colorPink")); sesProps.setProperty("colorBlue",schemaProps.getProperty(prefix + ".colorBlue")); sesProps.setProperty("colorSep",schemaProps.getProperty(prefix + ".colorSep")); sesProps.setProperty("colorHexAttr",schemaProps.getProperty(prefix + ".colorHexAttr")); sesProps.setProperty("font",GUIGraphicsUtils.getDefaultFont()); ConfigureFactory.getInstance().saveSettings("dfltSessionProps", getConfigurationResource(), ""); } } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + getConfigurationResource()); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/cf233bb7b435e40f202bf1f9e79caf9a1b1747bf/SessionConfig.java/buggy/tn5250j/src/org/tn5250j/SessionConfig.java
|
keepTrucking = false;
|
public final boolean disconnect() { if (me != null && me.isAlive()) { me.interrupt(); pthread.interrupt(); } screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_ON,"X - Disconnected"); screen52.setKeyboardLocked(false); try { if (bin != null) bin.close(); if (bout != null) bout.close(); if (sock != null) { System.out.println("Closing socket"); sock.close(); } connected = false; controller.fireSessionChanged(TN5250jConstants.STATE_DISCONNECTED); } catch(Exception exception) { System.out.println(exception.getMessage()); connected = false; devSeq = -1; return false; } devSeq = -1; return true; }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
|
|
boolean keepTrucking = true;
|
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/99debc0e39981c309029bd7389a7d7c50837d87b/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
|
|
if (axisId != null) { if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); AxisObj.put(axisId, newaxis); }
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId()));
|
newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId(), AxisAliasId));
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
} if (axisId != null) { if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); AxisObj.put(axisId, newaxis);
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
formatObj.setIOAxesOrder(AxisReadOrder);
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator(); myLocator.setIterationOrder(AxisReadOrder); formatObj.setIOAxesOrder(AxisReadOrder);/*Iterator thisIter = AxisReadOrder.iterator();while(thisIter.hasNext()) { Log.debugln("ReadAxis: "+((AxisInterface) thisIter.next()).getAxisId());}*/ CurrentDataFormatIndex = 0; ArrayList strValueList; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) { // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. String thisData = (String) iter.next(); addDataToCurrentArray(myLocator, thisData, CurrentDataFormat, IntRadix[CurrentDataFormatIndex]); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisIndex(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
newfieldaxis.setAxisId(findUniqueIdName(AxisObj, newfieldaxis.getAxisId()));
|
newfieldaxis.setAxisId(findUniqueIdName(AxisObj, newfieldaxis.getAxisId(), AxisAliasId));
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately FieldAxis newfieldaxis = new FieldAxis(); newfieldaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newfieldaxis.getAxisId()) != null || (axisIdRef = newfieldaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newfieldaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newfieldaxis = (FieldAxis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone field object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newfieldaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newfieldaxis.setAxisId(findUniqueIdName(AxisObj, newfieldaxis.getAxisId())); newfieldaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newfieldaxis.getAxisId(), newfieldaxis); } else { Log.warnln("Error: Reader got an fieldaxis with AxisIdRef=\""+axisIdRef+"\" but no previous field axis has that id! Ignoring add fieldAxis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.setFieldAxis(newfieldaxis); } else { Log.errorln("FieldAxis object:"+newfieldaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newfieldaxis; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
if (AxisReadOrder.size() > 0) { readObj.setIOAxesOrder(AxisReadOrder); }
|
public void action (SaxDocumentHandler handler) { // obtain the current XMLDataIOStyle Object XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); // initialization for XDF::Reader specific internal GLOBALS if ( (readObj instanceof TaggedXMLDataIOStyle) ) { // zero out all the tags Enumeration keys = DataTagCount.keys(); // slight departure from Perl while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); DataTagCount.put((String) key, new Integer(0)); } } else if ( (readObj instanceof DelimitedXMLDataIOStyle) || (readObj instanceof FormattedXMLDataIOStyle) ) { // do nothing } else { Log.errorln("ERROR: Dont know what do with this read style ("+readObj+"), aborting read."); System.exit(-1); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; } } } readObj.setIOAxesOrder(newAxisOrderList);
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
/*
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
*/
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
public String findUniqueIdName( Hashtable list, String baseIdName) {
|
public String findUniqueIdName( Hashtable idTable, String baseIdName) {
|
public String findUniqueIdName( Hashtable list, String baseIdName) { StringBuffer testName = new StringBuffer(baseIdName); while (list.containsKey(testName.toString())) { testName.append("0"); // isnt there something better to append here?? } return testName.toString(); }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
while (list.containsKey(testName.toString())) {
|
while (idTable.containsKey(testName.toString())) {
|
public String findUniqueIdName( Hashtable list, String baseIdName) { StringBuffer testName = new StringBuffer(baseIdName); while (list.containsKey(testName.toString())) { testName.append("0"); // isnt there something better to append here?? } return testName.toString(); }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/cba0d8d0ac190d1d12894f01819540622f1031c3/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
buttons.addElement(b);
|
else b.setSelected(false); } buttons.addElement(b);
|
public void add(AbstractButton b) { b.getModel().setGroup(this); if (b.isSelected()) sel = b.getModel(); buttons.addElement(b); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/ButtonGroup.java/buggy/core/src/classpath/javax/javax/swing/ButtonGroup.java
|
if (runCount > tabRuns.length) expandTabRunsArray();
|
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int max = 0; int runs = 0; int start = getTabRunIndent(tabPlacement, 1); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; max = calcRect.width + tabAreaInsets.left + insets.left; start += tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; max = calcRect.height + tabAreaInsets.top + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/BasicTabbedPaneUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.