You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Matthias (Jira)" <ji...@apache.org> on 2021/01/23 19:17:00 UTC

[jira] [Commented] (FLINK-21106) google-java-format Intellij Plugin 1.7.0.5 causes UnsupportedOperationException in IntelliJ

    [ https://issues.apache.org/jira/browse/FLINK-21106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270736#comment-17270736 ] 

Matthias commented on FLINK-21106:
----------------------------------

I worked around the issue for now by applying the patch below to the most recent {{google-java-format}} plugin code and build the plugin from source (it essentially reverts [(it essentially reverts [c2c8a51|https://github.com/google/google-java-format/commit/c2c8a517c92fbf3553e53524057cd2ad8ae62962]):
{code:java}
diff --git a/idea_plugin/build.gradle b/idea_plugin/build.gradle
index 6ec1c21..32eb5a0 100644
--- a/idea_plugin/build.gradle
+++ b/idea_plugin/build.gradle
@@ -15,7 +15,7 @@
  */

 plugins {
-  id "org.jetbrains.intellij" version "0.4.22"
+  id "org.jetbrains.intellij" version "0.4.18"
 }

 repositories {
@@ -23,7 +23,7 @@ repositories {
 }

 ext {
-  googleJavaFormatVersion = '1.9'
+  googleJavaFormatVersion = '1.7'
 }

 apply plugin: 'org.jetbrains.intellij'
@@ -37,7 +37,7 @@ intellij {
 patchPluginXml {
   pluginDescription = "Formats source code using the google-java-format tool. This version of " +
                       "the plugin uses version ${googleJavaFormatVersion} of the tool."
-  version = "${googleJavaFormatVersion}.0.0"
+  version = "${googleJavaFormatVersion}.0.5"
   sinceBuild = '201'
   untilBuild = ''
 }
{code}

You can find the patched plugin attached to this Jira issue. [^google-java-format.zip] 

> google-java-format Intellij Plugin 1.7.0.5 causes UnsupportedOperationException in IntelliJ
> -------------------------------------------------------------------------------------------
>
>                 Key: FLINK-21106
>                 URL: https://issues.apache.org/jira/browse/FLINK-21106
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Matthias
>            Priority: Minor
>         Attachments: google-java-format.zip
>
>
> There's a problem with {{google-java-format}} Intellij plugin version {{1.7.0.5}} that causes an {{UnsupportedOperationException}} when creating a new Java class file. Besides the exception, an error dialog pops up and the newly created file is not properly formatted. A simple reformat solves the issue.
> This problem is caused by a bug that got fixed in the {{google-java-format}} plugin's codebase in [45fb41a|https://github.com/google/google-java-format/commit/45fb41a7bac3dfe0726601ceb87d1c17bbf494ec].
> Unfortunately, this fix got released with the plugin version {{1.8.0.1}} which we cannot upgrade to due to our limitations on sticking to Java 8 for now.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)