René's URL Explorer Experiment


Title: Getting OOM instead of FormatterException · Issue #441 · google/google-java-format · GitHub

Open Graph Title: Getting OOM instead of FormatterException · Issue #441 · google/google-java-format

X Title: Getting OOM instead of FormatterException · Issue #441 · google/google-java-format

Description: For the following example I am getting OOM error instead of FormatterException. /*package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts; import org.eclipse.draw2d.ColorConstants; import org.eclipse.draw2d.Graphics; import o...

Open Graph Description: For the following example I am getting OOM error instead of FormatterException. /*package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts; import org.eclipse.draw2d.ColorConstants; impo...

X Description: For the following example I am getting OOM error instead of FormatterException. /*package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts; import org.eclipse.draw2d.ColorConstants; impo...

Opengraph URL: https://github.com/google/google-java-format/issues/441

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Getting OOM instead of FormatterException","articleBody":"For the following example I am getting OOM error instead of FormatterException.\r\n```\r\n/*package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts;\r\n\r\nimport org.eclipse.draw2d.ColorConstants;\r\nimport org.eclipse.draw2d.Graphics;\r\nimport org.eclipse.draw2d.GridLayout;\r\nimport org.eclipse.draw2d.IFigure;\r\nimport org.eclipse.draw2d.RoundedRectangle;\r\nimport org.eclipse.draw2d.Shape;\r\nimport org.eclipse.draw2d.StackLayout;\r\nimport org.eclipse.draw2d.ToolbarLayout;\r\nimport org.eclipse.draw2d.geometry.Dimension;\r\nimport org.eclipse.gef.EditPart;\r\nimport org.eclipse.gef.EditPolicy;\r\nimport org.eclipse.gef.Request;\r\nimport org.eclipse.gef.commands.Command;\r\nimport org.eclipse.gef.editpolicies.LayoutEditPolicy;\r\nimport org.eclipse.gef.editpolicies.NonResizableEditPolicy;\r\nimport org.eclipse.gef.requests.CreateRequest;\r\nimport org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;\r\nimport org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;\r\nimport org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;\r\nimport org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;\r\nimport org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;\r\nimport org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;\r\nimport org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;\r\nimport org.eclipse.gmf.runtime.notation.View;\r\nimport org.eclipse.swt.graphics.Color;\r\nimport org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.policies.ProxyServiceSequenceContainerCanonicalEditPolicy;\r\nimport org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.policies.ProxyServiceSequenceContainerItemSemanticEditPolicy;\r\n\r\n*//**\r\n * @generated\r\n *//*\r\npublic class ProxyServiceSequenceContainerEditPart extends ShapeNodeEditPart {\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tpublic static final int VISUAL_ID = 3391;\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected IFigure contentPane;\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected IFigure primaryShape;\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tpublic ProxyServiceSequenceContainerEditPart(View view) {\r\n\t\tsuper(view);\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected void createDefaultEditPolicies() {\r\n\t\tinstallEditPolicy(EditPolicyRoles.CREATION_ROLE,\r\n\t\t\t\tnew CreationEditPolicy());\r\n\t\tsuper.createDefaultEditPolicies();\r\n\t\tinstallEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,\r\n\t\t\t\tnew ProxyServiceSequenceContainerItemSemanticEditPolicy());\r\n\t\tinstallEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,\r\n\t\t\t\tnew DragDropEditPolicy());\r\n\t\tinstallEditPolicy(EditPolicyRoles.CANONICAL_ROLE,\r\n\t\t\t\tnew ProxyServiceSequenceContainerCanonicalEditPolicy());\r\n\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());\r\n\t\t// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies\r\n\t\t// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected LayoutEditPolicy createLayoutEditPolicy() {\r\n\t\torg.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {\r\n\r\n\t\t\tprotected EditPolicy createChildEditPolicy(EditPart child) {\r\n\t\t\t\tEditPolicy result = child\r\n\t\t\t\t\t\t.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);\r\n\t\t\t\tif (result == null) {\r\n\t\t\t\t\tresult = new NonResizableEditPolicy();\r\n\t\t\t\t}\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\r\n\t\t\tprotected Command getMoveChildrenCommand(Request request) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tprotected Command getCreateCommand(CreateRequest request) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn lep;\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected IFigure createNodeShape() {\r\n\t\treturn primaryShape = new ProxyServiceSequenceContainerFigure();\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tpublic ProxyServiceSequenceContainerFigure getPrimaryShape() {\r\n\t\treturn (ProxyServiceSequenceContainerFigure) primaryShape;\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected NodeFigure createNodePlate() {\r\n\t\tDefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);\r\n\t\treturn result;\r\n\t}\r\n\r\n\t*//**\r\n\t * Creates figure for this edit part.\r\n\t *\r\n\t * Body of this method does not depend on settings in generation model\r\n\t * so you may safely remove \u003ci>generated\u003c/i> tag and modify it.\r\n\t *\r\n\t * @generated\r\n\t *//*\r\n\tprotected NodeFigure createNodeFigure() {\r\n\t\tNodeFigure figure = createNodePlate();\r\n\t\tfigure.setLayoutManager(new StackLayout());\r\n\t\tIFigure shape = createNodeShape();\r\n\t\tfigure.add(shape);\r\n\t\tcontentPane = setupContentPane(shape);\r\n\t\treturn figure;\r\n\t}\r\n\r\n\t*//**\r\n\t * Default implementation treats passed figure as content pane.\r\n\t * Respects layout one may have set for generated figure.\r\n\t * @param nodeShape instance of generated figure class\r\n\t * @generated\r\n\t *//*\r\n\tprotected IFigure setupContentPane(IFigure nodeShape) {\r\n\t\tif (nodeShape.getLayoutManager() == null) {\r\n\t\t\tConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();\r\n\t\t\tlayout.setSpacing(5);\r\n\t\t\tnodeShape.setLayoutManager(layout);\r\n\t\t}\r\n\t\treturn nodeShape; // use nodeShape itself as contentPane\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tpublic IFigure getContentPane() {\r\n\t\tif (contentPane != null) {\r\n\t\t\treturn contentPane;\r\n\t\t}\r\n\t\treturn super.getContentPane();\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected void setForegroundColor(Color color) {\r\n\t\tif (primaryShape != null) {\r\n\t\t\tprimaryShape.setForegroundColor(color);\r\n\t\t}\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected void setBackgroundColor(Color color) {\r\n\t\tif (primaryShape != null) {\r\n\t\t\tprimaryShape.setBackgroundColor(color);\r\n\t\t}\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected void setLineWidth(int width) {\r\n\t\tif (primaryShape instanceof Shape) {\r\n\t\t\t((Shape) primaryShape).setLineWidth(width);\r\n\t\t}\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tprotected void setLineType(int style) {\r\n\t\tif (primaryShape instanceof Shape) {\r\n\t\t\t((Shape) primaryShape).setLineStyle(style);\r\n\t\t}\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tpublic class ProxyServiceSequenceContainerFigure extends RoundedRectangle {\r\n\r\n\t\t*//**\r\n\t\t * @generated NOT\r\n\t\t *//*\r\n\t\tpublic ProxyServiceSequenceContainerFigure() {\r\n\r\n\t\t\t\t\tGridLayout layoutThis = new GridLayout();\r\n\t\t\t\t\tlayoutThis.numColumns = 1;\r\n\t\t\t\t\tlayoutThis.makeColumnsEqualWidth = true;\r\n\t\t\t\t\tthis.setLayoutManager(layoutThis);\r\n\r\n\t\t\tToolbarLayout layoutThis = new ToolbarLayout();\r\n\t\t\tlayoutThis.setStretchMinorAxis(true);\r\n\t\t\tlayoutThis.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);\r\n\t\t\tlayoutThis.setSpacing(0);\r\n\t\t\tlayoutThis.setVertical(true);\r\n\r\n\t\t\tthis.setLayoutManager(layoutThis);\r\n\r\n\t\t\tthis.setCornerDimensions(new Dimension(getMapMode().DPtoLP(8),\r\n\t\t\t\t\tgetMapMode().DPtoLP(8)));\r\n\t\t\tthis.setLineStyle(Graphics.LINE_DASH);\r\n\t\t\tthis.setPreferredSize(new Dimension(getMapMode().DPtoLP(3000),\r\n\t\t\t\t\tgetMapMode().DPtoLP(500)));\r\n\t\t\tthis.setOutline(false);\r\n\r\n\t\t\tthis.setBackgroundColor(THIS_BACK);\r\n\t\t}\r\n\r\n\t\tprotected void fillShape(Graphics graphics) {\r\n\t\t\t// Backup the graphics colors\r\n\t\t\tColor bgColor = graphics.getBackgroundColor();\r\n\t\t\tColor fgColor = graphics.getForegroundColor();\r\n\t\t\t// Set the graphics color\r\n\t\t\tgraphics.setBackgroundColor(getBackgroundColor());\r\n\t\t\tgraphics.setForegroundColor(ColorConstants.white);\r\n\t\t\t// Restore the original colors\r\n\t\t\tgraphics.fillGradient(getBounds(), true);\r\n\t\t\tgraphics.setBackgroundColor(bgColor);\r\n\t\t\tgraphics.setForegroundColor(fgColor);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tpublic boolean isSelectable() {\r\n\t\t// TODO This or using ResizableEditpolicy?\r\n\t\treturn false;\r\n\t}\r\n\r\n\t*//**\r\n\t * @generated\r\n\t *//*\r\n\tstatic final Color THIS_BACK = new Color(null, 255, 255, 255);\r\n\r\n}\r\n*/\r\n```\r\n\r\nWhen I pass the example stated above to the Formatter I am getting the OOM, which I shouldn't expect.\r\nThe driver code I am using is \r\n\r\n```\r\npackage com.foo;\r\n\r\nimport com.google.googlejavaformat.java.Formatter;\r\nimport java.nio.file.Files;\r\nimport java.nio.file.Paths;\r\n\r\npublic class Playground {\r\n    public static String readCode() throws Exception{\r\n        return new String(Files.readAllBytes(Paths.get(\"example\")));\r\n    }\r\n\r\n    public static void main(String[] args) throws Exception{\r\n\r\n        String code = readCode();\r\n        System.out.println(code);\r\n\r\n        Formatter formatter = new Formatter();\r\n        String out = formatter.formatSource(code);\r\n        System.out.println(out);\r\n    }\r\n}\r\n```","author":{"url":"https://github.com/jayendra13","@type":"Person","name":"jayendra13"},"datePublished":"2020-03-13T08:46:46Z","url":"https://github.com/google/google-java-format/issues/441"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0dc35478-636f-60f0-d839-882836d5e0ce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8296:1C1295:F1DC6:150A2B:6AFBCAB3
html-safe-nonce66891282f0dfcc1350cf9684f7ee866a23cacc0bb2edbd4d9fc47e6677ed22a9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mjk2OjFDMTI5NTpGMURDNjoxNTBBMkI6NkFGQkNBQjMiLCJ2aXNpdG9yX2lkIjoiODAyMzI5ODE2Njg2NDIwMjQxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2fd03bbbe762ce01fb0c28125eb27e1d90b09795f60caa6442220b557a4603f1
hovercard-subject-tagissue:580454581
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-java-format/441/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2093848d61c45770ea917400289214614e4a75a6b38e107dcf2a63a1ce000b0e/google/google-java-format/issues/441
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2093848d61c45770ea917400289214614e4a75a6b38e107dcf2a63a1ce000b0e/google/google-java-format/issues/441
og:image:altFor the following example I am getting OOM error instead of FormatterException. /*package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts; import org.eclipse.draw2d.ColorConstants; impo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejayendra13
hostnamegithub.com
expected-hostnamegithub.com
Noned440bda0d812801778b27bfe9f7c1ce9ff22420c73f6f95150c4fcbca311c50b
turbo-cache-controlno-preview
go-importgithub.com/google/google-java-format git https://github.com/google/google-java-format.git
octolytics-dimension-user_id1342004
octolytics-dimension-user_logingoogle
octolytics-dimension-repository_id35448780
octolytics-dimension-repository_nwogoogle/google-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35448780
octolytics-dimension-repository_network_root_nwogoogle/google-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2c43021aed8695990c86c0eaaedc600bfeffec36
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/google/google-java-format/issues/441#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F441
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F441
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=google%2Fgoogle-java-format
Reloadhttps://github.com/google/google-java-format/issues/441
Reloadhttps://github.com/google/google-java-format/issues/441
Reloadhttps://github.com/google/google-java-format/issues/441
googlehttps://github.com/google
google-java-formathttps://github.com/google/google-java-format
Codehttps://github.com/google/google-java-format
Issues84 (84)https://github.com/google/google-java-format/issues
Pull requests35 (35)https://github.com/google/google-java-format/pulls
Actionshttps://github.com/google/google-java-format/actions
Projectshttps://github.com/google/google-java-format/projects
Wikihttps://github.com/google/google-java-format/wiki
Security and qualityhttps://github.com/google/google-java-format/security
Insightshttps://github.com/google/google-java-format/pulse
https://github.com/google/google-java-format
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/441
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/441
Getting OOM instead of FormatterExceptionhttps://github.com/google/google-java-format/issues/441#top
https://github.com/jayendra13
jayendra13https://github.com/jayendra13
on Mar 13, 2020https://github.com/google/google-java-format/issues/441#issue-580454581
https://github.com/cushon
cushonhttps://github.com/cushon
on Oct 28, 2025https://github.com/google/google-java-format/issues/441#issuecomment-3458224383
#413https://github.com/google/google-java-format/issues/413
cushonhttps://github.com/cushon
duplicatehttps://github.com/google/google-java-format/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Aduplicate
OutOfMemoryError on formating file with no actual code #413https://github.com/google/google-java-format/issues/413
on Oct 28, 2025https://github.com/google/google-java-format/issues/441#event-20563140904
Sign up for freehttps://github.com/signup?return_to=https://github.com/google/google-java-format/issues/441
Sign in to commenthttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/441
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.