PDE doesn't report invalid size() arguments as a logic error
まだ誰も着手していません。
評価
調査の方向性
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
- スター
- 497
- フォーク
- 183
- 平均マージ
- 4時間 39分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
-
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 オープンbug
processing/processing4#1567 · コメント 3 件 · リアクション 1 件 · 担当者 1 名 ·
-
lower priority
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
processing/processing4#1566 · コメント 3 件 ·
processing/processing4 の issue をすべて見る
似ている issue
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
opensearch-project/ml-commons#5094 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
emitter:client:csharp feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 オープンbug frontend maui-pilot
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100