GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added the wrapper for static methods of java.util.List by Damtev · Pull Request #400 · UnitTestBot/UTBotJava

Added the wrapper for static methods of java.util.List #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Damtev merged 1 commit into main from damtev/list_statics_wrapper
Jul 4, 2022

Uh oh!

There was an error while loading. Please reload this page.

Merged

Added the wrapper for static methods of java.util.List #400

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
8ee97b5
Added the wrapper for static methods of java.util.List
Damtev Jul 4, 2022
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

72 changes: 72 additions & 0 deletions 72 utbot-framework/src/main/java/org/utbot/engine/overrides/collections/List.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package org.utbot.engine.overrides.collections;

import org.utbot.api.annotation.UtClassMock;

import java.util.Collection;

@UtClassMock(target = java.util.List.class, internalUsage = true)
public interface List<E> extends java.util.List<E> {
static <E> java.util.List<E> of() {
return new UtArrayList<>();
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1) {
return new UtArrayList<>((E[]) new Object[]{e1});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2) {
return new UtArrayList<>((E[]) new Object[]{e1, e2});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4, E e5) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4, e5});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4, E e5, E e6) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4, e5, e6});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4, e5, e6, e7});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4, e5, e6, e7, e8});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4, e5, e6, e7, e8, e9});
}

@SuppressWarnings("unchecked")
static <E> java.util.List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) {
return new UtArrayList<>((E[]) new Object[]{e1, e2, e3, e4, e5, e6, e7, e8, e9, e10});
}

@SafeVarargs
@SuppressWarnings("varargs")
static <E> java.util.List<E> of(E... elements) {
return new UtArrayList<>(elements);
}

static <E> java.util.List<E> copyOf(Collection<? extends E> collection) {
return new UtArrayList<>(collection);
}
}
8 changes: 8 additions & 0 deletions 8 utbot-framework/src/main/java/org/utbot/engine/overrides/collections/UtArrayList.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ public UtArrayList(Collection<? extends E> c) {
addAll(c);
}

public UtArrayList(E[] data) {
visit(this);
int length = data.length;
elementData = new RangeModifiableUnlimitedArray<>();
elementData.setRange(0, data, 0, length);
elementData.end = length;
}

/**
* Precondition check is called only once by object,
* if it was passed as parameter to method under test.
Expand Down
2 changes: 2 additions & 0 deletions 2 utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/SootUtils.kt
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.utbot.engine.overrides.collections.UtHashSet
import org.utbot.engine.overrides.collections.UtLinkedList
import org.utbot.engine.overrides.UtOverrideMock
import org.utbot.engine.overrides.collections.Collection
import org.utbot.engine.overrides.collections.List
import org.utbot.engine.overrides.collections.UtGenericStorage
import org.utbot.engine.overrides.collections.UtOptional
import org.utbot.engine.overrides.collections.UtOptionalDouble
Expand Down Expand Up @@ -133,6 +134,7 @@ private val classesToLoad = arrayOf(
UtStringBuffer::class,
Stream::class,
Collection::class,
List::class,
UtStream::class,
UtStream.UtStreamIterator::class
)
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.