test_class.declarator: req = BidRequest.newBuilder()
        .setId("1")
        .build()
test_class.modifier: private static
test_class.original_string: private static BidRequest req = BidRequest.newBuilder()
        .setId("1")
        .build();
test_class.type: BidRequest
test_class.var_name: req
test_class.declarator: bid = Bid.newBuilder()
        .setId("1")
        .setImpid("1")
        .setPrice(10000)
test_class.modifier: private static
test_class.original_string: private static Bid.Builder bid = Bid.newBuilder()
        .setId("1")
        .setImpid("1")
        .setPrice(10000);
test_class.type: Bid.Builder
test_class.var_name: bid
test_class.declarator: resp = BidResponse.newBuilder()
        .setId("1")
        .addSeatbid(SeatBid.newBuilder()
            .addBid(bid))
test_class.modifier: private static
test_class.original_string: private static BidResponse.Builder resp = BidResponse.newBuilder()
        .setId("1")
        .addSeatbid(SeatBid.newBuilder()
            .addBid(bid));
test_class.type: BidResponse.Builder
test_class.var_name: resp
test_class.declarator: processor = new SnippetProcessor() {
      @Override protected List<SnippetMacroType> registerMacros() {
        return ImmutableList.<SnippetMacroType>builder()
            .addAll(super.registerMacros())
            .addAll(asList(TestMacros.values()))
            .build();
      }
  
      @Override protected boolean processMacroAt(
          SnippetProcessorContext ctx, SnippetMacroType macroDef) {
        if (macroDef instanceof TestMacros) {
          switch ((TestMacros) macroDef) {
            case TEST:
              ctx.builder().append("#");
              return true;
  
            case MACRO_NREC:
              ctx.builder().append(TestMacros.TEST.key());
              return true;
  
            case MACRO_REC:
              ctx.builder().append(TestMacros.MACRO_REC.key());
              return true;
          }
        }
  
        return false;
      }
    }
test_class.modifier: private final
test_class.original_string: private final SnippetProcessor processor = new SnippetProcessor() {
      @Override protected List<SnippetMacroType> registerMacros() {
        return ImmutableList.<SnippetMacroType>builder()
            .addAll(super.registerMacros())
            .addAll(asList(TestMacros.values()))
            .build();
      }
  
      @Override protected boolean processMacroAt(
          SnippetProcessorContext ctx, SnippetMacroType macroDef) {
        if (macroDef instanceof TestMacros) {
          switch ((TestMacros) macroDef) {
            case TEST:
              ctx.builder().append("#");
              return true;
  
            case MACRO_NREC:
              ctx.builder().append(TestMacros.TEST.key());
              return true;
  
            case MACRO_REC:
              ctx.builder().append(TestMacros.MACRO_REC.key());
              return true;
          }
        }
  
        return false;
      }
    };
test_class.type: SnippetProcessor
test_class.var_name: processor
test_class.file: openrtb-core/src/test/java/com/google/openrtb/snippet/SnippetProcessorTest.java
test_class.identifier: SnippetProcessorTest
test_case.body: @Test
    public void testUrlEncoding() {
      assertThat(process("")).isEqualTo("");
      assertThat(process("{!+/}")).isEqualTo("{!+/}");
      assertThat(process("%!+/%")).isEqualTo("%!+/%");
      assertThat(process("%{aaa}%")).isEqualTo(esc("aaa"));
      assertThat(process("%{!+/}%")).isEqualTo(esc("!+/"));
      assertThat(process("%{!+/}%%{aaa}%")).isEqualTo(esc("!+/") + esc("aaa"));
      assertThat(process("%{%{!+/}%aaa}%")).isEqualTo(esc2("!+/") + esc("aaa"));
      assertThat(process("%{%{%{%{%{%{%{%{%{%{!}%}%}%}%}%}%}%}%}%}%"))
          .isEqualTo(esc2(esc2(esc2(esc2(esc2("!"))))));
    }
