1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Fix Java 7 compiler warnings

Adds @SafeVarargs annotation to non-problematic varargs.
This commit is contained in:
2011-10-09 13:01:50 -03:00
parent 2e6fdb20bb
commit 6f680acd2c
16 changed files with 35 additions and 22 deletions

View File

@@ -474,6 +474,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
* @param objects
* the object list
*/
@SafeVarargs
public InsertUpdateQuery(T... objects) {
this(new ArrayIterator<T>(objects));
}

View File

@@ -357,6 +357,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
* @param objects
* the object list
*/
@SafeVarargs
public InsertUpdateQuery(T... objects) {
this(new ArrayIterator<T>(objects));
}

View File

@@ -43,6 +43,7 @@ public class ArrayIterator<T> implements Iterator<T> {
* @param objects
* the objects
*/
@SafeVarargs
public ArrayIterator(T... objects) {
this.objects = objects;
}

View File

@@ -1,23 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<character class="FIGHTER">
<stats level="40" crafter="false">
<hp base="2444.46819" multiplier="7.5" add="" />
<mp base="2444.46819" multiplier="7.5" add="" />
<cp base="2444.46819" multiplier="7.5" add="" />
<base int="21" str="40" con="43" men="20" dex="30" wit="20" />
<attack critical="4" evasion="0">
<physical damage="688.86373" speed="253" />
<magical damage="470.40463" speed="333" />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<character xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="character ../templates/character.xsd" xmlns="character"
class="HUMAN_FIGHTER">
<stats crafter="false" level="1">
<hp add="11.83" modifier="0.37" base="80.0" />
<mp add="5.46" modifier="0.14" base="30.0" />
<cp add="3.01" modifier="0.22" base="32.0" />
<attack accuracy="33" critical="44" evasion="33">
<physical speed="300.0" damage="4.0" />
<magical speed="333.0" damage="6.0" />
</attack>
<defense>
<physical value="0" />
<magical value="0" />
<physical value="80.0" />
<magical value="41.0" />
</defense>
<move run="120" walk="50" />
<load>100</load>
<move walk="115.0" run="115.0" />
<base wit="11" dex="30" men="25" con="43" str="40" int="21" />
<maxload>81900</maxload>
</stats>
<collision>
<male radius="" heigth="" />
<female radius="" heigth="" />
<male heigth="23.0" radius="9.0" />
<female heigth="23.5" radius="8.0" />
</collision>
</character>

View File

@@ -44,6 +44,7 @@ public class WorldObjectIterator<T extends WorldObject> implements Iterator<T> {
* @param ids
* the {@link ObjectID} var-arg
*/
@SafeVarargs
public WorldObjectIterator(ObjectID<T>... ids) {
this(new ArrayIterator<ObjectID<T>>(ids));
}

View File

@@ -29,6 +29,7 @@ public class ActorCalculator extends
* @param calculators
* the calculators
*/
@SafeVarargs
public ActorCalculator(
Calculator<ActorCalculatorContext, StatType>... calculators) {
super(StatType.class, calculators);

View File

@@ -149,7 +149,6 @@ public abstract class ActorStats<T extends ActorCalculatorContext> {
* @param calculator
* the calculator
*/
@SuppressWarnings("unchecked")
protected void addTo(ActorCalculator calculator) {
calculator.addNoSort(HP_BONUS_FORMULA, MP_BONUS_FORMULA,
RUN_SPEED_BONUS_FORMULA, WALK_SPEED_BONUS_FORMULA,

View File

@@ -263,7 +263,6 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
/**
* The character calculator
*/
@SuppressWarnings("unchecked")
private static final CharacterCalculator calculator = new CharacterCalculator();
/**
@@ -300,7 +299,6 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
/**
* Setups the default formulas
*/
@SuppressWarnings("unchecked")
private void setup() {
calculator.addNoSort(BASE_HP_FORMULA, BASE_MP_FORMULA, BASE_CP_FORMULA);

View File

@@ -31,6 +31,7 @@ public class CharacterCalculator extends ActorCalculator {
* @param calculators
* the calculators
*/
@SafeVarargs
public CharacterCalculator(
Calculator<ActorCalculatorContext, StatType>... calculators) {
super(calculators);

View File

@@ -215,7 +215,6 @@ public class NPCStats extends ActorStats<NPCCalculatorContext> {
* @param npc
* the npc
*/
@SuppressWarnings("unchecked")
public NPCStats(NPC npc) {
super();
this.npc = npc;

View File

@@ -39,6 +39,7 @@ public class AndFilter<O extends WorldObject> implements WorldObjectFilter<O> {
* @param filters
* filters to be used with <tt>AND</tt> operator
*/
@SafeVarargs
public AndFilter(WorldObjectFilter<O>... filters) {
this.filters = filters;
}

View File

@@ -39,6 +39,7 @@ public class OrFilter<O extends WorldObject> implements WorldObjectFilter<O> {
* @param filters
* filters to be used with <tt>OR</tt> operator
*/
@SafeVarargs
public OrFilter(WorldObjectFilter<O>... filters) {
this.filters = filters;
}

View File

@@ -33,6 +33,7 @@ public final class WorldFilters {
* the filters
* @return the {@link AndFilter}
*/
@SafeVarargs
public static final <O extends WorldObject> WorldObjectFilter<O> and(
WorldObjectFilter<O>... filters) {
return new AndFilter<O>(filters);
@@ -47,6 +48,7 @@ public final class WorldFilters {
* the filters
* @return the {@link OrFilter}
*/
@SafeVarargs
public static final <O extends WorldObject> WorldObjectFilter<O> or(
WorldObjectFilter<O>... filters) {
return new OrFilter<O>(filters);

View File

@@ -81,6 +81,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
* @param functions
* the calculator functions
*/
@SafeVarargs
public ComplexCalculator(V value, Function<T, V>... functions) {
super(0x00, value);
this.functions = new EnumMap<V, List<Function<T, V>>>(
@@ -97,6 +98,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
* @param functions
* the calculator functions
*/
@SafeVarargs
public ComplexCalculator(Class<V> type, Function<T, V>... functions) {
this(type);
add(functions);
@@ -133,7 +135,8 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
* @param functions
* the functions to be added
*/
public void add(Function<T, V>... functions) {
@SafeVarargs
public final void add(Function<T, V>... functions) {
for (final Function<T, V> func : functions) {
getList(func.type()).add(func);
}
@@ -149,7 +152,8 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
* @param functions
* the functions to be added
*/
public void addNoSort(Function<T, V>... functions) {
@SafeVarargs
public final void addNoSort(Function<T, V>... functions) {
for (final Function<T, V> func : functions) {
getList(func.type()).add(func);
}

View File

@@ -48,6 +48,7 @@ public class SimpleCalculator<T extends CalculatorContext, V extends Enum<V>>
* @param functions
* the calculator functions
*/
@SafeVarargs
public SimpleCalculator(V value, Function<T, V>... functions) {
super(0x00, value);
this.value = value;