Skip to content

Commit c74c49b

Browse files
committed
Added protections against overflowing limit parameter
1 parent 6967873 commit c74c49b

File tree

13 files changed

+520
-186
lines changed

13 files changed

+520
-186
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters;
21+
22+
/**
23+
* Auto-generated code used to translate Guild a JSON Response to a Java object
24+
*
25+
* @author Micc
26+
*
27+
*/
28+
public class ErrorMessage {
29+
Error ErrorObject;
30+
private float status_code;
31+
32+
33+
// Getter Methods
34+
35+
public Error getError() {
36+
return ErrorObject;
37+
}
38+
39+
public float getStatus_code() {
40+
return status_code;
41+
}
42+
43+
// Setter Methods
44+
45+
public void setError( Error errorObject ) {
46+
this.ErrorObject = errorObject;
47+
}
48+
49+
public void setStatus_code( float status_code ) {
50+
this.status_code = status_code;
51+
}
52+
53+
54+
public class Error {
55+
private String message;
56+
57+
// Getter Methods
58+
public String getMessage() {
59+
return message;
60+
}
61+
62+
// Setter Methods
63+
public void setMessage( String message ) {
64+
this.message = message;
65+
}
66+
}
67+
}
68+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters;
21+
22+
/**
23+
* Auto-generated code used to translate Guild a JSON Response to a Java object
24+
*
25+
* @author Micc
26+
*
27+
*/
28+
public class Guild
29+
{
30+
private String id;
31+
32+
private String icon;
33+
34+
private String name;
35+
36+
public String getId ()
37+
{
38+
return id;
39+
}
40+
41+
public void setId (String id)
42+
{
43+
this.id = id;
44+
}
45+
46+
public String getIcon ()
47+
{
48+
return icon;
49+
}
50+
51+
public void setIcon (String icon)
52+
{
53+
this.icon = icon;
54+
}
55+
56+
public String getName ()
57+
{
58+
return name;
59+
}
60+
61+
public void setName (String name)
62+
{
63+
this.name = name;
64+
}
65+
66+
@Override
67+
public String toString()
68+
{
69+
return "ClassPojo [id = "+id+", icon = "+icon+", name = "+name+"]";
70+
}
71+
}

src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/MeeResponse.java renamed to src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/Adapters/MeeResponse.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures;
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters;
21+
22+
/**
23+
* Auto-generated code used to translate Guild a JSON Response to a Java object
24+
*
25+
* @author Micc
26+
*
27+
*/
228
public class MeeResponse
329
{
430
private Role_rewards[] role_rewards;

src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/Players.java renamed to src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/Adapters/Players.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures;
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters;
21+
22+
/**
23+
* Auto-generated code used to translate Guild a JSON Response to a Java object
24+
*
25+
* @author Micc
26+
*
27+
*/
228
public class Players
329
{
430
private String id;

src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/Role.java renamed to src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/Adapters/Role.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures;
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters;
21+
22+
/**
23+
* Auto-generated code used to translate Guild a JSON Response to a Java object
24+
*
25+
* @author Micc
26+
*
27+
*/
228
public class Role
329
{
430
private int position;
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters;
21+
22+
/**
23+
* Auto-generated code used to translate Guild a JSON Response to a Java object
24+
*
25+
* @author Micc
26+
*
27+
*/
28+
public class Role_rewards
29+
{
30+
private int rank;
31+
32+
private Role role;
33+
34+
public int getRank ()
35+
{
36+
return rank;
37+
}
38+
39+
public void setRank (int rank)
40+
{
41+
this.rank = rank;
42+
}
43+
44+
public Role getRole ()
45+
{
46+
return role;
47+
}
48+
49+
public void setRole (Role role)
50+
{
51+
this.role = role;
52+
}
53+
54+
@Override
55+
public String toString()
56+
{
57+
return "ClassPojo [rank = "+rank+", role = "+role+"]";
58+
}
59+
}
60+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
package com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Exceptions;
21+
22+
import java.io.IOException;
23+
24+
import com.elyssiamc.Micc.JavaMee6APIWrapper.DataStructures.Adapters.ErrorMessage;
25+
26+
/**
27+
* To specify an exception generated by a Mee6 Server Error
28+
* @author Micc
29+
*
30+
*/
31+
public class Mee6Exception extends IOException {
32+
private static final long serialVersionUID = -8835251128956277014L;
33+
34+
public Mee6Exception(ErrorMessage message) {
35+
super(message.getError().getMessage());
36+
}
37+
}

src/main/java/com/elyssiamc/Micc/JavaMee6APIWrapper/DataStructures/Guild.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)