Skip to content

I20210714-1800

@sravanlakkimsetti sravanlakkimsetti tagged this 14 Jul 21:57
java.lang.ArrayIndexOutOfBoundsException

Because we add methods and remove duplicate methods during compilation
we end up having holes(missing some index entries) in the synthetic
method bindings sequence. This causes Out of bounds problems when we
depend on synthetic methods count as new index.

Removal of duplicates got added with Record feature.

To fix two changes have been done
1. Reworked sorting of synthetic methods in syntheticMethods() method.
We are directly placing bindings using index. But with missing bindings
in sequence, we end up having AIOOB issue. This sorting algorithm has
been reworked.
2. When we are creating new sythetic methods we are using count of
existing methods as new index. But with removals this is not correct
anymore. Reworked this max index in the existing synthetic methods + 1.


Conflicts:
	org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java

Change-Id: If370e3219420893a67372509f4d3f99b789decbb
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/182667
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Reviewed-by: Manoj Palat <manpalat@in.ibm.com>
Assets 2
Loading