From 1d4f89c78e651afd8cb30be106c60f05cd08f9e9 Mon Sep 17 00:00:00 2001 From: Robinson Date: Fri, 23 Jun 2023 21:05:49 +0200 Subject: [PATCH] code cleanup --- src/dorkbox/netUtil/dnsUtils/ResolveConf.kt | 5 ++-- .../netUtil/dnsUtils/package-info.java | 17 +++++++++++++ src/dorkbox/netUtil/jna/package-info.java | 17 +++++++++++++ .../netUtil/jna/windows/package-info.java | 17 +++++++++++++ .../jna/windows/structs/package-info.java | 17 +++++++++++++ src/dorkbox/netUtil/package-info.java | 17 +++++++++++++ src/dorkbox/netUtil/ping/package-info.java | 17 +++++++++++++ src9/dorkbox/netUtil/web/EmptyClass.java | 24 +++++++++++++++++++ src9/module-info.java | 15 ++++++------ 9 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 src/dorkbox/netUtil/dnsUtils/package-info.java create mode 100644 src/dorkbox/netUtil/jna/package-info.java create mode 100644 src/dorkbox/netUtil/jna/windows/package-info.java create mode 100644 src/dorkbox/netUtil/jna/windows/structs/package-info.java create mode 100644 src/dorkbox/netUtil/package-info.java create mode 100644 src/dorkbox/netUtil/ping/package-info.java create mode 100644 src9/dorkbox/netUtil/web/EmptyClass.java diff --git a/src/dorkbox/netUtil/dnsUtils/ResolveConf.kt b/src/dorkbox/netUtil/dnsUtils/ResolveConf.kt index e61c10d..6409248 100644 --- a/src/dorkbox/netUtil/dnsUtils/ResolveConf.kt +++ b/src/dorkbox/netUtil/dnsUtils/ResolveConf.kt @@ -1,5 +1,5 @@ /* - * Copyright 2016 dorkbox, llc + * Copyright 2023 dorkbox, llc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -189,7 +189,7 @@ object ResolveConf { var nameServers = mutableListOf() val nameServerDomains = mutableMapOf>() - @Suppress("unused") + @Suppress("UNUSED_VARIABLE") var port = 53 // this is really used, it's just that the kotlin compiler doesn't notice var domainName = Dns.DEFAULT_SEARCH_DOMAIN var line0: String? @@ -247,6 +247,7 @@ object ResolveConf { "error parsing label $PORT_ROW_LABEL in file $path value: $line" } + @Suppress("UNUSED_VALUE") port = line.substring(i).toInt() } } diff --git a/src/dorkbox/netUtil/dnsUtils/package-info.java b/src/dorkbox/netUtil/dnsUtils/package-info.java new file mode 100644 index 0000000..c71e2ad --- /dev/null +++ b/src/dorkbox/netUtil/dnsUtils/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil.dnsUtils; diff --git a/src/dorkbox/netUtil/jna/package-info.java b/src/dorkbox/netUtil/jna/package-info.java new file mode 100644 index 0000000..2b0455c --- /dev/null +++ b/src/dorkbox/netUtil/jna/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil.jna; diff --git a/src/dorkbox/netUtil/jna/windows/package-info.java b/src/dorkbox/netUtil/jna/windows/package-info.java new file mode 100644 index 0000000..c1b9806 --- /dev/null +++ b/src/dorkbox/netUtil/jna/windows/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil.jna.windows; diff --git a/src/dorkbox/netUtil/jna/windows/structs/package-info.java b/src/dorkbox/netUtil/jna/windows/structs/package-info.java new file mode 100644 index 0000000..6853650 --- /dev/null +++ b/src/dorkbox/netUtil/jna/windows/structs/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil.jna.windows.structs; diff --git a/src/dorkbox/netUtil/package-info.java b/src/dorkbox/netUtil/package-info.java new file mode 100644 index 0000000..3faa3ed --- /dev/null +++ b/src/dorkbox/netUtil/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil; diff --git a/src/dorkbox/netUtil/ping/package-info.java b/src/dorkbox/netUtil/ping/package-info.java new file mode 100644 index 0000000..f895884 --- /dev/null +++ b/src/dorkbox/netUtil/ping/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil.ping; diff --git a/src9/dorkbox/netUtil/web/EmptyClass.java b/src9/dorkbox/netUtil/web/EmptyClass.java new file mode 100644 index 0000000..2e24ec8 --- /dev/null +++ b/src9/dorkbox/netUtil/web/EmptyClass.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 dorkbox, llc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dorkbox.netUtil.web; + +/** + * Required for intellij to not complain regarding `module-info` for a multi-release jar. + * This file is completely ignored by the gradle build process + */ +public +class EmptyClass {} diff --git a/src9/module-info.java b/src9/module-info.java index 720a5fe..2f47ff0 100644 --- a/src9/module-info.java +++ b/src9/module-info.java @@ -3,15 +3,16 @@ module dorkbox.netutil { exports dorkbox.netUtil.dnsUtils; exports dorkbox.netUtil.jna; exports dorkbox.netUtil.ping; + exports dorkbox.netUtil.web; - requires dorkbox.executor; - requires dorkbox.updates; + requires transitive dorkbox.executor; + requires transitive dorkbox.updates; - requires org.slf4j; + requires transitive kotlin.stdlib; + requires transitive kotlinx.coroutines.core; - requires com.sun.jna; - requires com.sun.jna.platform; + requires static com.sun.jna; + requires static com.sun.jna.platform; - requires kotlin.stdlib; - requires java.base; + requires static org.slf4j; }