Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for watchmakerâ€
| Type | On... | Excerpt | Status | Date |
|---|---|---|---|---|
| Edit | Post #295115 | Initial revision | — | 10 months ago |
| Question | — |
Setting icon with javaFX does not show in task list I try to set an icon (.png) with javaFX, but it does not show in the task bar, instead I see the default icon (white cogwheel on light gray background). Here is my code: ``` package application; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; ... (more) |
— | 10 months ago |
| Edit | Post #295095 | Initial revision | — | 10 months ago |
| Question | — |
Java: ignore warnings from generated code Again, I'm playing around with `javaCC`, and get those annoying warnings about "unused" and "dead code". Is there a decent way to put a `@SuppressWarnings` annotation on a whole package but not on the whole project or workspace? (more) |
— | 10 months ago |
| Comment | Post #295050 |
I got confused about saved drafts and posted this again, luckily the copy is deleted now. (more) |
— | 10 months ago |
| Edit | Post #295070 | Initial revision | — | 10 months ago |
| Question | — |
eclipse: change toString to prettyPrint The task looks ridiculously simple, but I could not find a way of doing it but manually. I have a class with a `@Override ... toString()` method. I want to diversify this to a more specialized method that takes parameters to specify what should show up. Eclipse failed to simply rename ... (more) |
— | 10 months ago |
| Edit | Post #295050 |
Post edited: silly typo in header that would prevent searge engins to find it |
— | 10 months ago |
| Edit | Post #295050 | Initial revision | — | 10 months ago |
| Question | — |
eclipse templates -- creating and setting a permanent variable In eclipse (java) Window->Preferences->Java->New new templates can be created. In the field "Pattern" I entered ``` System.out.println("DEBUG ${label}"); ${cursor} ``` I like old-style debugging, so I use a lot statements like `System.out.println("DEBUG A");` ... `System.out.println("... (more) |
— | 10 months ago |
| Edit | Post #294977 |
Post edited: typo |
— | 10 months ago |
| Edit | Post #294977 |
Post edited: short summerization of the answers |
— | 10 months ago |
| Edit | Post #294977 | Initial revision | — | 10 months ago |
| Question | — |
java.time.ZonedDateTime missing seconds in output When printing a `java.time.ZonedDateTime`, it's missing the seconds in output, is it a bug or a feature? See my code: ```java package tryNcry; import java.time.Instant; import java.time.ZoneId; import java.time.ZonedDateTime; public class TestOfTime { public static void main(St... (more) |
— | 10 months ago |
| Comment | Post #294826 |
The solution with varargs looks interesting, I wasn't thinking of that. I had thought of the first alternative, but passing an instance instead of a class-object.
As you mentioned, it looks like there is no straightforward solution. And, if the java dev-team would drop the erasure, there woul... (more) |
— | 11 months ago |
| Edit | Post #294813 | Initial revision | — | 11 months ago |
| Question | — |
Java generics, how to work around type erasure? This code doesn't compile: ```java package tryNcry; public class ExampleClass { S[] createArray(int n) { return new S[n]; // obvious compile time ERROR here: // Cannot create a generic array of S } } ``` The reason for this is obvious: due t... (more) |
— | 11 months ago |
| Comment | Post #294729 |
"When you give code a type, you are typing the variable, not the value."
OK, looks like this is the main clue I was missing.
So (Huge question mark here) the *variable* expects a *value* `Function<?, ?>` which is *broader* than the lambda expression given.
The compiler has to make sure th... (more) |
— | 11 months ago |
| Edit | Post #294726 | Initial revision | — | 11 months ago |
| Question | — |
Trouble understanding java lambdas and generics Of course, everyone thinks to understand lambdas and generics. I was one of those until recently. Look at my code: ```java package debug; import java.util.function.Function; public class UnderstandingGenerix { public static void main(String[] args) { { Function code = (S... (more) |
— | 11 months ago |
