prepare for move into community: bundle javaee-coverage to javaee part
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 19 Jun 2014 17:12:53 +0000 (19:12 +0200)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 19 Jun 2014 19:32:46 +0000 (21:32 +0200)
plugins/coverage/coverage.iml
plugins/coverage/src/META-INF/j2ee-plugin.xml [deleted file]
plugins/coverage/src/META-INF/plugin.xml
plugins/coverage/src/com/intellij/coverage/DefaultJ2EEContainerExtension.java [deleted file]

index ba320ba65c310b8b55975b5aa2c1ed8e3c579d2a..4c3abf7edb6162866291209881e62a42bb6ada7a 100644 (file)
@@ -8,8 +8,8 @@
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="coverage-common" exported="" />
-    <orderEntry type="module" module-name="execution-openapi" />
-    <orderEntry type="module" module-name="openapi" />
+    <orderEntry type="module" module-name="execution-openapi" exported="" />
+    <orderEntry type="module" module-name="openapi" exported="" />
     <orderEntry type="module" module-name="execution-impl" />
     <orderEntry type="module" module-name="testRunner" />
     <orderEntry type="module" module-name="idea" />
@@ -30,8 +30,6 @@
     <orderEntry type="library" name="TestNG" level="project" />
     <orderEntry type="module" module-name="ultimate-verifier" />
     <orderEntry type="module" module-name="platform-ultimate" />
-    <orderEntry type="module" module-name="javaee-api" />
-    <orderEntry type="module" module-name="web-openapi" />
     <orderEntry type="library" name="JaCoCo" level="project" />
     <orderEntry type="module" module-name="coverage_rt" />
   </component>
diff --git a/plugins/coverage/src/META-INF/j2ee-plugin.xml b/plugins/coverage/src/META-INF/j2ee-plugin.xml
deleted file mode 100644 (file)
index c0a0a93..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<idea-plugin url="http://www.jetbrains.com/idea">
-  <extensions defaultExtensionNs="com.intellij">
-    <javaCoverageEngineExtension implementation="com.intellij.coverage.DefaultJ2EEContainerExtension"/>
-  </extensions>
-</idea-plugin>
index 51aa05ab5ac2dd1f9a14f92aaae1826e0399aec7..077a6513fd4ea98cad01f9459b4b6eaa754a0bed 100644 (file)
@@ -4,7 +4,6 @@
   <depends optional="true" config-file="junit-integration.xml">JUnit</depends>
   <depends>com.intellij.modules.java</depends>
   <depends>com.intellij.modules.ultimate</depends>
-  <depends optional="true" config-file="j2ee-plugin.xml">com.intellij.javaee</depends>
   <description>
       <![CDATA[
      This plugin supports gathering coverage information and presenting it right in
diff --git a/plugins/coverage/src/com/intellij/coverage/DefaultJ2EEContainerExtension.java b/plugins/coverage/src/com/intellij/coverage/DefaultJ2EEContainerExtension.java
deleted file mode 100644 (file)
index bb6d57e..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.intellij.coverage;
-
-import com.intellij.execution.configurations.RunConfigurationBase;
-import com.intellij.javaee.run.configuration.CommonModel;
-import com.intellij.javaee.web.WebUtil;
-import com.intellij.lang.jsp.JspFileViewProvider;
-import com.intellij.lang.jsp.JspxFileViewProvider;
-import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.psi.FileViewProvider;
-import com.intellij.psi.JavaPsiFacade;
-import com.intellij.psi.PsiClass;
-import com.intellij.psi.PsiFile;
-import com.intellij.psi.jsp.JspFile;
-import com.intellij.psi.jsp.WebDirectoryElement;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.Set;
-
-/**
- * User: anna
- * Date: 2/12/11
- */
-public class DefaultJ2EEContainerExtension extends JavaCoverageEngineExtension {
-
-  @Override
-  public boolean isApplicableTo(@Nullable RunConfigurationBase conf) {
-    return conf instanceof CommonModel && ((CommonModel)conf).isLocal();
-  }
-
-  @Override
-  public boolean suggestQualifiedName(@NotNull final PsiFile sourceFile, final PsiClass[] classes, final Set<String> names) {
-    final FileViewProvider viewProvider = sourceFile.getViewProvider();
-    if (!(viewProvider instanceof JspFileViewProvider || viewProvider instanceof JspxFileViewProvider)) {
-      return false;
-    }
-    final VirtualFile virtualFile = sourceFile.getVirtualFile();
-    if (virtualFile != null) {
-      final WebDirectoryElement webDirectoryElement = WebUtil.findWebDirectoryByFile(virtualFile, sourceFile.getProject());
-      if (webDirectoryElement != null) {
-        final WebDirectoryElement parentDirectory = webDirectoryElement.getParentDirectory();
-        String webRoot = parentDirectory != null ? parentDirectory.getPath() : "/";
-        if (!webRoot.endsWith("/")) {
-          webRoot += "/";
-        }
-        names.add("org.apache.jsp" + makeJavaIdentifier(webRoot + virtualFile.getName(), sourceFile.getProject()));
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Converts the given identifier to a legal Java identifier
-   * {@see org.apache.jasper.compiler.JspUtil}
-   */
-  public static String makeJavaIdentifier(String identifier, Project project) {
-    StringBuffer modifiedIdentifier =
-      new StringBuffer(identifier.length());
-    if (!Character.isJavaIdentifierStart(identifier.charAt(0)) && identifier.charAt(0) != '/') {
-      modifiedIdentifier.append('_');
-    }
-    for (int i = 0; i < identifier.length(); i++) {
-      char ch = identifier.charAt(i);
-      if (ch == '/') {
-        modifiedIdentifier.append('.');
-      }
-      else if (Character.isJavaIdentifierPart(ch) && ch != '_') {
-        modifiedIdentifier.append(ch);
-      } else if (ch == '.') {
-        modifiedIdentifier.append('_');
-      }
-      else {
-        modifiedIdentifier.append(mangleChar(ch));
-      }
-    }
-    if (JavaPsiFacade.getInstance(project).getNameHelper().isKeyword(modifiedIdentifier.toString())) {
-      modifiedIdentifier.append('_');
-    }
-    return modifiedIdentifier.toString();
-  }
-
-  /**
-   * Mangle the specified character to create a legal Java class name.
-   */
-  public static String mangleChar(char ch) {
-    char[] result = new char[5];
-    result[0] = '_';
-    result[1] = Character.forDigit((ch >> 12) & 0xf, 16);
-    result[2] = Character.forDigit((ch >> 8) & 0xf, 16);
-    result[3] = Character.forDigit((ch >> 4) & 0xf, 16);
-    result[4] = Character.forDigit(ch & 0xf, 16);
-    return new String(result);
-  }
-}