Skip to content

ImportOrderStep reads its config file eagerly, rather than lazily #218

Closed

Description

@nedtwigg

public static FormatterStep createFromFile(File importsFile) {
Objects.requireNonNull(importsFile);
return createFromOrderImpl(getImportOrder(importsFile));
}

It shouldn't read the file until its state is calculated. First discovered in #217.

Activity

  1. jbduncan commented on Mar 7, 2018

    @jbduncan
    Member

    I suspect the easiest fix would be to make getImportOrder return a lazy Supplier<List<String>>.

  2. jbduncan commented on Mar 7, 2018

    @jbduncan
    Member

    ...and then memoize the result of this supplier somehow.

  3. nedtwigg commented on Mar 8, 2018

    @nedtwigg
    MemberAuthor

    FormatterStep.createLazy handles the memoization for you.

  4. added a commit that references this issue on Feb 10, 2019
    3005544
  5. jbduncan commented on Feb 11, 2019

    @jbduncan
    Member

    Cheers for tackling this, @nedtwigg. :)

  6. nedtwigg commented on Feb 12, 2019

    @nedtwigg
    MemberAuthor

    Published in 3.18.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions