Cosium / git-code-format-maven-plugin

A maven plugin that automatically deploys code formatters as pre-commit git hook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

on-precommit fails if source uses new instanceof pattern.

anoopvarma opened this issue · comments

What steps will reproduce the problem?
Steps to reproduce the behavior:

  1. Write a code using new instanceof pattern matching.
  2. Try to commit the code.
  3. The precommit hook will throw formatterexception.

What is the expected output?

It should get committed without any issue.

What happens instead?

precommit hook throws exception.

Environment:

  • OS: Windows 11
  • Git version: 2.40.1.windows.1
  • git-code-format-maven-plugin version: 4.2
  • Maven version: 3.9.1

I don’t know what you call « new instanceof pattern matching »

pre-commits uses the system's default JDK. Make sure JAVA_HOME env variable is bound to a JDK 16+.