test_class.file: common/src/test/java/org/keycloak/common/util/HtmlUtilsTest.java
test_class.identifier: HtmlUtilsTest
test_case.body: @Test
    public void escapeAttribute() {
      Assert.assertEquals("1&lt;2", HtmlUtils.escapeAttribute("1<2"));
      Assert.assertEquals("2&lt;3&amp;&amp;3&gt;2", HtmlUtils.escapeAttribute("2<3&&3>2") );
      Assert.assertEquals("test", HtmlUtils.escapeAttribute("test"));
      Assert.assertEquals("&apos;test&apos;", HtmlUtils.escapeAttribute("\'test\'"));
      Assert.assertEquals("&quot;test&quot;", HtmlUtils.escapeAttribute("\"test\""));
    }
test_case.class_method_signature: HtmlUtilsTest.escapeAttribute()
test_case.full_signature: @Test public void escapeAttribute()
test_case.identifier: escapeAttribute
test_case.invocations: assertEquals escapeAttribute assertEquals escapeAttribute assertEquals escapeAttribute assertEquals escapeAttribute assertEquals escapeAttribute
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void escapeAttribute()
focal_class.file: common/src/main/java/org/keycloak/common/util/HtmlUtils.java
focal_class.identifier: HtmlUtils
focal_class.class_method_signature: HtmlUtils.escapeAttribute(String value)
focal_class.full_signature: public static String escapeAttribute(String value)
focal_class.identifier: escapeAttribute
focal_class.modifiers: public static
focal_class.parameters: (String value)
focal_class.return: String
focal_class.signature: String escapeAttribute(String value)
focal_method.body: public static String escapeAttribute(String value) {
          StringBuilder escaped = new StringBuilder();
  
          for (int i = 0; i < value.length(); i++) {
              char chr = value.charAt(i);
  
              if (chr == '<') {
                  escaped.append("&lt;");
              } else if (chr == '>') {
                  escaped.append("&gt;");
              } else if (chr == '"') {
                  escaped.append("&quot;");
              } else if (chr == '\'') {
                  escaped.append("&apos;");
              } else if (chr == '&') {
                  escaped.append("&amp;");
              } else {
                  escaped.append(chr);
              }
          }
  
          return escaped.toString();
      }
focal_method.class_method_signature: HtmlUtils.escapeAttribute(String value)
focal_method.full_signature: public static String escapeAttribute(String value)
focal_method.identifier: escapeAttribute
focal_method.invocations: length charAt append append append append append append toString
focal_method.modifiers: public static
focal_method.parameters: (String value)
focal_method.return: String
focal_method.signature: String escapeAttribute(String value)