diff --git a/src/jna-client/org/firebirdsql/gds/ng/jna/FbLocalDatabaseFactory.java b/src/jna-client/org/firebirdsql/gds/ng/jna/FbLocalDatabaseFactory.java index ce988dcab..cf0fd27cc 100644 --- a/src/jna-client/org/firebirdsql/gds/ng/jna/FbLocalDatabaseFactory.java +++ b/src/jna-client/org/firebirdsql/gds/ng/jna/FbLocalDatabaseFactory.java @@ -27,7 +27,9 @@ * * @author Mark Rotteveel * @since 3.0 + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated public class FbLocalDatabaseFactory extends AbstractNativeDatabaseFactory { private static final FbLocalDatabaseFactory INSTANCE = new FbLocalDatabaseFactory(); diff --git a/src/main/org/firebirdsql/encodings/IEncodingFactory.java b/src/main/org/firebirdsql/encodings/IEncodingFactory.java index 9f75c1993..d214a5f38 100644 --- a/src/main/org/firebirdsql/encodings/IEncodingFactory.java +++ b/src/main/org/firebirdsql/encodings/IEncodingFactory.java @@ -232,6 +232,9 @@ public interface IEncodingFactory { * @param * Type parameter of type {@link DatatypeCoder} * @return New or cached instance of datatype coder + * @deprecated will be removed in Jaybird 6 and replaced by + * {@code T getOrCreateDatatypeCoder(Class, Function)} */ + @Deprecated T getOrCreateDatatypeCoder(Class datatypeCoderClass); } diff --git a/src/main/org/firebirdsql/gds/GDSException.java b/src/main/org/firebirdsql/gds/GDSException.java index cb94d12ad..e8924992c 100644 --- a/src/main/org/firebirdsql/gds/GDSException.java +++ b/src/main/org/firebirdsql/gds/GDSException.java @@ -24,6 +24,7 @@ */ package org.firebirdsql.gds; +import java.sql.SQLException; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; /** @@ -31,7 +32,9 @@ * * @author David Jencks * @author Roman Rokytskyy + * @deprecated use a normal SQLException or subclass, this class may be removed in Jaybird 7 or later */ +@Deprecated public class GDSException extends Exception { private static final long serialVersionUID = -2993273656432230359L; @@ -65,7 +68,9 @@ public class GDSException extends Exception { * * @param message Message for the new instance * @param xaErrorCode The XA error code + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public static GDSException createWithXAErrorCode(String message, int xaErrorCode) { GDSException gdse = new GDSException(message); gdse.setXAErrorCode(xaErrorCode); @@ -79,7 +84,11 @@ public static GDSException createWithXAErrorCode(String message, int xaErrorCode * {@link ISCConstants#isc_arg_gds}, otherwise no message will be * displayed. * @param intParam Additional int parameter about the new exception + * @deprecated will be removed in Jaybird 6, if you really must use this class, use {@link #GDSException(String)}, + * {@link #GDSException(int)}, or {@link #GDSException(int,Throwable)}, but keep in mind this class will be removed + * in Jaybird 7 or later */ + @Deprecated public GDSException(int type, int intParam) { this.type = type; this.intParam = intParam; @@ -95,7 +104,11 @@ public GDSException(int type, int intParam) { * @param strParam value of the string parameter that will substitute * {0} entry in error message corresponding to the * specified error code. + * @deprecated will be removed in Jaybird 6, if you really must use this class, use {@link #GDSException(String)}, + * {@link #GDSException(int)}, or {@link #GDSException(int,Throwable)}, but keep in mind this class will be removed + * in Jaybird 7 or later */ + @Deprecated public GDSException(int type, String strParam) { this.type = type; this.strParam = strParam; @@ -114,7 +127,11 @@ public GDSException(int type, String strParam) { * @param strParam value of the string parameter that will substitute * {0} entry in error message corresponding to the specified * error code. + * @deprecated will be removed in Jaybird 6, if you really must use this class, use {@link #GDSException(String)}, + * {@link #GDSException(int)}, or {@link #GDSException(int,Throwable)}, but keep in mind this class will be removed + * in Jaybird 7 or later */ + @Deprecated public GDSException(int type, int fbErrorCode, String strParam) { this.type = type; this.intParam = fbErrorCode; @@ -136,7 +153,11 @@ public GDSException(int type, int fbErrorCode, String strParam) { * error code. * * @param cause Cause of this exception + * @deprecated will be removed in Jaybird 6, if you really must use this class, use {@link #GDSException(String)}, + * {@link #GDSException(int)}, or {@link #GDSException(int,Throwable)}, but keep in mind this class will be removed + * in Jaybird 7 or later */ + @Deprecated public GDSException(int type, int fbErrorCode, String strParam, Throwable cause) { this(type, fbErrorCode, strParam); initCause(cause); @@ -181,7 +202,9 @@ public GDSException(String message) { * Get the Firebird-specific error code for this exception. * * @return The Firebird error code + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public int getFbErrorCode() { switch (type) { case ISCConstants.isc_arg_number: @@ -198,7 +221,9 @@ public int getFbErrorCode() { * * @return the SQL state of this exception or null if this * object does not represent an error. + * @deprecated will be removed in Jaybird 6, but replaced by {@link SQLException#getSQLState()} */ + @Deprecated public String getSQLState() { switch (type) { case ISCConstants.isc_arg_number: @@ -213,7 +238,9 @@ public String getSQLState() { * Get the int parameter for this exception. * * @return The int parameter + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public int getIntParam() { return intParam; } @@ -222,7 +249,9 @@ public int getIntParam() { /** * Get the XaErrorCode value. * @return the XaErrorCode value. + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public int getXAErrorCode() { return xaErrorCode; } @@ -230,7 +259,9 @@ public int getXAErrorCode() { /** * Set the XaErrorCode value. * @param xaErrorCode The new XaErrorCode value. + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public void setXAErrorCode(int xaErrorCode) { this.xaErrorCode = xaErrorCode; } @@ -239,7 +270,9 @@ public void setXAErrorCode(int xaErrorCode) { * Set the next exception in the chain. * * @param e The next chained exception + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public void setNext(GDSException e) { GDSException current = this; for(;;) { @@ -260,7 +293,9 @@ public void setNext(GDSException e) { * Get the next chained exception. * * @return The next chained exception + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public GDSException getNext() { return next; } @@ -270,7 +305,9 @@ public GDSException getNext() { * * @return true if this is a warning, * false otherwise + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public boolean isWarning() { return type == ISCConstants.isc_arg_warning; } @@ -315,7 +352,10 @@ public String getMessage() { /** * Returns the parameter depending on the type of the error code. + * + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public String getParam() { switch (type) { case ISCConstants.isc_arg_interpreted: diff --git a/src/main/org/firebirdsql/gds/JaybirdSystemProperties.java b/src/main/org/firebirdsql/gds/JaybirdSystemProperties.java index 0481e33eb..0562c7308 100644 --- a/src/main/org/firebirdsql/gds/JaybirdSystemProperties.java +++ b/src/main/org/firebirdsql/gds/JaybirdSystemProperties.java @@ -33,8 +33,20 @@ public final class JaybirdSystemProperties { // do not include 'sensitive' properties, and only include Jaybird specific properties + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String FORCE_CONSOLE_LOGGER_PROP = JDBC_PREFIX + "forceConsoleLogger"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String DISABLE_LOGGING_PROP = JDBC_PREFIX + "disableLogging"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String LOGGER_IMPLEMENTATION_PROP = JDBC_PREFIX + "loggerImplementation"; public static final String SYNC_WRAP_NATIVE_LIBRARY_PROP = COMMON_PREFIX + "jna.syncWrapNativeLibrary"; public static final String PROCESS_ID_PROP = JDBC_PREFIX + "pid"; @@ -48,14 +60,26 @@ private JaybirdSystemProperties() { // no instances } + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static boolean isForceConsoleLogger() { return getBooleanSystemPropertyPrivileged(FORCE_CONSOLE_LOGGER_PROP); } + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static boolean isDisableLogging() { return getBooleanSystemPropertyPrivileged(DISABLE_LOGGING_PROP); } + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static String getLoggerImplementation() { return getSystemPropertyPrivileged(LOGGER_IMPLEMENTATION_PROP); } diff --git a/src/main/org/firebirdsql/gds/impl/argument/StringArgument.java b/src/main/org/firebirdsql/gds/impl/argument/StringArgument.java index 4e651909e..ebd96e838 100644 --- a/src/main/org/firebirdsql/gds/impl/argument/StringArgument.java +++ b/src/main/org/firebirdsql/gds/impl/argument/StringArgument.java @@ -34,11 +34,14 @@ public final class StringArgument extends TypedArgument { private static final EnumSet SUPPORTED_ARGUMENT_TYPES = EnumSet.of(ArgumentType.TraditionalDpb, ArgumentType.Wide, ArgumentType.StringSpb); private static final long serialVersionUID = -7980793147101287101L; - + private final String value; private final byte[] asBytes; private final Encoding encoding; + /** + * @deprecated will be removed in Jaybird 6, use {@link #StringArgument(int, ArgumentType, String, Encoding)} + */ @Deprecated public StringArgument(int type, ArgumentType argumentType, String value) { this(type, argumentType, value, EncodingFactory.getPlatformEncoding()); diff --git a/src/main/org/firebirdsql/gds/ng/DefaultDatatypeCoder.java b/src/main/org/firebirdsql/gds/ng/DefaultDatatypeCoder.java index 7273a0ab7..49297ed3d 100644 --- a/src/main/org/firebirdsql/gds/ng/DefaultDatatypeCoder.java +++ b/src/main/org/firebirdsql/gds/ng/DefaultDatatypeCoder.java @@ -107,7 +107,7 @@ public int sizeOfShort() { @Override public byte[] encodeShort(short value) { - return intToBytes(value); + return encodeInt(value); } @Override @@ -132,7 +132,9 @@ public short decodeShort(byte[] bytes, int fromIndex) { @Override public byte[] encodeInt(int value) { - return intToBytes(value); + byte[] ret = new byte[4]; + encodeInt(value, ret, 0); + return ret; } @Override @@ -148,16 +150,12 @@ public void encodeInt(int value, byte[] target, int fromIndex) { * * @param value * The value to be encoded - * @return The value of value encoded as a - * byte array + * @return The value of value encoded as a byte array + * @deprecated will be removed in Jaybird 6, use {@link #encodeInt(int)} */ + @Deprecated protected byte[] intToBytes(int value) { - byte[] ret = new byte[4]; - ret[0] = (byte) ((value >>> 24) & 0xff); - ret[1] = (byte) ((value >>> 16) & 0xff); - ret[2] = (byte) ((value >>> 8) & 0xff); - ret[3] = (byte) ((value) & 0xff); - return ret; + return encodeInt(value); } @Override diff --git a/src/main/org/firebirdsql/gds/ng/wire/auth/legacy/UnixCrypt.java b/src/main/org/firebirdsql/gds/ng/wire/auth/legacy/UnixCrypt.java index c5220bda0..c2d0e6648 100644 --- a/src/main/org/firebirdsql/gds/ng/wire/auth/legacy/UnixCrypt.java +++ b/src/main/org/firebirdsql/gds/ng/wire/auth/legacy/UnixCrypt.java @@ -27,12 +27,14 @@ import java.nio.charset.StandardCharsets; -/** Unix Crypt. - * Implements the one way cryptography used by Unix systems for - * simple password protection. +/** + * Unix Crypt. Implements the one way cryptography used by Unix systems for simple password protection. + * * @version $Id: UnixCrypt.java,v 1.5 2004/10/11 00:28:41 gregwilkins Exp $ * @author Greg Wilkins (gregw) + * @deprecated will be removed in Jaybird 6, and replaced by {@code LegacyHash} which will be introduced in Jaybird 6 */ +@Deprecated public class UnixCrypt { //@formatter:off diff --git a/src/main/org/firebirdsql/jaybird/xca/FBXAException.java b/src/main/org/firebirdsql/jaybird/xca/FBXAException.java index 2c63487a5..85ca41b41 100644 --- a/src/main/org/firebirdsql/jaybird/xca/FBXAException.java +++ b/src/main/org/firebirdsql/jaybird/xca/FBXAException.java @@ -31,6 +31,10 @@ */ public class FBXAException extends XAException { + /** + * @deprecated will be removed in Jaybird 6, use one of the other constructors + */ + @Deprecated public FBXAException() { super(); } diff --git a/src/main/org/firebirdsql/jdbc/FBConnection.java b/src/main/org/firebirdsql/jdbc/FBConnection.java index d68a9378e..30996056f 100644 --- a/src/main/org/firebirdsql/jdbc/FBConnection.java +++ b/src/main/org/firebirdsql/jdbc/FBConnection.java @@ -103,6 +103,10 @@ public FBConnection(FBManagedConnection mc) { : ResultSet.CLOSE_CURSORS_AT_COMMIT; } + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public FBObjectListener.StatementListener getStatementListener() { return txCoordinator; } @@ -700,7 +704,10 @@ public PreparedStatement prepareStatement(String sql, int resultSetType, int res return prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability, false, false); } - // TODO Why unused? Remove? + /** + * @deprecated will be removed in Jaybird 6, use {@link #prepareStatement(String, int, int, int, boolean, boolean)} + */ + @Deprecated protected PreparedStatement prepareMetaDataStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability, true, false); @@ -1054,8 +1061,11 @@ public String getSchema() throws SQLException { } /** - * Check if this connection is currently involved in a transaction + * Check if this connection is currently involved in a transaction. + * + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated public boolean inTransaction() throws SQLException { return getGDSHelper().inTransaction(); } @@ -1113,7 +1123,9 @@ public boolean isUseFirebirdAutoCommit() { * * @throws SQLException * If the client info is not supported, or if there is no database connection. + * @deprecated will be removed in Jaybird 6 without replacement */ + @Deprecated protected void checkClientInfoSupport() throws SQLException { if (!getFbDatabase().getServerVersion().isEqualOrAbove(2, 0)) { throw new FBDriverNotCapableException( diff --git a/src/main/org/firebirdsql/jdbc/FBResultSet.java b/src/main/org/firebirdsql/jdbc/FBResultSet.java index 589234b7e..64c808b7c 100644 --- a/src/main/org/firebirdsql/jdbc/FBResultSet.java +++ b/src/main/org/firebirdsql/jdbc/FBResultSet.java @@ -403,6 +403,10 @@ public boolean isClosed() throws SQLException { return closed; } + /** + * @deprecated use {@link #close(boolean, CompletionReason)}, will be removed in Jaybird 6 + */ + @Deprecated void close(boolean notifyListener) throws SQLException { close(notifyListener, CompletionReason.OTHER); } diff --git a/src/main/org/firebirdsql/jdbc/SQLStateConstants.java b/src/main/org/firebirdsql/jdbc/SQLStateConstants.java index b8df23581..358488720 100644 --- a/src/main/org/firebirdsql/jdbc/SQLStateConstants.java +++ b/src/main/org/firebirdsql/jdbc/SQLStateConstants.java @@ -34,13 +34,28 @@ public final class SQLStateConstants { public static final String SQL_STATE_WARNING = "01000"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String SQL_STATE_INVALID_CONN_ATTR = "01S00"; public static final String SQL_STATE_NO_ROW_AVAIL = "01S06"; public static final String SQL_STATE_FEATURE_NOT_SUPPORTED = "0A000"; public static final String SQL_STATE_GENERAL_ERROR = "HY000"; + /** + * @deprecated will be removed in Jaybird 6 and replaced by {@code SQL_STATE_INVALID_DESC_FIELD_ID}, which will + * be introduced in Jaybird 6 + */ + @Deprecated public static final String SQL_STATE_INVALID_COLUMN = "HY002"; + /** + * @deprecated will be removed in Jaybird 6 and replaced by {@code SQL_STATE_INVALID_USE_NULL}, + * {@code SQL_STATE_ATT_CANNOT_SET_NOW}, {@code SQL_STATE_INVALID_ATTR_VALUE} and + * {@code SQL_STATE_INVALID_STRING_LENGTH}, which will all be introduced in Jaybird 6 + */ + @Deprecated public static final String SQL_STATE_INVALID_ARG_VALUE = "HY009"; public static final String SQL_STATE_INVALID_OPTION_IDENTIFIER = "HY092"; public static final String SQL_STATE_INVALID_PARAM_TYPE = "HY105"; @@ -51,8 +66,20 @@ public final class SQLStateConstants { public static final String SQL_STATE_INVALID_CONVERSION = "07006"; public static final String SQL_STATE_INVALID_TX_STATE = "25000"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String SQL_STATE_INVALID_TRANSACTION_STATE = "25S01"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String SQL_STATE_TRANSACTION_ACTIVE = "25S02"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String SQL_STATE_TRANSACTION_ROLLED_BACK = "25S03"; public static final String SQL_STATE_INVALID_STATEMENT_ID = "26000"; @@ -60,7 +87,15 @@ public final class SQLStateConstants { public static final String SQL_STATE_CONNECTION_ERROR = "08000"; public static final String SQL_STATE_CONNECTION_CLOSED = "08003"; public static final String SQL_STATE_CONNECTION_FAILURE = "08006"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String SQL_STATE_CONNECTION_FAILURE_IN_TX = "08007"; + /** + * @deprecated will be removed in Jaybird 6 without replacement + */ + @Deprecated public static final String SQL_STATE_COMM_LINK_FAILURE = "08S01"; public static final String SQL_STATE_SYNTAX_ERROR = "42000"; diff --git a/src/main/org/firebirdsql/logging/ConsoleLogger.java b/src/main/org/firebirdsql/logging/ConsoleLogger.java index 66a191c4a..04e1cdc05 100644 --- a/src/main/org/firebirdsql/logging/ConsoleLogger.java +++ b/src/main/org/firebirdsql/logging/ConsoleLogger.java @@ -22,7 +22,9 @@ * Logger implementation that writes to the console output. * * @author Roman Rokytskyy + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated final class ConsoleLogger implements Logger { private static final boolean debugEnabled = false; diff --git a/src/main/org/firebirdsql/logging/JulLogger.java b/src/main/org/firebirdsql/logging/JulLogger.java index 75a8c20a1..74ae039d4 100644 --- a/src/main/org/firebirdsql/logging/JulLogger.java +++ b/src/main/org/firebirdsql/logging/JulLogger.java @@ -25,7 +25,9 @@ * * @author Mark Rotteveel * @since 3.0 + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated final class JulLogger implements Logger { private final java.util.logging.Logger log; diff --git a/src/main/org/firebirdsql/logging/Logger.java b/src/main/org/firebirdsql/logging/Logger.java index e30e16642..45f493d8a 100644 --- a/src/main/org/firebirdsql/logging/Logger.java +++ b/src/main/org/firebirdsql/logging/Logger.java @@ -26,7 +26,9 @@ * @author David Jencks * @author Blas Rodriguez Somoza * @author Mark Rotteveel + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated @SuppressWarnings("unused") public interface Logger { diff --git a/src/main/org/firebirdsql/logging/LoggerFactory.java b/src/main/org/firebirdsql/logging/LoggerFactory.java index 8a6707565..689bc6987 100644 --- a/src/main/org/firebirdsql/logging/LoggerFactory.java +++ b/src/main/org/firebirdsql/logging/LoggerFactory.java @@ -28,7 +28,9 @@ * * @author Blas Rodriguez Somoza * @author Mark Rotteveel + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated @InternalApi public final class LoggerFactory { diff --git a/src/main/org/firebirdsql/logging/NullLogger.java b/src/main/org/firebirdsql/logging/NullLogger.java index bb53be313..4b427da86 100644 --- a/src/main/org/firebirdsql/logging/NullLogger.java +++ b/src/main/org/firebirdsql/logging/NullLogger.java @@ -26,7 +26,9 @@ * @author Blas Rodriguez Somoza * @author Mark Rotteveel * @version 1.0 + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated final class NullLogger implements Logger{ @Override diff --git a/src/main/org/firebirdsql/logging/package-info.java b/src/main/org/firebirdsql/logging/package-info.java index d8af130b5..e4a0dda7e 100644 --- a/src/main/org/firebirdsql/logging/package-info.java +++ b/src/main/org/firebirdsql/logging/package-info.java @@ -4,5 +4,8 @@ * See also section Logging * in the Jaybird manual. *

+ * + * @deprecated will be removed in Jaybird 6 without replacement */ +@Deprecated package org.firebirdsql.logging; \ No newline at end of file diff --git a/src/openoffice/org/firebirdsql/gds/impl/oo/package-info.java b/src/openoffice/org/firebirdsql/gds/impl/oo/package-info.java index 917154f16..e122aaa9d 100644 --- a/src/openoffice/org/firebirdsql/gds/impl/oo/package-info.java +++ b/src/openoffice/org/firebirdsql/gds/impl/oo/package-info.java @@ -1,4 +1,7 @@ /** - * Pure-java implementation of {@link org.firebirdsql.gds.impl.GDSFactoryPlugin} for use with OpenOffice/LibreOffice + * Pure-java implementation of {@link org.firebirdsql.gds.impl.GDSFactoryPlugin} for use with OpenOffice/LibreOffice. + * + * @deprecated Switch to using "Firebird External" in LibreOffice, will be removed in Jaybird 6. */ +@Deprecated package org.firebirdsql.gds.impl.oo; \ No newline at end of file diff --git a/src/openoffice/org/firebirdsql/jdbc/oo/package-info.java b/src/openoffice/org/firebirdsql/jdbc/oo/package-info.java index 1d9347930..09172e2aa 100644 --- a/src/openoffice/org/firebirdsql/jdbc/oo/package-info.java +++ b/src/openoffice/org/firebirdsql/jdbc/oo/package-info.java @@ -1,4 +1,7 @@ /** * JDBC implementation classes specifically for the OOREMOTE protocol. + * + * @deprecated Switch to using "Firebird External" in LibreOffice, will be removed in Jaybird 6. */ +@Deprecated package org.firebirdsql.jdbc.oo; \ No newline at end of file