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:
@@ -474,6 +474,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
|||||||
* @param objects
|
* @param objects
|
||||||
* the object list
|
* the object list
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public InsertUpdateQuery(T... objects) {
|
public InsertUpdateQuery(T... objects) {
|
||||||
this(new ArrayIterator<T>(objects));
|
this(new ArrayIterator<T>(objects));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,6 +357,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
|||||||
* @param objects
|
* @param objects
|
||||||
* the object list
|
* the object list
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public InsertUpdateQuery(T... objects) {
|
public InsertUpdateQuery(T... objects) {
|
||||||
this(new ArrayIterator<T>(objects));
|
this(new ArrayIterator<T>(objects));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class ArrayIterator<T> implements Iterator<T> {
|
|||||||
* @param objects
|
* @param objects
|
||||||
* the objects
|
* the objects
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public ArrayIterator(T... objects) {
|
public ArrayIterator(T... objects) {
|
||||||
this.objects = objects;
|
this.objects = objects;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<character class="FIGHTER">
|
<character xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
<stats level="40" crafter="false">
|
xsi:schemaLocation="character ../templates/character.xsd" xmlns="character"
|
||||||
<hp base="2444.46819" multiplier="7.5" add="" />
|
class="HUMAN_FIGHTER">
|
||||||
<mp base="2444.46819" multiplier="7.5" add="" />
|
<stats crafter="false" level="1">
|
||||||
<cp base="2444.46819" multiplier="7.5" add="" />
|
<hp add="11.83" modifier="0.37" base="80.0" />
|
||||||
<base int="21" str="40" con="43" men="20" dex="30" wit="20" />
|
<mp add="5.46" modifier="0.14" base="30.0" />
|
||||||
<attack critical="4" evasion="0">
|
<cp add="3.01" modifier="0.22" base="32.0" />
|
||||||
<physical damage="688.86373" speed="253" />
|
<attack accuracy="33" critical="44" evasion="33">
|
||||||
<magical damage="470.40463" speed="333" />
|
<physical speed="300.0" damage="4.0" />
|
||||||
|
<magical speed="333.0" damage="6.0" />
|
||||||
</attack>
|
</attack>
|
||||||
<defense>
|
<defense>
|
||||||
<physical value="0" />
|
<physical value="80.0" />
|
||||||
<magical value="0" />
|
<magical value="41.0" />
|
||||||
</defense>
|
</defense>
|
||||||
<move run="120" walk="50" />
|
<move walk="115.0" run="115.0" />
|
||||||
<load>100</load>
|
<base wit="11" dex="30" men="25" con="43" str="40" int="21" />
|
||||||
|
<maxload>81900</maxload>
|
||||||
</stats>
|
</stats>
|
||||||
<collision>
|
<collision>
|
||||||
<male radius="" heigth="" />
|
<male heigth="23.0" radius="9.0" />
|
||||||
<female radius="" heigth="" />
|
<female heigth="23.5" radius="8.0" />
|
||||||
</collision>
|
</collision>
|
||||||
</character>
|
</character>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public class WorldObjectIterator<T extends WorldObject> implements Iterator<T> {
|
|||||||
* @param ids
|
* @param ids
|
||||||
* the {@link ObjectID} var-arg
|
* the {@link ObjectID} var-arg
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public WorldObjectIterator(ObjectID<T>... ids) {
|
public WorldObjectIterator(ObjectID<T>... ids) {
|
||||||
this(new ArrayIterator<ObjectID<T>>(ids));
|
this(new ArrayIterator<ObjectID<T>>(ids));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class ActorCalculator extends
|
|||||||
* @param calculators
|
* @param calculators
|
||||||
* the calculators
|
* the calculators
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public ActorCalculator(
|
public ActorCalculator(
|
||||||
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
||||||
super(StatType.class, calculators);
|
super(StatType.class, calculators);
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ public abstract class ActorStats<T extends ActorCalculatorContext> {
|
|||||||
* @param calculator
|
* @param calculator
|
||||||
* the calculator
|
* the calculator
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected void addTo(ActorCalculator calculator) {
|
protected void addTo(ActorCalculator calculator) {
|
||||||
calculator.addNoSort(HP_BONUS_FORMULA, MP_BONUS_FORMULA,
|
calculator.addNoSort(HP_BONUS_FORMULA, MP_BONUS_FORMULA,
|
||||||
RUN_SPEED_BONUS_FORMULA, WALK_SPEED_BONUS_FORMULA,
|
RUN_SPEED_BONUS_FORMULA, WALK_SPEED_BONUS_FORMULA,
|
||||||
|
|||||||
@@ -263,7 +263,6 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
|
|||||||
/**
|
/**
|
||||||
* The character calculator
|
* The character calculator
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private static final CharacterCalculator calculator = new CharacterCalculator();
|
private static final CharacterCalculator calculator = new CharacterCalculator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -300,7 +299,6 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
|
|||||||
/**
|
/**
|
||||||
* Setups the default formulas
|
* Setups the default formulas
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void setup() {
|
private void setup() {
|
||||||
calculator.addNoSort(BASE_HP_FORMULA, BASE_MP_FORMULA, BASE_CP_FORMULA);
|
calculator.addNoSort(BASE_HP_FORMULA, BASE_MP_FORMULA, BASE_CP_FORMULA);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class CharacterCalculator extends ActorCalculator {
|
|||||||
* @param calculators
|
* @param calculators
|
||||||
* the calculators
|
* the calculators
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public CharacterCalculator(
|
public CharacterCalculator(
|
||||||
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
||||||
super(calculators);
|
super(calculators);
|
||||||
|
|||||||
@@ -215,7 +215,6 @@ public class NPCStats extends ActorStats<NPCCalculatorContext> {
|
|||||||
* @param npc
|
* @param npc
|
||||||
* the npc
|
* the npc
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public NPCStats(NPC npc) {
|
public NPCStats(NPC npc) {
|
||||||
super();
|
super();
|
||||||
this.npc = npc;
|
this.npc = npc;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class AndFilter<O extends WorldObject> implements WorldObjectFilter<O> {
|
|||||||
* @param filters
|
* @param filters
|
||||||
* filters to be used with <tt>AND</tt> operator
|
* filters to be used with <tt>AND</tt> operator
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public AndFilter(WorldObjectFilter<O>... filters) {
|
public AndFilter(WorldObjectFilter<O>... filters) {
|
||||||
this.filters = filters;
|
this.filters = filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class OrFilter<O extends WorldObject> implements WorldObjectFilter<O> {
|
|||||||
* @param filters
|
* @param filters
|
||||||
* filters to be used with <tt>OR</tt> operator
|
* filters to be used with <tt>OR</tt> operator
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public OrFilter(WorldObjectFilter<O>... filters) {
|
public OrFilter(WorldObjectFilter<O>... filters) {
|
||||||
this.filters = filters;
|
this.filters = filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public final class WorldFilters {
|
|||||||
* the filters
|
* the filters
|
||||||
* @return the {@link AndFilter}
|
* @return the {@link AndFilter}
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public static final <O extends WorldObject> WorldObjectFilter<O> and(
|
public static final <O extends WorldObject> WorldObjectFilter<O> and(
|
||||||
WorldObjectFilter<O>... filters) {
|
WorldObjectFilter<O>... filters) {
|
||||||
return new AndFilter<O>(filters);
|
return new AndFilter<O>(filters);
|
||||||
@@ -47,6 +48,7 @@ public final class WorldFilters {
|
|||||||
* the filters
|
* the filters
|
||||||
* @return the {@link OrFilter}
|
* @return the {@link OrFilter}
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public static final <O extends WorldObject> WorldObjectFilter<O> or(
|
public static final <O extends WorldObject> WorldObjectFilter<O> or(
|
||||||
WorldObjectFilter<O>... filters) {
|
WorldObjectFilter<O>... filters) {
|
||||||
return new OrFilter<O>(filters);
|
return new OrFilter<O>(filters);
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
|
|||||||
* @param functions
|
* @param functions
|
||||||
* the calculator functions
|
* the calculator functions
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public ComplexCalculator(V value, Function<T, V>... functions) {
|
public ComplexCalculator(V value, Function<T, V>... functions) {
|
||||||
super(0x00, value);
|
super(0x00, value);
|
||||||
this.functions = new EnumMap<V, List<Function<T, V>>>(
|
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
|
* @param functions
|
||||||
* the calculator functions
|
* the calculator functions
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public ComplexCalculator(Class<V> type, Function<T, V>... functions) {
|
public ComplexCalculator(Class<V> type, Function<T, V>... functions) {
|
||||||
this(type);
|
this(type);
|
||||||
add(functions);
|
add(functions);
|
||||||
@@ -133,7 +135,8 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
|
|||||||
* @param functions
|
* @param functions
|
||||||
* the functions to be added
|
* 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) {
|
for (final Function<T, V> func : functions) {
|
||||||
getList(func.type()).add(func);
|
getList(func.type()).add(func);
|
||||||
}
|
}
|
||||||
@@ -149,7 +152,8 @@ public class ComplexCalculator<T extends CalculatorContext, V extends Enum<V>>
|
|||||||
* @param functions
|
* @param functions
|
||||||
* the functions to be added
|
* 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) {
|
for (final Function<T, V> func : functions) {
|
||||||
getList(func.type()).add(func);
|
getList(func.type()).add(func);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class SimpleCalculator<T extends CalculatorContext, V extends Enum<V>>
|
|||||||
* @param functions
|
* @param functions
|
||||||
* the calculator functions
|
* the calculator functions
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public SimpleCalculator(V value, Function<T, V>... functions) {
|
public SimpleCalculator(V value, Function<T, V>... functions) {
|
||||||
super(0x00, value);
|
super(0x00, value);
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user