Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix searching of modifiers field for JDK 8-17#408

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.

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

Already on GitHub?Sign in to your account

Merged

Conversation

@sergeypospelov
Copy link
Member

@sergeypospelovsergeypospelov commentedJul 5, 2022
edited
Loading

Description

Changed the way of searchingmodifiers field inReflectionUtil.kt. The suggested change works for JDK 8-17, but doesn't work for JDK 18.

Fixes#374

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

RepeatedTo Reproduce section from the#374:

Steps to reproduce the behavior:

  1. Define JDK-13 as primary (Path, JAVA_HOME)
  2. Download one of the latestCLI from master
  3. For simplicity in the folder where utbot-cli*.jar is located :
    Create ExampleString.java using var (feature introduced in Java 9)
public class ExampleString {    public void stringNewMethod() {        var text = "Hello!\n This is String defined with var";        text = text.toLowerCase();        System.out.println(text);        text = text.toUpperCase();        System.out.println(text);    }}
  1. Compile your files with JDK-13

javac -version

javac ExampleString.class

  1. Run utbot-cli to generate tests for it, like that:

java -jar utbot-cli-2022.7.jar generate --source ExampleString.java --classpath "D:\Current\Java" -o ExampleStringTest.java ExampleString

Tests are generated.

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • Tests that prove my change is effective
  • All tests pass locally with my changes

@sergeypospelovsergeypospelov requested a review fromdtimJuly 5, 2022 07:37
Copy link
Collaborator

@dtimdtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@sergeypospelovsergeypospelov self-assigned thisJul 7, 2022
@sergeypospelovsergeypospelov merged commita92e289 intomainJul 7, 2022
@sergeypospelovsergeypospelov deleted the fix-modifiers-field-search-for-jdk-17 branchJuly 7, 2022 06:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dtimdtimdtim approved these changes

Assignees

@sergeypospelovsergeypospelov

Labels

None yet

Projects

Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

var with JDK 13 - CLI throws "NoSuchFieldException: modifiers"

3 participants

@sergeypospelov@dtim

[8]ページ先頭

©2009-2025 Movatter.jp