Description
The following snippet of code will cause a JVM out of memory error exception.
`
A`.align(Integer.MIN_VALUE);
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.Arrays.copyOf(Arrays.java:3746)
at java.base/java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:169)
at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:535)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:174)
at java.base/java.lang.String.lambda$indent$0(String.java:2847)
at java.base/java.lang.String$$Lambda$30/0x0000000840069840.apply(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.lang.StringLatin1$LinesSpliterator.forEachRemaining(StringLatin1.java:655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at java.base/java.lang.String.indent(String.java:2853)
at java.base/java.lang.String.align(String.java:2971)
at com.company.TestSwitchExpressions.main(TestSwitchExpressions.java:30)
Process finished with exit code 1
`
A`.align(Integer.MIN_VALUE);
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.Arrays.copyOf(Arrays.java:3746)
at java.base/java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:169)
at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:535)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:174)
at java.base/java.lang.String.lambda$indent$0(String.java:2847)
at java.base/java.lang.String$$Lambda$30/0x0000000840069840.apply(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.lang.StringLatin1$LinesSpliterator.forEachRemaining(StringLatin1.java:655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at java.base/java.lang.String.indent(String.java:2853)
at java.base/java.lang.String.align(String.java:2971)
at com.company.TestSwitchExpressions.main(TestSwitchExpressions.java:30)
Process finished with exit code 1