# Unit 4: Abstrat Art Issue

**URL:** <https://forum.code.org/t/unit-4-abstrat-art-issue/40236>\
**Category:** CSA\
**Tags:** csa-unit-4\
**Created:** [December 13, 2024, 6:31pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236 "2024-12-13T18:31:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff.rhodes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jeff.rhodes/32/7758_2.png) [@jeff.rhodes](https://forum.code.org/u/jeff.rhodes)\
**Post date:** [December 13, 2024, 6:31pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/1 "2024-12-13T18:31:20Z")

</div>

I am having an issue with the filer reader.

I am copying code directly from the multi selection unit and just changing the names. Even when I copy and paste code that works in from a previous lesson, it won’t work in the lesson. I am at a loss, any help would be appreciated. Super simple project below:

> **[New Java Lab Project - Code.org](https://studio.code.org/projects/javalab/_8g4Km43mDHddCkjvgbu0on-MG_3n2QACXbyBIKKJ0o)**
>
> Anyone can learn computer science. Make games, apps and art with code.

---

<div class="post-metadata">

**Author:** ![varrience](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/varrience/32/8042_2.png) [@varrience](https://forum.code.org/u/varrience)\
**Post date:** [December 13, 2024, 6:58pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/2 "2024-12-13T18:58:05Z")

</div>

When i was looking through the project i did not see a FileReader.java file which is what i think the main is relying on to extract data from a project, this must be a modified distribution of the class since the original one does not have the method `.toIntArray` in the class perhaps this is the issue? i’m not able to fully troubleshoot if the part of the original codebase is missing

---

<div class="post-metadata">

**Author:** ![jeff.rhodes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jeff.rhodes/32/7758_2.png) [@jeff.rhodes](https://forum.code.org/u/jeff.rhodes)\
**Post date:** [December 13, 2024, 7:34pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/3 "2024-12-13T19:34:00Z")

</div>

This was my fault. For some reason the “sandbox” in that lesson is not working right. Works perfectly fine in the lesson though. Not sure what is going on with that:

Same code, different spot:

> **[New Java Lab Project - Code.org](https://studio.code.org/projects/javalab/_scBBoqpJBKJ-guiD6p1-vzwUj6joXpyFK__n4WewsA)**
>
> Anyone can learn computer science. Make games, apps and art with code.

---

<div class="post-metadata">

**Author:** ![varrience](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/varrience/32/8042_2.png) [@varrience](https://forum.code.org/u/varrience)\
**Post date:** [December 13, 2024, 8:11pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/4 "2024-12-13T20:11:28Z")

</div>

perhaps this is an error on CDO’s hands, i was able to get it running by manually adding in the reader myself and compiling that way but it required a lot more configuring unfortunately so this may be an issue for support

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/8/8c45d31734cb1c674d993dde03ac552ed766b95e.png)  
here’s proof i got it working  
[https://studio.code.org/projects/javalab/x52UloeggFDwsizlbXowdPoQ4X-hmvAtaQph5qK\_UOk/view](https://studio.code.org/projects/javalab/x52UloeggFDwsizlbXowdPoQ4X-hmvAtaQph5qK_UOk/view)  
though the FileReader that was implemented must have more extended methods because the one that i was able to put into the project did not have an effective method of giving back an `int[]` datatype from the ArrayList

Additionally i made my own polyfill for the `.toIntArray` method if anyone is interested

```java
public static int[] toIntArr(String filename) {
      ArrayList<Integer> ints = getIntData(filename);
      int length = ints.size();
      int[] values = new int[length];
      for(int i = 0; i < length; i++) {
          values[i] = ints.get(i);
      }
      return values;
  }

```

i know this solution probably isn’t the most ideal since it’s supposed to be included in the course but i hope this solution helps rectify why it wasn’t working

# Varrience

---

<div class="post-metadata">

**Author:** ![sylvia.wood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/sylvia.wood/32/5622_2.png) [@sylvia.wood](https://forum.code.org/u/sylvia.wood)\
**Post date:** [December 16, 2024, 3:40am UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/5 "2024-12-16T03:40:06Z")

</div>

@jeff.rhodes - Thank you for posting this issue to the forum. I have reported it to the [code.org](http://code.org) support group. I will post an update once I know the issue is resolved and/or being addressed.

---

<div class="post-metadata">

**Author:** ![lindsay.davis](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/lindsay.davis/32/7632_2.png) [@lindsay.davis](https://forum.code.org/u/lindsay.davis)\
**Post date:** [December 16, 2024, 4:38pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/6 "2024-12-16T16:38:32Z")

</div>

Hi @jeff.rhodes ,  
Sylvia will probably hear back more details from [support@code.org](mailto:support@code.org), but my understanding of the FileReader class is that it is a hidden helper class, and will not work on levels that don’t have it loaded into the background.

A work around could be to use the 1 day project lesson for Unit 4 if you wish to also use the theater, or use the 1 day project lesson for Unit 3 if you just want a console.

Best,  
Lindsay

---

<div class="post-metadata">

**Author:** ![erik\_dillaman](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/erik_dillaman/32/7604_2.png) [@erik\_dillaman](https://forum.code.org/u/erik_dillaman)\
**Post date:** [December 17, 2024, 5:26pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/7 "2024-12-17T17:26:30Z")

</div>

Greetings all,

This actually looks to be an issue with the size of one of the integers in the Sales.txt file.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/3/3280f10e1deac6f1ae18346aad9e279c57f0ff3c.jpeg)

Since this number is above the max size of an int in Java, it causes the while() loop to terminate prematurely within FileReader.

While FileReader is technically a helper class (and is hidden by default on many of the levels on which it is used), it can also be included explicitly as a class file within your programs.

Cheers all (and happy holidays!)  
Erik

---

<div class="post-metadata">

**Author:** ![jeff.rhodes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jeff.rhodes/32/7758_2.png) [@jeff.rhodes](https://forum.code.org/u/jeff.rhodes)\
**Post date:** [December 19, 2024, 3:50pm UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/8 "2024-12-19T15:50:14Z")

</div>

Thanks for all your help everyone, I really appreciate it!

---

<div class="post-metadata">

**Author:** ![sylvia.wood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/sylvia.wood/32/5622_2.png) [@sylvia.wood](https://forum.code.org/u/sylvia.wood)\
**Post date:** [December 23, 2024, 3:00am UTC](https://forum.code.org/t/unit-4-abstrat-art-issue/40236/9 "2024-12-23T03:00:33Z")

</div>

@erik_dillaman  
Thanks for posting an update.
