Menu

#174 Unused variable in File connector

open
5
2005-10-24
2005-10-24
Vincent G.
No

There is an unused variable in DataManager.java of the
File Connector which should lead to a bug.

In the following code "idx" is useless:
-------------
private void write_entry_into_datastore(
org.openorb.pss.connector.file.DataEntry entry )
{

synchronized ( _access )
{
try
{
long idx = _access.length();

if ( idx == 0 )
idx += 8;

_access.seek( _access.length() );

_index_table.put( new String(
entry.short_pid ), new Long( _access.getFilePointer() ) );

copy( _access, entry );
}
catch ( java.io.IOException ex )
{
ex.printStackTrace();
}
}
}
-------------

I guess you meant:

-------------
private void write_entry_into_datastore(
org.openorb.pss.connector.file.DataEntry entry) {

synchronized (_access) {
try {
long idx = _access.length();

if (idx == 0) {
_access.writeLong(0);
}
_access.seek(_access.length());
Long index = new Long(_access
.getFilePointer());
String pid =
FilePID.shortArrayToString(entry.short_pid);
_index_table.put(pid, index);

System.out.println("copy " + index.toString() + " "
+ pid);

copy(_access, entry);
} catch (java.io.IOException ex) {
ex.printStackTrace();
}
}
}

-------------

Discussion


Log in to post a comment.

Monday.com Logo