This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Open StmtJavaPrinter.cpp from JConvert, go to i.e. StmtJavaPrinter::PrintOMPExecutableDirective start to type "if (true ) {" then wait => CPU is highly used + a lot of red signs appear above. Then remove this line and you will see a lot of CPU activity as well. Please, don't do extra work when file is known in advance to be "broken" i.e. when we have unbalanced {} () [] when originally file was in balanced state
Alexander, can you investigate what can be done, please?
What unbalanced is? Is Code: int main() { #if 0 { #endif return 0; } unbalanced? Is code: int main() { #if 0 { #endif int i = 0; return i; #if 1 } #endif } balanced?
How is it for formatter? Please, use "balance" logic used by formatter. Thanks!
I do not see performance problems. My steps: - Open JConvert - goto method StmtJavaPrinter::PrintOMPExecutableDirective - insert inside the method the string "if (true ) {" - comment inserted string Result: - insert took 502 ms (diff between two logging lines: === Stopping parser queue stopwatch JConvert (47 files): 34828 ms) - comment took 456 ms.
It seems problem in "unfair" re-parse an edited file. Go to StmtJavaPrinter::PrintOMPExecutableDirective and add new line after beginning "{". IDE red highlight a lot of IDs in the previous unnamed namespace in each OMPClausePrinter method (except VisitOMPClauseList). IDE does not re-parse methods created by "include inside class". See lines inside OMPClausePrinter class: #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S); #include "clang/Basic/OpenMPKinds.def"
CPU activity relates with big file (5000 lines). It is expected behavior. There is no reliable algorithm to detect "when we have unbalanced {} () []". Do not fix. Of course you can file separate bug described in comment #5. You can simplify test case to: start to type "int a;" And see a lot of redness.