Unused variables in code

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

Unused variables in code

Александр Меньшиков
Hello, everyone!

I found some unused variables in code. For example:

Unnecessary argument in method
MiniFuture#onResult(ClusterTopologyCheckedException e) in inner class of
GridDhtLockFuture.

There isn't another onResult() method (in super class including) with
another behavior. So argument can be safe delete.

Also I found some ignored exceptions wasn't named "ignored". For example
unused exception was named "e0" in method:

GridDhtTransactionalCacheAdapter#onForceKeysError(UUID, GridDhtLockRequest,
IgniteCheckedException)


So I think i can go through code and cleanup thing like that.

Need I create new issue in JIRA for cleanup or some issue for cleanup
already exists? If that please give me a link.
Reply | Threaded
Open this post in threaded view
|

Re: Unused variables in code

Alexey Kuznetsov
I think it is better to have such issue in JIRA "Minor code cleanup":

1) Cleanup unused imports.
2) Rename e -> ignored
3) Remove unused variables
4)...
5) PROFIT :)

On Tue, Jan 24, 2017 at 9:46 PM, Александр Меньшиков <[hidden email]>
wrote:

> Hello, everyone!
>
> I found some unused variables in code. For example:
>
> Unnecessary argument in method
> MiniFuture#onResult(ClusterTopologyCheckedException e) in inner class of
> GridDhtLockFuture.
>
> There isn't another onResult() method (in super class including) with
> another behavior. So argument can be safe delete.
>
> Also I found some ignored exceptions wasn't named "ignored". For example
> unused exception was named "e0" in method:
>
> GridDhtTransactionalCacheAdapter#onForceKeysError(UUID,
> GridDhtLockRequest,
> IgniteCheckedException)
>
>
> So I think i can go through code and cleanup thing like that.
>
> Need I create new issue in JIRA for cleanup or some issue for cleanup
> already exists? If that please give me a link.
>



--
Alexey Kuznetsov
Reply | Threaded
Open this post in threaded view
|

Re: Unused variables in code

Александр Меньшиков
Okay, I created issue:
https://issues.apache.org/jira/browse/IGNITE-4612


2017-01-24 18:19 GMT+03:00 Alexey Kuznetsov <[hidden email]>:

> I think it is better to have such issue in JIRA "Minor code cleanup":
>
> 1) Cleanup unused imports.
> 2) Rename e -> ignored
> 3) Remove unused variables
> 4)...
> 5) PROFIT :)
>
> On Tue, Jan 24, 2017 at 9:46 PM, Александр Меньшиков <[hidden email]
> >
> wrote:
>
> > Hello, everyone!
> >
> > I found some unused variables in code. For example:
> >
> > Unnecessary argument in method
> > MiniFuture#onResult(ClusterTopologyCheckedException e) in inner class of
> > GridDhtLockFuture.
> >
> > There isn't another onResult() method (in super class including) with
> > another behavior. So argument can be safe delete.
> >
> > Also I found some ignored exceptions wasn't named "ignored". For example
> > unused exception was named "e0" in method:
> >
> > GridDhtTransactionalCacheAdapter#onForceKeysError(UUID,
> > GridDhtLockRequest,
> > IgniteCheckedException)
> >
> >
> > So I think i can go through code and cleanup thing like that.
> >
> > Need I create new issue in JIRA for cleanup or some issue for cleanup
> > already exists? If that please give me a link.
> >
>
>
>
> --
> Alexey Kuznetsov
>
Reply | Threaded
Open this post in threaded view
|

Re: Unused variables in code

Александр Меньшиков
Done.

My PR:
https://github.com/apache/ignite/pull/1466/files
<https://github.com/apache/ignite/pull/1466>



2017-01-25 13:11 GMT+03:00 Александр Меньшиков <[hidden email]>:

