Skip to content

Commit

Permalink
Remove invalid todo/comments for SPB version 3 usage, use default met…
Browse files Browse the repository at this point in the history
…hod for addPreamble

Related to #463
  • Loading branch information
mrotteveel committed Oct 2, 2021
1 parent 8265c55 commit adc6bf4
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 36 deletions.
6 changes: 0 additions & 6 deletions src/main/org/firebirdsql/gds/impl/BlobParameterBufferImp.java
Expand Up @@ -20,7 +20,6 @@

import org.firebirdsql.gds.BlobParameterBuffer;
import org.firebirdsql.gds.ISCConstants;
import org.firebirdsql.gds.ParameterBuffer;
import org.firebirdsql.gds.impl.argument.ArgumentType;

/**
Expand All @@ -47,11 +46,6 @@ public final int getType() {
return bpbVersion;
}

@Override
public final void addPreamble(ParameterBuffer parameterBuffer) {
// Do nothing
}

@Override
public final ArgumentType getStringArgumentType(int tag) {
return ArgumentType.TraditionalDpb;
Expand Down
Expand Up @@ -21,7 +21,6 @@
import org.firebirdsql.encodings.Encoding;
import org.firebirdsql.gds.DatabaseParameterBuffer;
import org.firebirdsql.gds.ISCConstants;
import org.firebirdsql.gds.ParameterBuffer;
import org.firebirdsql.gds.ParameterTagMapping;
import org.firebirdsql.gds.impl.argument.ArgumentType;

Expand Down Expand Up @@ -67,11 +66,6 @@ public final int getType() {
return dpbVersion;
}

@Override
public final void addPreamble(ParameterBuffer parameterBuffer) {
// Do nothing
}

@Override
public final ArgumentType getStringArgumentType(int tag) {
return argumentType;
Expand Down
Expand Up @@ -45,7 +45,9 @@ public interface ParameterBufferMetaData {
*
* @param parameterBuffer Parameter buffer.
*/
void addPreamble(ParameterBuffer parameterBuffer);
default void addPreamble(ParameterBuffer parameterBuffer) {
// Do nothing
}

/**
* Gets the string argument type for the supplied tag.
Expand Down
Expand Up @@ -75,6 +75,7 @@ public ArgumentType getSingleArgumentType(int tag) {
return ArgumentType.TraditionalDpb;
}
},
// Technically this has nothing to do with SPB version 2/3
SPB_VERSION_2(ISCConstants.isc_spb_current_version) {
// TODO Check if correct and add additional types
@Override
Expand Down Expand Up @@ -136,10 +137,5 @@ public ArgumentType getSingleArgumentType(int tag) {
public final int getType() {
return spbVersion;
}

@Override
public void addPreamble(ParameterBuffer parameterBuffer) {
// Do nothing
}
}
}
Expand Up @@ -41,7 +41,7 @@ public void addArgument(int argumentType, byte value) {
}

public enum SrbMetaData implements ParameterBufferMetaData {
// TODO Add isc_spb_version3 as well?
// Technically this has nothing to do with SPB version 2/3
SRB_VERSION_2(ISCConstants.isc_spb_current_version) {
// TODO Check if correct and add additional types
@Override
Expand Down Expand Up @@ -82,10 +82,5 @@ public ArgumentType getSingleArgumentType(int tag) {
public final int getType() {
return spbVersion;
}

@Override
public void addPreamble(ParameterBuffer parameterBuffer) {
// Do nothing
}
}
}
Expand Up @@ -21,7 +21,6 @@
package org.firebirdsql.gds.impl;

import org.firebirdsql.gds.ISCConstants;
import org.firebirdsql.gds.ParameterBuffer;
import org.firebirdsql.gds.TransactionParameterBuffer;
import org.firebirdsql.gds.impl.argument.ArgumentType;

Expand Down Expand Up @@ -57,11 +56,6 @@ public final int getType() {
return tpbVersion;
}

@Override
public final void addPreamble(ParameterBuffer parameterBuffer) {
// Do nothing
}

@Override
public final ArgumentType getStringArgumentType(int tag) {
return ArgumentType.TraditionalDpb;
Expand Down
Expand Up @@ -65,15 +65,13 @@ public FbWireService createService(WireServiceConnection connection) {
@Override
public ServiceParameterBuffer createServiceParameterBuffer(final WireServiceConnection connection) {
final Encoding stringEncoding = connection.getEncodingFactory().getEncodingForFirebirdName("UTF8");
// TODO Version 3?
return new ServiceParameterBufferImp(ServiceParameterBufferImp.SpbMetaData.SPB_VERSION_2,
stringEncoding);
}

@Override
public ServiceRequestBuffer createServiceRequestBuffer(final WireServiceConnection connection) {
final Encoding stringEncoding = connection.getEncodingFactory().getEncodingForFirebirdName("UTF8");
// TODO Version 3?
return new ServiceRequestBufferImp(ServiceRequestBufferImp.SrbMetaData.SRB_VERSION_2, stringEncoding);
}

Expand Down
Expand Up @@ -67,15 +67,13 @@ public FbWireService createService(WireServiceConnection connection) {
@Override
public ServiceParameterBuffer createServiceParameterBuffer(final WireServiceConnection connection) {
final Encoding stringEncoding = connection.getEncodingFactory().getEncodingForFirebirdName("UTF8");
// TODO Version 3?
return new ServiceParameterBufferImp(ServiceParameterBufferImp.SpbMetaData.SPB_VERSION_2,
stringEncoding);
}

@Override
public ServiceRequestBuffer createServiceRequestBuffer(final WireServiceConnection connection) {
final Encoding stringEncoding = connection.getEncodingFactory().getEncodingForFirebirdName("UTF8");
// TODO Version 3?
return new ServiceRequestBufferImp(ServiceRequestBufferImp.SrbMetaData.SRB_VERSION_2, stringEncoding);
}

Expand Down
Expand Up @@ -67,15 +67,13 @@ public FbWireService createService(WireServiceConnection connection) {
@Override
public ServiceParameterBuffer createServiceParameterBuffer(final WireServiceConnection connection) {
final Encoding stringEncoding = connection.getEncodingFactory().getEncodingForFirebirdName("UTF8");
// TODO Version 3?
return new ServiceParameterBufferImp(ServiceParameterBufferImp.SpbMetaData.SPB_VERSION_2,
stringEncoding);
}

@Override
public ServiceRequestBuffer createServiceRequestBuffer(final WireServiceConnection connection) {
final Encoding stringEncoding = connection.getEncodingFactory().getEncodingForFirebirdName("UTF8");
// TODO Version 3?
return new ServiceRequestBufferImp(ServiceRequestBufferImp.SrbMetaData.SRB_VERSION_2, stringEncoding);
}

Expand Down

0 comments on commit adc6bf4

Please sign in to comment.