Incorrect "Bad value" warning for dynamically assigned variable
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 18
### What happened
On this line
```xml
```
the IDE flags
```
Bad value " " for attribute "value on element 'input": Expected a minus sign or a digit but saw " instead " for attribute "value" on element "input": Expected a minus sign or a digit but saw "
From line 68, column 9; to line 68, column 119
(Rule Category: Attributes)
```
As the value of $_SESSION['stock']['action_price'] is dynamically set during runtime and the IDE cannot determine its actual value, it should not report an error - which causes the programmer to think that the syntax is wrong.
I wasn't able to resolve this even with chatGPT :) which suggested to ignore the warning (provided that at runtime the type checks are ok).
Still the warning is annoying.
### How to reproduce
_No response_
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Mac OS X version 13.2.1 running on x86_64; UTF-8; en_US (nb)
### JDK
Java(TM) SE Runtime Environment 19.0.2+7-44
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
_No response_
### Are you willing to submit a pull request?
No
Contributor guide
Research direction
Start by reproducing the warning in the PHP/HTML input example from the issue using Apache NetBeans 18. The payload names no source files or tests, so locate the HTML attribute validation entry point and its related tests first. Done means dynamically assigned PHP values no longer produce an incorrect numeric-value warning while genuine invalid values remain reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, php
- Domain
- tooling, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100