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 — Disabled NPE checks for non-public library fields by default by Damtev · Pull Request #353 · UnitTestBot/UTBotJava

Conversation

@Damtev

@Damtev Damtev commented Jun 29, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Description

Disable NPE checks for non-public fields from library classes by default, as for final fields.

Fixes #358

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Automated Testing

See org.utbot.examples.stdlib.DateExampleTest

Manual Scenario

Checks #358 description.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@Damtev
Damtev marked this pull request as ready for review June 30, 2022 10:10
@Damtev
Damtev requested review from CaelmBleidd and dtim June 30, 2022 10:10
CaelmBleidd
CaelmBleidd approved these changes Jun 30, 2022
View reviewed changes

@CaelmBleidd CaelmBleidd left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt Resolved

Uh oh!

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

Comment thread utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt Resolved

Uh oh!

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

dtim
dtim approved these changes Jun 30, 2022
View reviewed changes

@dtim dtim left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Seems good.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread docs/SpeculativeFieldNonNullability.md Resolved

Uh oh!

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

@Damtev
Damtev force-pushed the damtev/inaccessible_fields_npe_checks_setting branch 2 times, most recently from e05263e to aeb2a17 Compare July 1, 2022 12:44
@Damtev

Damtev commented Jul 4, 2022

Copy link
Copy Markdown
Member Author

As discussed, defining "trusted" libraries was suggested so we do not check NPE for final/non-public fields in them.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Damtev
Damtev force-pushed the damtev/inaccessible_fields_npe_checks_setting branch from aeb2a17 to 808db1e Compare July 4, 2022 12:53
@Damtev
Damtev requested review from CaelmBleidd and dtim July 4, 2022 16:01
CaelmBleidd
CaelmBleidd approved these changes Jul 4, 2022
View reviewed changes
Comment thread utbot-framework-api/src/main/kotlin/org/utbot/framework/TrustedLibraries.kt Resolved

Uh oh!

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

@Damtev
Damtev force-pushed the damtev/inaccessible_fields_npe_checks_setting branch from 2f36cf6 to 0fcd216 Compare July 4, 2022 16:10
dtim
dtim requested changes Jul 5, 2022
View reviewed changes

@dtim dtim left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The code looks good, but I think that the default set of trusted libraries should be reduced.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread utbot-framework-api/src/main/kotlin/org/utbot/framework/TrustedLibraries.kt Resolved

Uh oh!

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

@Damtev
Damtev force-pushed the damtev/inaccessible_fields_npe_checks_setting branch from 0fcd216 to c8bef4d Compare July 5, 2022 08:55
@Damtev
Damtev enabled auto-merge (squash) July 5, 2022 08:58
dtim
dtim approved these changes Jul 5, 2022
View reviewed changes

