facebook

Exclude java warnings in generated code

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #315684 Reply

    Hi,

    I am integrating in my project code generated by Axis WSDL2Java. The trouble is that it produces 2 types of warnings: unused variables and dead code. Lots of them. I take warnings seriously and I don’t want genuine warnings lost in a heap of junk warnings. So I want them to go away.

    This code is generated in its own package, so I tried to exclude that from validation. The warnings don’t go away. It seems java compiler warnings are something different from validator warnings.

    So how can I ignore java warnings from one specific directory? I don’t want to move that code to another project. But I can move it to another source folder.

    Thanks in advance.

    #315691 Reply

    support-swapna
    Moderator

    florianfj ,

    Can you please check if the solution discussed in this thread helps you?

    http://stackoverflow.com/questions/3736208/how-to-exclude-a-folder-that-is-producing-warnings-errors-in-an-eclipse-project

    Attached is a screen shot for your reference.

    Let me know how this helps you.

    Attachments:
    You must be logged in to view attached files.
    #315695 Reply

    Configuring the content of the problems pane doesn’t work because I cannot exclude a directory.

    I cannot exclude all Java Problems. The best I could do is to exclude some messages by matching on the error message. But I can only exclude one pattern, so I cannot ignore both types of warnings.

    Anyway, that would suppress these 2 warnings from all my java code, and not all warnings from generated code.

    Deleting the messages works, but only as long as I don’t clean it. This is the best solution so far.

    What I really need is that the “exclude from validation” also excludes compiler warnings from these folders.

    #315742 Reply

    Brian Fernandes
    Moderator

    florianfj,

    I’m afraid we cannot control the Java compiler settings on a directory basis.

    The only solution I can think of, is for you to create another project which you use only for generated code and disable the warnings/errors in this project – have your project depend on this one.

    You may also want to vote on this bug, which, when fixed, will allow you to apply the settings to a specific source folder in your project:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=220928

    Hope this helps.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Exclude java warnings in generated code

You must be logged in to post in the forum log in