Title: PDE doesn't report invalid size() arguments as a logic error · Issue #1573 · processing/processing4 · GitHub
Open Graph Title: PDE doesn't report invalid size() arguments as a logic error · Issue #1573 · processing/processing4
X Title: PDE doesn't report invalid size() arguments as a logic error · Issue #1573 · processing/processing4
Description: Most appropriate sub-area of Processing 4? PDE Processing version 4.5.6 Operating system Windows Bug description When size() is called from setup() using variables for its width and height, Processing reports the error only when the sket...
Open Graph Description: Most appropriate sub-area of Processing 4? PDE Processing version 4.5.6 Operating system Windows Bug description When size() is called from setup() using variables for its width and height, Process...
X Description: Most appropriate sub-area of Processing 4? PDE Processing version 4.5.6 Operating system Windows Bug description When size() is called from setup() using variables for its width and height, Process...
Opengraph URL: https://github.com/processing/processing4/issues/1573
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PDE doesn't report invalid size() arguments as a logic error","articleBody":"### Most appropriate sub-area of Processing 4?\n\nPDE\n\n### Processing version\n\n4.5.6\n\n### Operating system\n\nWindows\n\n### Bug description\n\nWhen `size()` is called from `setup()` using variables for its width and height, Processing reports the error only when the sketch is run/compiled:\n\n`size() cannot be used here, see https://processing.org/reference/size_.html`\n\nHowever, the PDE does not report this as a logic error while editing the sketch.\n\nThis is inconsistent with other invalid `size()` usage and makes the problem harder to identify before running the sketch.\n\nFor comparison, using the same variables from `settings()` works correctly, and arithmetic expressions such as `size(400 + 400, 900 - 300)` are accepted.\n\n### Expected behavior\n\nThe PDE should identify the invalid `size()` usage as a logic error while editing, before the sketch is run.\n\n### Actual behavior\n\nThe invalid usage is not reported as a PDE logic error while editing. The error is encountered when the sketch is processed/run.\n\n\n### Steps to reproduce this\n\n1. Open Processing 4.\n2. Create a new Java Mode sketch.\n3. Add the following code:\n4. Wait for the PDE to process the sketch.\n5. Observe that the invalid `size()` usage is not reported as a logic error in the editor.\n6. Run the sketch.\n7. Processing reports:\n\n`size() cannot be used here, see https://processing.org/reference/size_.html`\n\nFor comparison, moving the `size(width, height)` call into `settings()` allows the sketch to run successfully.\n\n\n### snippet\n\n```processing\nint width = 800;\nint height = 600;\n\nvoid setup() {\n size(width, height);\n}\n```\n\n\n### Additional context\n\nThe issue appears to originate in the Java Mode preprocessing of `size()` arguments.\n\nI investigated the existing `sizeParamValid()` handling and implemented a change that reports invalid `size()` arguments as a logic error during preprocessing. I also added regression tests for invalid method and variable arguments.\n\nI manually verified the following cases:\n\n* `size(width, height)` in `setup()` → logic error\n* `size(width, height)` in `settings()` → works\n* `size(400 + 400, 900 - 300)` → works\n\nThe Java test suite passes with 194 tests and 0 failures on my local setup.\n\nI would be interested in working on this issue and submitting the corresponding fix.\n\n\n### Would you like to work on the issue?\n\nYes, I’d like to help with this","author":{"url":"https://github.com/letsmanuel","@type":"Person","name":"letsmanuel"},"datePublished":"2026-09-21T20:16:12Z","url":"https://github.com/processing/processing4/issues/1573"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:16fdbd2d-42bc-95a7-283c-b2078d4adf6f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C104:B3B5C:120B9F:185777:6B05F786 |
| html-safe-nonce | dc553516c61b76d8f88c52147f7147fea2b997409f51cf9703fc6a0978c4c4bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTA0OkIzQjVDOjEyMEI5RjoxODU3Nzc6NkIwNUY3ODYiLCJ2aXNpdG9yX2lkIjoiNDA4MjcyNjA0Mjg0NTE4MTgzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 88763c7814dbcc1ff03a2107065eee0e7bc8bb95025236e78833709fb657b180 |
| hovercard-subject-tag | issue:5531994630 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/processing4/1573/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a9e42012860aa2913019d53b5ac01c976b983044b008321730accc54c80d8285/processing/processing4/issues/1573 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a9e42012860aa2913019d53b5ac01c976b983044b008321730accc54c80d8285/processing/processing4/issues/1573 |
| og:image:alt | Most appropriate sub-area of Processing 4? PDE Processing version 4.5.6 Operating system Windows Bug description When size() is called from setup() using variables for its width and height, Process... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | letsmanuel |
| hostname | github.com |
| expected-hostname | github.com |
| None | c214754a6652274794ed4e054a7b71be999d69843f103ba54893001d45010ece |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing4 git https://github.com/processing/processing4.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 844382769 |
| octolytics-dimension-repository_nwo | processing/processing4 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 844382769 |
| octolytics-dimension-repository_network_root_nwo | processing/processing4 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d164a4e71eb333b2b17fd5b17e18efb7855505c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width