> Okay, I created issue:
> https://issues.apache.org/jira/browse/IGNITE-4612
>
>
> 2017-01-24 18:19 GMT+03:00 Alexey Kuznetsov <[hidden email]>:
>
>> I think it is better to have such issue in JIRA "Minor code cleanup":
>>
>> 1) Cleanup unused imports.
>> 2) Rename e -> ignored
>> 3) Remove unused variables
>> 4)...
>> 5) PROFIT :)
>>
>> On Tue, Jan 24, 2017 at 9:46 PM, Александр Меньшиков <
>> [hidden email]>
>> wrote:
>>
>> > Hello, everyone!
>> >
>> > I found some unused variables in code. For example:
>> >
>> > Unnecessary argument in method
>> > MiniFuture#onResult(ClusterTopologyCheckedException e) in inner class
>> of
>> > GridDhtLockFuture.
>> >
>> > There isn't another onResult() method (in super class including) with
>> > another behavior. So argument can be safe delete.
>> >
>> > Also I found some ignored exceptions wasn't named "ignored". For example
>> > unused exception was named "e0" in method:
>> >
>> > GridDhtTransactionalCacheAdapter#onForceKeysError(UUID,
>> > GridDhtLockRequest,
>> > IgniteCheckedException)
>> >
>> >
>> > So I think i can go through code and cleanup thing like that.
>> >
>> > Need I create new issue in JIRA for cleanup or some issue for cleanup
>> > already exists? If that please give me a link.
>> >
>>
>>
>>
>> --
>> Alexey Kuznetsov
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Unused variables in code

Александр Меньшиков
And result of testing:
http://ci.ignite.apache.org/project.html?projectId=IgniteTests&tab=projectOverview&branch_IgniteTests=pull/1466/head

2017-01-30 18:39 GMT+03:00 Александр Меньшиков <[hidden email]>:

> Done.
>
> My PR:
> https://github.com/apache/ignite/pull/1466/files
> <https://github.com/apache/ignite/pull/1466>
>
>
>
>
> 2017-01-25 13:11 GMT+03:00 Александр Меньшиков <[hidden email]>:
>
>> Okay, I created issue:
>> https://issues.apache.org/jira/browse/IGNITE-4612
>>
>>
>> 2017-01-24 18:19 GMT+03:00 Alexey Kuznetsov <[hidden email]>:
>>
>>> I think it is better to have such issue in JIRA "Minor code cleanup":
>>>
>>> 1) Cleanup unused imports.
>>> 2) Rename e -> ignored
>>> 3) Remove unused variables
>>> 4)...
>>> 5) PROFIT :)
>>>
>>> On Tue, Jan 24, 2017 at 9:46 PM, Александр Меньшиков <
>>> [hidden email]>
>>> wrote:
>>>
>>> > Hello, everyone!
>>> >
>>> > I found some unused variables in code. For example:
>>> >
>>> > Unnecessary argument in method
>>> > MiniFuture#onResult(ClusterTopologyCheckedException e) in inner class
>>> of
>>> > GridDhtLockFuture.
>>> >
>>> > There isn't another onResult() method (in super class including) with
>>> > another behavior. So argument can be safe delete.
>>> >
>>> > Also I found some ignored exceptions wasn't named "ignored". For
>>> example
>>> > unused exception was named "e0" in method:
>>> >
>>> > GridDhtTransactionalCacheAdapter#onForceKeysError(UUID,
>>> > GridDhtLockRequest,
>>> > IgniteCheckedException)
>>> >
>>> >
>>> > So I think i can go through code and cleanup thing like that.
>>> >
>>> > Need I create new issue in JIRA for cleanup or some issue for cleanup
>>> > already exists? If that please give me a link.
>>> >
>>>
>>>
>>>
>>> --
>>> Alexey Kuznetsov
>>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Unused variables in code

yzhdanov
Thanks, Alexander! I looked this through and it seems fine to me.

Anton V, can you also review and merge if it is OK to you?

--Yakov

2017-01-31 12:49 GMT+03:00 Александр Меньшиков <[hidden email]>:

