Skip to content

[SPARK-49020] Avoid raw type usage#26

Closed
dongjoon-hyun wants to merge 1 commit into
apache:mainfrom
dongjoon-hyun:SPARK-49020
Closed

[SPARK-49020] Avoid raw type usage#26
dongjoon-hyun wants to merge 1 commit into
apache:mainfrom
dongjoon-hyun:SPARK-49020

Conversation

@dongjoon-hyun
Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun commented Jul 26, 2024

What changes were proposed in this pull request?

This PR aims to avoid raw type usage.

A raw type is the name of a generic class or interface without any type arguments.

Why are the changes needed?

We need to use use generic types like the following.

- Class listenerClass = Class.forName(name);
+ Class<?> listenerClass = Class.forName(name);
- public static Object resolveValueToPrimitiveType(Class clazz, String value) {
+ public static Object resolveValueToPrimitiveType(Class<?> clazz, String value) {

Or, we can use var syntax like the following.

- SentinelManager sentinelManager = new SentinelManager<SparkApplication>();
+ var sentinelManager = new SentinelManager<SparkApplication>();

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the CIs.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun
Copy link
Copy Markdown
Member Author

Could you review this, @jiangzho and @viirya ?

@dongjoon-hyun
Copy link
Copy Markdown
Member Author

Thank you, @viirya .
Merged to main.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-49020 branch July 27, 2024 00:02
@dongjoon-hyun dongjoon-hyun mentioned this pull request Jul 29, 2024
jiangzho pushed a commit to jiangzho/spark-kubernetes-operator that referenced this pull request Jul 17, 2025
### What changes were proposed in this pull request?

This PR aims to avoid `raw` type usage.

- https://docs.oracle.com/javase/tutorial/java/generics/rawTypes.html
> A raw type is the name of a generic class or interface without any type arguments.

### Why are the changes needed?

We need to use use generic types like the following.

```java
- Class listenerClass = Class.forName(name);
+ Class<?> listenerClass = Class.forName(name);
```

```java
- public static Object resolveValueToPrimitiveType(Class clazz, String value) {
+ public static Object resolveValueToPrimitiveType(Class<?> clazz, String value) {
```

Or, we can use `var` syntax like the following.

```java
- SentinelManager sentinelManager = new SentinelManager<SparkApplication>();
+ var sentinelManager = new SentinelManager<SparkApplication>();
```

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#26 from dongjoon-hyun/SPARK-49020.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
jiangzho added a commit to jiangzho/spark-kubernetes-operator that referenced this pull request Jul 17, 2025
Sync main branch into apple internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants