rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
optionPane.removeAll(); messageAreaContainer = createMessageArea(); optionPane.add(messageAreaContainer); optionPane.add(buttonContainer);
optionPane.remove(messageAreaContainer); messageAreaContainer = createMessageArea(); optionPane.add(messageAreaContainer); Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; optionPane.add(buttonContainer);
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY) || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY)) addIcon(messageAreaContainer); else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY)) resetSelectedValue(); else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALUE_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY)) { Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; } else if (e.getPropertyName().equals(JOptionPane.MESSAGE_PROPERTY) || e.getPropertyName().equals(JOptionPane.WANTS_INPUT_PROPERTY) || e.getPropertyName().equals(JOptionPane.SELECTION_VALUES_PROPERTY)) { optionPane.removeAll(); messageAreaContainer = createMessageArea(); optionPane.add(messageAreaContainer); optionPane.add(buttonContainer); } optionPane.invalidate(); optionPane.repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
rightSide.setBorder(BorderFactory.createEmptyBorder(0, 11, 17, 0));
rightSide.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
protected Container createMessageArea() { JPanel messageArea = new JPanel(); messageArea.setLayout(new BorderLayout()); addIcon(messageArea); JPanel rightSide = new JPanel(); rightSide.setBorder(BorderFactory.createEmptyBorder(0, 11, 17, 0)); rightSide.setLayout(new GridBagLayout()); GridBagConstraints con = createConstraints(); addMessageComponents(rightSide, con, getMessage(), getMaxCharactersPerLineCount(), false); if (optionPane.getWantsInput()) { Object[] selection = optionPane.getSelectionValues(); if (selection == null) inputComponent = new JTextField(15); else if (selection.length < 20) inputComponent = new JComboBox(selection); else inputComponent = new JList(selection); if (inputComponent != null) { addMessageComponents(rightSide, con, inputComponent, getMaxCharactersPerLineCount(), false); resetSelectedValue(); selectInitialValue(optionPane); } } messageArea.add(rightSide, BorderLayout.EAST); return messageArea; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
protected Container createMessageArea() { JPanel messageArea = new JPanel(); messageArea.setLayout(new BorderLayout()); addIcon(messageArea); JPanel rightSide = new JPanel(); rightSide.setBorder(BorderFactory.createEmptyBorder(0, 11, 17, 0)); rightSide.setLayout(new GridBagLayout()); GridBagConstraints con = createConstraints(); addMessageComponents(rightSide, con, getMessage(), getMaxCharactersPerLineCount(), false); if (optionPane.getWantsInput()) { Object[] selection = optionPane.getSelectionValues(); if (selection == null) inputComponent = new JTextField(15); else if (selection.length < 20) inputComponent = new JComboBox(selection); else inputComponent = new JList(selection); if (inputComponent != null) { addMessageComponents(rightSide, con, inputComponent, getMaxCharactersPerLineCount(), false); resetSelectedValue(); selectInitialValue(optionPane); } } messageArea.add(rightSide, BorderLayout.EAST); return messageArea; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
messageArea.add(rightSide, BorderLayout.EAST);
messageArea.add(rightSide, BorderLayout.CENTER);
protected Container createMessageArea() { JPanel messageArea = new JPanel(); messageArea.setLayout(new BorderLayout()); addIcon(messageArea); JPanel rightSide = new JPanel(); rightSide.setBorder(BorderFactory.createEmptyBorder(0, 11, 17, 0)); rightSide.setLayout(new GridBagLayout()); GridBagConstraints con = createConstraints(); addMessageComponents(rightSide, con, getMessage(), getMaxCharactersPerLineCount(), false); if (optionPane.getWantsInput()) { Object[] selection = optionPane.getSelectionValues(); if (selection == null) inputComponent = new JTextField(15); else if (selection.length < 20) inputComponent = new JComboBox(selection); else inputComponent = new JList(selection); if (inputComponent != null) { addMessageComponents(rightSide, con, inputComponent, getMaxCharactersPerLineCount(), false); resetSelectedValue(); selectInitialValue(optionPane); } } messageArea.add(rightSide, BorderLayout.EAST); return messageArea; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
return new Object[] { OK_STRING, CANCEL_STRING };
return (optionPane.getWantsInput() ) ? new Object[] { OK_STRING, CANCEL_STRING } : ( optionPane.getMessageType() == JOptionPane.QUESTION_MESSAGE ) ? new Object[] { YES_STRING, NO_STRING, CANCEL_STRING } : new Object[] { OK_STRING };
protected Object[] getButtons() { if (optionPane.getOptions() != null) return optionPane.getOptions(); switch (optionPane.getOptionType()) { case JOptionPane.YES_NO_OPTION: return new Object[] { YES_STRING, NO_STRING }; case JOptionPane.YES_NO_CANCEL_OPTION: return new Object[] { YES_STRING, NO_STRING, CANCEL_STRING }; case JOptionPane.OK_CANCEL_OPTION: case JOptionPane.DEFAULT_OPTION: return new Object[] { OK_STRING, CANCEL_STRING }; } return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
return null;
return null;
protected Object[] getButtons() { if (optionPane.getOptions() != null) return optionPane.getOptions(); switch (optionPane.getOptionType()) { case JOptionPane.YES_NO_OPTION: return new Object[] { YES_STRING, NO_STRING }; case JOptionPane.YES_NO_CANCEL_OPTION: return new Object[] { YES_STRING, NO_STRING, CANCEL_STRING }; case JOptionPane.OK_CANCEL_OPTION: case JOptionPane.DEFAULT_OPTION: return new Object[] { OK_STRING, CANCEL_STRING }; } return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
Dimension d2 = getMinimumOptionPaneSize();
Dimension d2 = getMinimumOptionPaneSize();
public Dimension getPreferredSize(JComponent c) { Dimension d = optionPane.getLayout().preferredLayoutSize(optionPane); Dimension d2 = getMinimumOptionPaneSize(); int w = Math.max(d.width, d2.width); int h = Math.max(d.height, d2.height); return new Dimension(w, h); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
}
}
protected void installComponents() { // reset it. hasCustomComponents = false; Container msg = createMessageArea(); if (msg != null) { ((JComponent) msg).setBorder(messageBorder); msg.setForeground(messageForeground); messageAreaContainer = msg; optionPane.add(msg); } // FIXME: Figure out if the separator should be inserted here or what // this thing is supposed to do. Note: The JDK does NOT insert another // component at this place. The JOptionPane only has two panels in it // and there actually are applications that depend on this beeing so. Container sep = createSeparator(); if (sep != null) optionPane.add(sep); Container button = createButtonArea(); if (button != null) { ((JComponent) button).setBorder(buttonBorder); buttonContainer = button; optionPane.add(button); } optionPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 11, 11)); optionPane.invalidate(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
minimumWidth = minimumSize.width; minimumHeight = minimumSize.height;
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); optionPane.setFont(defaults.getFont("OptionPane.font")); optionPane.setBackground(defaults.getColor("OptionPane.background")); optionPane.setForeground(defaults.getColor("OptionPane.foreground")); optionPane.setBorder(defaults.getBorder("OptionPane.border")); optionPane.setOpaque(true); messageBorder = defaults.getBorder("OptionPane.messageAreaBorder"); messageForeground = defaults.getColor("OptionPane.messageForeground"); buttonBorder = defaults.getBorder("OptionPane.buttonAreaBorder"); minimumSize = defaults.getDimension("OptionPane.minimumSize"); minimumWidth = minimumSize.width; minimumHeight = minimumSize.height; // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
{
{
void resetSelectedValue() { if (inputComponent != null) { Object init = optionPane.getInitialSelectionValue(); if (init == null) return; if (inputComponent instanceof JTextField) ((JTextField) inputComponent).setText((String) init); else if (inputComponent instanceof JComboBox) ((JComboBox) inputComponent).setSelectedItem(init); else if (inputComponent instanceof JList) { // ((JList) inputComponent).setSelectedValue(init, true); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicOptionPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicOptionPaneUI.java
public static void debug(String msg) {
public static void debug (String msg) {
public static void debug(String msg) { if (priority > Priority.DEBUG) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.debug()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
output.write(Constants.NEW_LINE.getBytes());
public static void debug(String msg) { if (priority > Priority.DEBUG) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.debug()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
public static void debug(String msg) { if (priority > Priority.DEBUG) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.debug()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
public static void error(String msg) {
public static void error (String msg) {
public static void error(String msg) { if (priority > Priority.ERROR) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.error()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
output.write(Constants.NEW_LINE.getBytes());
public static void error(String msg) { if (priority > Priority.ERROR) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.error()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
public static void info(String msg) {
public static void info (String msg) {
public static void info(String msg) { if (priority > Priority.INFO) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.info()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
output.write(Constants.NEW_LINE.getBytes());
public static void info(String msg) { if (priority > Priority.INFO) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.info()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
public static void warn(String msg) {
public static void warn (String msg) {
public static void warn(String msg) { if (priority > Priority.WARN) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.warn()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
output.write(Constants.NEW_LINE.getBytes());
public static void warn(String msg) { if (priority > Priority.WARN) return; try { output.write(msg.getBytes()); output.write(Constants.NEW_LINE.getBytes()); } catch (IOException e) { System.err.println("error in Log.warn()"); e.printStackTrace(); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e7a9ac18e9d2994061521c78b0e214111d3c5741/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
switch (buffer[offset])
char c = buffer[offset]; if (len > 0 && (c == '\t' || c == '\n')) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; pos = offset+1; len = 0; } switch (c)
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must draw // the buffer and jump on the next line. g.drawChars(buffer, offset, 1, pixelX, y); pixelY += metrics.getHeight(); pixelX = x; break; default: // Here we draw the char. g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]); break; } } return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/698ac538b7482b0e4aac918befb43b8376e364e3/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must draw // the buffer and jump on the next line. g.drawChars(buffer, offset, 1, pixelX, y); pixelY += metrics.getHeight(); pixelX = x; break; default: // Here we draw the char. g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]); break; } } return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/698ac538b7482b0e4aac918befb43b8376e364e3/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
g.drawChars(buffer, offset, 1, pixelX, y);
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must draw // the buffer and jump on the next line. g.drawChars(buffer, offset, 1, pixelX, y); pixelY += metrics.getHeight(); pixelX = x; break; default: // Here we draw the char. g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]); break; } } return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/698ac538b7482b0e4aac918befb43b8376e364e3/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]);
++len; pixelWidth += metrics.charWidth(buffer[offset]);
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must draw // the buffer and jump on the next line. g.drawChars(buffer, offset, 1, pixelX, y); pixelY += metrics.getHeight(); pixelX = x; break; default: // Here we draw the char. g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]); break; } } return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/698ac538b7482b0e4aac918befb43b8376e364e3/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent);
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must draw // the buffer and jump on the next line. g.drawChars(buffer, offset, 1, pixelX, y); pixelY += metrics.getHeight(); pixelX = x; break; default: // Here we draw the char. g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]); break; } } return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/698ac538b7482b0e4aac918befb43b8376e364e3/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
super(toolkit, panel, new JPanel()); final JPanel jPanel = (JPanel)jComponent; this.panel = panel;
super(toolkit, panel, new SwingPanel(panel)); final SwingPanel jPanel = (SwingPanel) jComponent;
public SwingPanelPeer(SwingToolkit toolkit, Panel panel) { super(toolkit, panel, new JPanel()); final JPanel jPanel = (JPanel)jComponent; this.panel = panel; SwingToolkit.add(panel, jPanel); SwingToolkit.copyAwtProperties(panel, jPanel); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingPanelPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingPanelPeer.java
((JPanel)jComponent).add(peer);
((JPanel) jComponent).add(peer);
public void addAWTComponent(Component awtComponent, JComponent peer) { ((JPanel)jComponent).add(peer); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingPanelPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingPanelPeer.java
return ((JPanel)jComponent).getInsets(); }
return ((JPanel) jComponent).getInsets(); }
public Insets getInsets() { return ((JPanel)jComponent).getInsets(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingPanelPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingPanelPeer.java
return getInsets(); }
return getInsets(); }
public Insets insets() { return getInsets(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingPanelPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingPanelPeer.java
public void addLayoutComponent(String string, Component component) { }
public void addLayoutComponent(String string, Component component) { }
public void addLayoutComponent(String string, Component component) { // TODO } // addLayoutComponent()
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
public float getLayoutAlignmentX(Container target) { return (float) 0.0; }
public float getLayoutAlignmentX(Container target) { return (float) 0.0; }
public float getLayoutAlignmentX(Container target) { return (float) 0.0; // TODO } // getLayoutAlignmentX()
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
public float getLayoutAlignmentY(Container target) { return (float) 0.0; }
public float getLayoutAlignmentY(Container target) { return (float) 0.0; }
public float getLayoutAlignmentY(Container target) { return (float) 0.0; // TODO } // getLayoutAlignmentY()
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
public void invalidateLayout(Container target) { }
public void invalidateLayout(Container target) { }
public void invalidateLayout(Container target) { // TODO } // invalidateLayout()
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
public void layoutContainer(Container target) { }
public void layoutContainer(Container target) { }
public void layoutContainer(Container target) { // TODO } // layoutContainer()
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
public Dimension maximumLayoutSize(Container target) { return null; }
public Dimension maximumLayoutSize(Container target) { return null; }
public Dimension maximumLayoutSize(Container target) { return null; // TODO } // maximumLayoutSize()
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
public Dimension minimumLayoutSize(Container target) { return null; }
public Dimension minimumLayoutSize(Container target) { return null; }
public Dimension minimumLayoutSize(Container target) { return null; // TODO } // minimumLayoutSize()
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
public Dimension preferredLayoutSize(Container target) { return null; }
public Dimension preferredLayoutSize(Container target) { return null; }
public Dimension preferredLayoutSize(Container target) { return null; // TODO } // preferredLayoutSize()
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
public void removeLayoutComponent(Component component) { }
public void removeLayoutComponent(Component component) { }
public void removeLayoutComponent(Component component) { // TODO } // removeLayoutComponent()
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
Throwable throwable = record.getThrown(); if (throwable != null) { StringWriter sink = new StringWriter(); throwable.printStackTrace(new PrintWriter(sink, true)); buf.append(sink.toString()); }
public String format(LogRecord record) { StringBuffer buf = new StringBuffer(180); if (dateFormat == null) dateFormat = DateFormat.getDateTimeInstance(); buf.append(dateFormat.format(new Date(record.getMillis()))); buf.append(' '); buf.append(record.getSourceClassName()); buf.append(' '); buf.append(record.getSourceMethodName()); buf.append(lineSep); buf.append(record.getLevel()); buf.append(": "); buf.append(formatMessage(record)); buf.append(lineSep); return buf.toString(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SimpleFormatter.java/buggy/core/src/classpath/java/java/util/logging/SimpleFormatter.java
Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous);
Dimension e = prefSize(editor); Dimension n = prefSize(next); Dimension p = prefSize(previous);
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w;
int h = e.height / 2; int e_width = s.width - w - i.left - i.right;
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height);
setBounds(editor, x, y, e_width, 2 * h);
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
setBounds(previous, x, y, w, h);
setBounds(previous, x, y + (s.height - e.height) / 2, w, h);
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
public void layoutContainer(Container parent) { synchronized (parent.getTreeLock()) { Insets i = parent.getInsets(); boolean l2r = parent.getComponentOrientation().isLeftToRight(); /* -------------- -------------- | | n | | n | | | e | - | or | - | e | | | p | | p | | -------------- -------------- */ Dimension e = minSize(editor); Dimension n = minSize(next); Dimension p = minSize(previous); Dimension s = spinner.getPreferredSize(); int x = l2r ? i.left : i.right; int y = i.top; int w = Math.max(p.width, n.width); int h = Math.max(p.height, n.height); h = Math.max(h, e.height / 2); int e_width = s.width - w; if (l2r) { setBounds(editor, x, y + (s.height - e.height) / 2, e_width, e.height); x += e_width; setBounds(next, x, y, w, h); y += h; setBounds(previous, x, y, w, h); } else { setBounds(next, x, y + (s.height - e.height) / 2, w, h); y += h; setBounds(previous, x, y, w, h); x += w; y -= h; setBounds(editor, x, y, e_width, e.height); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
int otherHeight = 0;
public Dimension minimumLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getMinimumSize(); d.width += tmp.width; d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getMinimumSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getMinimumSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
otherHeight += tmp.height;
public Dimension minimumLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getMinimumSize(); d.width += tmp.width; d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getMinimumSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getMinimumSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
otherHeight += tmp.height;
public Dimension minimumLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getMinimumSize(); d.width += tmp.width; d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getMinimumSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getMinimumSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
d.height = Math.max(d.height, otherHeight);
public Dimension minimumLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getMinimumSize(); d.width += tmp.width; d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getMinimumSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getMinimumSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
int otherHeight = 0;
public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getPreferredSize(); d.width += Math.max(tmp.width, 40); d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getPreferredSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getPreferredSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
otherHeight += tmp.height;
public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getPreferredSize(); d.width += Math.max(tmp.width, 40); d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getPreferredSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getPreferredSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
otherHeight += tmp.height;
public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getPreferredSize(); d.width += Math.max(tmp.width, 40); d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getPreferredSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getPreferredSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
d.height = Math.max(d.height, otherHeight);
public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getPreferredSize(); d.width += Math.max(tmp.width, 40); d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getPreferredSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getPreferredSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
Insets insets = parent.getInsets(); d.width = d.width + insets.left + insets.right; d.height = d.height + insets.top + insets.bottom;
public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); if (editor != null) { Dimension tmp = editor.getPreferredSize(); d.width += Math.max(tmp.width, 40); d.height = tmp.height; } int nextWidth = 0; int previousWidth = 0; int otherHeight = 0; if (next != null) { Dimension tmp = next.getPreferredSize(); nextWidth = tmp.width; otherHeight += tmp.height; } if (previous != null) { Dimension tmp = previous.getPreferredSize(); previousWidth = tmp.width; otherHeight += tmp.height; } d.height = Math.max(d.height, otherHeight); d.width += Math.max(nextWidth, previousWidth); return d; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
public void propertyChange(PropertyChangeEvent evt)
public void propertyChange(PropertyChangeEvent event)
protected PropertyChangeListener createPropertyChangeListener() { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { // FIXME: Add check for enabled property change. Need to // disable the buttons. if ("editor".equals(evt.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(), (JComponent) evt.getNewValue()); } }; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
if ("editor".equals(evt.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(), (JComponent) evt.getNewValue());
if ("editor".equals(event.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) event.getOldValue(), (JComponent) event.getNewValue());
protected PropertyChangeListener createPropertyChangeListener() { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { // FIXME: Add check for enabled property change. Need to // disable the buttons. if ("editor".equals(evt.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(), (JComponent) evt.getNewValue()); } }; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
public void propertyChange(PropertyChangeEvent evt)
public void propertyChange(PropertyChangeEvent event)
public void propertyChange(PropertyChangeEvent evt) { // FIXME: Add check for enabled property change. Need to // disable the buttons. if ("editor".equals(evt.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(), (JComponent) evt.getNewValue()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
if ("editor".equals(evt.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(), (JComponent) evt.getNewValue());
if ("editor".equals(event.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) event.getOldValue(), (JComponent) event.getNewValue());
public void propertyChange(PropertyChangeEvent evt) { // FIXME: Add check for enabled property change. Need to // disable the buttons. if ("editor".equals(evt.getPropertyName())) BasicSpinnerUI.this.replaceEditor((JComponent) evt.getOldValue(), (JComponent) evt.getNewValue()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
JComponent e = spinner.getEditor(); if (e instanceof JSpinner.DefaultEditor) { JSpinner.DefaultEditor de = (JSpinner.DefaultEditor) e; de.getTextField().setBorder(null); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(spinner, "Spinner.background", "Spinner.foreground", "Spinner.font"); LookAndFeel.installBorder(spinner, "Spinner.border"); spinner.setLayout(createLayout()); spinner.setOpaque(true); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/BasicSpinnerUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSpinnerUI.java
boolean niceOutput = sPrettyXDFOutput;
boolean niceOutput = Specification.getInstance().isPrettyXDFOutput();
protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { boolean niceOutput = sPrettyXDFOutput; //write out the tags info String[] tags = getAxisTags(); List axisList = parentArray.getAxisList(); String axisId; String tag; int stop = axisList.size(); synchronized (axisList) { for (int i = 0; i <stop; i++) { axisId = ((AxisInterface) axisList.get(i)).getAxisId(); tag = tags[i]; if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\"" + axisId + "\"" + " tag = \"" + tag + "\"/>"); } } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/TaggedXMLDataIOStyle.java/clean/src/gov/nasa/gsfc/adc/xdf/TaggedXMLDataIOStyle.java
ICC_ProfileGray()
ICC_ProfileGray(int cspace)
ICC_ProfileGray() { super(ColorSpace.CS_GRAY); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileGray.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileGray.java
super(ColorSpace.CS_GRAY);
super(cspace); whitePoint = getXYZData(icSigMediaWhitePointTag);
ICC_ProfileGray() { super(ColorSpace.CS_GRAY); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileGray.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileGray.java
return 0;
short[] data = getCurve(icSigGrayTRCTag); if (data == null) throw new IllegalArgumentException("Couldn't read Gray TRC data."); if (data.length != 1) throw new ProfileDataException("TRC is a table, not a gamma value."); double gamma = (double) (data[0] & (0xFFFF)) / 256.0; return (float) gamma;
public float getGamma() { return 0; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileGray.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileGray.java
return null;
float[] wp = new float[3]; wp[0] = whitePoint[0]; wp[1] = whitePoint[1]; wp[2] = whitePoint[2]; return wp;
public float[] getMediaWhitePoint() { return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileGray.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileGray.java
return null;
short[] data = getCurve(icSigGrayTRCTag); if (data == null) throw new IllegalArgumentException("Couldn't read Gray TRC data."); if (data.length <= 1) throw new ProfileDataException("Gamma value, not a TRC table."); return data;
public short[] getTRC() { return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileGray.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileGray.java
this.profileID = profileID;
header = null; tagTable = null; createProfile(profileID);
ICC_Profile(int profileID) { this.profileID = profileID; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_Profile.java/buggy/core/src/classpath/java/java/awt/color/ICC_Profile.java
super(toolkit, checkBox, new JCheckBox()); this.checkBox = checkBox; final JCheckBox jcb = (JCheckBox)jComponent;
super(toolkit, checkBox, new SwingCheckBox(checkBox)); final JCheckBox jcb = (JCheckBox) jComponent;
public SwingCheckboxPeer(SwingToolkit toolkit, Checkbox checkBox) { super(toolkit, checkBox, new JCheckBox()); this.checkBox = checkBox; final JCheckBox jcb = (JCheckBox)jComponent; SwingToolkit.add(checkBox, jcb); SwingToolkit.copyAwtProperties(checkBox, jcb); jcb.setText(checkBox.getLabel()); setState(checkBox.getState()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingCheckboxPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingCheckboxPeer.java
((JCheckBox)jComponent).setText(label); }
((JCheckBox) jComponent).setText(label); }
public void setLabel(String label) { ((JCheckBox)jComponent).setText(label); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingCheckboxPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingCheckboxPeer.java
((JCheckBox)jComponent).setSelected(state);
((JCheckBox) jComponent).setSelected(state);
public void setState(boolean state) { ((JCheckBox)jComponent).setSelected(state); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cb141050fd84afdb6e8ef6f8cc3ed4e90608d848/SwingCheckboxPeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingCheckboxPeer.java
g.setClip(portBounds);
g.setClip(new Rectangle(0, 0, portBounds.width, portBounds.height));
private void paintSimple(Graphics g, JViewport v, Component view, Point pos, Rectangle viewBounds, Rectangle portBounds) { Rectangle oldClip = g.getClipBounds(); g.setClip(portBounds); g.translate (-pos.x, -pos.y); try { view.paint(g); } finally { g.translate (pos.x, pos.y); g.setClip (oldClip); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicViewportUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicViewportUI.java
if (pixel < map_size)
if (pixel >= 0 && pixel < map_size)
public final int getRGB (int pixel) { if (pixel < map_size) return rgb[pixel]; return 0; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f9edc08acdeb1f2f4fe82f01243818bd374a3e46/IndexColorModel.java/buggy/core/src/classpath/java/java/awt/image/IndexColorModel.java
Address sf = VmMagic.getCurrentFrame();
final VmStackFrameEnumerator sfEnum = new VmStackFrameEnumerator(reader);
public static void checkPermission(Permission perm) throws AccessControlException { if (!Unsafe.getCurrentProcessor().isThreadSwitchActive()) { // getContext().checkPermission(perm); // This is an optimized version of // getContext().checkPermission() // that does not require any memory allocations. final VmStackReader reader = Unsafe.getCurrentProcessor() .getArchitecture().getStackReader(); Address sf = VmMagic.getCurrentFrame(); int recursionCount = 0; while (reader.isValid(sf)) { final VmMethod method = reader.getMethod(sf); if (method.hasDoPrivilegedPragma()) { // Stop here with the current thread's stacktrace. break; } else if (method.hasCheckPermissionPragma()) { // Be paranoia for now, let's check for recursive // checkPermission calls. recursionCount++; if (recursionCount > 2) { reader.debugStackTrace(); Unsafe.die("Recursive checkPermission"); } } else { final VmType<?> declClass = method.getDeclaringClass(); final ProtectionDomain pd = declClass.getProtectionDomain(); if (pd != null) { // Unsafe.debug(":pd"); if (!pd.implies(perm)) { // Unsafe.debug("Permission denied"); throw new AccessControlException("Permission \"" + perm + "\" not granted due to " + declClass.getName()); } } } if (method.hasPrivilegedActionPragma()) { // Break here, do not include inherited thread context return; } sf = reader.getPrevious(sf); } final VmThread thread = VmThread.currentThread(); final VmAccessControlContext inheritedCtx = thread.getContext(); if (inheritedCtx != null) { inheritedCtx.checkPermission(perm); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAccessController.java/clean/core/src/core/org/jnode/vm/VmAccessController.java
while (reader.isValid(sf)) { final VmMethod method = reader.getMethod(sf);
while (sfEnum.isValid()) { final VmMethod method = sfEnum.getMethod();
public static void checkPermission(Permission perm) throws AccessControlException { if (!Unsafe.getCurrentProcessor().isThreadSwitchActive()) { // getContext().checkPermission(perm); // This is an optimized version of // getContext().checkPermission() // that does not require any memory allocations. final VmStackReader reader = Unsafe.getCurrentProcessor() .getArchitecture().getStackReader(); Address sf = VmMagic.getCurrentFrame(); int recursionCount = 0; while (reader.isValid(sf)) { final VmMethod method = reader.getMethod(sf); if (method.hasDoPrivilegedPragma()) { // Stop here with the current thread's stacktrace. break; } else if (method.hasCheckPermissionPragma()) { // Be paranoia for now, let's check for recursive // checkPermission calls. recursionCount++; if (recursionCount > 2) { reader.debugStackTrace(); Unsafe.die("Recursive checkPermission"); } } else { final VmType<?> declClass = method.getDeclaringClass(); final ProtectionDomain pd = declClass.getProtectionDomain(); if (pd != null) { // Unsafe.debug(":pd"); if (!pd.implies(perm)) { // Unsafe.debug("Permission denied"); throw new AccessControlException("Permission \"" + perm + "\" not granted due to " + declClass.getName()); } } } if (method.hasPrivilegedActionPragma()) { // Break here, do not include inherited thread context return; } sf = reader.getPrevious(sf); } final VmThread thread = VmThread.currentThread(); final VmAccessControlContext inheritedCtx = thread.getContext(); if (inheritedCtx != null) { inheritedCtx.checkPermission(perm); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAccessController.java/clean/core/src/core/org/jnode/vm/VmAccessController.java
sf = reader.getPrevious(sf);
sfEnum.next();
public static void checkPermission(Permission perm) throws AccessControlException { if (!Unsafe.getCurrentProcessor().isThreadSwitchActive()) { // getContext().checkPermission(perm); // This is an optimized version of // getContext().checkPermission() // that does not require any memory allocations. final VmStackReader reader = Unsafe.getCurrentProcessor() .getArchitecture().getStackReader(); Address sf = VmMagic.getCurrentFrame(); int recursionCount = 0; while (reader.isValid(sf)) { final VmMethod method = reader.getMethod(sf); if (method.hasDoPrivilegedPragma()) { // Stop here with the current thread's stacktrace. break; } else if (method.hasCheckPermissionPragma()) { // Be paranoia for now, let's check for recursive // checkPermission calls. recursionCount++; if (recursionCount > 2) { reader.debugStackTrace(); Unsafe.die("Recursive checkPermission"); } } else { final VmType<?> declClass = method.getDeclaringClass(); final ProtectionDomain pd = declClass.getProtectionDomain(); if (pd != null) { // Unsafe.debug(":pd"); if (!pd.implies(perm)) { // Unsafe.debug("Permission denied"); throw new AccessControlException("Permission \"" + perm + "\" not granted due to " + declClass.getName()); } } } if (method.hasPrivilegedActionPragma()) { // Break here, do not include inherited thread context return; } sf = reader.getPrevious(sf); } final VmThread thread = VmThread.currentThread(); final VmAccessControlContext inheritedCtx = thread.getContext(); if (inheritedCtx != null) { inheritedCtx.checkPermission(perm); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAccessController.java/clean/core/src/core/org/jnode/vm/VmAccessController.java
public final void pop(int type) {
public final int pop() {
public final void pop(int type) { if (tos <= 0) { throw new Error("Stack is empty"); } if (stack[ --tos] != type) { throw new Error("TypeStack[" + tos + "] is not the expected element " + type + " but " + stack[ tos]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TypeStack.java/clean/core/src/core/org/jnode/vm/bytecode/TypeStack.java
if (stack[ --tos] != type) { throw new Error("TypeStack[" + tos + "] is not the expected element " + type + " but " + stack[ tos]); }
return stack[ --tos];
public final void pop(int type) { if (tos <= 0) { throw new Error("Stack is empty"); } if (stack[ --tos] != type) { throw new Error("TypeStack[" + tos + "] is not the expected element " + type + " but " + stack[ tos]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TypeStack.java/clean/core/src/core/org/jnode/vm/bytecode/TypeStack.java
private void calculateDay(int[] fields, long day, boolean gregorian) { // the epoch is a Thursday. int weekday = (int) (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; // get a first approximation of the year. This may be one // year too big. int year = 1970 + (int) (gregorian ? ((day - 100) * 400) / (365 * 400 + 100 - 4 + 1) : ((day - 100) * 4) / (365 * 4 + 1)); if (day >= 0) year++; long firstDayOfYear = getLinearDay(year, 1, gregorian); // Now look in which year day really lies. if (day < firstDayOfYear) { year--; firstDayOfYear = getLinearDay(year, 1, gregorian); } day -= firstDayOfYear - 1; // day of year, one based. fields[DAY_OF_YEAR] = (int) day; if (year <= 0) { fields[ERA] = BC; fields[YEAR] = 1 - year; } else { fields[ERA] = AD; fields[YEAR] = year; } int leapday = isLeapYear(year, gregorian) ? 1 : 0; if (day <= 31 + 28 + leapday) { fields[MONTH] = (int) day / 32; // 31->JANUARY, 32->FEBRUARY fields[DAY_OF_MONTH] = (int) day - 31 * fields[MONTH]; } else { // A few more magic formulas int scaledDay = ((int) day - leapday) * 5 + 8; fields[MONTH] = scaledDay / (31 + 30 + 31 + 30 + 31); fields[DAY_OF_MONTH] = (scaledDay % (31 + 30 + 31 + 30 + 31)) / 5 + 1; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
? ((day - 100) * 400) / (365 * 400 + 100 - 4 + 1) : ((day - 100) * 4) / (365 * 4 + 1));
? ((day - 100L) * 400L) / (365L * 400L + 100L - 4L + 1L) : ((day - 100L) * 4L) / (365L * 4L + 1L));
private void calculateDay(int[] fields, long day, boolean gregorian) { // the epoch is a Thursday. int weekday = (int) (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; // get a first approximation of the year. This may be one // year too big. int year = 1970 + (int) (gregorian ? ((day - 100) * 400) / (365 * 400 + 100 - 4 + 1) : ((day - 100) * 4) / (365 * 4 + 1)); if (day >= 0) year++; long firstDayOfYear = getLinearDay(year, 1, gregorian); // Now look in which year day really lies. if (day < firstDayOfYear) { year--; firstDayOfYear = getLinearDay(year, 1, gregorian); } day -= firstDayOfYear - 1; // day of year, one based. fields[DAY_OF_YEAR] = (int) day; if (year <= 0) { fields[ERA] = BC; fields[YEAR] = 1 - year; } else { fields[ERA] = AD; fields[YEAR] = year; } int leapday = isLeapYear(year, gregorian) ? 1 : 0; if (day <= 31 + 28 + leapday) { fields[MONTH] = (int) day / 32; // 31->JANUARY, 32->FEBRUARY fields[DAY_OF_MONTH] = (int) day - 31 * fields[MONTH]; } else { // A few more magic formulas int scaledDay = ((int) day - leapday) * 5 + 8; fields[MONTH] = scaledDay / (31 + 30 + 31 + 30 + 31); fields[DAY_OF_MONTH] = (scaledDay % (31 + 30 + 31 + 30 + 31)) / 5 + 1; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int leapday = isLeapYear(year, gregorian) ? 1 : 0;
int leapday = isLeapYear(year) ? 1 : 0;
private void calculateDay(int[] fields, long day, boolean gregorian) { // the epoch is a Thursday. int weekday = (int) (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; // get a first approximation of the year. This may be one // year too big. int year = 1970 + (int) (gregorian ? ((day - 100) * 400) / (365 * 400 + 100 - 4 + 1) : ((day - 100) * 4) / (365 * 4 + 1)); if (day >= 0) year++; long firstDayOfYear = getLinearDay(year, 1, gregorian); // Now look in which year day really lies. if (day < firstDayOfYear) { year--; firstDayOfYear = getLinearDay(year, 1, gregorian); } day -= firstDayOfYear - 1; // day of year, one based. fields[DAY_OF_YEAR] = (int) day; if (year <= 0) { fields[ERA] = BC; fields[YEAR] = 1 - year; } else { fields[ERA] = AD; fields[YEAR] = year; } int leapday = isLeapYear(year, gregorian) ? 1 : 0; if (day <= 31 + 28 + leapday) { fields[MONTH] = (int) day / 32; // 31->JANUARY, 32->FEBRUARY fields[DAY_OF_MONTH] = (int) day - 31 * fields[MONTH]; } else { // A few more magic formulas int scaledDay = ((int) day - leapday) * 5 + 8; fields[MONTH] = scaledDay / (31 + 30 + 31 + 30 + 31); fields[DAY_OF_MONTH] = (scaledDay % (31 + 30 + 31 + 30 + 31)) / 5 + 1; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
protected synchronized void computeFields() { boolean gregorian = (time >= gregorianCutover); TimeZone zone = getTimeZone(); fields[ZONE_OFFSET] = zone.getRawOffset(); long localTime = time + fields[ZONE_OFFSET]; long day = localTime / (24 * 60 * 60 * 1000L); int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } calculateDay(fields, day, gregorian); fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET]; millisInDay += fields[DST_OFFSET]; if (millisInDay >= 24 * 60 * 60 * 1000) { millisInDay -= 24 * 60 * 60 * 1000; calculateDay(fields, ++day, gregorian); } fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7; // which day of the week are we (0..6), relative to getFirstDayOfWeek int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7; fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7; int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7; // Do the Correction: getMinimalDaysInFirstWeek() is always in the // first week. int minDays = getMinimalDaysInFirstWeek(); int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7; if (minDays - firstWeekday < 1) weekOfYear++; fields[WEEK_OF_YEAR] = weekOfYear; int hourOfDay = millisInDay / (60 * 60 * 1000); fields[AM_PM] = (hourOfDay < 12) ? AM : PM; int hour = hourOfDay % 12; fields[HOUR] = (hour == 0) ? 12 : hour; fields[HOUR_OF_DAY] = hourOfDay; millisInDay %= (60 * 60 * 1000); fields[MINUTE] = millisInDay / (60 * 1000); millisInDay %= (60 * 1000); fields[SECOND] = millisInDay / (1000); fields[MILLISECOND] = millisInDay % 1000; areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH])
int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { month = 0; day = fields[DAY_OF_YEAR]; } } else
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0)
if (isSet[DAY_OF_WEEK])
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
month += 12; year--;
int first = getFirstDayOfMonth(year, month); if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; }
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year;
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0;
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay;
long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L));
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
if (isLenient())
if (month < 0)
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L));
year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--;
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
else
} if (month > 11)
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--;
year += (month / 12); month = month % 12;
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true;
month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month];
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } int dayOfYear = dayCount[month] + day - 1; if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
long julianDay = (year - 1) * 365L + ((year - 1) >> 2) + (dayOfYear - 1) - EPOCH_DAYS;
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear(year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear(year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset;
int gregOffset = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); return julianDay + gregOffset;
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear(year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
else julianDay -= 2;
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear(year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L));
boolean greg = isGregorian(year, dayOfYear); int day = (int) getLinearDay(year, dayOfYear, greg);
private int getWeekDay(int year, int dayOfYear) { int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L)); // The epoch was a thursday. int weekday = (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; return weekday; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
if ((year & 3) != 0)
public boolean isLeapYear(int year) { if ((year & 3) != 0) // Only years divisible by 4 can be leap years return false; // compute the linear day of the 29. February of that year. // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. int julianDay = (((year - 1) * (365 * 4 + 1)) >> 2) + (31 + 29 - (((1970 - 1) * (365 * 4 + 1)) / 4 + 1 - 13)); // If that day is smaller than the gregorianChange the julian // rule applies: This is a leap year since it is divisible by 4. if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover) return true; return ((year % 100) != 0 || (year % 400) == 0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
int julianDay = (((year - 1) * (365 * 4 + 1)) >> 2) + (31 + 29 - (((1970 - 1) * (365 * 4 + 1)) / 4 + 1 - 13)); if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover)
if (! isGregorian(year, 31 + 29 - 1))
public boolean isLeapYear(int year) { if ((year & 3) != 0) // Only years divisible by 4 can be leap years return false; // compute the linear day of the 29. February of that year. // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. int julianDay = (((year - 1) * (365 * 4 + 1)) >> 2) + (31 + 29 - (((1970 - 1) * (365 * 4 + 1)) / 4 + 1 - 13)); // If that day is smaller than the gregorianChange the julian // rule applies: This is a leap year since it is divisible by 4. if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover) return true; return ((year % 100) != 0 || (year % 400) == 0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
public boolean isLeapYear(int year) { if ((year & 3) != 0) // Only years divisible by 4 can be leap years return false; // compute the linear day of the 29. February of that year. // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. int julianDay = (((year - 1) * (365 * 4 + 1)) >> 2) + (31 + 29 - (((1970 - 1) * (365 * 4 + 1)) / 4 + 1 - 13)); // If that day is smaller than the gregorianChange the julian // rule applies: This is a leap year since it is divisible by 4. if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover) return true; return ((year % 100) != 0 || (year % 400) == 0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/GregorianCalendar.java/buggy/core/src/classpath/java/java/util/GregorianCalendar.java
if (!isTimeSet)
if (! isTimeSet)
protected void complete() { if (!isTimeSet) computeTime(); if (!areFieldsSet) computeFields(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/Calendar.java/buggy/core/src/classpath/java/java/util/Calendar.java