java-9

Can a Subscriber act as a Publisher?

蓝咒 提交于 2019-12-08 09:12:23
In terms of Reactive Streams, there is a Publisher and it could have as many Subscribers. But suppose, a subscriber gets a message from Publisher. Now this Subscriber(say Subs1) changes/modifies the message and passes it to some other Subscriber(say Subs2), which consumes the modified message. So can this Subs1 subscriber can act as a Publisher which can pass on message to new Subs2 subscriber? I am not sure if it possible or not, but the scenario is possible i think. If its possible, please suggest a possible way to do this. If we want to transform incoming message and pass it further to the

Can a Subscriber act as a Publisher?

核能气质少年 提交于 2019-12-08 08:47:19
问题 In terms of Reactive Streams, there is a Publisher and it could have as many Subscribers. But suppose, a subscriber gets a message from Publisher. Now this Subscriber(say Subs1) changes/modifies the message and passes it to some other Subscriber(say Subs2), which consumes the modified message. So can this Subs1 subscriber can act as a Publisher which can pass on message to new Subs2 subscriber? I am not sure if it possible or not, but the scenario is possible i think. If its possible, please

How to replace --add-modules java.xml.ws

风流意气都作罢 提交于 2019-12-08 08:05:51
问题 I did migrate my Maven based project to SpringBoot 2.0 and Java 9. In the process, I had to add some dependencies to get rid of Java 9 warnings regarding modules (that still can be added with --add-modules). However I am unable to get rid off --add-modules java.xml.ws . As suggested in JEP 320, adding dependencies: <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId

JavaFX 9/10 no longer possible to override TableView.resizeColumnToFitContent

自闭症网瘾萝莉.ら 提交于 2019-12-08 05:22:26
问题 In JavaFX 8 it was possible to override the TableView.resizeColumnToFitContent function. This is vital for our purposes since it allows us to enhance the way column headers are laid out beyond the default implementation, as well as to tune the performance where the default suffers somewhat in larger tables. One example of how the layout behaviour has been enhanced is in the context of nested column headers. By default a leaf column header's prefWidth is set according to either the max width

An illegal reflective access operation has occurred while executing automated tests using Selenium and Java 9

拈花ヽ惹草 提交于 2019-12-08 04:36:18
问题 I having a strange issue with my selenium test When I am opening my chrome browser im receiving 2 errors: [1569419754.430][WARNING]: Timed out connecting to Chrome, retrying... [1569419759.899][WARNING]: Timed out connecting to Chrome, retrying... Before the browser actually opens. I also noticed at the end of the test there are numerous warnings: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.openqa.selenium.os.ProcessUtils WARNING:

How to take user input in jshell script?

有些话、适合烂在心里 提交于 2019-12-08 02:41:47
问题 Question: How to take user input in jshell script ? or what I'm doing wrong? Note: I'm NOT looking how to pass arguments to jshell script. Example: For example script hello.java : Scanner in = new Scanner(System.in); System.out.print("Enter number n1: "); int n1 = in.nextInt(); System.out.print("Enter number n2: "); int n2 = in.nextInt(); System.out.println("n1 + n2 = "+ (n1 +n2)); /exit It works if I type line by line in jshell, but then I run jshell hello.java it doesn't. Throws java.util

Why does javac complain about named automatic-modules?

限于喜欢 提交于 2019-12-07 20:46:34
问题 Why does the Java 9 compiler warn "requires directive for an automatic module" if module-info.java references automatic modules with "Automatic-Module-Name" set? What's the risk of such modules? This question isn't an exact duplicate of What is an automatic module? because the latter does not address the specific reasons behind the compiler warning I have referenced (the context of the question matters). That said, it is a useful link for follow-up reading. 回答1: Quoting Remi Forax: The main

Is there a way to remove imports in JShell?

♀尐吖头ヾ 提交于 2019-12-07 16:48:41
问题 I'm discovering JShell and I discovered the imports added in by default: jshell> /imports | import java.io.* | import java.math.* | import java.net.* | import java.nio.file.* | import java.util.* | import java.util.concurrent.* | import java.util.function.* | import java.util.prefs.* | import java.util.regex.* | import java.util.stream.* After doing that I added my own import using the following command: import java.lang.Math Is there a way to remove the latter import without killing the

Java 9: how to add further jar files to classpath dynamically [duplicate]

柔情痞子 提交于 2019-12-07 16:18:40
问题 This question already has answers here : Add jar to classpath at runtime under java 9 (2 answers) Closed last year . Our Java-based application has a tiny "bootloader.jar" and the core application jars. The core application jars might be loaded either from the default (file system) location or from another where a previous application run might have downloaded updated jars. The bootloader runs following code: final List<File> jars = getJarsToAddToClasspath(); final String mainClassName =

Java 9 migration javax.annotation

血红的双手。 提交于 2019-12-07 14:45:38
问题 So i try to migrate my project to Java 9 but the process seems not so easy as i thought it would be. I kept getting some errors about invisible packages that i could fix with the following argument in my pom: <compilerArgs> <arg>--add-modules</arg> <arg>java.se.ee</arg> </compilerArgs> But i still get the following error: cannot find symbol [ERROR] symbol: class Priority [ERROR] location: package javax.annotation any help would be appreciated 回答1: I'm not sure where javax.annotation.Priority