Skip to content

Commit f001e37

Browse files
committed
Fixed last review issues
1 parent 8665433 commit f001e37

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

utbot-framework/src/main/java/org/utbot/engine/overrides/stream/UtDoubleStream.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public UtDoubleStream(Double[] data, int startInclusive, int endExclusive) {
7373
* <li> elementData is marked as parameter </li>
7474
* <li> elementData.storage and it's elements are marked as parameters </li>
7575
*/
76-
@SuppressWarnings({"DuplicatedCode"})
76+
@SuppressWarnings("DuplicatedCode")
7777
void preconditionCheck() {
7878
if (alreadyVisited(this)) {
7979
return;
@@ -146,6 +146,8 @@ public DoubleStream map(DoubleUnaryOperator mapper) {
146146
@SuppressWarnings("unchecked")
147147
@Override
148148
public <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper) {
149+
// Here we assume that this mapping does not produce infinite streams
150+
// - otherwise it should always be executed concretely.
149151
preconditionCheckWithClosingStream();
150152

151153
int size = elementData.end;

utbot-framework/src/main/java/org/utbot/engine/overrides/stream/UtIntStream.java

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public IntStream map(IntUnaryOperator mapper) {
147147
@SuppressWarnings("unchecked")
148148
@Override
149149
public <U> Stream<U> mapToObj(IntFunction<? extends U> mapper) {
150+
// Here we assume that this mapping does not produce infinite streams
151+
// - otherwise it should always be executed concretely.
150152
preconditionCheckWithClosingStream();
151153

152154
int size = elementData.end;

utbot-framework/src/main/java/org/utbot/engine/overrides/stream/UtLongStream.java

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public LongStream map(LongUnaryOperator mapper) {
147147
@SuppressWarnings("unchecked")
148148
@Override
149149
public <U> Stream<U> mapToObj(LongFunction<? extends U> mapper) {
150+
// Here we assume that this mapping does not produce infinite streams
151+
// - otherwise it should always be executed concretely.
150152
preconditionCheckWithClosingStream();
151153

152154
int size = elementData.end;

utbot-framework/src/main/kotlin/org/utbot/engine/Resolver.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,11 @@ class Resolver(
813813
// as const or store model.
814814
if (defaultBaseType is PrimType) return null
815815

816-
if (actualType.numDimensions == 0) {
816+
require(!defaultType.isJavaLangObject()) {
817+
"Object type $defaultType is unexpected in fallback to default type"
818+
}
819+
820+
if (defaultType.numDimensions == 0) {
817821
return defaultType
818822
}
819823

0 commit comments

Comments
 (0)