Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immutable.java:38-40: Introduce an Immutable wrapper for... #1219

Closed
0pdd opened this issue Nov 3, 2019 · 19 comments
Closed

Immutable.java:38-40: Introduce an Immutable wrapper for... #1219

0pdd opened this issue Nov 3, 2019 · 19 comments

Comments

@0pdd
Copy link
Collaborator

0pdd commented Nov 3, 2019

The puzzle 898-fb66ac0b from #898 has to be resolved:

* @todo #898:30min Introduce an Immutable wrapper for {@link ListIterator}
* and use it in listIterator() methods instead of {@link ListIteratorOf}.
* One another option is renaming of {@link ListIteratorOf}.

The puzzle was created by @fanifieiev on 28-Oct-19.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

@0crat
Copy link
Collaborator

0crat commented Nov 3, 2019

@paulodamaso/z please, pay attention to this issue

@0crat
Copy link
Collaborator

0crat commented Nov 3, 2019

Job #1219 is now in scope, role is DEV

@0crat 0crat added the scope label Nov 3, 2019
@0crat
Copy link
Collaborator

0crat commented Nov 3, 2019

The job #1219 assigned to @fanifieiev/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

@fanifieiev
Copy link
Contributor

fanifieiev commented Nov 5, 2019

@victornoel @iakunin @paulodamaso
Guys, I have a question to you:
The test class ListEnvelopeTest contains some tests:

  1. ListEnvelopeTest.java#L142
  2. ListEnvelopeTest.java#L59
  3. ListEnvelopeTest.java#L92
    The all use ListIterator.set method to successfully change the iterator, but the StringList class they use is based on Immutable list, so ListIterator.set operation IMHO should not be allowed here.
    Moreover, if that test passes, then it basically means that Immutable class is not actually immutable.
    My question is: why do those tests were written in a way to accept the ListIterator.set operation?

@iakunin
Copy link
Contributor

iakunin commented Nov 5, 2019

@fanifieiev there is a todo just above the class and there is a corresponding issue: #1217

This test should be rewritten without using Immutable decorator.

By the way:

in these cases set() called on the iterator not on the ListEnvelope (Immutable decorator).

Also there is a test exactly about immutability of Immutable decorator:

@fanifieiev
Copy link
Contributor

fanifieiev commented Nov 5, 2019

@fanifieiev there is a todo just above the class and there is a corresponding issue: #1217

This test should be rewritten without using Immutable decorator.

By the way:

in these cases set() called on the iterator not on the ListEnvelope (Immutable decorator).

Also there is a test exactly about immutability of Immutable decorator:

@iakunin,
IMHO, the org.cactoos.list.Immutable
is broken, it is not completely immutable. It looks more like a decorator to restrict mutable methods.
For instance,

  1. The subList method should result in returning an immutable list as well;
  2. Also, please have a look at the issue
    Immutable list is not really immutable

PS: Regarding the above tests you mentioned

@fanifieiev
Copy link
Contributor

fanifieiev commented Nov 5, 2019

@iakunin
I was actually more concerned about the following tests:

  1. ListEnvelopeTest.java#L142
  2. ListEnvelopeTest.java#L59
  3. ListEnvelopeTest.java#L92

Why do the TESTS allow mutations for listIterator returned from immutable list?
The tests IMHO are broken, they are invalid.

@iakunin
Copy link
Contributor

iakunin commented Nov 6, 2019

@fanifieiev you can always create an issue and suggest your changes in it.

@victornoel
Copy link
Collaborator

@fanifieiev don't bother too much about ListEnvelope because #1185 is going to clean this up :)

fanifieiev added a commit to fanifieiev/cactoos that referenced this issue Nov 6, 2019
fanifieiev added a commit to fanifieiev/cactoos that referenced this issue Nov 6, 2019
fanifieiev added a commit to fanifieiev/cactoos that referenced this issue Nov 8, 2019
@0pdd
Copy link
Collaborator Author

0pdd commented Nov 8, 2019

The puzzle 898-fb66ac0b has disappeared from the source code, that's why I closed this issue.

@0pdd
Copy link
Collaborator Author

0pdd commented Nov 8, 2019

@0pdd the puzzle #1230 is still not solved.

@0crat
Copy link
Collaborator

0crat commented Nov 8, 2019

@sereshqua/z please review this job completed by @fanifieiev/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat 0crat removed the scope label Nov 8, 2019
@0crat
Copy link
Collaborator

0crat commented Nov 8, 2019

The job #1219 is now out of scope

@sereshqua
Copy link

@0crat quality good

@0crat
Copy link
Collaborator

0crat commented Nov 9, 2019

Order was finished, quality is "good": +35 point(s) just awarded to @fanifieiev/z

@0crat
Copy link
Collaborator

0crat commented Nov 9, 2019

Quality review completed: +4 point(s) just awarded to @sereshqua/z

@0pdd
Copy link
Collaborator Author

0pdd commented Nov 12, 2019

@0pdd the puzzle #1233 is still not solved; solved: #1230.

@0pdd
Copy link
Collaborator Author

0pdd commented Feb 11, 2020

@0pdd the puzzle #1291 is still not solved; solved: #1230, #1233.

@0pdd
Copy link
Collaborator Author

0pdd commented Feb 27, 2020

@0pdd all 3 puzzles are solved here: #1230, #1233, #1291.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants