GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Unnecessary reflection used for val properties that can be set via constructor · Issue #1190 · UnitTestBot/UTBotJava Closed Labels comp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a buglang-kotlinIssue is related to Kotlin language supportIssue is related to Kotlin language support DescriptionDescription If constructor has a val property, codegen doesn't use this constructor but instead instantiates class via reflection although it can normally be done without it. To Reproduce Launch action on the following class: class CustomClass(val x: Int) { fun f(): Int { return x } } Expected behavior Correct tests are generated, reflection is not used at all. Actual behavior Generated tests contain reflection usage. Visual proofs (screenshots, logs, images) One of the generated tests: @Test fun testF1() { val customClass = (createInstance("CustomClass") as CustomClass) setField(customClass, "CustomClass", "x", -255) val actual = customClass.f() assertEquals(-255, actual) } Activity
MetadataMetadataAssigneesLabelscomp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a buglang-kotlinIssue is related to Kotlin language supportIssue is related to Kotlin language support TypeProjects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — 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. |