Coder Social home page Coder Social logo

record-builder-139-reproducer's Introduction

record-builder #139 reproducer

This repository contains a minimal reproducer for Randgalt/record-builder#139.

Use ./trigger.sh to reproduce the issue. The second mvn compile should fail with the following error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project record-builder-139-reproducer: Fatal error compiling: java.lang.NullPointerException: Cannot invoke "javax.lang.model.element.ExecutableElement.getAnnotationMirrors()" because the return value of "javax.lang.model.element.RecordComponentElement.getAccessor()" is null -> [Help 1]

To understand what is going on you can use mvnDebug rather than mvn for the second build and set following breakpoints:

  1. com.sun.tools.javac.code.Symbol.ClassSymbol.setRecordComponents

  2. com.sun.tools.javac.code.Symbol.ClassSymbol.getRecordComponent(com.sun.tools.javac.tree.JCTree.JCVariableDecl, boolean, com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCAnnotation>) with condition var.name.toString().contains("Concurrency")

  3. io.soabase.recordbuilder.processor.InternalRecordBuilderProcessor.buildRecordComponents

First one allows to observe that javac parses the class file from the first build and add a record component for maxConcurrency with pos = -1 and no accessor.

The second one allow to observe that a second record component is added at a latter stage. Since pos != 1, TypeElement for ConfRecord ends up with two record components for maxConcurrency one of them having no accessor.

record-builder-139-reproducer's People

Contributors

cykl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.