Package com.intellij.psi

Examples of com.intellij.psi.PsiCodeBlock


      for (PsiNameValuePair nameValuePair : psiAnnotation.getParameterList().getAttributes()) {
        annotation.setDeclaredAttributeValue(nameValuePair.getName(), nameValuePair.getValue());
      }
    }

    PsiCodeBlock body = fromMethod.getBody();
    if (null != body) {
      resultMethod.getBody().replace(body);
    }

    return (PsiMethod) CodeStyleManager.getInstance(project).reformat(resultMethod);
View Full Code Here


          compareType(beforeMethod.getReturnType(), afterMethod.getReturnType(), afterMethod);
          compareParams(beforeMethod.getParameterList(), afterMethod.getParameterList());
          compareThrows(beforeMethod.getThrowsList(), afterMethod.getThrowsList(), afterMethod);

          if (shouldCompareCodeBlocks()) {
            final PsiCodeBlock beforeMethodBody = beforeMethod.getBody();
            final PsiCodeBlock afterMethodBody = afterMethod.getBody();
            if (null != beforeMethodBody && null != afterMethodBody) {

              boolean codeBlocksAreEqual = beforeMethodBody.textMatches(afterMethodBody);
              if (!codeBlocksAreEqual) {
                String text1 = beforeMethodBody.getText().replaceAll("\\s+", "");
                String text2 = afterMethodBody.getText().replaceAll("\\s+", "");
                assertEquals("Methods not equal, Method: (" + afterMethod.getName() + ") Class:" + afterClass.getName(), text2, text1);
              }
            } else {
              if (null != afterMethodBody) {
                fail("MethodCodeBlocks is null: Method: (" + beforeMethod.getName() + ") Class:" + beforeClass.getName());
View Full Code Here

TOP

Related Classes of com.intellij.psi.PsiCodeBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.