Formatting of limit prevents opening of "All securities" view

Hello,
for approx one year I have been suffering from a “strange error message” problem with limit handling when defining securities in the “All securities” view. However, today the problem got so bad that when I try to open the “All Securities” view, I get “Internal error: Reason: java.lang.IllegalArgumentException”. Luckily I could still open the backup-file and save my data. I would gladly send this file which causes this internal error to some developer who wants to examine the problem? (but I’d rather not send it into this forum, as it contain all my personal financial data).
However, I describe briefly the background which led into this:
I have Portfolio Performance 0.50.2, which I run in macOS Catalina 10.15.7.
The strange behaviour starts like this:
I vant to define a security with a limit, so I go to All Securities view, press the plus-sign, and enter in this example the data for the “Security Master Data”:
Name: NEC
Currency: JPY (Japanese Yen)
Symbol: 6701.T
Then I click the historical quotes tab, and choose “Provider” as “Yahoo Finance”. The historical data is shown. Good.
Then I go to “Additional Attributes”-tab, press the plus-sign, and add the attribute “Limit”. I enter as its value “< 3200”, because I want a visual notification when the value goes below 3200. I press OK. Everything went as excepted, except: in the list of securities, the limit is now shown as “< 3 200,00”.
This is strange, but it seems cosmetic for now.
Then I right-mouse click the same security, choose “Edit”, and the “Security Master Data” tab opens - but now it shows a red error message right after the security name:
“A limit must be formatted as a relational comparator (>, >= , < or <=) followed by a price”
This is strange because this is exactly what I did.
I press the Additional Attributes tab again.
The limit is shown as “< 3 200,00”.
I edit it back to “<3200”. Even removing the first space after the number three removes the error message, but I clean also the decimals and the comma away. I press OK
Result: again it shows in the list of securities as “<3 200,00”

I have considered this only as a cosmetic issue, but today it got so bad that when I created a new security with a limit, I started to get these internal java -error messages. It was strange: My new security was named as “Seabridge”, and when I wanted to edit it here in the “All securities” view, I first searched for its name with the search box until the view contained only this security. I defined limit for it - all OK. I started to clean up the display by pressing backspace in the search box - and when I had removed enough characters (and enough new securities were visible), this internal java error came. I tried to experiment by editing one security with this kind of a “<= 3200”-limit, and as a result, the “All securities” -view now refuses to open.

Is the problem also in 0.50.3?

I tried to reproduce this, but it is always shown as
Bildschirmfoto_2021-02-07_13-36-44
Ich have tried with

LC_ALL=C.UTF-8 ./PortfolioPerformance
LC_ALL=en_US.UTF-8 ./PortfolioPerformance
LC_ALL=de_DE.UTF-8 ./PortfolioPerformance

What are your local language settings?

The Field-Type in PP is “Limit Price”?

Hello -

  • I downloaded and installed PP 0.50.3, and the problem occurs with that too.
  • In General Data / Settings / Attributes-securities , the field type for Limit is “Limit Price” indeed as in your screenshot
  • When I go to MacOS “System Preferences” and choose “Language & Region”, I see:
    Region: Finland
    and
    Preferred languates: English (first on the list)

When in this dialog I press “Advanced”, I see three tabs: General/Dates/Times
In the General-tab, I have:
Number separators: Grouping: Space (there are five possible selections in the drop-down for this)
Decimal: “,”
Currency: Euro
Grouping: Space
Decimal: “,”
Measurement units: Metric

I don’t know if this is relevant, but if I go to Terminal and type “locale”, I get:
LANG=""
LC_COLLATE=“C”
LC_CTYPE=“UTF-8”
LC_MESSAGES=“C”
LC_MONETARY=“C”
LC_NUMERIC=“C”
LC_TIME=“C”
LC_ALL=

Ok, it’s the cosmetic that you want.

I can not reproduce this.

Are you sure the limit is the trigger? Have you test “File / Sanity Check”?

File/Sanity Check gives an Info-window with a message “No issues found.”
Trying to open All Securities gives “Internal Error - Reason: java.lang.IllegalArgumentException”.

