def enterCreatedName0(self, ctx: JavaParserLabeled.CreatedName0Context): if self.is_package_imported or self.in_selected_package: if ctx.IDENTIFIER(0).getText() == self.class_identifier: self.token_stream_rewriter.replaceIndex( index=ctx.start.tokenIndex, text=self.class_new_name) print("class name in creator changed")
def enterCreatedName0(self, ctx: JavaParserLabeled.CreatedName0Context): if self.is_package_imported \ or self.package_identifier is None \ or self.in_selected_package: if ctx.getText() == self.class_identifier: print("ClassInstanceCreationExpression_lfno_primary1") self.token_stream_rewriter.replaceIndex( index=ctx.start.tokenIndex, text=self.class_new_name)
def exitCreatedName0(self, ctx: JavaParserLabeled.CreatedName0Context): if ctx.IDENTIFIER(0).getText() == self.source_class and self.is_safe: self.detected_class = True self.start = ctx.start self.stop = ctx.stop
def enterCreatedName0(self, ctx: JavaParserLabeled.CreatedName0Context): if ctx.IDENTIFIER() and self.in_constructor and self.is_valid: identifiers = [i.getText() for i in ctx.IDENTIFIER()] if self.class_name in identifiers: self.is_valid = False
def enterCreatedName0(self, ctx: JavaParserLabeled.CreatedName0Context): if ctx.IDENTIFIER(0).getText() == self.source_class and self.target_class: self.token_stream_rewriter.replaceIndex( index=ctx.start.tokenIndex, text=self.target_class )
def exitCreatedName0(self, ctx: JavaParserLabeled.CreatedName0Context): if not self.has_import or not self.need_import: if self.class_identifier in ctx.getText().split('.'): self.need_import = True