Giter Site home page Giter Site logo

abductcows / java-bit-array Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 537 KB

The List<Boolean> we deserve

Home Page: https://abductcows.github.io/java-bit-array/

License: Apache License 2.0

Java 60.33% Kotlin 39.67%
java memory-conservation boolean-array arraylist-sucks class performance-optimization bitarray javadoc

java-bit-array's Introduction

Yo

My name is George.

I currently use github for small projects to add to my portfolio. My interests are:

  • Software Engineering
  • Android/Kotlin/Java projects and flings
  • Spring (Boot)
  • Game Development with Unity (still have a lot to learn)
  • Android Compose & Compose Multi-platform

GPGโ€‚gpg --keyserver keys.openpgp.org --recv-keys 5DA3A22B0C08FBAE6ED672DFD4A60EEF7D46E388

java-bit-array's People

Contributors

abductcows avatar alcbrains avatar

Watchers

 avatar

Forkers

alcbrains

java-bit-array's Issues

[BUG-ish] - int overflow in element count possible

Describe the bug
Adding more than Integer.MAX_VALUE elements to the array can and will currently lead to overflow of the elements field. This is in violation of the specification of size() from the List interface:

Returns the number of elements in this list. If this list contains more than 
Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

and will also throw an IndexOutOfBoundsException on plain add(Boolean b) calls due to the negative element count.

To Reproduce
Add Integer.MAX_VALUE + 1 elements in the array and check its size (should be Integer.MIN_VALUE)
Add one more without specifying the index to get the exception.

Expected behavior
Subsequent size() calls should return Integer.MAX_VALUE. And elements probably should not be allowed to overflow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.