test_class.declarator: DESCRIPTOR = new PropertyDescriptor()
test_class.modifier: private static final
test_class.original_string: private static final PropertyDescriptor DESCRIPTOR = new PropertyDescriptor();
test_class.type: PropertyDescriptor
test_class.var_name: DESCRIPTOR
test_class.file: efm/efm-flow-designer/efm-flow-designer-framework/src/test/java/com/cloudera/cem/efm/validation/TestExpressionLanguageUtil.java
test_class.identifier: TestExpressionLanguageUtil
test_case.body: @Test
      public void testIsExpressionLanguagePresent() {
          assertTrue(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${value}"));
          assertTrue(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${myFunction()}"));
          assertTrue(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${attr:chained():function()}"));
          assertTrue(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${}"));
          assertTrue(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "$ ${var}"));
  
          assertFalse(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${"));
          assertFalse(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "$${var}"));
          assertFalse(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "plain value"));
          assertFalse(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "plain"));
          assertFalse(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${'}'"));
          assertFalse(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${'}"));
  
          assertTrue(ExpressionLanguageUtil.isExpressionLanguagePresent(DESCRIPTOR, "${\"'\"}"));
      }
test_case.class_method_signature: TestExpressionLanguageUtil.testIsExpressionLanguagePresent()
test_case.full_signature: @Test public void testIsExpressionLanguagePresent()
test_case.identifier: testIsExpressionLanguagePresent
test_case.invocations: assertTrue isExpressionLanguagePresent assertTrue isExpressionLanguagePresent assertTrue isExpressionLanguagePresent assertTrue isExpressionLanguagePresent assertTrue isExpressionLanguagePresent assertFalse isExpressionLanguagePresent assertFalse isExpressionLanguagePresent assertFalse isExpressionLanguagePresent assertFalse isExpressionLanguagePresent assertFalse isExpressionLanguagePresent assertFalse isExpressionLanguagePresent assertTrue isExpressionLanguagePresent
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsExpressionLanguagePresent()
focal_class.file: efm/efm-flow-designer/efm-flow-designer-framework/src/main/java/com/cloudera/cem/efm/validation/ExpressionLanguageUtil.java
focal_class.identifier: ExpressionLanguageUtil
focal_class.class_method_signature: ExpressionLanguageUtil.isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value)
focal_class.full_signature: public static boolean isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value)
focal_class.identifier: isExpressionLanguagePresent
focal_class.modifiers: public static
focal_class.parameters: (final PropertyDescriptor descriptor, final String value)
focal_class.return: boolean
focal_class.signature: boolean isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value)
focal_class.class_method_signature: ExpressionLanguageUtil.findEndQuoteChar(final String value, final int quoteStart)
focal_class.full_signature: private static int findEndQuoteChar(final String value, final int quoteStart)
focal_class.identifier: findEndQuoteChar
focal_class.modifiers: private static
focal_class.parameters: (final String value, final int quoteStart)
focal_class.return: int
focal_class.signature: int findEndQuoteChar(final String value, final int quoteStart)
focal_method.body: public static boolean isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value) {
          final ExpressionLanguageScope scope = descriptor.getExpressionLanguageScope();
          if (scope == null || scope == ExpressionLanguageScope.NONE) {
              return false;
          }
  
          char lastChar = 0;
          int embeddedCount = 0;
          int expressionStart = -1;
          boolean oddDollarCount = false;
          int backslashCount = 0;
  
          for (int i = 0; i < value.length(); i++) {
              final char c = value.charAt(i);
  
              if (expressionStart > -1 && (c == '\'' || c == '"') && (lastChar != '\\' || backslashCount % 2 == 0)) {
                  final int endQuoteIndex = findEndQuoteChar(value, i);
                  if (endQuoteIndex < 0) {
                      break;
                  }
  
                  i = endQuoteIndex;
                  continue;
              }
  
              if (c == '{') {
                  if (oddDollarCount && lastChar == '$') {
                      if (embeddedCount == 0) {
                          expressionStart = i - 1;
                      }
                  }
  
                  // Keep track of the number of opening curly braces that we are embedded within,
                  // if we are within an Expression. If we are outside of an Expression, we can just ignore
                  // curly braces. This allows us to ignore the first character if the value is something
                  // like: { ${abc} }
                  // However, we will count the curly braces if we have something like: ${ $${abc} }
                  if (expressionStart > -1) {
                      embeddedCount++;
                  }
              } else if (c == '}') {
                  if (embeddedCount <= 0) {
                      continue;
                  }
  
                  if (--embeddedCount == 0) {
                      if (expressionStart > -1) {
                          // ended expression. EL is present
                          return true;
                      }
  
                      expressionStart = -1;
                  }
              } else if (c == '$') {
                  oddDollarCount = !oddDollarCount;
              } else if (c == '\\') {
                  backslashCount++;
              } else {
                  oddDollarCount = false;
              }
  
              lastChar = c;
          }
  
          return false;
      }
focal_method.class_method_signature: ExpressionLanguageUtil.isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value)
focal_method.full_signature: public static boolean isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value)
focal_method.identifier: isExpressionLanguagePresent
focal_method.invocations: getExpressionLanguageScope length charAt findEndQuoteChar
focal_method.modifiers: public static
focal_method.parameters: (final PropertyDescriptor descriptor, final String value)
focal_method.return: boolean
focal_method.signature: boolean isExpressionLanguagePresent(final PropertyDescriptor descriptor, final String value)