Title: NPE in concrete processing static field · Issue #432 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: NPE in concrete processing static field · Issue #432 · UnitTestBot/UTBotJava
X Title: NPE in concrete processing static field · Issue #432 · UnitTestBot/UTBotJava
Description: Description If the first statement in MUT used a static field that should be processed concretely and which is not an enum, the engine emits UtError because of NullPointerException produced by environment.state.lastEdge == null. To Repro...
Open Graph Description: Description If the first statement in MUT used a static field that should be processed concretely and which is not an enum, the engine emits UtError because of NullPointerException produced by envi...
X Description: Description If the first statement in MUT used a static field that should be processed concretely and which is not an enum, the engine emits UtError because of NullPointerException produced by envi...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/432
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NPE in concrete processing static field ","articleBody":"**Description**\r\n\r\nIf **the first** statement in MUT used a static field that should be processed concretely and which is not an enum, the engine emits `UtError` because of `NullPointerException` produced by `environment.state.lastEdge == null`.\r\n\r\n**To Reproduce**\r\n\r\nTry to generate a test for such a method:\r\n\r\n```java\r\npublic static void concreteStaticFieldAsFirstStatement() {\r\n System.out.println(0);\r\n}\r\n```\r\n\r\n**Expected behavior**\r\n\r\nOne test is generated, which does nothing:\r\n\r\n```java\r\n@Test\r\n@DisplayName(\"concreteStaticFieldAsFirstStatement: -\u003e PrintStreamPrintln\")\r\npublic void testConcreteStaticFieldAsFirstStatement_PrintStreamPrintln() {\r\n HelloWorld.concreteStaticFieldAsFirstStatement();\r\n}\r\n\r\n**Actual behavior**\r\n\r\nOne error method is generated:\r\n\r\n```java\r\npublic void testConcreteStaticFieldAsFirstStatement_errors() {\r\n // Couldn't generate some tests. List of errors:\r\n // \r\n // 1 occurrences of:\r\n // \u003cThrowable with empty message\u003e\r\n\r\n}\r\n```\r\n\r\n**Environment**\r\n\r\nCommit c09568f29e0ec6149a43ac6e318feca64e420daf\r\nJava, no mocks.\r\n\r\n**Additional context**\r\n\r\nNot applicable\r\n","author":{"url":"https://github.com/Damtev","@type":"Person","name":"Damtev"},"datePublished":"2022-07-06T09:41:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/432/UTBotJava/issues/432"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eaf1eda3-c17b-cc72-7656-087750b47548 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAD6:9A1E2:2D85429:3D92C6D:698DB8F7 |
| html-safe-nonce | 2dbd6a48920e8e7644d9937821dde32fba425096cb4709f80e13aa74438a0d3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUQ2OjlBMUUyOjJEODU0Mjk6M0Q5MkM2RDo2OThEQjhGNyIsInZpc2l0b3JfaWQiOiIyOTkzOTE5Nzg4NTMzNTI4ODIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fc9aa698838959be394f665875e7294aba6adee5724ad8ea9a30378bbd7ee209 |
| hovercard-subject-tag | issue:1295564393 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/432/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c787ca8b211ad32efc76909a58e3994f94cac15bded6241372d0b6d0d420bbeb/UnitTestBot/UTBotJava/issues/432 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c787ca8b211ad32efc76909a58e3994f94cac15bded6241372d0b6d0d420bbeb/UnitTestBot/UTBotJava/issues/432 |
| og:image:alt | Description If the first statement in MUT used a static field that should be processed concretely and which is not an enum, the engine emits UtError because of NullPointerException produced by envi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Damtev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2457fd9a1b17ca7f38c3c2653895ccb2e0dd04f18f77446a21354e9bc4b7902f |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 878672b82363fd98fbdc5bd0edb68e572c8a8d9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width