@@ -72,7 +72,7 @@ private static class DefaultsHolder {
7272 /**
7373 * Produces the default configurable id for the configurables that didn't override it, produced by {@link CodeStyleSettingsProvider}.
7474 */
75- public static String generateConfigurableIdByLanguage (@ NotNull Language language ) {
75+ public static @ NotNull String generateConfigurableIdByLanguage (@ NotNull Language language ) {
7676 return "preferences.sourceCode." + language .getID ();
7777 }
7878
@@ -176,7 +176,7 @@ private void copyCustomSettingsFrom(@NotNull CodeStyleSettings from) {
176176 myRepeatAnnotations .addAll (from .myRepeatAnnotations );
177177 }
178178
179- public void copyFrom (CodeStyleSettings from ) {
179+ public void copyFrom (@ NotNull CodeStyleSettings from ) {
180180 CommonCodeStyleSettings .copyPublicFields (from , this );
181181 OTHER_INDENT_OPTIONS .copyFrom (from .OTHER_INDENT_OPTIONS );
182182 mySoftMargins .setValues (from .getDefaultSoftMargins ());
@@ -273,13 +273,13 @@ public String getLineSeparator() {
273273
274274 /** @deprecated Use {@link com.intellij.psi.codeStyle.JavaCodeStyleSettings#getRepeatAnnotations()} */
275275 @ Deprecated (forRemoval = true )
276- public List <String > getRepeatAnnotations () {
276+ public @ NotNull List <String > getRepeatAnnotations () {
277277 return myRepeatAnnotations ;
278278 }
279279
280280 /** @deprecated Use {@link com.intellij.psi.codeStyle.JavaCodeStyleSettings#setRepeatAnnotations(List)} */
281281 @ Deprecated (forRemoval = true )
282- public void setRepeatAnnotations (List <String > repeatAnnotations ) {
282+ public void setRepeatAnnotations (@ NotNull List <String > repeatAnnotations ) {
283283 myRepeatAnnotations .clear ();
284284 myRepeatAnnotations .addAll (repeatAnnotations );
285285 }
@@ -412,14 +412,14 @@ public void setUseFqClassNames(boolean value) {
412412 /** @deprecated Use {@link com.intellij.psi.codeStyle.JavaCodeStyleSettings#getImportLayoutTable()} */
413413 @ Deprecated
414414 @ Override
415- public PackageEntryTable getImportLayoutTable () {
415+ public @ NotNull PackageEntryTable getImportLayoutTable () {
416416 return IMPORT_LAYOUT_TABLE ;
417417 }
418418
419419 /** @deprecated Use {@link com.intellij.psi.codeStyle.JavaCodeStyleSettings#getPackagesToUseImportOnDemand()} */
420420 @ Deprecated
421421 @ Override
422- public PackageEntryTable getPackagesToUseImportOnDemand () {
422+ public @ NotNull PackageEntryTable getPackagesToUseImportOnDemand () {
423423 return PACKAGES_TO_USE_IMPORT_ON_DEMAND ;
424424 }
425425
@@ -550,7 +550,7 @@ private static int getVersion(@NotNull Element element) {
550550 }
551551
552552 @ Override
553- public void readExternal (Element element ) throws InvalidDataException {
553+ public void readExternal (@ NotNull Element element ) throws InvalidDataException {
554554 myVersion = getVersion (element );
555555 myCustomCodeStyleSettingsManager .notifySettingsBeforeLoading ();
556556 myStoredOptions .processOptions (element );
@@ -609,7 +609,7 @@ public void readExternal(Element element) throws InvalidDataException {
609609 }
610610
611611 @ Override
612- public void writeExternal (Element element ) throws WriteExternalException {
612+ public void writeExternal (@ NotNull Element element ) throws WriteExternalException {
613613 setVersion (element , myVersion );
614614 CodeStyleSettings defaultSettings = new CodeStyleSettings (true , false );
615615 DefaultJDOMExternalizer .write (this , element , myStoredOptions .createDiffFilter (this , defaultSettings ));
@@ -641,7 +641,7 @@ public void writeExternal(Element element) throws WriteExternalException {
641641 }
642642 }
643643
644- private static IndentOptions getDefaultIndentOptions (FileType fileType ) {
644+ private static @ NotNull IndentOptions getDefaultIndentOptions (@ NotNull FileType fileType ) {
645645 for (final FileTypeIndentOptionsFactory factory : CodeStyleSettingsService .getInstance ().getFileTypeIndentOptionsFactories ()) {
646646 if (factory .getFileType ().equals (fileType )) {
647647 return getFileTypeIndentOptions (factory );
@@ -858,7 +858,7 @@ void unregisterAdditionalIndentOptions(@NotNull FileType fileType) {
858858 }
859859 }
860860
861- private static IndentOptions getFileTypeIndentOptions (@ NotNull FileTypeIndentOptionsFactory factory ) {
861+ private static @ NotNull IndentOptions getFileTypeIndentOptions (@ NotNull FileTypeIndentOptionsFactory factory ) {
862862 try {
863863 return factory .createIndentOptions ();
864864 }
@@ -931,7 +931,7 @@ public boolean isBinary() {
931931 * @return Language-specific code style settings or shared settings if not found.
932932 * @see CommonCodeStyleSettingsManager#getCommonSettings
933933 */
934- public CommonCodeStyleSettings getCommonSettings (String langName ) {
934+ public @ NotNull CommonCodeStyleSettings getCommonSettings (@ NotNull String langName ) {
935935 return myCommonSettingsManager .getCommonSettings (langName );
936936 }
937937
@@ -1008,16 +1008,15 @@ public boolean isWrapOnTyping(@Nullable Language language) {
10081008 }
10091009
10101010 public enum WrapStyle implements PresentableEnum {
1011-
10121011 DO_NOT_WRAP (CommonCodeStyleSettings .DO_NOT_WRAP , CodeStyleBundle .messagePointer ("wrapping.do.not.wrap" )),
10131012 WRAP_AS_NEEDED (CommonCodeStyleSettings .WRAP_AS_NEEDED , CodeStyleBundle .messagePointer ("wrapping.wrap.if.long" )),
10141013 WRAP_ON_EVERY_ITEM (CommonCodeStyleSettings .WRAP_ON_EVERY_ITEM , CodeStyleBundle .messagePointer ("wrapping.chop.down.if.long" )),
10151014 WRAP_ALWAYS (CommonCodeStyleSettings .WRAP_ALWAYS , CodeStyleBundle .messagePointer ("wrapping.wrap.always" ));
10161015
10171016 private final int myId ;
1018- private final Supplier <@ Label String > myDescription ;
1017+ private final @ NotNull Supplier <@ Label String > myDescription ;
10191018
1020- WrapStyle (int id , @ NotNull Supplier <@ Label String > description ) {
1019+ WrapStyle (int id , @ NotNull Supplier <@ Label @ NotNull String > description ) {
10211020 myId = id ;
10221021 myDescription = description ;
10231022 }
@@ -1026,7 +1025,7 @@ public int getId() {
10261025 return myId ;
10271026 }
10281027
1029- @ Override public @ Label String getPresentableText () {
1028+ @ Override public @ Label @ NotNull String getPresentableText () {
10301029 return myDescription .get ();
10311030 }
10321031
@@ -1052,7 +1051,7 @@ public enum HtmlTagNewLineStyle implements PresentableEnum {
10521051 private final String myValue ;
10531052 private final Supplier <@ Label String > myDescription ;
10541053
1055- HtmlTagNewLineStyle (@ NotNull String value , @ NotNull Supplier <@ Label String > description ) {
1054+ HtmlTagNewLineStyle (@ NotNull String value , @ NotNull Supplier <@ Label @ NotNull String > description ) {
10561055 myValue = value ;
10571056 myDescription = description ;
10581057 }
@@ -1062,7 +1061,7 @@ public String toString() {
10621061 return myValue ;
10631062 }
10641063
1065- @ Override public @ Label String getPresentableText () {
1064+ @ Override public @ Label @ NotNull String getPresentableText () {
10661065 return myDescription .get ();
10671066 }
10681067 }
@@ -1075,12 +1074,12 @@ public enum QuoteStyle implements PresentableEnum {
10751074 public final String quote ;
10761075 private final Supplier <@ Label String > myDescription ;
10771076
1078- QuoteStyle (@ NotNull String quote , @ NotNull Supplier <@ Label String > description ) {
1077+ QuoteStyle (@ NotNull String quote , @ NotNull Supplier <@ Label @ NotNull String > description ) {
10791078 this .quote = quote ;
10801079 myDescription = description ;
10811080 }
10821081
1083- @ Override public @ Label String getPresentableText () {
1082+ @ Override public @ Label @ NotNull String getPresentableText () {
10841083 return myDescription .get ();
10851084 }
10861085 }
@@ -1152,7 +1151,7 @@ public int getVersion() {
11521151 * @param language The language to set soft margins for.
11531152 * @param softMargins The soft margins to set.
11541153 */
1155- public void setSoftMargins (@ NotNull Language language , List <Integer > softMargins ) {
1154+ public void setSoftMargins (@ NotNull Language language , @ NotNull List <Integer > softMargins ) {
11561155 CommonCodeStyleSettings languageSettings = myCommonSettingsManager .getCommonSettings (language );
11571156 assert languageSettings != null : "Settings for language " + language .getDisplayName () + " do not exist" ;
11581157 languageSettings .setSoftMargins (softMargins );
@@ -1169,15 +1168,15 @@ public void setSoftMargins(@NotNull Language language, List<Integer> softMargins
11691168 * Sets the default soft margins used for languages not defining them explicitly.
11701169 * @param softMargins The default soft margins.
11711170 */
1172- public void setDefaultSoftMargins (List <Integer > softMargins ) {
1171+ public void setDefaultSoftMargins (@ NotNull List <Integer > softMargins ) {
11731172 mySoftMargins .setValues (softMargins );
11741173 }
11751174
11761175 public @ NotNull ExcludedFiles getExcludedFiles () {
11771176 return myExcludedFiles ;
11781177 }
11791178
1180- public SimpleModificationTracker getModificationTracker () {
1179+ public @ NotNull SimpleModificationTracker getModificationTracker () {
11811180 return myModificationTracker ;
11821181 }
11831182
@@ -1201,8 +1200,8 @@ public void registerCustomSettings(@NotNull CustomCodeStyleSettingsFactory facto
12011200 myCustomCodeStyleSettingsManager .registerCustomSettings (this , factory );
12021201 }
12031202
1203+ @ NotNull
12041204 CustomCodeStyleSettingsManager getCustomCodeStyleSettingsManager () {
12051205 return myCustomCodeStyleSettingsManager ;
12061206 }
1207-
12081207}
0 commit comments