[BUG] Find/replace tool silent error

There are two bugs here.

  1. this error below went silently by when I tried to search for text inside a template. I only found it when I looked in the Console and in the Designer Diagnostics
  2. this error occurred.
12:14:09.709 [ForkJoinPool.commonPool-worker-9] WARN SearchReplace - Error during search.
java.lang.NullPointerException: null
java.lang.NullPointerException: null
     at java.base/java.util.StringTokenizer.<init>(Unknown Source)
     at java.base/java.util.StringTokenizer.<init>(Unknown Source)
     at com.inductiveautomation.factorypmi.application.components.template.VisionTemplate.getComponentForPath(VisionTemplate.java:70)
     at com.inductiveautomation.factorypmi.designer.search.CachedComponent.component(CachedComponent.java:44)
     at com.inductiveautomation.factorypmi.designer.search.ComponentCursor$PropertyIterator.<init>(ComponentCursor.java:457)
     at com.inductiveautomation.factorypmi.designer.search.ComponentCursor.<init>(ComponentCursor.java:66)
     at com.inductiveautomation.factorypmi.designer.search.TemplateCursor.next(TemplateCursor.java:65)
     at com.inductiveautomation.ignition.designer.findreplace.SearchObjectAggregator.advance(SearchObjectAggregator.java:119)
     at com.inductiveautomation.ignition.designer.findreplace.SearchObjectAggregator.next(SearchObjectAggregator.java:107)
     at com.inductiveautomation.ignition.designer.findreplace.SearchObjectAggregator.next(SearchObjectAggregator.java:89)
     at com.inductiveautomation.ignition.designer.findreplace.SearchObjectAggregator.next(SearchObjectAggregator.java:31)
     at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
     at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
     at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
     at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
     at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
     at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
     at com.inductiveautomation.ignition.designer.findreplace.DefaultSearchExecutor.search(DefaultSearchExecutor.java:40)
     at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
     at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source)
     at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
     at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
     at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Any ideas how to resolve this? I’m suspecting there’s a corrupted template somewhere which is tripping up the find script

I did an upgrade to 8.1.18 and need to find all references to some text as I know they will have issues (e.g. tag qualities now have more context in them, and I use to compare the quality as a string to hide tags that didn’t exist. I need to replace these to use isGood())

I think you might have done some inadvertently in one find/replace operation that left things in a bad state. Does this persist after you restart the designer?

I’m also getting error with “null pointers” and “array out of bounds” and others on almost all Find/Replace’s I do that include vision templates/windows after going from 7.9.x to 8.1.18

Here’s an example

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
	at java.base/java.util.Vector.elementAt(Unknown Source)
	at java.desktop/javax.swing.table.DefaultTableColumnModel.getColumn(Unknown Source)
	at com.inductiveautomation.factorypmi.application.components.VisionAdvancedTable.lambda$updateViewDataset$3(VisionAdvancedTable.java:704)
	at com.inductiveautomation.ignition.client.util.EDTUtil$ProcessQueue.run(EDTUtil.java:126)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

I forgot to come back to this. I solved it eventually by narrowing down the bad view by selecting folders of views and searching using the new contextual find replace tool. Once the find replace tool stopped working, I searched again in smaller selections within that folder and so on until I got to a single view. I had to resave a particular binding in the view and then it fixed it

If either of you could reach out to support with the views/templates/whatevers in question, that’d be very helpful :slight_smile:

I’ll see what I can do, hopefully I kept a copy of the original json, otherwise I’ll have to restore the original backup and find the page again :frowning: