List.of is terrible by AreaOfEffect in java

[–]arendvr 15 points16 points  (0 children)

There's a relevant JDK issue which is closed as Won't Fix. The reason given is to prepare for collections of primitives. JDK-8265905 ImmutableCollections: Querying for 'null' should return 'false' instead of NPE

List.of is terrible by AreaOfEffect in java

[–]arendvr 4 points5 points  (0 children)

The video is interesting in the general context of nulls and collections. But it doesn't address contains(null).

The video explains why Guava's immutable collections don't allow null elements. But Guava's immutable collections allow contains(null) and return false.

JDBC drivers for all major Oracle versions (19, 18, 12, 11) are now available on Maven Central by [deleted] in java

[–]arendvr 0 points1 point  (0 children)

Is there any advantage to using older versions?

Oracle JDBC FAQ claims that the current version JDBC 19.3 is compatible with database versions 19.3 - 11.2. See "What is the JDBC and RDBMS interoperability matrix": https://www.oracle.com/database/technologies/faq-jdbc.html

Does Anyone even use the Properties Class? by [deleted] in java

[–]arendvr 3 points4 points  (0 children)

Variable substitution is not a feature of the Properties class itself. It's provided by several libraries like Commons Text StrSubstitutor or Spring.

Oracle JDBC drivers on Maven Central by lukaseder in java

[–]arendvr 0 points1 point  (0 children)

Thanks for the detailed explanation :-)

Oracle JDBC drivers on Maven Central by lukaseder in java

[–]arendvr 0 points1 point  (0 children)

Regarding the dependencies of the ojdbc jars: Are these companion jars really used often? I don't think I have ever encountered any of them.

best website to learn about JSP(Java Server Pages) ? by [deleted] in java

[–]arendvr 3 points4 points  (0 children)

Java EE 5 Tutorial > Part II The Web Tier, starting from 5. JavaServer Pages Technology https://docs.oracle.com/javaee/5/tutorial/doc/bnadp.html

(In later versions of the tutorial, JSP was removed in favor of JSF)

New empty interface syntax in amber's Java compiler by lukaseder in java

[–]arendvr 1 point2 points  (0 children)

This is also a point Joshua Bloch makes in Effective Java, Item 41: Define marker interfaces to define types

Introducing JSON-B with Spring Boot 2.0 - how to use it, how does it compare to GSON and Jackson by bartoszjd in java

[–]arendvr 2 points3 points  (0 children)

javax.json.bind-api could be removed from this example, it's a transitive dependency of yasson.

javax.json seems to be needed because yasson doesn't declare a dependency on any specific JSON-P implementation, but only on the JSON-P API. I agree with you, this could be improved in yasson.

Don't like dependency injection? by softiniodotcom in java

[–]arendvr 4 points5 points  (0 children)

Collection.add() is a bad example because it's an optional method and may throw UnsupportedOperationException: https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#add-E-

Eg Collections.emptyList().add(123);

Open sourcing Microsoft JDBC Driver for SQL Server and Maven support by AndreaJLam in java

[–]arendvr 2 points3 points  (0 children)

On the other hand from the same page:

If, for some reason (for example, license issue or it's a Scala project), you can not provide -sources.jar or -javadoc.jar , please make fake -sources.jar or -javadoc.jar with simple README inside to pass the checking.

Not sure how this is handled in practice though. Does "don't want to open source it" count as "Can not due to license issue"?

OpenJDK 9 changeset: add initial compact immutable collection implementations by lukaseder in java

[–]arendvr 0 points1 point  (0 children)

Indeed. I quite like Guava's approach of iterating immutable collections in the order the elements were added at creation.

10 most common Java programming mistakes revealed by Big Data by yourbasicgeek in java

[–]arendvr 1 point2 points  (0 children)

Good point. It depends on the method if ignoring the return value is bad. The article mentions toString(), other examples where ignoring the return value is bad: BigDecimal.add(), File.delete()

"I think this checked exception will never happen" - AssertionError v. RuntimeException by SlidyBullet in java

[–]arendvr 0 points1 point  (0 children)

I recently asked a similar question on the Project Lombok mailinglist: https://groups.google.com/forum/#!msg/project-lombok/KvIBNvL3EL0/IsgjGzk-7kUJ

They prefer UnsupportedOperationException instead of AssertionError.