From: Chris Billington Subject: Re: [NEW]: productivity/jstock, stock market price/analysis To: Stuart Henderson Cc: ports@openbsd.org Date: Thu, 24 Jul 2025 19:58:19 +0800 On Thu, 24 Jul 2025 10:30:27 +0100 Stuart Henderson wrote: > On 2025/07/24 16:28, Chris Billington wrote: > > Proposed port productivity/jstock, a Java stock price/analysis > > program, is attached. Upstream: https://jstock.org. A matching > > Android application also exists. > > > > This is my first Java port so a practised eye to review and test > > would be much appreciated. > > > > Happy to act as Maintainer if accepted. > > > > -- > > Chris Billington > > some comments from a read-through: > > : JAVA_HOME=/usr/local/jdk-1.8.0/ > : PATH=$PATH:/usr/local/jdk-1.8.0/bin/ > > don't hardcode. use javaPathHelper to retrieve the paths based on > package installation info. > > if it specifically needs 1.8 then set it in MODJAVA_VER. > > : _JAVA_AWT_WM_NONREPARENTING=1 > > not exported so this does nothing. also it's WM-specific, shouldn't be > set in general anyway. > > > : COMMENT= Stock market software for 28 countries > > lowercase 'stock' > > I'd skip the number and just use e.g. 'various' to avoid it getting > out of sync with updates. maybe include 'gui' or similar? > > : V = 1.0.7.60 > : DISTNAME= jstock-${V} > .. > : EXTRACT_SUFX = .zip > : DISTFILES = ${DISTNAME}-bin${EXTRACT_SUFX} > > there are various neater ways to do this, I'd go with > > V = 1.0.7.60 > DISTNAME= jstock-${V} > .. > EXTRACT_SUFX= -bin.zip > > don't mix "VAR=" and "VAR =", stick to one > > : SITES = ${HOMEPAGE}/releases/download/release_1-0-7-60/ > > .../release-${V:S/./-/g} > > : post-extract: > : mv ${WRKDIR}/jstock ${WRKDIR}/${DISTNAME} > > WRKDIST=${WRKDIR}/jstock > > amd don't list Homepage in DESCR, it's added automatically so it's now > doubled. > > README should follow the standard formatting used in other ports. Thanks Stuart, I have implemented all your comments with the exception of WRKDIST=${WRKDIR}/jstock which I could not make work at the 'make fake' step. Unfortunately on further testing with real data it seems there are issues with realtime stock price fetching: - Yahoo API broken for current pricing, on all platforms - an exception thrown only when attempting to refresh stock prices: Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError at org.yccheok.jstock.gui.trading.TradingView.(TradingView.java:32) at org.yccheok.jstock.gui.trading.TradingView.(TradingView.java:33) at org.yccheok.jstock.gui.JStock.jMenuItem15ActionPerformed(JStock.java:1657) at org.yccheok.jstock.gui.JStock.access$2500(JStock.java:84) at org.yccheok.jstock.gui.JStock$16.actionPerformed(JStock.java:592) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.AbstractButton.doClick(AbstractButton.java:356) at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(BasicMenuItemUI.java:851) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1668) at javax.swing.JComponent.processKeyBinding(JComponent.java:2882) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:699) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:706) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:706) at javax.swing.JMenuBar.processKeyBinding(JMenuBar.java:677) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:307) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:293) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2974) at javax.swing.JComponent.processKeyBindings(JComponent.java:2966) at javax.swing.JComponent.processKeyEvent(JComponent.java:2845) at java.awt.Component.processEvent(Component.java:6316) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1958) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:834) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1102) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:973) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:799) at java.awt.Component.dispatchEventImpl(Component.java:4760) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: java.lang.UnsupportedOperationException: OpenBSD is not supported at com.sun.javafx.tk.Toolkit.getDefaultToolkit(Toolkit.java:194) at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:228) at com.sun.javafx.perf.PerformanceTracker.logEvent(PerformanceTracker.java:110) at javafx.scene.Node.(Node.java:387) (EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) ...which require further digging to see if I can fix them. "OpenBSD is not supported" sounds like a showstopper. -- Chris Billington