1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 16:56:04 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2014-05-09 12:17:10 -07:00
parent ca4098caac
commit 2c5f599327
3 changed files with 17 additions and 17 deletions

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial implementation
* Markus Schorn (Wind River Systems)
* Andrew Ferguson (Symbian) - Initial implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@ -24,7 +24,7 @@ import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.core.runtime.CoreException;
/**
* Sanity check the DBProperties class
* Tests for the {@link DBProperties} class.
*/
public class DBPropertiesTests extends BaseTestCase {
File dbLoc;
@ -50,19 +50,19 @@ public class DBPropertiesTests extends BaseTestCase {
public void testBasic() throws CoreException {
DBProperties properties = new DBProperties(db);
Properties expected = System.getProperties();
for(Iterator i = expected.keySet().iterator(); i.hasNext(); ) {
for (Iterator i = expected.keySet().iterator(); i.hasNext(); ) {
String key = (String) i.next();
String value = expected.getProperty(key);
if(value!=null) {
if (value != null) {
properties.setProperty(key, value);
}
}
for(Iterator i = expected.keySet().iterator(); i.hasNext(); ) {
for (Iterator i = expected.keySet().iterator(); i.hasNext(); ) {
String key = (String) i.next();
String aValue = properties.getProperty(key);
assertEquals(expected.getProperty(key), aValue);
}
for(Iterator i = expected.keySet().iterator(); i.hasNext(); ) {
for (Iterator i = expected.keySet().iterator(); i.hasNext(); ) {
String key = (String) i.next();
properties.removeProperty(key);
}
@ -76,7 +76,7 @@ public class DBPropertiesTests extends BaseTestCase {
DBProperties ps = new DBProperties(db);
StringBuffer largeValue = new StringBuffer();
for(int i=0; i<Database.CHUNK_SIZE*2; i+=64) {
for (int i= 0; i < Database.CHUNK_SIZE * 2; i += 64) {
largeValue.append("********");
ps.setProperty("key", largeValue.toString());
ps.setProperty(largeValue.toString(), "value");

View file

@ -102,9 +102,9 @@ final class Chunk {
static final int getInt(final byte[] buffer, int idx) {
return ((buffer[idx] & 0xff) << 24) |
((buffer[++idx] & 0xff) << 16) |
((buffer[++idx] & 0xff) << 8) |
((buffer[++idx] & 0xff) << 0);
((buffer[++idx] & 0xff) << 16) |
((buffer[++idx] & 0xff) << 8) |
((buffer[++idx] & 0xff) << 0);
}
/**
@ -130,7 +130,7 @@ final class Chunk {
* have an unsigned 32-bit value as a long. This gives us one more useful bit in the
* stored record pointers.
*/
long address = value & (((long) 1 << Integer.SIZE) - 1);
long address = value & 0xFFFFFFFFL;
return address << Database.BLOCK_SIZE_DELTA_BITS;
}
@ -198,8 +198,8 @@ final class Chunk {
public int get3ByteUnsignedInt(final long offset) {
int idx= recPtrToIndex(offset);
return ((fBuffer[idx] & 0xff) << 16) |
((fBuffer[++idx] & 0xff) << 8) |
((fBuffer[++idx] & 0xff) << 0);
((fBuffer[++idx] & 0xff) << 8) |
((fBuffer[++idx] & 0xff) << 0);
}
public void putShort(final long offset, final short value) {

View file

@ -53,7 +53,7 @@ import com.ibm.icu.text.MessageFormat;
* INT_SIZE * m (1) | pointer to head of linked list of blocks of size (m + MIN_BLOCK_DELTAS) * BLOCK_SIZE_DELTA
* DATA_AREA | undefined (PDOM stores its own house-keeping data in this area)
*
* (1) where 2 <= m <= CHUNK_SIZE/BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS + 1
* (1) where 2 <= m <= CHUNK_SIZE / BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS + 1
*
* ===== block structure
*
@ -406,12 +406,12 @@ public class Database {
private long getFirstBlock(int blocksize) throws CoreException {
assert fLocked;
return fHeaderChunk.getFreeRecPtr((blocksize/BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS + 1) * INT_SIZE);
return fHeaderChunk.getFreeRecPtr((blocksize / BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS + 1) * INT_SIZE);
}
private void setFirstBlock(int blocksize, long block) throws CoreException {
assert fExclusiveLock;
fHeaderChunk.putFreeRecPtr((blocksize/BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS + 1) * INT_SIZE, block);
fHeaderChunk.putFreeRecPtr((blocksize / BLOCK_SIZE_DELTA - MIN_BLOCK_DELTAS + 1) * INT_SIZE, block);
}
private void removeBlock(Chunk chunk, int blocksize, long block) throws CoreException {