57376

How to avoid warnings when implementing an interface that uses raw types?

I am implementing the IProcessFactory interface that has the following method:

IProcess newProcess(ILaunch launch, Process process, String label, Map attributes);

As you can see it uses the raw Map type. When I implement this method with the same signature Eclipse gives the following warning:

Map is a raw type. References to generic type Map should be parameterized.

Replacing Map with Map<?, ?> gives an error. So what is a proper way to implement such an interface?

Answer1:

So what is a proper way to implement

To the extent of my knowledge you are forced to use raw types in such situations. Indeed Eclipse refers to them as "unavoidable".

How to avoid warnings when implementing an interface that uses raw types?

If you're using Eclipse you can disable these warnings under the Errors/Warnings section in the preferences.

See this answer for further details:

Recommend

  • C++ Parser/Model for Java
  • Building a dynamic query in C# (SQL Injection Attack)
  • Jquery hide first 12 elementes, show next 12 elements
  • How to pass string and dictionary in NUnit test cases?
  • Entity Framework and the raw string query - SQL injection prevention
  • Outlook Com not registered
  • With one EDMX file use multiple connection strings that relate to multiple databases
  • Using Paypal Pro in Omnipay
  • Ant: fileset “dir” attribute with a runtime expanded full path
  • ASP.NET, C# How to Pass a StringQuery to a custom SQL Command
  • What is Closure Compiler?
  • Laravel lmutator $this->attributes return 'Undefined index: id'
  • Pointer vs Reference difference when passing Eigen objects as arguments
  • CSS Grid, position absolute an element in a css grid item: IMPOSSIBLE
  • LNK1104: cannot open file 'kernel32.lib'
  • How to set an entity field that does not exist on the table but does exists in the raw SQL as an ali
  • How to use animated gif in Firemonkey?
  • Count from each distinct date, fill in missing dates with zero
  • how to get data attributes of dynamically generated element
  • Can my PDF ping my server when it is opened?
  • Trying to string.Join an IList
  • Using Generics on right hand side in Java 6?
  • Pycharm: Marking a folder as 'sources root' is not recursive for subfolders
  • ListItem.Attributes.Add not working
  • Django simple Captcha “No module named fields” error
  • Remove final comma from string in vb.net
  • How to change the font size of a single index for UISegmentedControl?
  • How to do unit test for HttpContext.Current.Server.MapPath
  • Sails.js/waterline: Executing waterline queries in toJSON function of a model?
  • C# - Serializing and deserializing static member
  • Bug in WPF DataGrid
  • How to add a column to a Pandas dataframe made of arrays of the n-preceding values of another column
  • Incrementing object id automatically JS constructor (static method and variable)
  • script to move all files from one location to another location
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • How do I configure my settings file to work with unit tests?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Running Map reduces the dimensions of the matrices
  • Binding checkboxes to object values in AngularJs
  • Android Heatmap on canvas or ImageView