-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2e731f
commit affad7f
Showing
5,595 changed files
with
6,279 additions
and
300,115 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/java/org/owasp/benchmark/helpers/ArrayHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class ArrayHolder { | ||
private String[] values; | ||
|
||
public ArrayHolder(String value) { | ||
this(new String[] {value, "A", "B"}); // Динамическая инициализация | ||
} | ||
|
||
public ArrayHolder(String[] initialValues) { | ||
this.values = initialValues; | ||
} | ||
|
||
public String[] getValues() { | ||
return values; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class BaseClass { | ||
public String baseValue; | ||
|
||
public BaseClass(String value) { | ||
this.baseValue = value; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/owasp/benchmark/helpers/CollectionHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
import java.util.*; | ||
|
||
public class CollectionHolder { | ||
public List<String> list; | ||
|
||
public CollectionHolder(String value) { | ||
this(Arrays.asList(value, "EMPTY")); | ||
} | ||
|
||
private CollectionHolder(List<String> initialList) { | ||
this.list = new ArrayList<>(initialList); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/owasp/benchmark/helpers/Configurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class Configurator { | ||
private String configurationValue; | ||
|
||
public Configurator(int value) { | ||
this(value, "EMPTY"); // Значение по умолчанию | ||
} | ||
|
||
public Configurator(int value, String configurationValue) { | ||
this.configurationValue = value > 50 ? "EMPTY" : configurationValue; | ||
} | ||
|
||
public String getConfigurationValue() { | ||
return configurationValue; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/org/owasp/benchmark/helpers/ConstructorChains.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class ConstructorChains { | ||
|
||
private final int number; | ||
private final String text; | ||
|
||
public ConstructorChains(String text) { | ||
this(1, text); | ||
} | ||
|
||
public ConstructorChains(int number, String text) { | ||
this.number = number; | ||
if (number == 1) { | ||
this.text = text; | ||
} else { | ||
this.text = "empty"; | ||
} | ||
} | ||
|
||
public String getText(int n) { | ||
if (n == 1) { | ||
return text; | ||
} else { | ||
return ""; | ||
} | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/org/owasp/benchmark/helpers/ConstructorDelegation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class ConstructorDelegation { | ||
private String a, b, c; | ||
|
||
public ConstructorDelegation(String value) { | ||
this(value, " ADD "); // Default values | ||
} | ||
|
||
private ConstructorDelegation(String a, String b) { | ||
this(a, b, a + b); // Calculate c based on a and b | ||
} | ||
|
||
private ConstructorDelegation(String a, String b, String c) { | ||
this.a = a; | ||
this.b = b; | ||
this.c = c; | ||
} | ||
|
||
public String getC() { | ||
return c; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/org/owasp/benchmark/helpers/DerivedClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class DerivedClass extends BaseClass { | ||
public DerivedClass() { | ||
super("EMPTY"); | ||
this.baseValue += "DerivedClass"; | ||
} | ||
|
||
public DerivedClass(String value) { | ||
super(value); | ||
this.baseValue += "FROM"; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/owasp/benchmark/helpers/FactoryExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class FactoryExample { | ||
public String val; | ||
|
||
private FactoryExample(String val) { | ||
if (val.contains("USERS")) { | ||
this.val = val; | ||
} else { | ||
this.val = "EMPTY"; | ||
} | ||
} | ||
|
||
public static FactoryExample createInstance(String value) { | ||
return new FactoryExample(value); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/org/owasp/benchmark/helpers/InstanceInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class InstanceInitializer { | ||
|
||
public static String value; | ||
|
||
private List<String> list; | ||
|
||
{ | ||
list = new ArrayList<>(); | ||
list.add(value); | ||
} | ||
|
||
public String getValue() { | ||
return list.get(0); | ||
} | ||
|
||
public InstanceInitializer() { | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/org/owasp/benchmark/helpers/LazyInitialized.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class LazyInitialized { | ||
private volatile String value; | ||
|
||
public String getValue(String val) { | ||
if (value == null) { | ||
synchronized (this) { | ||
if (value == null) { | ||
value = "~[String]~"; | ||
} | ||
} | ||
} | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public enum Mode { | ||
DEFAULT, CUSTOM | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/owasp/benchmark/helpers/ModeSelector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class ModeSelector { | ||
private Mode mode; | ||
|
||
public ModeSelector() { | ||
this(Mode.DEFAULT); | ||
} | ||
|
||
public ModeSelector(Mode mode) { | ||
this.mode = mode; | ||
} | ||
|
||
public Mode getMode() { | ||
return mode; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/org/owasp/benchmark/helpers/OptionalHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
import java.util.Optional; | ||
|
||
public class OptionalHolder { | ||
private Optional<String> optionalValue; | ||
|
||
public OptionalHolder(String value) { | ||
this(Optional.ofNullable(value)); | ||
} | ||
|
||
private OptionalHolder(Optional<String> value) { | ||
this.optionalValue = value; | ||
} | ||
|
||
public String getOptionalValue() { | ||
return optionalValue.orElse("EMPTY"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class OuterClass { | ||
private InnerClass innerObject; | ||
private String value; | ||
|
||
public OuterClass(String value) { | ||
this.innerObject = this.new InnerClass(value); | ||
} | ||
|
||
public InnerClass getInnerObject() { | ||
return innerObject; | ||
} | ||
|
||
|
||
public class InnerClass { | ||
public String innerValue; | ||
|
||
InnerClass(String value) { | ||
this.innerValue = value; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/org/owasp/benchmark/helpers/UtilityClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.owasp.benchmark.helpers; | ||
|
||
public class UtilityClass { | ||
public static String DEFAULT_VALUE = "EMPTY"; | ||
public String value; | ||
|
||
public UtilityClass() { | ||
this(initialValue()); | ||
} | ||
|
||
private UtilityClass(String value) { | ||
this.value = value; | ||
} | ||
|
||
private static String initialValue() { | ||
return DEFAULT_VALUE; | ||
} | ||
} |
105 changes: 0 additions & 105 deletions
105
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00001.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.