@dtim dtim left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
@Damtev
Damtev disabled auto-merge July 5, 2022 09:14
Damtev added 8 commits July 7, 2022 12:17
@Damtev
Disabled NPE checks for non-public fields in non-application classes …
7cf9b50
…by default
@Damtev
Added test
62df0e4
@Damtev
Fixed rebasing error
3308cf1
@Damtev
Added docs
603aff9
@Damtev
Enabled reflection for ContestEstimator
0644c98
@Damtev
Fixed review issues
4526d3b
@Damtev
Added trusted libraries scope
98c2dda
@Damtev
Used only JDK as a default trusted library
be48844
@Damtev
Damtev force-pushed the damtev/inaccessible_fields_npe_checks_setting branch from c8bef4d to be48844 Compare July 7, 2022 09:17
@Damtev
Damtev enabled auto-merge (squash) July 7, 2022 10:17
@Damtev
Damtev merged commit fe0f7f8 into main Jul 7, 2022
@Damtev
Damtev deleted the damtev/inaccessible_fields_npe_checks_setting branch July 7, 2022 11:19
rudolf101 added a commit that referenced this pull request Jul 8, 2022
@rudolf101
Squashed commit of the following:
bf2e0e7
commit 31fbc83
Author: Andrey Tarbeev <[email protected]>
Date:   Fri Jul 8 10:50:52 2022 +0300

    Minimize exceptions in signature (#418)

    * Minimize exceptions in test methods signatures

commit 63eb9b0
Author: Yury Kamenev <[email protected]>
Date:   Thu Jul 7 15:13:45 2022 +0300

    Removed always used coverage-based minimization strategy (#450)

commit fe0f7f8
Author: Yury Kamenev <[email protected]>
Date:   Thu Jul 7 14:19:53 2022 +0300

    Disabled NPE checks for non-public library fields by default (#353)

commit d1b51fe
Author: Yury Kamenev <[email protected]>
Date:   Thu Jul 7 13:44:46 2022 +0300

    Fixed NPE for processing static field as first statement in MUT (#433)

commit acc2fff
Author: Nikita Vlaev <[email protected]>
Date:   Wed Jul 6 15:37:28 2022 +0300

    Added ForceStaticMockListener to run "configure mockito-inline" action.
    Refactored url listener in notifications.

commit 80c2328
Author: Nikita Stroganov <[email protected]>
Date:   Thu Jul 7 11:21:13 2022 +0300

    Support -P parameters in the utbot-gradle (#377)

commit a92e289
Author: Sergey Pospelov <[email protected]>
Date:   Tue Jul 5 10:29:45 2022 +0300

    Fix searching of modifiers field for JDK 8-17

commit 9a3acb6
Author: Amandel Pie <[email protected]>
Date:   Wed Jul 6 14:16:09 2022 +0300

    Disabled clustering of tests generated by Fuzzer (#431)

    * Disabled clustering of tests generated by Fuzzer

    * Refactored the multiple calls

commit c09568f
Author: Vassiliy Kudryashov <[email protected]>
Date:   Wed Jul 6 10:21:52 2022 +0300

    Existing test file without test class obstruct generation #160 (#425)

commit 2ec8fb3
Author: Denis Fokin <[email protected]>
Date:   Tue Jul 5 16:52:42 2022 +0300

    Better naming

commit 68c66ef
Author: Vassiliy Kudryashov <[email protected]>
Date:   Tue Jul 5 19:51:55 2022 +0300

    SVG logo contains 'inaccurate' holes #330 (#411)

commit 1d48789
Author: Dmitrii Timofeev <[email protected]>
Date:   Tue Jul 5 17:08:38 2022 +0300

    Workaround: run concrete execution for invokedynamic

commit 65d95c1
Author: Vassiliy Kudryashov <[email protected]>
Date:   Tue Jul 5 19:42:55 2022 +0300

    Plugin fails with an exception if no SDK is configured for the test module #399 (#424)

commit 6f9f2d8
Author: Maksim Pelevin <[email protected]>
Date:   Tue Jul 5 17:49:58 2022 +0300

    Fix CNFE: kotlin.collections.ArrayDeque in ContestEstimator (#419)

commit 67cc7d9
Author: Denis Fokin <[email protected]>
Date:   Tue Jul 5 11:58:40 2022 +0300

    Put concrete executor jar in resources for contest estimator

commit 63e2252
Author: Alena Lisevych <[email protected]>
Date:   Tue Jul 5 15:48:29 2022 +0300

    Tooltips correction for #343 (#410)

    Co-authored-by: Alena Lisevych <>

commit 8b3defa
Author: Vassiliy Kudryashov <[email protected]>
Date:   Tue Jul 5 13:22:31 2022 +0300

    Write access exception on test generating in Idea project with JDK 11 #350 (#409)

commit c02883c
Author: Amandel Pie <[email protected]>
Date:   Tue Jul 5 11:21:21 2022 +0300

    Enables 40 tests for utbot-summary module (#389)

    * Repair testPow

    * Repaired ReturnExampleTest tests

    * Restored SummaryCycleTest.kt

    * Restored all the tests

commit 65c07f8
Author: Victoria <[email protected]>
Date:   Tue Jul 5 09:51:44 2022 +0300

    Update Dockerfile_java_cli (#396)

commit 3b21112
Author: Alexey Menshutin <[email protected]>
Date:   Mon Jul 4 21:16:53 2022 +0300

    ToString support for abstract collection using makeSymbolic #391

commit c2673df
Author: Vassiliy Kudryashov <[email protected]>
Date:   Mon Jul 4 21:56:43 2022 +0300

    IDE fatal error during tests generation #68 (#379)

commit 43693fb
Author: Nikita Vlaev <[email protected]>
Date:   Mon Jul 4 18:59:57 2022 +0300

    Bring back test class generation (#403)

commit 1c01193
Author: Yury Kamenev <[email protected]>
Date:   Mon Jul 4 20:24:03 2022 +0300

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

commit a805f31
Author: Nikita Vlaev <[email protected]>
Date:   Fri Jul 1 20:16:28 2022 +0300

    Add title pane with unsupported jdk notification (#373)

commit 16c13fb
Author: Dmitrii Timofeev <[email protected]>
Date:   Mon Jul 4 18:35:36 2022 +0300

    Initiate concrete execution if a wrapper method is missing (#392)

    If a JVM class is overridden but a method is missing from the wrapper,
    the engine will discard the path and fall back to concrete execution
    instead of analysing the real JVM code graph.

    This approach fixes the problem with methods that have been introduced
    in newer JDKs. Now wrappers are mostly limited to Java 1.8 interfaces
    and fail to analyze methods like `String::isBlank` or `String::lines`
    when the code runs under JDK 11. Building graphs from the real JDK code
    fails because the wrapper does not have private fields that the original
    code uses.

    TODO: to allow symbolic analysis of the code, missing methods should be
    actually implemented in corresponding wrappers.
Vassiliy-Kudryashov pushed a commit that referenced this pull request Jul 11, 2022
@Damtev @Vassiliy-Kudryashov
Disabled NPE checks for non-public library fields by default (#353)
91cae79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dtim dtim dtim approved these changes
@CaelmBleidd CaelmBleidd CaelmBleidd approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

UTBot Java
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Disable NPE checks for non-public library fields

Uh oh!

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

3 participants

@Damtev @dtim @CaelmBleidd
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.