Title: Stricter check for enum classes in EnumModelProvider #558 by dtim · Pull Request #559 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Stricter check for enum classes in EnumModelProvider #558 by dtim · Pull Request #559 · UnitTestBot/UTBotJava
X Title: Stricter check for enum classes in EnumModelProvider #558 by dtim · Pull Request #559 · UnitTestBot/UTBotJava
Description: Co-author: @volivan239 Description Java enums allow users to declare anonymous classes corresponding to constants. These classes are commonly used to overload toString or methods declared in the enum class. These classes are not enums themselves. According to the comment in the java.lang.Class#isEnum method: // An enum must both directly extend java.lang.Enum and have // the ENUM bit set; classes for specialized enum constants // don't do the former. Suppose we have an enum: public enum Foo { A { @Override public String toString() { return "It's A"; } }, B { @Override public String toString() { return "It's B"; } } } Anonymous inner classes Foo$1 and Foo$2 are (non-direct) subtypes of java.lang.Enum, but are not declared as enums, and are not considered enums from the point of view of the Java specification: their direct superclass is Foo. These specialized anonymous classes do not have enum constants themselves, and getEnumConstants method will return null for them. Fixes #558 Type of Change Bug fix (non-breaking change which fixes an issue) Refactoring (typos and non-functional changes) How Has This Been Tested? Automated Testing No new unit tests are added. All existing tests should pass. Manual Scenario Run the contest estimator on com.google.common.base.CaseFormat class of the Guava library by editing main function body in ContestEstimator.kt: methodFilter = "com.google.common.base.CaseFormat.*" projectFilter = null Tests (probably with errors due to other issues) should be generated. Without the fix, a NullPointerException would be thrown, and no tests would be generated. Checklist: 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 New tests have been added All fuzzer tests pass locally with my changes
Open Graph Description: Co-author: @volivan239 Description Java enums allow users to declare anonymous classes corresponding to constants. These classes are commonly used to overload toString or methods declared in the en...
X Description: Co-author: @volivan239 Description Java enums allow users to declare anonymous classes corresponding to constants. These classes are commonly used to overload toString or methods declared in the en...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/pull/559
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0eb5808f-9a50-3e0c-823e-99d5220745db |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AADE:3E958:2D3A88:3981A5:6990193E |
| html-safe-nonce | 8d434657e41aa8f05ce27050b6ccd8ad4ba8d31a997c998d0f9ff41f6d11f762 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQURFOjNFOTU4OjJEM0E4ODozOTgxQTU6Njk5MDE5M0UiLCJ2aXNpdG9yX2lkIjoiODE3MTM2NDYxNzQ1NDM2MDg5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bfe602b687cf977231724a1b49ed557e339d3e465eca2a66ac4f28c3986c6f14 |
| hovercard-subject-tag | pull_request:1001039971 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/UnitTestBot/UTBotJava/pull/559/files |
| twitter:image | https://avatars.githubusercontent.com/u/336793?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336793?s=400&v=4 |
| og:image:alt | Co-author: @volivan239 Description Java enums allow users to declare anonymous classes corresponding to constants. These classes are commonly used to overload toString or methods declared in the en... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width