diff --git a/adapter/call/JavaCallListener.go b/adapter/call/JavaCallListener.go index f0648b940492031db397b6f19314239f8cd1ea42..5f3560088ef7a76073f8a1e0528bd8f2aff3a030 100644 --- a/adapter/call/JavaCallListener.go +++ b/adapter/call/JavaCallListener.go @@ -59,9 +59,9 @@ func (s *JavaCallListener) EnterInterfaceDeclaration(ctx *InterfaceDeclarationCo func (s *JavaCallListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodDeclarationContext) { startLine := ctx.GetStart().GetLine() - startLinePosition := ctx.GetStart().GetTokenSource().GetCharPositionInLine() + startLinePosition := ctx.GetStart().GetColumn() stopLine := ctx.GetStop().GetLine() - stopLinePosition := ctx.GetStop().GetTokenSource().GetCharPositionInLine() + stopLinePosition := ctx.GetStop().GetColumn() name := ctx.IDENTIFIER().GetText() //XXX: find the start position of {, not public method := &JMethod{name, startLine, startLinePosition, stopLine, stopLinePosition} @@ -87,9 +87,9 @@ func (s *JavaCallListener) EnterLocalVariableDeclaration(ctx *LocalVariableDecla func (s *JavaCallListener) EnterMethodDeclaration(ctx *MethodDeclarationContext) { startLine := ctx.GetStart().GetLine() - startLinePosition := ctx.GetStart().GetTokenSource().GetCharPositionInLine() + startLinePosition := ctx.GetStart().GetColumn() stopLine := ctx.GetStop().GetLine() - stopLinePosition := ctx.GetStop().GetTokenSource().GetCharPositionInLine() + stopLinePosition := ctx.GetStop().GetColumn() name := ctx.IDENTIFIER().GetText() //XXX: find the start position of {, not public method := &JMethod{name, startLine, startLinePosition, stopLine, stopLinePosition} @@ -101,9 +101,9 @@ func (s *JavaCallListener) EnterMethodCall(ctx *MethodCallContext) { callee := ctx.GetChild(0).(antlr.ParseTree).GetText() startLine := ctx.GetStart().GetLine() - startLinePosition := ctx.GetStart().GetTokenSource().GetCharPositionInLine() + startLinePosition := ctx.GetStart().GetColumn() stopLine := ctx.GetStop().GetLine() - stopLinePosition := ctx.GetStop().GetTokenSource().GetCharPositionInLine() + stopLinePosition := ctx.GetStop().GetColumn() fullType := warpTargetFullType(targetType); if fullType != "" { diff --git a/adapter/identifier/JavaIdentifierListener.go b/adapter/identifier/JavaIdentifierListener.go index cfc181618cd86d7b05a7159217810abb63bd5269..6d1ddede173968c2d634bde683d7debecccf1df8 100644 --- a/adapter/identifier/JavaIdentifierListener.go +++ b/adapter/identifier/JavaIdentifierListener.go @@ -22,9 +22,9 @@ func (s *JavaIdentifierListener) EnterClassDeclaration(ctx *ClassDeclarationCont func (s *JavaIdentifierListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodDeclarationContext) { startLine := ctx.GetStart().GetLine() - startLinePosition := ctx.GetStart().GetTokenSource().GetCharPositionInLine() + startLinePosition := ctx.GetStart().GetColumn() stopLine := ctx.GetStop().GetLine() - stopLinePosition := ctx.GetStop().GetTokenSource().GetCharPositionInLine() + stopLinePosition := ctx.GetStop().GetColumn() name := ctx.IDENTIFIER().GetText() //XXX: find the start position of {, not public method := &JMethod{name, startLine, startLinePosition, stopLine, stopLinePosition} @@ -33,9 +33,9 @@ func (s *JavaIdentifierListener) EnterInterfaceMethodDeclaration(ctx *InterfaceM func (s *JavaIdentifierListener) EnterMethodDeclaration(ctx *MethodDeclarationContext) { startLine := ctx.GetStart().GetLine() - startLinePosition := ctx.GetStart().GetTokenSource().GetCharPositionInLine() + startLinePosition := ctx.GetStart().GetColumn() stopLine := ctx.GetStop().GetLine() - stopLinePosition := ctx.GetStop().GetTokenSource().GetCharPositionInLine() + stopLinePosition := ctx.GetStop().GetColumn() name := ctx.IDENTIFIER().GetText() //XXX: find the start position of {, not public method := &JMethod{name, startLine, startLinePosition, stopLine, stopLinePosition} diff --git a/refactor/base/JavaRefactorListener.go b/refactor/base/JavaRefactorListener.go index 3a7398ae67429558ae649a7787aaff10e757cbd2..a78ece14bb11f48dfd64081cca9d03d008ac7891 100644 --- a/refactor/base/JavaRefactorListener.go +++ b/refactor/base/JavaRefactorListener.go @@ -63,9 +63,9 @@ func (s *JavaRefactorListener) EnterCatchType(ctx *CatchTypeContext) { func (s *JavaRefactorListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodDeclarationContext) { //fmt.Println(ctx.TypeTypeOrVoid()) startLine := ctx.GetStart().GetLine() - startLinePosition := ctx.GetStart().GetTokenSource().GetCharPositionInLine() + startLinePosition := ctx.GetStart().GetColumn() stopLine := ctx.GetStop().GetLine() - stopLinePosition := ctx.GetStop().GetTokenSource().GetCharPositionInLine() + stopLinePosition := ctx.GetStop().GetColumn() name := ctx.IDENTIFIER().GetText() //XXX: find the start position of {, not public method := &JFullMethod{name, startLine, startLinePosition, stopLine, stopLinePosition}