Corrected Access Specifier modification 79/48179/2
authorRich Tabedzki <richard.tabedzki@att.com>
Fri, 18 May 2018 14:11:53 +0000 (10:11 -0400)
committerTimoney, Dan (dt5972) <dt5972@att.com>
Thu, 7 Jun 2018 17:45:58 +0000 (13:45 -0400)
Changes made:
* Removed calls to Method::setAccessible(true)

Change-Id: I5a73939383859cb7e5a241be8b3d4f52cea3c45a
Issue-ID: CCSDK-287
Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com>
aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java

index d7b25b4..e02caac 100755 (executable)
@@ -1082,7 +1082,6 @@ public abstract class AAIDeclarations implements AAIClient {
                                 setter = resourceClass.getMethod("set"+StringUtils.capitalize(value), type);
                                 if(type.getName().startsWith("java.lang") || "boolean".equals(type.getName()) || "long".equals(type.getName()) || "int".equals(type.getName())) {
                                     try {
-                                        setter.setAccessible(true);
                                         Object arglist[] = new Object[1];
                                         arglist[0] = params.get(id);
 
@@ -1184,7 +1183,6 @@ public abstract class AAIDeclarations implements AAIClient {
                 Method method = getters.get(attribute);
                 if(method != null) {
                     try {
-                        method.setAccessible(true);
                         Object arglist[] = new Object[0];
 //                        arglist[0] = value;
                         Class<?>[] types = method.getParameterTypes();
@@ -1220,7 +1218,6 @@ public abstract class AAIDeclarations implements AAIClient {
 
                 if(getRelationshipListMethod != null){
                     try {
-                        getRelationshipListMethod.setAccessible(true);
                         obj = getRelationshipListMethod.invoke(instance);
                     } catch (InvocationTargetException x) {
                         Throwable cause = x.getCause();
@@ -1233,7 +1230,6 @@ public abstract class AAIDeclarations implements AAIClient {
                     Method setRelationshipListMethod = resourceClass.getMethod("setRelationshipList", RelationshipList.class);
                     if(setRelationshipListMethod != null){
                         try {
-                            setRelationshipListMethod.setAccessible(true);
                             Object arglist[] = new Object[1];
                             arglist[0] = relationshipList;
 
@@ -1320,7 +1316,6 @@ public abstract class AAIDeclarations implements AAIClient {
                 Method getVLansMethod = resourceClass.getMethod("getVlans");
                 if(getVLansMethod != null){
                     try {
-                        getVLansMethod.setAccessible(true);
                         obj = getVLansMethod.invoke(instance);
                     } catch (InvocationTargetException x) {
                         Throwable cause = x.getCause();
@@ -1333,7 +1328,6 @@ public abstract class AAIDeclarations implements AAIClient {
                     Method setVlansMethod = resourceClass.getMethod("setVlans", Vlans.class);
                     if(setVlansMethod != null){
                         try {
-                            setVlansMethod.setAccessible(true);
                             Object arglist[] = new Object[1];
                             arglist[0] = vlanList;
 
@@ -1386,7 +1380,6 @@ public abstract class AAIDeclarations implements AAIClient {
                 Method getMetadataMethod = resourceClass.getMethod("getMetadata");
                 if(getMetadataMethod != null){
                     try {
-                        getMetadataMethod.setAccessible(true);
                         obj = getMetadataMethod.invoke(instance);
                     } catch (InvocationTargetException x) {
                         Throwable cause = x.getCause();
@@ -1399,7 +1392,6 @@ public abstract class AAIDeclarations implements AAIClient {
                     Method setMetadataMethod = resourceClass.getMethod("setMetadata", Metadata.class);
                     if(setMetadataMethod != null){
                         try {
-                            setMetadataMethod.setAccessible(true);
                             Object arglist[] = new Object[1];
                             arglist[0] = metadataList;
 
@@ -1508,7 +1500,6 @@ public abstract class AAIDeclarations implements AAIClient {
             }
             if(getRelationshipListMethod != null){
                 try {
-                    getRelationshipListMethod.setAccessible(true);
                     obj = getRelationshipListMethod.invoke(instance);
                 } catch (InvocationTargetException x) {
                     Throwable cause = x.getCause();
@@ -1521,7 +1512,6 @@ public abstract class AAIDeclarations implements AAIClient {
                 Method setRelationshipListMethod = resourceClass.getMethod("setRelationshipList", RelationshipList.class);
                 if(setRelationshipListMethod != null){
                     try {
-                        setRelationshipListMethod.setAccessible(true);
                         Object arglist[] = new Object[1];
                         arglist[0] = relationshipList;
 
@@ -1643,7 +1633,6 @@ public abstract class AAIDeclarations implements AAIClient {
             Method getMetadataMethod = resourceClass.getMethod("getMetadata");
             if(getMetadataMethod != null){
                 try {
-                    getMetadataMethod.setAccessible(true);
                     obj = getMetadataMethod.invoke(instance);
                 } catch (InvocationTargetException x) {
                     Throwable cause = x.getCause();
@@ -1656,7 +1645,6 @@ public abstract class AAIDeclarations implements AAIClient {
                 Method setMetadataMethod = resourceClass.getMethod("setMetadata", Metadata.class);
                 if(setMetadataMethod != null){
                     try {
-                        setMetadataMethod.setAccessible(true);
                         setMetadataMethod.invoke(instance, metadata);
                     } catch (InvocationTargetException x) {
                     }
@@ -1783,7 +1771,6 @@ public abstract class AAIDeclarations implements AAIClient {
             Method getResourceVersionMethod = resourceClass.getMethod("getResourceVersion");
             if(getResourceVersionMethod != null){
                 try {
-                    getResourceVersionMethod.setAccessible(true);
                     Object object = getResourceVersionMethod.invoke(instance);
                     if(object != null)
                         resourceVersion = object.toString();
@@ -1802,7 +1789,6 @@ public abstract class AAIDeclarations implements AAIClient {
             }
             if(getRelationshipListMethod != null){
                 try {
-                    getRelationshipListMethod.setAccessible(true);
                     obj = getRelationshipListMethod.invoke(instance);
                 } catch (InvocationTargetException x) {
                     Throwable cause = x.getCause();
@@ -1900,7 +1886,6 @@ public abstract class AAIDeclarations implements AAIClient {
             Method getResourceVersionMethod = resourceClass.getMethod("getResourceVersion");
             if(getResourceVersionMethod != null){
                 try {
-                    getResourceVersionMethod.setAccessible(true);
                     resourceVersion = (String) getResourceVersionMethod.invoke(instance);
                 } catch (InvocationTargetException x) {
                 }
@@ -1911,7 +1896,6 @@ public abstract class AAIDeclarations implements AAIClient {
             Method getMetadataMethod = resourceClass.getMethod("getMetadata");
             if(getMetadataMethod != null){
                 try {
-                    getMetadataMethod.setAccessible(true);
                     obj = getMetadataMethod.invoke(instance);
                 } catch (InvocationTargetException x) {
                     Throwable cause = x.getCause();