Skip to content

Commit

Permalink
ctf: Remove deprecated APIs in IntegerDeclaration
Browse files Browse the repository at this point in the history
Deprecated in patch:
https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/203774

Fixes issue eclipse-tracecompass#87

[Removed] IntegerDeclaration.createDeclaration() without role

Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
PatrickTasse committed May 22, 2024
1 parent 0dd5e89 commit 68c46bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 99 deletions.
2 changes: 1 addition & 1 deletion ctf/org.eclipse.tracecompass.ctf.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Version: 4.5.0.qualifier
Bundle-Version: 5.0.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.ctf.core;singleton:=true
Bundle-ActivationPolicy: lazy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2014 Ericsson, Ecole Polytechnique de Montreal and others
* Copyright (c) 2011, 2024 Ericsson, Ecole Polytechnique de Montreal and others
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0 which
Expand Down Expand Up @@ -135,101 +135,7 @@ public final class IntegerDeclaration extends Declaration implements ISimpleData
// ------------------------------------------------------------------------

/**
* Factory, some common types cached
*
* @deprecated use
* {@link #createDeclaration(int, boolean, int, ByteOrder, Encoding, String, long, String)}
* instead
*
* @param len
* The length in bits
* @param signed
* Is the integer signed? false == unsigned
* @param base
* The base (10-16 are most common)
* @param byteOrder
* Big-endian little-endian or other
* @param encoding
* ascii, utf8 or none.
* @param clock
* The clock path, can be null
* @param alignment
* The minimum alignment. Should be >= 1
* @return the integer declaration
* @deprecated use
* {@link #createDeclaration(int, boolean, int, ByteOrder, Encoding, String, long, String)}
*/
@Deprecated
public static IntegerDeclaration createDeclaration(int len, boolean signed, int base,
@Nullable ByteOrder byteOrder, Encoding encoding, String clock, long alignment) {
if (encoding.equals(Encoding.NONE) && (clock.equals("")) && base == BASE_10 && byteOrder != null) { //$NON-NLS-1$
if (alignment == BYTE_ALIGN) {
switch (len) {
case SIZE_8:
return signed ? INT_8_DECL : UINT_8_DECL;
case SIZE_16:
if (!signed) {
if (isBigEndian(byteOrder)) {
return UINT_16B_DECL;
}
return UINT_16L_DECL;
}
break;
case SIZE_32:
if (signed) {
if (isBigEndian(byteOrder)) {
return INT_32B_DECL;
}
return INT_32L_DECL;
}
if (isBigEndian(byteOrder)) {
return UINT_32B_DECL;
}
return UINT_32L_DECL;
case SIZE_64:
if (signed) {
if (isBigEndian(byteOrder)) {
return INT_64B_DECL;
}
return INT_64L_DECL;
}
if (isBigEndian(byteOrder)) {
return UINT_64B_DECL;
}
return UINT_64L_DECL;

default:

}

} else if (alignment == 1) {
switch (len) {
case SIZE_5:
if (!signed) {
if (isBigEndian(byteOrder)) {
return UINT_5B_DECL;
}
return UINT_5L_DECL;
}
break;
case SIZE_27:
if (!signed) {
if (isBigEndian(byteOrder)) {
return UINT_27B_DECL;
}
return UINT_27L_DECL;
}
break;
default:
break;
}
}
}
return new IntegerDeclaration(len, signed, base, byteOrder, encoding, clock, alignment);
}

/**
* Alternate create method for CTF2 integers which have roles
* Create method for CTF2 integers which have roles
*
* @param len
* The length in bits
Expand Down Expand Up @@ -331,7 +237,7 @@ public static IntegerDeclaration createDeclaration(int len, boolean signed, int
* A boolean indicating if the declaration is a varint
* @return IntegerDeclaration
*
* @since 4.5
* @since 5.0
*/
public static IntegerDeclaration createVarintDeclaration(boolean signed, int base, @Nullable String role, boolean varint) {
IntegerDeclaration decl = new IntegerDeclaration(0, signed, base, null, Encoding.NONE, "", 0); //$NON-NLS-1$
Expand Down Expand Up @@ -422,7 +328,7 @@ public boolean isSigned() {
* Is the integer a varint ?
*
* @return a boolean indicating varint status
* @since 4.5
* @since 5.0
*/
public boolean isVarint() {
return fVarint;
Expand Down

0 comments on commit 68c46bb

Please sign in to comment.