prefs's People
prefs's Issues
Eclipse Java フォーマット設定ファイルのデフォルト値が想定と異なる
(本 issue に記載している事象は Eclipse 2021-12 で実行して確認しています。ただしそれより以前のバージョンでも発生しているはずです。)
Eclipse の Java コード整形ルールとして以下のふぃあるを用意しています:
あるとき、 Windows での新規環境構築時に、このファイルを用いてセットアップを行ったところ、従来と異なる挙動を示すようになっているのに気づきました。
public class MyClass {
@Deprecated @SuppressWarnings("all")
public void method() {
}
}
上記のコード例では、アノテーションごとに改行される想定の設定ですが、上記のようにすべてのアノテーションが改行されず1行にまとまってしまいます。
これは Line Wrapping > Wrapping settings > Annotations の設定が Do not wrap になっているからでした。
この設定は 4.18(2020-12) で新しく導入されたもののようで、Eclipseのデフォルト値と設定をインポートしたときのデフォルト値が異なるために発生していると考えられます(これは従来よりしばしば発生している問題です: revelc/formatter-maven-plugin#289 など)。
対応としては、これらの設定について、明示的に Wrap all elements, every elements on a new line 値を与えるようにしました。
Windows では上記の対応で想定通りの挙動になりました。
しかし一方、 Linux 環境新規セットアップで上記対応後の整形ルールファイルをインポートすると、逆に設定が Do not wrap になってしまいました。
Linux では対応前では想定通りの挙動でした。
状況を整理した上で、必要に応じてバグレポートを出す必要があります。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.