[JAVA-5202] Automatic module name was broken for Kotlin modules Created: 14/Oct/23  Updated: 10/Jan/24  Resolved: 27/Oct/23

Status: Closed
Project: Java Driver
Component/s: Build
Affects Version/s: 4.11.0
Fix Version/s: 4.11.1

Type: Bug Priority: Major - P3
Reporter: Yuri N/A Assignee: Slav Babanin
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2023-10-14-17-19-10-245.png    
Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Summary

Automatic module name was broken by name "org.mongodb.mongodb-driver-kotlin-coroutine", this violates the convention of [package naming|https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html]

Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

MongoDb driver kotlin coroutine 4.11.0

How to Reproduce

Use in any projects with modules or project Gradle Minecraft 1.19.2 with Forge 43.2.21.

Additional Background

I create a Pull Request in official Github with fix this problem.

 

Stacktrace:

 


Exception in thread "main" java.lang.IllegalArgumentException: org.mongodb.mongodb-driver-kotlin-coroutine: Invalid module name: 'mongodb-driver-kotlin-coroutine' is not a Java identifier     at java.base/jdk.internal.module.Checks.requireModuleName(Checks.java:59)     at java.base/java.lang.module.ModuleDescriptor$Builder.<init>(ModuleDescriptor.java:1515)     at java.base/java.lang.module.ModuleDescriptor.newAutomaticModule(ModuleDescriptor.java:2395)

 

 

Screenshot:



 Comments   
Comment by Slav Babanin [ 27/Oct/23 ]

Thank you iura.andrianov@Yandex.ru for bringing this issue to our attention. The fix for this issue will be included in the 4.11.1 patch release.

Comment by Githook User [ 26/Oct/23 ]

Author:

{'name': 'Viacheslav Babanin', 'email': 'frest0512@gmail.com', 'username': 'vbabanin'}

Message: Add explicit automatic module name configuration. (#1232)

JAVA-5213
JAVA-5202
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/aa4c0f1344ad1e003555d4d4dea7ad1a94460aee

Comment by Yuri N/A [ 16/Oct/23 ]

I discovered this bug with bson-kotlin and maybe bug with bson-kotlinx

Comment by Yuri N/A [ 14/Oct/23 ]

Pull request

Comment by PM Bot [ 14/Oct/23 ]

Hi iura.andrianov@Yandex.ru, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:04:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.