Regex Patterns for Spring Roo Mobile Cleanup

When retiring the Roo Mobile scaffold, you need to strip conditional blocks that toggle between desktop and mobile views. The regex patterns below help automate the cleanup in IDEs that support search-and-replace with regular expressions.

Regex Snippets

  • Inline Ternaries:

    ScaffoldApp\.isMobile\(\) \? .*\.instance\(\) :
    

    Replace with the non-mobile implementation (usually the RHS of the ternary).

  • Ternaries with Line Breaks:

    ScaffoldApp\.isMobile\(\) \? .*\.instance\(\)\R\t\t\t\t:
    

    Useful when Roo generated the conditional over multiple lines with indentation.

Workflow Tips

  • Back up the project or use version control before running bulk replacements.
  • After removal, search for any remaining ScaffoldApp.isMobile() references to confirm the bootstrap code no longer calls the mobile view.
  • Run integration tests or manually smoke-test the generated UI to ensure there are no dangling references.