gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-536) Avoid calling Class#newInstance
Date Sun, 13 May 2018 18:56:00 GMT

    [ https://issues.apache.org/jira/browse/GORA-536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473607#comment-16473607
] 

ASF GitHub Bot commented on GORA-536:
-------------------------------------

Github user lewismc commented on the issue:

    https://github.com/apache/gora/pull/133
  
    Hi @carlosrmng when grepping for presence of ```newInstance()```, I get many more hits
    ```
    lmcgibbn@LMC-056430 /usr/local/gora(GORA-266) $ grep -lr "newInstance()" .
    ./gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
    ./gora-cassandra/src/examples/java/org/apache/gora/cassandra/example/generated/AvroSerialization/CassandraKey.java
    ./gora-cassandra/src/examples/java/org/apache/gora/cassandra/example/generated/AvroSerialization/CassandraRecord.java
    ./gora-cassandra/src/examples/java/org/apache/gora/cassandra/example/generated/nativeSerialization/ComplexTypes.java
    ./gora-cassandra/src/examples/java/org/apache/gora/cassandra/example/generated/nativeSerialization/Document.java
    ./gora-cassandra/src/examples/java/org/apache/gora/cassandra/example/generated/nativeSerialization/User.java
    ./gora-cassandra/src/main/java/org/apache/gora/cassandra/compiler/GoraCassandraNativeCompiler.java
    ./gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
    ./gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
    ./gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
    ./gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java
    ./gora-core/src/examples/java/org/apache/gora/examples/generated/ImmutableFields.java
    ./gora-core/src/examples/java/org/apache/gora/examples/generated/Metadata.java
    ./gora-core/src/examples/java/org/apache/gora/examples/generated/TokenDatum.java
    ./gora-core/src/examples/java/org/apache/gora/examples/generated/V2.java
    ./gora-core/src/examples/java/org/apache/gora/examples/generated/WebPage.java
    ./gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java
    ./gora-core/src/main/java/org/apache/gora/persistency/Persistent.java
    ./gora-core/src/main/java/org/apache/gora/persistency/ws/impl/BeanFactoryWSImpl.java
    ./gora-core/src/test/java/org/apache/gora/mock/persistency/MockPersistent.java
    ./gora-dynamodb/src/examples/java/org/apache/gora/dynamodb/example/generated/Person.java
    ./gora-dynamodb/src/examples/java/org/apache/gora/dynamodb/example/generated/Webpage.java
    ./gora-dynamodb/src/main/java/org/apache/gora/dynamodb/compiler/GoraDynamoDBCompiler.java
    ./gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBNativeStore.java
    ./gora-goraci/src/main/java/org/apache/gora/goraci/chef/ChefSoftwareProvisioning.java
    ./gora-goraci/src/main/java/org/apache/gora/goraci/generated/CINode.java
    ./gora-goraci/src/main/java/org/apache/gora/goraci/generated/Flushed.java
    ./gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
    ./gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanClient.java
    ./gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanStore.java
    ./gora-lucene/src/main/java/org/apache/gora/lucene/store/LuceneStore.java
    ./gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java
    ./gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java
    ```


> Avoid calling Class#newInstance
> -------------------------------
>
>                 Key: GORA-536
>                 URL: https://issues.apache.org/jira/browse/GORA-536
>             Project: Apache Gora
>          Issue Type: Task
>            Reporter: Ted Yu
>            Priority: Minor
>             Fix For: 0.9
>
>
> Class::newInstance is deprecated starting in Java 9 - https://bugs.openjdk.java.net/browse/JDK-6850612
- because it may throw undeclared checked exceptions.
> The suggested replacement is {{getDeclaredConstructor().newInstance()}}, which will wrap
the checked exceptions in InvocationException.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message