@@ -26,33 +26,40 @@ public class GrafeasTransport extends Transport {
26
26
URI uri ;
27
27
GrafeasOccurrence occurrence ;
28
28
29
- public class GrafeasInTotoMetadata {
29
+ public static class GrafeasInTotoMetadata {
30
30
// This class exists to represent the signed document format for Grafeas
31
31
// in-toto links.
32
32
33
- public ArrayList <Signature > signatures = new ArrayList <Signature >();
34
- public GrafeasInTotoLink signed ;
33
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
34
+ private ArrayList <Signature > signatures = new ArrayList <Signature >();
35
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
36
+ private GrafeasInTotoLink signed ;
35
37
36
- private class GrafeasInTotoLink {
38
+ private static class GrafeasInTotoLink {
37
39
// This class exists to represent the Grafeas document format for
38
40
// in-toto links.
39
41
40
- private class Artifact {
41
- public String resourceUri ;
42
- public Map <String , String > hashes ;
42
+ private static class Artifact {
43
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
44
+ private String resourceUri ;
45
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
46
+ private Map <String , String > hashes ;
43
47
44
- public Artifact (String resourceUri , Map <String , String > hashes ) {
48
+ private Artifact (String resourceUri , Map <String , String > hashes ) {
45
49
this .resourceUri = resourceUri ;
46
50
this .hashes = hashes ;
47
51
}
48
52
49
53
}
50
54
51
- public List <String > command = new ArrayList <String >();
52
- public List <Artifact > materials = new ArrayList <Artifact >();
53
- public List <Artifact > products = new ArrayList <Artifact >();
54
- public Map <String , Map <String , String >> byproducts = new HashMap <String , Map <String , String >>();
55
- public Map <String , Map <String , String >> environment = new HashMap <String , Map <String , String >>();
55
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
56
+ private List <String > command = new ArrayList <String >();
57
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
58
+ private List <Artifact > materials = new ArrayList <Artifact >();
59
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
60
+ private List <Artifact > products = new ArrayList <Artifact >();
61
+ private Map <String , Map <String , String >> byproducts = new HashMap <String , Map <String , String >>();
62
+ private Map <String , Map <String , String >> environment = new HashMap <String , Map <String , String >>();
56
63
57
64
public GrafeasInTotoLink (List <String > command ,
58
65
Map <String , ArtifactHash > materials ,
@@ -75,13 +82,13 @@ public GrafeasInTotoLink(List<String> command,
75
82
}
76
83
77
84
Map <String , String > stringByproducts = new HashMap <String , String >();
78
- for (String byproduct : byproducts .keySet ()) {
79
- stringByproducts .put (byproduct , String .valueOf (byproducts . get ( byproduct )));
85
+ for (Map . Entry < String , Object > entry : byproducts .entrySet ()) {
86
+ stringByproducts .put (entry . getKey () , String .valueOf (entry . getValue ( )));
80
87
}
81
88
82
89
Map <String , String > stringEnvironment = new HashMap <String , String >();
83
- for (String env : environment .keySet ()) {
84
- stringEnvironment .put (env , String .valueOf (environment . get ( env )));
90
+ for (Map . Entry < String , Object > entry : environment .entrySet ()) {
91
+ stringEnvironment .put (entry . getKey () , String .valueOf (entry . getValue ( )));
85
92
}
86
93
87
94
this .byproducts .put ("customValues" , stringByproducts );
@@ -102,11 +109,14 @@ public GrafeasInTotoMetadata(Link link) {
102
109
}
103
110
104
111
105
- public class GrafeasOccurrence {
106
- public String noteName ;
107
- public Map <String , String > resource = new HashMap <String , String >();
108
- public String kind = "INTOTO" ;
109
- public GrafeasInTotoMetadata intoto ;
112
+ public static class GrafeasOccurrence {
113
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
114
+ private String noteName ;
115
+ private Map <String , String > resource = new HashMap <String , String >();
116
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
117
+ private String kind = "INTOTO" ;
118
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
119
+ private GrafeasInTotoMetadata intoto ;
110
120
111
121
public GrafeasOccurrence (String noteName , String resourceUri ) {
112
122
this .noteName = noteName ;
@@ -144,6 +154,7 @@ public GrafeasTransport(URI uri) {
144
154
145
155
Map <String , String > parameterMap = GrafeasTransport .getParameterMap (parameterString );
146
156
157
+ @ edu .umd .cs .findbugs .annotations .SuppressWarnings ("URF_UNREAD_FIELD" )
147
158
GrafeasOccurrence occurrence = new GrafeasOccurrence (
148
159
parameterMap .get ("noteName" ),
149
160
parameterMap .get ("resourceUri" )
0 commit comments