test_case.class_method_signature: SnippetProcessorTest.testUrlEncoding()
test_case.full_signature: @Test public void testUrlEncoding()
test_case.identifier: testUrlEncoding
test_case.invocations: isEqualTo assertThat process isEqualTo assertThat process isEqualTo assertThat process isEqualTo assertThat process esc isEqualTo assertThat process esc isEqualTo assertThat process esc esc isEqualTo assertThat process esc2 esc isEqualTo assertThat process esc2 esc2 esc2 esc2 esc2
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUrlEncoding()
focal_class.declarator: logger = LoggerFactory.getLogger(SnippetProcessor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SnippetProcessor.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: ESCAPER = new PercentEscaper("-_.*", true)
focal_class.modifier: private static final
focal_class.original_string: private static final Escaper ESCAPER = new PercentEscaper("-_.*", true);
focal_class.type: Escaper
focal_class.var_name: ESCAPER
focal_class.declarator: NULL = new SnippetProcessor() {
      @Override public String process(SnippetProcessorContext ctx, String snippet) {
        checkNotNull(ctx);
        return checkNotNull(snippet);
      }
  
      @Override protected boolean processMacroAt(
          SnippetProcessorContext ctx, SnippetMacroType macroDef) {
        return false;
      }
    }
focal_class.modifier: public static final
focal_class.original_string: public static final SnippetProcessor NULL = new SnippetProcessor() {
      @Override public String process(SnippetProcessorContext ctx, String snippet) {
        checkNotNull(ctx);
        return checkNotNull(snippet);
      }
  
      @Override protected boolean processMacroAt(
          SnippetProcessorContext ctx, SnippetMacroType macroDef) {
        return false;
      }
    };
focal_class.type: SnippetProcessor
focal_class.var_name: NULL
focal_class.declarator: scanMacros
focal_class.modifier: private final
focal_class.original_string: private final ImmutableList<SnippetMacroType> scanMacros;
focal_class.type: ImmutableList<SnippetMacroType>
focal_class.var_name: scanMacros
focal_class.file: openrtb-core/src/main/java/com/google/openrtb/snippet/SnippetProcessor.java
focal_class.identifier: SnippetProcessor
focal_class.class_method_signature: SnippetProcessor.SnippetProcessor()
focal_class.full_signature: public  SnippetProcessor()
focal_class.identifier: SnippetProcessor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SnippetProcessor()
focal_class.class_method_signature: SnippetProcessor.registerMacros()
focal_class.full_signature: protected List<SnippetMacroType> registerMacros()
focal_class.identifier: registerMacros
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: List<SnippetMacroType>
focal_class.signature: List<SnippetMacroType> registerMacros()
focal_class.class_method_signature: SnippetProcessor.getEscaper()
focal_class.full_signature: public static Escaper getEscaper()
focal_class.identifier: getEscaper
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Escaper
focal_class.signature: Escaper getEscaper()
focal_class.class_method_signature: SnippetProcessor.process(SnippetProcessorContext ctx, String snippet)
focal_class.full_signature: public String process(SnippetProcessorContext ctx, String snippet)
focal_class.identifier: process
focal_class.modifiers: public
focal_class.parameters: (SnippetProcessorContext ctx, String snippet)
focal_class.return: String
focal_class.signature: String process(SnippetProcessorContext ctx, String snippet)
focal_class.class_method_signature: SnippetProcessor.processMacroAt(SnippetProcessorContext ctx,
        String snippet, int macroStart)
focal_class.full_signature: private int processMacroAt(SnippetProcessorContext ctx,
        String snippet, int macroStart)
focal_class.identifier: processMacroAt
focal_class.modifiers: private
focal_class.parameters: (SnippetProcessorContext ctx,
        String snippet, int macroStart)
focal_class.return: int
focal_class.signature: int processMacroAt(SnippetProcessorContext ctx,
        String snippet, int macroStart)
focal_class.class_method_signature: SnippetProcessor.match(String snippet, int macroStart)
focal_class.full_signature: private SnippetMacroType match(String snippet, int macroStart)
focal_class.identifier: match
focal_class.modifiers: private
focal_class.parameters: (String snippet, int macroStart)
focal_class.return: SnippetMacroType
focal_class.signature: SnippetMacroType match(String snippet, int macroStart)
focal_class.class_method_signature: SnippetProcessor.processMacroAt(
        SnippetProcessorContext ctx, SnippetMacroType macroDef)
focal_class.full_signature: protected abstract boolean processMacroAt(
        SnippetProcessorContext ctx, SnippetMacroType macroDef)
focal_class.identifier: processMacroAt
focal_class.modifiers: protected abstract
focal_class.parameters: (
        SnippetProcessorContext ctx, SnippetMacroType macroDef)
focal_class.return: boolean
focal_class.signature: boolean processMacroAt(
        SnippetProcessorContext ctx, SnippetMacroType macroDef)
focal_class.class_method_signature: SnippetProcessor.urlEncode(SnippetProcessorContext ctx, String snippet)
focal_class.full_signature: protected static String urlEncode(SnippetProcessorContext ctx, String snippet)
focal_class.identifier: urlEncode
focal_class.modifiers: protected static
focal_class.parameters: (SnippetProcessorContext ctx, String snippet)
focal_class.return: String
focal_class.signature: String urlEncode(SnippetProcessorContext ctx, String snippet)
focal_class.class_method_signature: SnippetProcessor.flushEncoding(
        String snippet, int encodeStart, int encodeEnd, int encodeLevel)
focal_class.full_signature: private static String flushEncoding(
        String snippet, int encodeStart, int encodeEnd, int encodeLevel)
focal_class.identifier: flushEncoding
focal_class.modifiers: private static
focal_class.parameters: (
        String snippet, int encodeStart, int encodeEnd, int encodeLevel)
focal_class.return: String
focal_class.signature: String flushEncoding(
        String snippet, int encodeStart, int encodeEnd, int encodeLevel)
focal_class.class_method_signature: SnippetProcessor.toString()
focal_class.full_signature: @Override public final String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public final
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: SnippetProcessor.toStringHelper()
focal_class.full_signature: protected ToStringHelper toStringHelper()
focal_class.identifier: toStringHelper
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: ToStringHelper
focal_class.signature: ToStringHelper toStringHelper()
focal_method.body: public String process(SnippetProcessorContext ctx, String snippet) {
      checkNotNull(ctx);
      StringBuilder sb = ctx.builder();
      sb.setLength(0);
      String currSnippet = snippet;
  
      boolean processedMacros = false;
      int snippetPos = 0;
      int macroPos = currSnippet.indexOf("${");
  
      while (macroPos != -1) {
        sb.append(currSnippet.substring(snippetPos, macroPos));
        int macroEnd = processMacroAt(ctx, currSnippet, macroPos);
  
        if (macroEnd == -1) {
          sb.append("${");
          snippetPos = macroPos + 2;
        } else {
          snippetPos = macroEnd;
          processedMacros = true;
        }
  
        macroPos = currSnippet.indexOf("${", snippetPos);
      }
  
      if (processedMacros) {
        sb.append(currSnippet, snippetPos, currSnippet.length());
        currSnippet = sb.toString();
      }
      sb.setLength(0);
  
      String ret = urlEncode(ctx, currSnippet);
      sb.setLength(0);
      return ret;
    }
focal_method.class_method_signature: SnippetProcessor.process(SnippetProcessorContext ctx, String snippet)
focal_method.full_signature: public String process(SnippetProcessorContext ctx, String snippet)
focal_method.identifier: process
focal_method.invocations: checkNotNull builder setLength indexOf append substring processMacroAt append indexOf append length toString setLength urlEncode setLength
focal_method.modifiers: public
focal_method.parameters: (SnippetProcessorContext ctx, String snippet)
focal_method.return: String
focal_method.signature: String process(SnippetProcessorContext ctx, String snippet)