> And result of testing:
> http://ci.ignite.apache.org/project.html?projectId=IgniteTests&tab=
> projectOverview&branch_IgniteTests=pull/1466/head
>
> 2017-01-30 18:39 GMT+03:00 Александр Меньшиков <[hidden email]>:
>
> > Done.
> >
> > My PR:
> > https://github.com/apache/ignite/pull/1466/files
> > <https://github.com/apache/ignite/pull/1466>
> >
> >
> >
> >
> > 2017-01-25 13:11 GMT+03:00 Александр Меньшиков <[hidden email]>:
> >
> >> Okay, I created issue:
> >> https://issues.apache.org/jira/browse/IGNITE-4612
> >>
> >>
> >> 2017-01-24 18:19 GMT+03:00 Alexey Kuznetsov <[hidden email]>:
> >>
> >>> I think it is better to have such issue in JIRA "Minor code cleanup":
> >>>
> >>> 1) Cleanup unused imports.
> >>> 2) Rename e -> ignored
> >>> 3) Remove unused variables
> >>> 4)...
> >>> 5) PROFIT :)
> >>>
> >>> On Tue, Jan 24, 2017 at 9:46 PM, Александр Меньшиков <
> >>> [hidden email]>
> >>> wrote:
> >>>
> >>> > Hello, everyone!
> >>> >
> >>> > I found some unused variables in code. For example:
> >>> >
> >>> > Unnecessary argument in method
> >>> > MiniFuture#onResult(ClusterTopologyCheckedException e) in inner
> class
> >>> of
> >>> > GridDhtLockFuture.
> >>> >
> >>> > There isn't another onResult() method (in super class including) with
> >>> > another behavior. So argument can be safe delete.
> >>> >
> >>> > Also I found some ignored exceptions wasn't named "ignored". For
> >>> example
> >>> > unused exception was named "e0" in method:
> >>> >
> >>> > GridDhtTransactionalCacheAdapter#onForceKeysError(UUID,
> >>> > GridDhtLockRequest,
> >>> > IgniteCheckedException)
> >>> >
> >>> >
> >>> > So I think i can go through code and cleanup thing like that.
> >>> >
> >>> > Need I create new issue in JIRA for cleanup or some issue for cleanup
> >>> > already exists? If that please give me a link.
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Alexey Kuznetsov
> >>>
> >>
> >>
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Unused variables in code

Anton Vinogradov
I've checked and merged to master.

On Wed, Feb 1, 2017 at 10:25 AM, Yakov Zhdanov <[hidden email]> wrote:

> Thanks, Alexander! I looked this through and it seems fine to me.
>
> Anton V, can you also review and merge if it is OK to you?
>
> --Yakov
>
> 2017-01-31 12:49 GMT+03:00 Александр Меньшиков <[hidden email]>:
>
> > And result of testing:
> > http://ci.ignite.apache.org/project.html?projectId=IgniteTests&tab=
> > projectOverview&branch_IgniteTests=pull/1466/head
> >
> > 2017-01-30 18:39 GMT+03:00 Александр Меньшиков <[hidden email]>:
> >
> > > Done.
> > >
> > > My PR:
> > > https://github.com/apache/ignite/pull/1466/files
> > > <https://github.com/apache/ignite/pull/1466>
> > >
> > >
> > >
> > >
> > > 2017-01-25 13:11 GMT+03:00 Александр Меньшиков <[hidden email]>:
> > >
> > >> Okay, I created issue:
> > >> https://issues.apache.org/jira/browse/IGNITE-4612
> > >>
> > >>
> > >> 2017-01-24 18:19 GMT+03:00 Alexey Kuznetsov <[hidden email]>:
> > >>
> > >>> I think it is better to have such issue in JIRA "Minor code cleanup":
> > >>>
> > >>> 1) Cleanup unused imports.
> > >>> 2) Rename e -> ignored
> > >>> 3) Remove unused variables
> > >>> 4)...
> > >>> 5) PROFIT :)
> > >>>
> > >>> On Tue, Jan 24, 2017 at 9:46 PM, Александр Меньшиков <
> > >>> [hidden email]>
> > >>> wrote:
> > >>>
> > >>> > Hello, everyone!
> > >>> >
> > >>> > I found some unused variables in code. For example:
> > >>> >
> > >>> > Unnecessary argument in method
> > >>> > MiniFuture#onResult(ClusterTopologyCheckedException e) in inner
> > class
> > >>> of
> > >>> > GridDhtLockFuture.
> > >>> >
> > >>> > There isn't another onResult() method (in super class including)
> with
> > >>> > another behavior. So argument can be safe delete.
> > >>> >
> > >>> > Also I found some ignored exceptions wasn't named "ignored". For
> > >>> example
> > >>> > unused exception was named "e0" in method:
> > >>> >
> > >>> > GridDhtTransactionalCacheAdapter#onForceKeysError(UUID,
> > >>> > GridDhtLockRequest,
> > >>> > IgniteCheckedException)
> > >>> >
> > >>> >
> > >>> > So I think i can go through code and cleanup thing like that.
> > >>> >
> > >>> > Need I create new issue in JIRA for cleanup or some issue for
> cleanup
> > >>> > already exists? If that please give me a link.
> > >>> >
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> Alexey Kuznetsov
> > >>>
> > >>
> > >>
> > >
> >
>