Skip to content

Commit

Permalink
fixed linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
chame1eon committed Aug 14, 2019
1 parent 24ca6c7 commit cc939ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion jnitrace/jnitrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def _print_method_name(self, struct_type, name):
Style.RESET_ALL
))

def _get_data_metadata(self, arg_type, value):
@classmethod
def _get_data_metadata(cls, arg_type, value):
opt = None
if arg_type == "jboolean":
if value == 0:
Expand All @@ -110,6 +111,7 @@ def _print_data_prefix(self):
self._color_manager.get_current_color()
), end="")

# pylint: disable=too-many-arguments
def _print_data_value(self, sym, value, arg_type=None, opt=None, padding=0):
if not opt:
opt = self._get_data_metadata(arg_type, value)
Expand Down
8 changes: 5 additions & 3 deletions jnitrace/src/transport/data_transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DataJSONContainer {
return this.metadata;
}

public setMetadata(metadata: string | undefined) {
public setMetadata(metadata: string | undefined): void {
this.metadata = metadata;
}
};
Expand Down Expand Up @@ -270,6 +270,8 @@ class DataTransport {
}

private updateObjectIDsFromCall(data: MethodData): void {
const TYPE_START = 1;
const TYPE_END = -1;
const LAST_CALL_INDEX = 3;
const CALL_PTRS_OFFSET = 5;
if (data.javaMethod !== undefined) {
Expand All @@ -286,13 +288,13 @@ class DataTransport {
}
const nativeJType = data.javaMethod.nativeParams[i - start];
if (Types.isComplexObjectType(nativeJType)) {
this.jobjects[arg] = nativeJType.slice(1, -1);
this.jobjects[arg] = nativeJType.slice(TYPE_START, TYPE_END);
}
}
if (data.method.name.includes("Object")) {
if (this.jobjects[data.ret.toString()] === undefined) {
this.jobjects[data.ret.toString()]
= data.javaMethod.ret.slice(1, -1);
= data.javaMethod.ret.slice(TYPE_START, TYPE_END);
}
}
}
Expand Down

0 comments on commit cc939ad

Please sign in to comment.