Title: Using util method via reflection · Issue #2711 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Using util method via reflection · Issue #2711 · UnitTestBot/UTBotJava
X Title: Using util method via reflection · Issue #2711 · UnitTestBot/UTBotJava
Description: Consider the following class com.google.common.primitives.Booleans$LexicographicalComparator in guava-26.0: private static enum LexicographicalComparator implements Comparator
Open Graph Description: Consider the following class com.google.common.primitives.Booleans$LexicographicalComparator in guava-26.0: private static enum LexicographicalComparator implements Comparator
X Description: Consider the following class com.google.common.primitives.Booleans$LexicographicalComparator in guava-26.0: private static enum LexicographicalComparator implements Comparator<boolean[]> { .....
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/2711
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using util method via reflection","articleBody":"Consider the following class `com.google.common.primitives.Booleans$LexicographicalComparator` in `guava-26.0`:\r\n\r\n```java\r\nprivate static enum LexicographicalComparator implements Comparator\u003cboolean[]\u003e { ... }\r\n```\r\n\r\nIn tests for methods of this class in some specific conditions we generate the following code:\r\n\r\n```java\r\n Class booleansLexicographicalComparatorTestClazz = Class.forName(\"com.google.common.primitives.Booleans_LexicographicalComparatorTest\");\r\n Class classType = Class.forName(\"java.lang.Class\");\r\n Class stringType = Class.forName(\"java.lang.String\");\r\n Method getStaticFieldValueMethod = booleansLexicographicalComparatorTestClazz.getDeclaredMethod(\"getStaticFieldValue\", classType, stringType);\r\n getStaticFieldValueMethod.setAccessible(true);\r\n java.lang.Object[] getStaticFieldValueMethodArguments = new java.lang.Object[2];\r\n getStaticFieldValueMethodArguments[0] = \"com.google.common.primitives.Booleans$LexicographicalComparator\";\r\n getStaticFieldValueMethodArguments[1] = \"INSTANCE\";\r\n Object lexicographicalComparator = getStaticFieldValueMethod.invoke(null, getStaticFieldValueMethodArguments);\r\n```\r\n\r\nSteps to reproduce:\r\n\r\n1. Checkout to `usvm_competitions_2024` branch, at least one reproducable commit 5503f43ede037b732bfad0d0f7fc2ec5e0e16d01\r\n2. Use the following settings in `ContestEstimator`:\r\n ```kotlin\r\n val timeLimit = 120\r\n methodFilter = \"com.google.common.primitives.Booleans\\$LexicographicalComparator.toString\"\r\n projectFilter = listOf(\"guava-26.0\")\r\n ```\r\n3. Add the following line `com.google.common.primitives.Booleans$LexicographicalComparator` to the `utbot-junit-contest/src/main/resources/classes/guava-26.0/list`\r\n4. Always use `symbolicResult` and ignore `concreteResult` in `org.utbot.contest.usvm.jc.JcTestExecutor#execute`","author":{"url":"https://github.com/Damtev","@type":"Person","name":"Damtev"},"datePublished":"2023-12-07T08:34:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2711/UTBotJava/issues/2711"}
| 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:e21ce8d9-2699-f4f6-096b-4b2c94b46008 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF76:531A6:679BF02:8D3C718:698D0AC3 |
| html-safe-nonce | 7c60d4ee85d18496c423c0831de0e7caf58fff0ada8cb53b8b12185e7911fe8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjc2OjUzMUE2OjY3OUJGMDI6OEQzQzcxODo2OThEMEFDMyIsInZpc2l0b3JfaWQiOiIyNjU5MTc4MDYwNDgyMTUzMTU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c2ac9bc8f1ddf0f4709769dc2569a946561214378d6ea99ea04644c54b184570 |
| hovercard-subject-tag | issue:2030175411 |
| 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/2711/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e01bce4d4634afef3feaede7f0e9201b0178b04653899b676dfa91d3323e397b/UnitTestBot/UTBotJava/issues/2711 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e01bce4d4634afef3feaede7f0e9201b0178b04653899b676dfa91d3323e397b/UnitTestBot/UTBotJava/issues/2711 |
| og:image:alt | Consider the following class com.google.common.primitives.Booleans$LexicographicalComparator in guava-26.0: private static enum LexicographicalComparator implements Comparator |
| 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 | f2da95634bce8a94cfa4123788169bfabdf845fd1d790fbaaaaab09dcfebdf28 |
| 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 | 311e6780106f89302807c2d4e7790575cc939515 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width