Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Remove warnings when compiling Gravitino #1809

Open
justinmclean opened this issue Jan 31, 2024 · 2 comments
Open

[Improvement] Remove warnings when compiling Gravitino #1809

justinmclean opened this issue Jan 31, 2024 · 2 comments
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

justinmclean commented Jan 31, 2024

What would you like to be improved?

Warning shows up when compiling Gravitino, adding -Xlint:unchecked gives this:

> Task :common:compileJava FAILED
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java:82: warning: [unchecked] unchecked call to withProperties(Map<String,String>) as a member of the raw type Builder
        .withProperties(metalake.properties())
                       ^
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java:132: warning: [unchecked] unchecked call to withProperties(Map<String,String>) as a member of the raw type Builder
        .withProperties(catalog.properties())
                       ^
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java:141: warning: [unchecked] unchecked call to withProperties(Map<String,String>) as a member of the raw type Builder
        .withProperties(schema.properties())
                       ^
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/util/DTOConverters.java:167: warning: [unchecked] unchecked call to withProperties(Map<String,String>) as a member of the raw type Builder
        .withProperties(table.properties())
                       ^
  where S is a type-variable:
    S extends Builder declared in class Builder
error: warnings found and -Werror specified
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/AuditDTO.java:90: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/AuditDTO.java:101: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/AuditDTO.java:112: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/AuditDTO.java:123: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/MetalakeDTO.java:86: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/MetalakeDTO.java:97: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/MetalakeDTO.java:108: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/MetalakeDTO.java:119: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/CatalogDTO.java:112: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/CatalogDTO.java:123: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/CatalogDTO.java:134: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/CatalogDTO.java:145: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/CatalogDTO.java:156: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/CatalogDTO.java:167: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/SchemaDTO.java:86: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/SchemaDTO.java:97: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/SchemaDTO.java:108: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/SchemaDTO.java:119: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/ColumnDTO.java:141: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/ColumnDTO.java:152: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/ColumnDTO.java:163: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/ColumnDTO.java:174: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/ColumnDTO.java:185: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/ColumnDTO.java:190: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:164: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:175: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:186: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:197: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:208: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:213: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:218: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:223: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/TableDTO.java:228: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java:93: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java:98: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
/Users/justin/gravitino/common/src/main/java/com/datastrato/gravitino/dto/rel/indexes/IndexDTO.java:103: warning: [unchecked] unchecked cast
      return (S) this;
                 ^
  required: S
  found:    Builder<S>
  where S is a type-variable:
    S extends Builder declared in class Builder
1 error
40 warnings

How should we improve?

Remove the warnings. This is required by https://www.bestpractices.dev/en

@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Jan 31, 2024
@surajguduru
Copy link

Hey @justinmclean I would like to work on this issue. Can you assign it to me?

@justinmclean
Copy link
Member Author

justinmclean commented Aug 9, 2024

Sure - this issue is quite old so the warnings may have changed since then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
Development

No branches or pull requests

2 participants