Unused TypeInformation parameter in DeltaIteration constructor

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Unused TypeInformation parameter in DeltaIteration constructor

Vasiliki Kalavri
Hey,

the DeltaIteration constructor has a TypeInformation parameter that is not
used:

DeltaIteration(ExecutionEnvironment context, TypeInformation<ST> type,
DataSet<ST> solutionSet, DataSet<WT> workset, Keys<ST> keys, int
maxIterations) {
initialSolutionSet = solutionSet;
initialWorkset = workset;
solutionSetPlaceholder = new SolutionSetPlaceHolder<ST>(context,
solutionSet.getType(), this);
worksetPlaceholder = new WorksetPlaceHolder<WT>(context, workset.getType());
this.keys = keys;
this.maxIterations = maxIterations;
}

The solution set and workset types are set separately, so I guess this is a
leftover parameter because of some copy-paste? Or was it meant to be used
somewhere else?

Cheers,
V.
Reply | Threaded
Open this post in threaded view
|

Re: Unused TypeInformation parameter in DeltaIteration constructor

Stephan Ewen
I think you are right, it is a copy/paste artifact. Since the "type" and
"solutionSet.getType()" are identical, it is redundant.
Reply | Threaded
Open this post in threaded view
|

Re: Unused TypeInformation parameter in DeltaIteration constructor

Vasiliki Kalavri
Hey,

I didn't know, but apparently there is an option in Eclipse under
"Preferences -> Java -> Compiler -> Errors/Warnings -> Unnecessary code"
that can be activated to show a warning for unused parameters. I guess
there are similar tools for other IDEs.

I activated this and it seems that there are several other similar cases of
unused parameters in the code. Some of them look like methods that haven't
been implemented yet, others are just overrides, others seem to be similar
copy-paste cases and some are not that clear with a quick look.
Shall we carefully go through all cases and fix the ones that need fixing?

Cheers,
V.


On 17 June 2014 22:10, Stephan Ewen <[hidden email]> wrote:

> I think you are right, it is a copy/paste artifact. Since the "type" and
> "solutionSet.getType()" are identical, it is redundant.
>
Reply | Threaded
Open this post in threaded view
|

Re: Unused TypeInformation parameter in DeltaIteration constructor

Ufuk Celebi

On 18 Jun 2014, at 11:19, Vasiliki Kalavri <[hidden email]> wrote:

> Hey,
>
> I didn't know, but apparently there is an option in Eclipse under
> "Preferences -> Java -> Compiler -> Errors/Warnings -> Unnecessary code"
> that can be activated to show a warning for unused parameters. I guess
> there are similar tools for other IDEs.

We might consider adding such a check to our Maven checkstyle plugin.
Reply | Threaded
Open this post in threaded view
|

Re: Unused TypeInformation parameter in DeltaIteration constructor

Robert Metzger
I could not find such a checkstyle plugin. (They once had one but its not
maintained anymore)



On Wed, Jun 18, 2014 at 11:24 AM, Ufuk Celebi <[hidden email]> wrote:

>
> On 18 Jun 2014, at 11:19, Vasiliki Kalavri <[hidden email]>
> wrote:
>
> > Hey,
> >
> > I didn't know, but apparently there is an option in Eclipse under
> > "Preferences -> Java -> Compiler -> Errors/Warnings -> Unnecessary code"
> > that can be activated to show a warning for unused parameters. I guess
> > there are similar tools for other IDEs.
>
> We might consider adding such a check to our Maven checkstyle plugin.
>