rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k | meta stringlengths 141 403 |
|---|---|---|---|
VMContainer.invalidateTree(component); VMContainer.invalidateTree(jComponent); | VMAwtAPI.invalidateTree(component); VMAwtAPI.invalidateTree(jComponent); | public void run() { if (b) { jComponent.invalidate(); VMContainer.invalidateTree(component); VMContainer.invalidateTree(jComponent); jComponent.validate(); } jComponent.setVisible(b); ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d38fbd949384502ceb3f02e101548789fed3b5ca/SwingFramePeer.java/buggy/gui/src/awt/org/jnode/awt/swingpeers/SwingFramePeer.java |
private void buildMethodHash(Class cls, boolean build) | protected void buildMethodHash(Class cls, boolean build) | private void buildMethodHash(Class cls, boolean build) { Method[] meths = cls.getMethods(); for (int i = 0; i < meths.length; i++) { /* Don't need to include any java.xxx related stuff */ if (meths[i].getDeclaringClass().getName().startsWith("java.")) { continue; } long hash = RMIHashes.... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4b6281ed01a542e70503c69a67129ff6df618649/UnicastServerRef.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServerRef.java |
private Class findStubSkelClass(Class startCls) | protected Class findStubSkelClass(Class startCls) | private Class findStubSkelClass(Class startCls) { Class cls = startCls; while (true) { try { String stubClassname = cls.getName() + "_Stub"; ClassLoader cl = cls.getClassLoader(); Class scls = cl == null ? Class.forName(stubClassname) : cl.loadClass(stubClassname); return cls; //... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4b6281ed01a542e70503c69a67129ff6df618649/UnicastServerRef.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServerRef.java |
private Object getHelperClass(Class cls, String type) | protected Object getHelperClass(Class cls, String type) | private Object getHelperClass(Class cls, String type) { try { String classname = cls.getName(); ClassLoader cl = cls.getClassLoader(); Class scls = cl == null ? Class.forName(classname + type) : cl.loadClass(classname + type); if (type.equals("_Stub")) { try ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4b6281ed01a542e70503c69a67129ff6df618649/UnicastServerRef.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServerRef.java |
this(in); | super (in); | public CipherInputStream(InputStream in, Cipher cipher) { this(in); this.cipher = cipher; if (!(isStream = cipher.getBlockSize() == 1)) { inBuffer = new byte[2][]; inBuffer[0] = new byte[cipher.getBlockSize()]; inBuffer[1] = new byte[cipher.getBlockSize()]; inLength = 0; ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
if (!(isStream = cipher.getBlockSize() == 1)) { inBuffer = new byte[2][]; inBuffer[0] = new byte[cipher.getBlockSize()]; inBuffer[1] = new byte[cipher.getBlockSize()]; inLength = 0; outBuffer = new byte[cipher.getBlockSize()]; outOffset = outLength = 0; state = VIRGIN; } | isStream = cipher.getBlockSize () == 1; eof = false; if (Configuration.DEBUG) logger.log (Component.CRYPTO, "I am born; cipher: {0}, stream? {1}", new Object[] { cipher.getAlgorithm (), Boolean.valueOf (isStream) }); | public CipherInputStream(InputStream in, Cipher cipher) { this(in); this.cipher = cipher; if (!(isStream = cipher.getBlockSize() == 1)) { inBuffer = new byte[2][]; inBuffer[0] = new byte[cipher.getBlockSize()]; inBuffer[1] = new byte[cipher.getBlockSize()]; inLength = 0; ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
return outLength - outOffset; | if (outBuffer == null || outOffset >= outBuffer.length) nextBlock (); return outBuffer.length - outOffset; | public int available() throws IOException { if (isStream) return super.available(); return outLength - outOffset; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
public void close() throws IOException | public synchronized void close() throws IOException | public void close() throws IOException { super.close(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; | byte[] buf = new byte[cipher.getBlockSize ()]; if (Configuration.DEBUG) logger.log (Component.CRYPTO, "getting a new data block"); | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
if (state == VIRGIN || state == LIVING) { do | try | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
int l = in.read(inBuffer[1], count, inBuffer[1].length - count); | outBuffer = null; outOffset = 0; while (outBuffer == null) { int l = in.read (buf); if (Configuration.DEBUG) logger.log (Component.CRYPTO, "we read {0} bytes", Integer.valueOf (l)); | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
break; } count += l; } while (count < inBuffer[1].length); | return; | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
try { switch (state) { case VIRGIN: state = LIVING; nextBlock(); break; case LIVING: if (eof) { if (count > 0) { outOffset = cipher.update(inBuffer[0], 0, inLength, outBuffer, 0); state = DYING; } else { outOffset = cipher.doFinal(inBuffer[0], 0, inLength, outBuffer, 0); state = DEAD; } | outOffset = 0; outBuffer = cipher.update (buf, 0, l); | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
else { outOffset = cipher.update(inBuffer[0], 0, inLength, outBuffer, 0); } break; case DYING: outOffset = cipher.doFinal(inBuffer[0], 0, inLength, outBuffer, 0); state = DEAD; break; case DEAD: } } catch (ShortBufferException sbe) { throw new IOException(sbe.toString()); | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java | |
throw new IOException(bpe.toString()); | IOException ioe = new IOException ("bad padding"); ioe.initCause (bpe); throw ioe; | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
throw new IOException(ibse.toString()); | IOException ioe = new IOException ("illegal block size"); ioe.initCause (ibse); throw ioe; | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
inLength = count; | finally { if (Configuration.DEBUG) logger.log (Component.CRYPTO, "decrypted {0} bytes for reading", Integer.valueOf (outBuffer.length)); } | private void nextBlock() throws IOException { byte[] temp = inBuffer[0]; inBuffer[0] = inBuffer[1]; inBuffer[1] = temp; int count = 0; boolean eof = false; if (state == VIRGIN || state == LIVING) { do { int l = in.read(inBuffer[1], count, inBuffer[1].length - count);... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
public int read() throws IOException | public synchronized int read() throws IOException | public int read() throws IOException { if (isStream) { byte[] buf = new byte[1]; int in = super.read(); if (in == -1) return -1; buf[0] = (byte) in; try { cipher.update(buf, 0, 1, buf, 0); } catch (ShortBufferException shouldNotH... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
if (state == DEAD) return -1; if (available() == 0) nextBlock(); if (state == DEAD) return -1; return outBuffer[outOffset++] & 0xFF; | if (outBuffer == null || outOffset == outBuffer.length) { if (eof) return -1; nextBlock (); } return outBuffer [outOffset++] & 0xFF; | public int read() throws IOException { if (isStream) { byte[] buf = new byte[1]; int in = super.read(); if (in == -1) return -1; buf[0] = (byte) in; try { cipher.update(buf, 0, 1, buf, 0); } catch (ShortBufferException shouldNotH... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
if (bytes > 0 && available() > 0) | if (bytes > 0 && outBuffer != null && outOffset >= outBuffer.length) | public long skip(long bytes) throws IOException { if (isStream) { return super.skip(bytes); } long ret = 0; if (bytes > 0 && available() > 0) { ret = available(); outOffset = outLength = 0; } return ret; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
ret = available(); outOffset = outLength = 0; | ret = outBuffer.length - outOffset; outOffset = outBuffer.length; | public long skip(long bytes) throws IOException { if (isStream) { return super.skip(bytes); } long ret = 0; if (bytes > 0 && available() > 0) { ret = available(); outOffset = outLength = 0; } return ret; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/CipherInputStream.java/buggy/core/src/classpath/javax/javax/crypto/CipherInputStream.java |
Object val = (arg == null) ? null : arg.evaluate(context, pos, len); | Object val = (arg == null) ? Collections.singleton(context) : arg.evaluate(context, pos, len); | public Object evaluate(Node context, int pos, int len) { Object val = (arg == null) ? null : arg.evaluate(context, pos, len); return _local_name(context, (Collection) val); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/LocalNameFunction.java/buggy/core/src/classpath/gnu/gnu/xml/xpath/LocalNameFunction.java |
"List.font", new FontUIResource("Dialog", Font.PLAIN, 12), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractU... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9ec43c5570a0f69e3d8c8b733283719f52a770/BasicLookAndFeel.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLookAndFeel.java | |
if (event.isKeyPressed()) { l.keyPressed(event); } else if (event.isKeyReleased()) { l.keyReleased(event); | try { if (event.isKeyPressed()) { l.keyPressed(event); } else if (event.isKeyReleased()) { l.keyReleased(event); } } catch (Throwable ex) { log.error("Exception in KeyboardListener", ex); | public synchronized void fireEvent(KeyboardEvent event) { if (event != null) { for (Iterator i = listeners.iterator(); i.hasNext();) { KeyboardListener l = (KeyboardListener) i.next(); if (event.isKeyPressed()) { l.keyPressed(event); } else if (event.isKeyReleased()) { l.keyReleased(event); } ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/46b569c01215d00246035fa9e90a9c49cadccd7e/KeyboardAPIAdapter.java/buggy/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java |
if (accelerator != null) | protected void configurePropertiesFromAction(Action action) { super.configurePropertiesFromAction(action); if (! (this instanceof JMenu) && action != null) { setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); super.registerKeyboardAction(action, accelerator, ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/JMenuItem.java/clean/core/src/classpath/javax/javax/swing/JMenuItem.java | |
final int MIN_LENGTH = 1024; | final int MAX_LENGTH = 1024; | public String readLine() throws IOException { if (eof) { return null; } do { if (blockReads) { // Use mark and reset to read chunks of bytes final int MIN_LENGTH = 1024; int len, pos; len = in.available(); ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/91f4232dfb8a5dff7627558a11285391ca44ebfd/LineInputStream.java/buggy/core/src/classpath/gnu/gnu/java/net/LineInputStream.java |
len = (len < MIN_LENGTH) ? MIN_LENGTH : len; | if (len == 0 || len > MAX_LENGTH) len = MAX_LENGTH; | public String readLine() throws IOException { if (eof) { return null; } do { if (blockReads) { // Use mark and reset to read chunks of bytes final int MIN_LENGTH = 1024; int len, pos; len = in.available(); ... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/91f4232dfb8a5dff7627558a11285391ca44ebfd/LineInputStream.java/buggy/core/src/classpath/gnu/gnu/java/net/LineInputStream.java |
StringSeqHolder h = new StringSeqHolder(); h._read(input); return h.value; | String[] value = new String[ input.read_long() ]; for (int i = 0; i < value.length; i++) value [ i ] = input.read_wstring(); return value; | public static String[] read(InputStream input) { StringSeqHolder h = new StringSeqHolder(); h._read(input); return h.value; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/01dce648448be461531cfd95f93f9421282da0f4/StringSeqHelper.java/clean/core/src/classpath/org/org/omg/CORBA/StringSeqHelper.java |
StringSeqHolder h = new StringSeqHolder(value); h._write(output); | output.write_long(value.length); for (int i = 0; i < value.length; i++) output.write_wstring(value [ i ]); | public static void write(OutputStream output, String[] value) { StringSeqHolder h = new StringSeqHolder(value); h._write(output); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/01dce648448be461531cfd95f93f9421282da0f4/StringSeqHelper.java/clean/core/src/classpath/org/org/omg/CORBA/StringSeqHelper.java |
public Object clone() { try { return super.clone(); } catch (Exception e) { System.err.println("Huuuhhh, this class implements cloneable !!!!!!"); System.err.println("I think there is a bug in this JVM somewhere"); } return null; | public Object clone() { try { return super.clone(); } catch (Exception e) { System.err.println("Huuuhhh, this class implements cloneable !!!!!!"); System.err.println("I think there is a bug in this JVM somewhere"); | public Object clone() { try { return super.clone(); } catch (Exception e) { System.err.println("Huuuhhh, this class implements cloneable !!!!!!"); System.err.println("I think there is a bug in this JVM somewhere"); } return null; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
return null; } | public Object clone() { try { return super.clone(); } catch (Exception e) { System.err.println("Huuuhhh, this class implements cloneable !!!!!!"); System.err.println("I think there is a bug in this JVM somewhere"); } return null; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java | |
public char current() { return array[getIndex()]; } | public char current() { return array[getIndex()]; } | public char current() { return array[getIndex()]; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public char first() { offset = getBeginIndex(); return array[offset]; } | public char first() { offset = getBeginIndex(); return array[offset]; } | public char first() { offset = getBeginIndex(); return array[offset]; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public int getBeginIndex() { return offset; } | public int getBeginIndex() { return offset; } | public int getBeginIndex() { return offset; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public int getIndex() { return offset; } | public int getIndex() { return offset; } | public int getIndex() { return offset; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public char last() { offset = getEndIndex() - 1; return array[offset]; } | public char last() { offset = getEndIndex() - 1; return array[offset]; } | public char last() { offset = getEndIndex() - 1; return array[offset]; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public char next() { offset++; return array[offset]; } | public char next() { offset++; return array[offset]; } | public char next() { offset++; return array[offset]; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public char previous() { offset--; return array[offset]; } | public char previous() { offset--; return array[offset]; } | public char previous() { offset--; return array[offset]; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public char setIndex(int position) { offset = position; return array[offset]; } | public char setIndex(int position) { offset = position; return array[offset]; } | public char setIndex(int position) { offset = position; return array[offset]; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public String toString() { return new String(array, offset, count); } | public String toString() { return new String(array, offset, count); } | public String toString() { return new String(array, offset, count); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/2703ae3b51c371a2a79d28271cd57b4046c647d0/Segment.java/clean/core/src/classpath/javax/javax/swing/text/Segment.java |
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); log.setLevel(Level.INFO); blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); | public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); log.setLevel(Level.INFO); | public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); log.setLevel(Level.INFO); blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); //groupDescriptorLock = new Object(); //superblockLock = new Object(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
} | blockCache = new BlockCache(50, (float) 0.75); inodeCache = new INodeCache(50, (float) 0.75); } | public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); log.setLevel(Level.INFO); blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); //groupDescriptorLock = new Object(); //superblockLock = new Object(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
INodeTable iNodeTable = iNodeTables[0]; int iNodeNr = Ext2Constants.EXT2_ROOT_INO; INode iNode = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, 0, iNodeNr-1)); int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); iNode.create( Ext2Constants.EXT2_S_IFD... | INodeTable iNodeTable = iNodeTables[0]; int iNodeNr = Ext2Constants.EXT2_ROOT_INO; INode iNode = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, 0, iNodeNr - 1)); int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); iNode.create(Ext2Constants.EXT2_S_I... | protected FSEntry buildRootEntry() throws IOException { //a free inode has been found: create the inode and write it into the inode table INodeTable iNodeTable = iNodeTables[0]; //byte[] iNodeData = new byte[INode.INODE_LENGTH]; int iNodeNr = Ext2Constants.EXT2_ROOT_INO; INode iNode = new INode(this, new INode... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
modifyUsedDirsCount(0, 1); Ext2Entry rootEntry = new Ext2Entry(iNode,"/",Ext2Constants.EXT2_FT_DIR, this, null); ((Ext2Directory)rootEntry.getDirectory()).addINode(Ext2Constants.EXT2_ROOT_INO, ".", Ext2Constants.EXT2_FT_DIR); ((Ext2Directory)rootEntry.getDirectory()).addINode(Ext2Constants.EXT2_ROOT_INO, "..", Ext2Co... | synchronized (inodeCache) { inodeCache.put(new Integer(Ext2Constants.EXT2_ROOT_INO), iNode); } modifyUsedDirsCount(0, 1); Ext2Entry rootEntry = new Ext2Entry(iNode, "/", Ext2Constants.EXT2_FT_DIR, this, null); ((Ext2Directory) rootEntry.getDirectory()).addINode( Ext2Constants.EXT2_ROOT_INO, ".", Ext2Constants.EXT2_F... | protected FSEntry buildRootEntry() throws IOException { //a free inode has been found: create the inode and write it into the inode table INodeTable iNodeTable = iNodeTables[0]; //byte[] iNodeData = new byte[INode.INODE_LENGTH]; int iNodeNr = Ext2Constants.EXT2_ROOT_INO; INode iNode = new INode(this, new INode... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
if(a<=1) return true; | if (a <= 1) return true; | private boolean checkPow(int a, int b) { if(a<=1) return true; while (true) { if(a==b) return true; if(a%b==0) { a=a/b; continue; } return false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
if(a==b) return true; if(a%b==0) { a=a/b; continue; } return false; | if (a == b) return true; if (a % b == 0) { a = a / b; continue; } return false; | private boolean checkPow(int a, int b) { if(a<=1) return true; while (true) { if(a==b) return true; if(a%b==0) { a=a/b; continue; } return false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
} | } | private boolean checkPow(int a, int b) { if(a<=1) return true; while (true) { if(a==b) return true; if(a%b==0) { a=a/b; continue; } return false; } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
superblock.setState(Ext2Constants.EXT2_VALID_FS); | superblock.setState(Ext2Constants.EXT2_VALID_FS); | public void close() throws IOException { //mark the filesystem clean superblock.setState(Ext2Constants.EXT2_VALID_FS); super.close(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
super.close(); } | super.close(); } | public void close() throws IOException { //mark the filesystem clean superblock.setState(Ext2Constants.EXT2_VALID_FS); super.close(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
try{ superblock = new Superblock(); superblock.create(blockSize, this); groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; | try { superblock = new Superblock(); superblock.create(blockSize, this); | public void create(int blockSize) throws FileSystemException { try{ //create the superblock superblock = new Superblock(); superblock.create(blockSize, this); //create the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupD... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
iNodeTables = new INodeTable[groupCount]; for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(); groupDescriptors[i].create(i, this); } for(int i=0; i<groupCount; i++) { log.debug("creating gropup "+i); byte[] blockBitmap = new byte[blockSize]; byte[] inodeBitmap = new byte[blockSize]; lo... | groupCount = (int) Math.ceil((double) superblock.getBlocksCount() / (double) superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; | public void create(int blockSize) throws FileSystemException { try{ //create the superblock superblock = new Superblock(); superblock.create(blockSize, this); //create the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupD... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
writeBlock(groupDescriptors[i].getBlockBitmap(), blockBitmap, false); writeBlock(groupDescriptors[i].getInodeBitmap(), inodeBitmap, false); } log.info("superblock.getBlockSize(): "+superblock.getBlockSize()); | iNodeTables = new INodeTable[groupCount]; | public void create(int blockSize) throws FileSystemException { try{ //create the superblock superblock = new Superblock(); superblock.create(blockSize, this); //create the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupD... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
buildRootEntry(); flush(); | for (int i = 0; i < groupCount; i++) { groupDescriptors[i] = new GroupDescriptor(); groupDescriptors[i].create(i, this); } | public void create(int blockSize) throws FileSystemException { try{ //create the superblock superblock = new Superblock(); superblock.create(blockSize, this); //create the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupD... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
}catch (IOException ioe) { throw new FileSystemException("Unable to create filesystem", ioe); } } | for (int i = 0; i < groupCount; i++) { log.debug("creating gropup " + i); byte[] blockBitmap = new byte[blockSize]; byte[] inodeBitmap = new byte[blockSize]; long iNodeTableBlock = groupDescriptors[i].getInodeTable(); long firstNonMetadataBlock = iNodeTableBlock + INodeTable.getSizeInBlocks(this); int metadataLe... | public void create(int blockSize) throws FileSystemException { try{ //create the superblock superblock = new Superblock(); superblock.create(blockSize, this); //create the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupD... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
Ext2Entry e = (Ext2Entry) entry; return new Ext2Directory(e); } | Ext2Entry e = (Ext2Entry) entry; return new Ext2Directory(e); } | protected FSDirectory createDirectory(FSEntry entry) throws IOException { Ext2Entry e = (Ext2Entry) entry; return new Ext2Directory(e); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
Ext2Entry e = (Ext2Entry) entry; return new Ext2File(e.getINode()); } | Ext2Entry e = (Ext2Entry) entry; return new Ext2File(e.getINode()); } | protected FSFile createFile(FSEntry entry) throws IOException { Ext2Entry e = (Ext2Entry) entry; return new Ext2File(e.getINode()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected INode createINode(int preferredBlockBroup, int fileFormat, int accessRights, int uid, int gid) throws FileSystemException, IOException { if(preferredBlockBroup >= superblock.getBlocksCount()) throw new FileSystemException("Block group "+preferredBlockBroup+" does not exist"); int groupNr = preferredBlockBrou... | protected INode createINode(int preferredBlockBroup, int fileFormat, int accessRights, int uid, int gid) throws FileSystemException, IOException { if (preferredBlockBroup >= superblock.getBlocksCount()) throw new FileSystemException("Block group " + preferredBlockBroup + " does not exist"); | protected INode createINode(int preferredBlockBroup, int fileFormat, int accessRights, int uid, int gid) throws FileSystemException, IOException { if(preferredBlockBroup >= superblock.getBlocksCount()) throw new FileSystemException("Block group "+preferredBlockBroup+" does not exist"); int groupNr = preferr... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
log.debug("** NEW INODE ALLOCATED: inode number: "+iNode.getINodeNr()); synchronized(inodeCache) { Integer key = new Integer(iNodeNr); if(inodeCache.containsKey(key)) throw new FileSystemException("Newly allocated inode is already in the inode cache!?"); else inodeCache.put(key, iNode); } return iNode; } | int groupNr = preferredBlockBroup; INodeReservation res = findFreeINode(groupNr); if (!res.isSuccessful()) { for (groupNr = 0; groupNr < superblock.getBlockGroupNr(); groupNr++) { res = findFreeINode(groupNr); if (res.isSuccessful()) { break; } } } if (!res.isSuccessful()) throw new FileSystemException("No free in... | protected INode createINode(int preferredBlockBroup, int fileFormat, int accessRights, int uid, int gid) throws FileSystemException, IOException { if(preferredBlockBroup >= superblock.getBlocksCount()) throw new FileSystemException("Block group "+preferredBlockBroup+" does not exist"); int groupNr = preferr... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
try{ return new Ext2Entry( getINode(Ext2Constants.EXT2_ROOT_INO), "/", Ext2Constants.EXT2_FT_DIR, this, null ); }catch(FileSystemException e) { throw new IOException(e); } } | try { return new Ext2Entry(getINode(Ext2Constants.EXT2_ROOT_INO), "/", Ext2Constants.EXT2_FT_DIR, this, null); } catch (FileSystemException ex) { final IOException ioe = new IOException(); ioe.initCause(ex); throw ioe; } } | public FSEntry createRootEntry() throws IOException { try{ return new Ext2Entry( getINode(Ext2Constants.EXT2_ROOT_INO), "/", Ext2Constants.EXT2_FT_DIR, this, null ); }catch(FileSystemException e) { throw new IOException(e); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
public BlockReservation findFreeBlocks(int group, long threshold) throws IOException{ GroupDescriptor gdesc = groupDescriptors[group]; if( gdesc.getFreeBlocksCount() < threshold) return new BlockReservation(false, -1, -1, gdesc.getFreeBlocksCount()); /* Return false if the block is not a data block but a filesystem *... | public BlockReservation findFreeBlocks(int group, long threshold) throws IOException { GroupDescriptor gdesc = groupDescriptors[group]; if (gdesc.getFreeBlocksCount() < threshold) return new BlockReservation(false, -1, -1, gdesc .getFreeBlocksCount()); | public BlockReservation findFreeBlocks(int group, long threshold) throws IOException{ GroupDescriptor gdesc = groupDescriptors[group]; //see if it's worth to check the block group at all if( gdesc.getFreeBlocksCount() < threshold) return new BlockReservation(false, -1, -1, gdesc.getFreeBlocksCount()); /* Retur... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
BlockReservation result; | /* * Return false if the block is not a data block but a filesystem * metadata block, as the beginning of each block group is filesystem * metadata: superblock copy (if present) block bitmap inode bitmap * inode table Free blocks begin after the inode table. */ long iNodeTableBlock = groupDescriptors[group].getInodeTab... | public BlockReservation findFreeBlocks(int group, long threshold) throws IOException{ GroupDescriptor gdesc = groupDescriptors[group]; //see if it's worth to check the block group at all if( gdesc.getFreeBlocksCount() < threshold) return new BlockReservation(false, -1, -1, gdesc.getFreeBlocksCount()); /* Retur... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
synchronized(blockCache) { byte[] bitmapBlock = getBlock(gdesc.getBlockBitmap()); synchronized( bitmapBlock ) { result=BlockBitmap.findFreeBlocks( bitmapBlock, metadataLength ); if(result.isSuccessful()) { writeBlock(groupDescriptors[group].getBlockBitmap(), bitmapBlock, true); modifyFreeBlocksCount( group, -1... | BlockReservation result; synchronized (blockCache) { byte[] bitmapBlock = getBlock(gdesc.getBlockBitmap()); synchronized (bitmapBlock) { result = BlockBitmap .findFreeBlocks(bitmapBlock, metadataLength); if (result.isSuccessful()) { writeBlock(groupDescriptors[group].getBlockBitmap(), bitmapBlock, true); ... | public BlockReservation findFreeBlocks(int group, long threshold) throws IOException{ GroupDescriptor gdesc = groupDescriptors[group]; //see if it's worth to check the block group at all if( gdesc.getFreeBlocksCount() < threshold) return new BlockReservation(false, -1, -1, gdesc.getFreeBlocksCount()); /* Retur... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected INodeReservation findFreeINode(int blockGroup) throws IOException{ GroupDescriptor gdesc = groupDescriptors[blockGroup]; if(gdesc.getFreeInodesCount()> 0) { synchronized(blockCache) { byte[] bitmap= getBlock( gdesc.getInodeBitmap() ); synchronized(bitmap) { INodeReservation result = INodeBitmap.findFreeINo... | protected INodeReservation findFreeINode(int blockGroup) throws IOException { GroupDescriptor gdesc = groupDescriptors[blockGroup]; if (gdesc.getFreeInodesCount() > 0) { synchronized (blockCache) { byte[] bitmap = getBlock(gdesc.getInodeBitmap()); synchronized (bitmap) { INodeReservation result = INodeBitmap.findFr... | protected INodeReservation findFreeINode(int blockGroup) throws IOException{ GroupDescriptor gdesc = groupDescriptors[blockGroup]; if(gdesc.getFreeInodesCount()> 0) { //synchronize to the blockCache to avoid flushing the block between reading it //and synchronizing to it synchronized(blockCache) { byte[] bi... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
log.info("Flushing the contents of the filesystem"); synchronized(inodeCache) { try{ log.debug("inodecache size: "+inodeCache.size()); Iterator iterator = inodeCache.values().iterator(); while(iterator.hasNext()) { INode iNode = (INode)iterator.next(); iNode.flush(); log.debug("flush(): inodeCache.values().iterator().... | log.info("Flushing the contents of the filesystem"); synchronized (inodeCache) { try { log.debug("inodecache size: " + inodeCache.size()); Iterator iterator = inodeCache.values().iterator(); while (iterator.hasNext()) { INode iNode = (INode) iterator.next(); iNode.flush(); log .debug("flush(): inodeCache.values().iter... | public void flush() throws IOException { log.info("Flushing the contents of the filesystem"); //update the inodes synchronized(inodeCache) { try{ log.debug("inodecache size: "+inodeCache.size()); Iterator iterator = inodeCache.values().iterator(); while(iterator.hasNext()) { INode iNode = (INode)iter... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
public void freeBlock(long blockNr) throws FileSystemException, IOException{ if(blockNr<0 || blockNr>=superblock.getBlocksCount()) throw new FileSystemException("Attempt to free nonexisting block ("+blockNr+")"); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); GroupDescriptor gdesc = grou... | public void freeBlock(long blockNr) throws FileSystemException, IOException { if (blockNr < 0 || blockNr >= superblock.getBlocksCount()) throw new FileSystemException("Attempt to free nonexisting block (" + blockNr + ")"); | public void freeBlock(long blockNr) throws FileSystemException, IOException{ if(blockNr<0 || blockNr>=superblock.getBlocksCount()) throw new FileSystemException("Attempt to free nonexisting block ("+blockNr+")"); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); GroupDescriptor gde... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
/* Throw an exception if an attempt is made to free up a filesystem metadata * block (the beginning of each block group is filesystem metadata): * superblock copy (if present) * block bitmap * inode bitmap * inode table * Free blocks begin after the inode table. */ long iNodeTableBlock = groupDescriptors[group].getIno... | int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); GroupDescriptor gdesc = groupDescriptors[group]; | public void freeBlock(long blockNr) throws FileSystemException, IOException{ if(blockNr<0 || blockNr>=superblock.getBlocksCount()) throw new FileSystemException("Attempt to free nonexisting block ("+blockNr+")"); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); GroupDescriptor gde... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
synchronized(blockCache) { byte[] bitmap = getBlock(gdesc.getBlockBitmap()); synchronized( bitmap ) { BlockBitmap.freeBit( bitmap, index ); writeBlock(groupDescriptors[group].getBlockBitmap(), bitmap, false); modifyFreeBlocksCount(group, 1); } } } | /* * Throw an exception if an attempt is made to free up a filesystem * metadata block (the beginning of each block group is filesystem * metadata): superblock copy (if present) block bitmap inode bitmap * inode table Free blocks begin after the inode table. */ long iNodeTableBlock = groupDescriptors[group].getInodeTab... | public void freeBlock(long blockNr) throws FileSystemException, IOException{ if(blockNr<0 || blockNr>=superblock.getBlocksCount()) throw new FileSystemException("Attempt to free nonexisting block ("+blockNr+")"); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); GroupDescriptor gde... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) { | protected byte[] getBlock(long nr) throws IOException { if (isClosed()) throw new IOException("FS closed (fs instance: " + this + ")"); int blockSize = superblock.getBlockSize(); Block result; Integer key = new Integer((int) (nr)); synchronized (blockCache) { | protected byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) {... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
if(blockCache.containsKey(key)) { result=(Block)blockCache.get(key); return result.getData(); | if (blockCache.containsKey(key)) { result = (Block) blockCache.get(key); return result.getData(); | protected byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) {... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) {... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java | ||
byte[] data = new byte[blockSize]; log.debug("Reading block "+nr+" (offset: "+nr*blockSize+") from disk"); getApi().read( nr*blockSize, data, 0, blockSize ); synchronized(blockCache) { if(!blockCache.containsKey(key)) { result=new Block(this, nr, data); blockCache.put(key, result); return result.getData(); } else { ... | byte[] data = new byte[blockSize]; log.debug("Reading block " + nr + " (offset: " + nr * blockSize + ") from disk"); getApi().read(nr * blockSize, data, 0, blockSize); synchronized (blockCache) { if (!blockCache.containsKey(key)) { result = new Block(this, nr, data); blockCache.put(key, result); return result.getDat... | protected byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) {... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return blockCache; } | return blockCache; } | protected synchronized BlockCache getBlockCache() { return blockCache; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return superblock.getBlockSize(); } | return superblock.getBlockSize(); } | public int getBlockSize() { return superblock.getBlockSize(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return groupCount; } | return groupCount; } | protected int getGroupCount() { return groupCount; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); log.debug("iNodeCache size: "+inodeCache.si... | public INode getINode(int iNodeNr) throws IOException, FileSystemException { if ((iNodeNr < 1) || (iNodeNr > superblock.getINodesCount())) throw new FileSystemException("INode number (" + iNodeNr + ") out of range (0-" + superblock.getINodesCount() + ")"); | public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); log.debug("iNodeCache size: "+inod... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); | Integer key = new Integer(iNodeNr); | public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); log.debug("iNodeCache size: "+inod... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
INodeTable iNodeTable = iNodeTables[group]; INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr, group, index)); result.read(iNodeTable.getInodeData(index)); synchronized(inodeCache) { if(!inodeCache.containsKey(key)) { inodeCache.put(key, result); return result; } else return (INode)inodeCache.ge... | log.debug("iNodeCache size: " + inodeCache.size()); synchronized (inodeCache) { if (inodeCache.containsKey(key)) return (INode) inodeCache.get(key); } int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup()); int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup()); INodeTable iNodeTable = i... | public INode getINode(int iNodeNr) throws IOException, FileSystemException{ if((iNodeNr<1)||(iNodeNr>superblock.getINodesCount())) throw new FileSystemException("INode number ("+iNodeNr+") out of range (0-"+superblock.getINodesCount()+")"); Integer key=new Integer(iNodeNr); log.debug("iNodeCache size: "+inod... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return inodeCache; } | return inodeCache; } | protected synchronized INodeCache getInodeCache() { return inodeCache; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return superblock; } | return superblock; } | public Superblock getSuperblock() { return superblock; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected boolean groupHasDescriptors(int groupNr){ if(hasROFeature(Ext2Constants.EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) return (checkPow(groupNr, 3)||checkPow(groupNr, 5)||checkPow(groupNr, 7)); else return true; } | protected boolean groupHasDescriptors(int groupNr) { if (hasROFeature(Ext2Constants.EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) return (checkPow(groupNr, 3) || checkPow(groupNr, 5) || checkPow( groupNr, 7)); else return true; } | protected boolean groupHasDescriptors(int groupNr){ if(hasROFeature(Ext2Constants.EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) return (checkPow(groupNr, 3)||checkPow(groupNr, 5)||checkPow(groupNr, 7)); else return true; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
superblock.setState(Ext2Constants.EXT2_ERROR_FS); if(superblock.getErrors()==Ext2Constants.EXT2_ERRORS_RO) setReadOnly(true); if(superblock.getErrors()==Ext2Constants.EXT2_ERRORS_PANIC) throw new RuntimeException("EXT2 FileSystem exception", e); } | superblock.setState(Ext2Constants.EXT2_ERROR_FS); if (superblock.getErrors() == Ext2Constants.EXT2_ERRORS_RO) setReadOnly(true); if (superblock.getErrors() == Ext2Constants.EXT2_ERRORS_PANIC) throw new RuntimeException("EXT2 FileSystem exception", e); } | protected void handleFSError(Exception e) { //mark the fs as having errors superblock.setState(Ext2Constants.EXT2_ERROR_FS); if(superblock.getErrors()==Ext2Constants.EXT2_ERRORS_RO) setReadOnly(true); //remount readonly if(superblock.getErrors()==Ext2Constants.EXT2_ERRORS_PANIC) throw new RuntimeException(... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected boolean hasIncompatFeature(long mask){ return (mask & superblock.getFeatureIncompat()) != 0; } | protected boolean hasIncompatFeature(long mask) { return (mask & superblock.getFeatureIncompat()) != 0; } | protected boolean hasIncompatFeature(long mask){ return (mask & superblock.getFeatureIncompat()) != 0; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
protected boolean hasROFeature(long mask){ return (mask & superblock.getFeatureROCompat()) != 0; } | protected boolean hasROFeature(long mask) { return (mask & superblock.getFeatureROCompat()) != 0; } | protected boolean hasROFeature(long mask){ return (mask & superblock.getFeatureROCompat()) != 0; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } | GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeBlocksCount(gdesc.getFreeBlocksCount() + diff); superblock.setFreeBlocksCount(superblock.getFreeBlocksCount() + diff); } | protected void modifyFreeBlocksCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); | GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeInodesCount(gdesc.getFreeInodesCount() + diff); | protected void modifyFreeInodesCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); superblock.setFreeInodesCount( superblock.getFreeInodesCount()+diff ); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
superblock.setFreeInodesCount( superblock.getFreeInodesCount()+diff ); } | superblock.setFreeInodesCount(superblock.getFreeInodesCount() + diff); } | protected void modifyFreeInodesCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); superblock.setFreeInodesCount( superblock.getFreeInodesCount()+diff ); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } | GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setUsedDirsCount(gdesc.getUsedDirsCount() + diff); } | protected void modifyUsedDirsCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
byte data[]; | byte data[]; | public void read() throws FileSystemException { byte data[]; try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); //superblock = new Superb... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; | try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; | public void read() throws FileSystemException { byte data[]; try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); //superblock = new Superb... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(); superblock.read(data, this); groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; iNodeTables = new INodeTable[groupCo... | getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(); superblock.read(data, this); | public void read() throws FileSystemException { byte data[]; try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); //superblock = new Superb... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
if( hasROFeature(Ext2Constants.EXT2_FEATURE_RO_COMPAT_LARGE_FILE)) { log.info(getDevice().getId()+" Unsupported filesystem feature (LARGE_FILE) forces readonly mode"); setReadOnly(true); } if( hasROFeature(Ext2Constants.EXT2_FEATURE_RO_COMPAT_BTREE_DIR)) { log.info(getDevice().getId()+" Unsupported filesystem feature ... | groupCount = (int) Math.ceil((double) superblock.getBlocksCount() / (double) superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; iNodeTables = new INodeTable[groupCount]; for (int i = 0; i < groupCount; i++) { groupDescriptors[i] = new GroupDescriptor(); groupDescriptors[i].read(i, t... | public void read() throws FileSystemException { byte data[]; try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); //superblock = new Superb... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
public BlockReservation testAndSetBlock(long blockNr) throws IOException{ | public BlockReservation testAndSetBlock(long blockNr) throws IOException { | public BlockReservation testAndSetBlock(long blockNr) throws IOException{ if(blockNr<superblock.getFirstDataBlock() || blockNr>=superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); /* Return false if the block is no... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
if(blockNr<superblock.getFirstDataBlock() || blockNr>=superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); | if (blockNr < superblock.getFirstDataBlock() || blockNr >= superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); | public BlockReservation testAndSetBlock(long blockNr) throws IOException{ if(blockNr<superblock.getFirstDataBlock() || blockNr>=superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); /* Return false if the block is no... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
/* Return false if the block is not a data block but a filesystem * metadata block, as the beginning of each block group is filesystem * metadata: * superblock copy (if present) * block bitmap * inode bitmap * inode table * Free blocks begin after the inode table. */ long iNodeTableBlock = groupDescriptors[group].getI... | /* * Return false if the block is not a data block but a filesystem * metadata block, as the beginning of each block group is filesystem * metadata: superblock copy (if present) block bitmap inode bitmap * inode table Free blocks begin after the inode table. */ long iNodeTableBlock = groupDescriptors[group].getInodeTab... | public BlockReservation testAndSetBlock(long blockNr) throws IOException{ if(blockNr<superblock.getFirstDataBlock() || blockNr>=superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); /* Return false if the block is no... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
synchronized(blockCache) { byte[] bitmap= getBlock(groupDescriptors[group].getBlockBitmap()); synchronized( bitmap) { BlockReservation result = BlockBitmap.testAndSetBlock( bitmap, index ); if(result.isSuccessful()) { writeBlock(groupDescriptors[group].getBlockBitmap(), bitmap, false); modifyFreeBlocksCount(group, -... | if (blockNr < firstNonMetadataBlock) return new BlockReservation(false, -1, -1); | public BlockReservation testAndSetBlock(long blockNr) throws IOException{ if(blockNr<superblock.getFirstDataBlock() || blockNr>=superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); /* Return false if the block is no... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
} | synchronized (blockCache) { byte[] bitmap = getBlock(groupDescriptors[group].getBlockBitmap()); synchronized (bitmap) { BlockReservation result = BlockBitmap.testAndSetBlock(bitmap, index); if (result.isSuccessful()) { writeBlock(groupDescriptors[group].getBlockBitmap(), bitmap, false); modifyFreeBlocksCount(group,... | public BlockReservation testAndSetBlock(long blockNr) throws IOException{ if(blockNr<superblock.getFirstDataBlock() || blockNr>=superblock.getBlocksCount()) return new BlockReservation(false, -1, -1); int group = translateToGroup(blockNr); int index = translateToIndex(blockNr); /* Return false if the block is no... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return (int)((i-superblock.getFirstDataBlock()) / superblock.getBlocksPerGroup()); } | return (int) ((i - superblock.getFirstDataBlock()) / superblock .getBlocksPerGroup()); } | protected int translateToGroup(long i) { return (int)((i-superblock.getFirstDataBlock()) / superblock.getBlocksPerGroup()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
return (int)((i-superblock.getFirstDataBlock()) % superblock.getBlocksPerGroup()); } | return (int) ((i - superblock.getFirstDataBlock()) % superblock .getBlocksPerGroup()); } | protected int translateToIndex(long i) { return (int)((i-superblock.getFirstDataBlock()) % superblock.getBlocksPerGroup()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
for(int i=0; i<groupCount; i++) groupDescriptors[i].updateGroupDescriptor(); superblock.update(); } | for (int i = 0; i < groupCount; i++) groupDescriptors[i].updateGroupDescriptor(); superblock.update(); } | protected void updateFS() throws IOException { //updating one group descriptor updates all its copies for(int i=0; i<groupCount; i++) groupDescriptors[i].updateGroupDescriptor(); superblock.update(); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if(isClosed()) throw new IOException("FS closed"); | public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if (isClosed()) throw new IOException("FS closed"); | public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if(isClosed()) throw new IOException("FS closed"); if(isReadOnly()) throw new ReadOnlyFileSystemException("Filesystem is mounted read-only!"); Block block; Integer key=new Integer((int)nr); int blockSize=superblock.get... | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4fe0410e3d1e4dea160852289195cd6981c0f456/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.