5

My situation: we use IntelliJ Idea for Java development. Usually, Idea shows an "unused declaration" for injected fields (annotated with "@Inject"). According to this solution I successfully turned off this warning by modifying "entry point" settings (see full description here: “Variable is never assigned” warning in IntelliJ IDEA can be suppressed only "partially").

Now the question: we persist some Idea setting files in the project code repository so that all developers have equal basic set of fundamental project settings. We now wanted to add this suppressed "@Inject" warning to this settings to be used by all developers by default. But unfortunately, I could not recognize, where this setting is persisted. If i make a diff between settings files from repository (not containing this option) and my local settings from ".idea" directory, I don't recognize any difference, even though in the IDE I see that this setting is effectively applied.

So, in which files should I look into? Where is this setting persisted by IntelliJ Idea so that we can take it over into repository?

1 Answer 1

6

I eventually figured it out on my own by analyzing the difference between my local ".idea" folder (where I have the desired setting) and the folder from directory (which does not). In seems to be stored here:

<project_root>/.idea/misc.xml

There is a new section which is responsible for the option.

<component name="EntryPointsManager">
    <list size="1">
        <item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
    </list>
    <writeAnnotations>
        <writeAnnotation name="javax.inject.Inject" />
    </writeAnnotations>
</component>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.