Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PJF plugin supports the new PLUGIN_DIR/lib/*.jar structure #617

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

carterkozak
Copy link
Contributor

previous intellij versions used PLUGIN_DIR/impl/*.jar

Before this PR

Caused by: java.lang.RuntimeException: Couldn't list dir: /home/ckozak/.local/share/JetBrains/IntelliJIdea2021.3/palantir-java-format/impl
	at com.palantir.javaformat.intellij.FormatterProvider.listDirAsUrlsUnchecked(FormatterProvider.java:159)
	at com.palantir.javaformat.intellij.FormatterProvider.getBundledImplementationUrls(FormatterProvider.java:88)
	at com.palantir.javaformat.intellij.FormatterProvider.getImplementationUrls(FormatterProvider.java:95)
	at com.palantir.javaformat.intellij.FormatterProvider.createFormatter(FormatterProvider.java:64)
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:197)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$13(BoundedLocalCache.java:2451)
	at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2449)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2432)
	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:107)
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:57)
	at com.palantir.javaformat.intellij.FormatterProvider.get(FormatterProvider.java:54)
	at com.palantir.javaformat.intellij.PalantirCodeStyleManager.format(PalantirCodeStyleManager.java:195)
	at com.palantir.javaformat.intellij.PalantirCodeStyleManager.formatInternal(PalantirCodeStyleManager.java:184)
	at com.palantir.javaformat.intellij.PalantirCodeStyleManager.reformatText(PalantirCodeStyleManager.java:118)
	at com.intellij.codeInsight.actions.ReformatCodeProcessor.lambda$doReformat$5(ReformatCodeProcessor.java:196)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:147)
	at com.intellij.codeInsight.actions.ReformatCodeProcessor.lambda$doReformat$6(ReformatCodeProcessor.java:186)
	at com.intellij.openapi.editor.ex.util.EditorScrollingPositionKeeper.perform(EditorScrollingPositionKeeper.java:100)
	at com.intellij.codeInsight.actions.ReformatCodeProcessor.doReformat(ReformatCodeProcessor.java:186)
	at com.intellij.codeInsight.actions.ReformatCodeProcessor.lambda$prepareTask$2(ReformatCodeProcessor.java:134)
	at com.intellij.application.options.CodeStyle.doWithTemporarySettings(CodeStyle.java:338)
	at com.intellij.codeInsight.actions.ReformatCodeProcessor.lambda$prepareTask$3(ReformatCodeProcessor.java:130)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ProcessingTask.lambda$performFileProcessing$5(AbstractLayoutCodeProcessor.java:441)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:150)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:947)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:148)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:210)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:184)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:157)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:124)
	at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ProcessingTask.lambda$performFileProcessing$6(AbstractLayoutCodeProcessor.java:441)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:437)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:455)
	at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ProcessingTask.performFileProcessing(AbstractLayoutCodeProcessor.java:436)
	... 99 more
Caused by: java.nio.file.NoSuchFileException: /home/ckozak/.local/share/JetBrains/IntelliJIdea2021.3/palantir-java-format/impl
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:432)
	at java.base/java.nio.file.Files.newDirectoryStream(Files.java:472)
	at java.base/java.nio.file.Files.list(Files.java:3774)
	at com.palantir.javaformat.intellij.FormatterProvider.listDirAsUrlsUnchecked(FormatterProvider.java:156)
	... 134 more

After this PR

==COMMIT_MSG==
palantir-java-format intellij plugin supports the new PLUGIN_DIR/lib/*.jar structure in addition to the old PLUGIN_DIR/impl/*.jar location
==COMMIT_MSG==

Possible downsides?

Hard to test.

previous intellij versions used `PLUGIN_DIR/impl/*.jar`
@changelog-app
Copy link

changelog-app bot commented Jan 11, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

palantir-java-format intellij plugin supports the new PLUGIN_DIR/lib/*.jar structure in addition to the old PLUGIN_DIR/impl/*.jar location

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from CRogers January 11, 2022 22:46
@bulldozer-bot bulldozer-bot bot merged commit ebbe0b1 into develop Jan 11, 2022
@bulldozer-bot bulldozer-bot bot deleted the ckozak/ide_error branch January 11, 2022 22:55
carterkozak added a commit that referenced this pull request Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants