PDE doesn't report invalid size() arguments as a logic error
還沒有人認領這個 Issue。
評估
研究方向
Start with the Java Mode preprocessing and the existing sizeParamValid() handling described in the issue. Run the Java test suite and inspect the added regression-test cases for invalid method and variable arguments. Done means invalid size(width, height) in setup() is reported as a PDE logic error, while settings() and arithmetic expressions remain valid.
由索引模型根據 Issue 內容生成。
描述
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 sketch is run/compiled:
size() cannot be used here, see https://processing.org/reference/size_.html
However, the PDE does not report this as a logic error while editing the sketch.
This is inconsistent with other invalid size() usage and makes the problem harder to identify before running the sketch.
For comparison, using the same variables from settings() works correctly, and arithmetic expressions such as size(400 + 400, 900 - 300) are accepted.
Expected behavior
The PDE should identify the invalid size() usage as a logic error while editing, before the sketch is run.
Actual behavior
The invalid usage is not reported as a PDE logic error while editing. The error is encountered when the sketch is processed/run.
Steps to reproduce this
- Open Processing 4.
- Create a new Java Mode sketch.
- Add the following code:
- Wait for the PDE to process the sketch.
- Observe that the invalid
size()usage is not reported as a logic error in the editor. - Run the sketch.
- Processing reports:
size() cannot be used here, see https://processing.org/reference/size_.html
For comparison, moving the size(width, height) call into settings() allows the sketch to run successfully.
snippet
int width = 800;
int height = 600;
void setup() {
size(width, height);
}
Additional context
The issue appears to originate in the Java Mode preprocessing of size() arguments.
I 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.
I manually verified the following cases:
size(width, height)insetup()→ logic errorsize(width, height)insettings()→ workssize(400 + 400, 900 - 300)→ works
The Java test suite passes with 194 tests and 0 failures on my local setup.
I would be interested in working on this issue and submitting the corresponding fix.
Would you like to work on the issue?
Yes, I’d like to help with this
- 主要語言
- Java
- 星號
- 508
- 分支
- 183
- 平均合併
- 4 小時 6 分鐘
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
processing/processing4 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 64/100
processing/processing4#1554 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
processing/processing4#1515 · 1 個 reaction ·
-
startup error未關閉
難度 4/5 3-5 天 新手友好度 25/100
processing/processing4#1569 · 7 則留言 ·
-
Binaries under bin directory lack executable permissions for the snap and .deb packages for Linux可能已有人在做 @catilac 於 16 天前認領。 未關閉bug
processing/processing4#1567 · 3 則留言 · 1 個 reaction · 已指派 1 人 ·
-
lower priority
難度 4/5 3-5 天 新手友好度 55/100
processing/processing4#1566 · 3 則留言 ·
查看 processing/processing4 的全部 Issue
相似的 Issue
-
bug good first issue help wanted priority medium size S
難度 2/5 1-3 小時 新手友好度 84/100
martin-francois/symphony-trello#776 · 1 則留言 ·
維護者通常 1 天內回覆
-
Console.printHex未關閉good first issue kernel
難度 2/5 1-3 小時 新手友好度 88/100
JackFurton/who-would-build-a-kernel-in-java#33 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
objectionary/eo#9182 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
objectionary/hone-maven-plugin#1293 ·
維護者通常 1 天內回覆