When I open Help - Show error log, the last errors are:
“Comparison method violates its general contract!” & “Internal error”

By double-clicking the error message “Comparison method…” I got more info. I copy paste it here:

Sun Feb 07 21:42:59 EET 2021
Comparison method violates its general contract!

java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.base/java.util.TimSort.mergeHi(Unknown Source)
	at java.base/java.util.TimSort.mergeAt(Unknown Source)
	at java.base/java.util.TimSort.mergeForceCollapse(Unknown Source)
	at java.base/java.util.TimSort.sort(Unknown Source)
	at java.base/java.util.Arrays.sort(Unknown Source)
	at org.eclipse.jface.viewers.ViewerComparator.sort(ViewerComparator.java:206)
	at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:1037)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:670)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:618)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:610)
	at org.eclipse.jface.viewers.AbstractTableViewer.lambda$0(AbstractTableViewer.java:572)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1400)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1361)
	at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:572)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1634)
	at name.abuchen.portfolio.ui.views.SecuritiesTable.setInput(SecuritiesTable.java:797)
	at name.abuchen.portfolio.ui.views.SecurityListView.setSecurityTableInput(SecurityListView.java:542)
	at name.abuchen.portfolio.ui.views.SecurityListView.createTopTable(SecurityListView.java:534)
	at name.abuchen.portfolio.ui.views.AbstractListView.createBody(AbstractListView.java:31)
	at name.abuchen.portfolio.ui.editor.AbstractFinanceView.createViewControl(AbstractFinanceView.java:127)
	at name.abuchen.portfolio.ui.editor.PortfolioPart.createView(PortfolioPart.java:533)
	at name.abuchen.portfolio.ui.editor.PortfolioPart.activateView(PortfolioPart.java:503)
	at name.abuchen.portfolio.ui.editor.PortfolioPart.activateView(PortfolioPart.java:491)
	at name.abuchen.portfolio.ui.editor.ClientEditorSidebar$1.select(ClientEditorSidebar.java:70)
	at name.abuchen.portfolio.ui.editor.ClientEditorSidebar$1.select(ClientEditorSidebar.java:1)
	at name.abuchen.portfolio.ui.editor.Sidebar$Entry.handleMouseDown(Sidebar.java:419)
	at org.eclipse.swt.events.MouseListener$2.mouseDown(MouseListener.java:96)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:196)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4443)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3839)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:166)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)

And here is the similar info on “Internal error”:

Sun Feb 07 21:42:59 EET 2021
Internal Error

java.lang.IllegalArgumentException
	at name.abuchen.portfolio.ui.util.swt.SashLayout.layout(SashLayout.java:230)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1283)
	at org.eclipse.swt.widgets.Composite.resized(Composite.java:1005)
	at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:3971)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6058)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSView.setFrame(NSView.java:247)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:3693)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:3675)
	at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
	at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1283)
	at org.eclipse.swt.widgets.Composite.resized(Composite.java:1005)
	at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:3971)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6058)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSView.setFrame(NSView.java:247)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:3693)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:3734)
	at org.eclipse.swt.custom.StackLayout.layout(StackLayout.java:124)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1283)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1289)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1289)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1289)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1289)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1289)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1289)
	at org.eclipse.swt.widgets.Composite.setLayoutDeferred(Composite.java:1155)
	at org.eclipse.swt.widgets.Display.runDeferredLayouts(Display.java:4253)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3825)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:166)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)

Broken comparator(?) needs the care of @AndreasB or @Ragas or @inv-trad or another contributor.

Hi -
a little additional info:

  • in the All Securities - view, sorting the items by the Limits-column results into this:

  • although I was able to rescue the situation from the backup-file so that I can open the All Securities view, adding a new security and defining a limit for it results in the the same “Comparison method violates its general contract!” -error, so that I can’t add securities with limits now.

Hello -
this problem is still present in the latest version 0.51.0 -
is there a plan to fix it sometime in the future? I can’t use the limits currently,
because adding one results into not being able to open the “All securities”-view.