gpt4 book ai didi

java - Eclipse 格式化程序 : How to avoid indentation of method declaration after annotation?

转载 作者:行者123 更新时间:2023-11-30 08:07:47 25 4
gpt4 key购买 nike

我有一个带有注释的方法声明,该注释由 Eclipse Mars 格式化如下:

@Override
void addLoadShiftingConstraints() throws NoSuchDataException {
//method body
}

我不想缩进方法声明:

@Override
void addLoadShiftingConstraints() throws NoSuchDataException {
//method body
}

目前我有以下方法声明的格式化程序设置:

enter image description here右键单击项目 => 属性 => Java 代码样式 => 格式化程序=> 编辑 Activity 配置文件 => LineWrapping => 方法声明 => 声明 => 必要时换行

如果我选择 Do not wrap 选项,不需要的缩进就会消失。但是,我想保留长声明的包装。

这是 Eclipse 错误还是我必须更改注释的其他设置以避免缩进?

最佳答案

这确实是 a bug (related)。解决方法是按照您的描述将设置设置为“不换行”,或者添加访问修饰符,如 private

关于java - Eclipse 格式化程序 : How to avoid indentation of method declaration after annotation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33517913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com