Пример #1
0
 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")
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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
         )