Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
-Dfile.encoding=UTF-8
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
26 changes: 13 additions & 13 deletions cucumber-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
<name>Cucumber-JVM: Bill of Materials</name>

<properties>
<ci-environment.version>12.0.0</ci-environment.version>
<cucumber-expressions.version>18.0.1</cucumber-expressions.version>
<cucumber-json-formatter.version>0.3.0</cucumber-json-formatter.version>
<gherkin.version>36.1.0</gherkin.version>
<html-formatter.version>22.0.0</html-formatter.version>
<junit-xml-formatter.version>0.10.0</junit-xml-formatter.version>
<messages.version>30.1.0</messages.version>
<pretty-formatter.version>2.4.1</pretty-formatter.version>
<query.version>14.6.0</query.version>
<tag-expressions.version>8.0.0</tag-expressions.version>
<teamcity-formatter.version>0.2.0</teamcity-formatter.version>
<testng-xml-formatter.version>0.7.0</testng-xml-formatter.version>
<usage-formatter.version>0.1.0</usage-formatter.version>
<ci-environment.version>13.0.0-SNAPSHOT</ci-environment.version>
<cucumber-expressions.version>19.0.0-SNAPSHOT</cucumber-expressions.version>
<cucumber-json-formatter.version>0.4.0-SNAPSHOT</cucumber-json-formatter.version>
<gherkin.version>38.0.0-SNAPSHOT</gherkin.version>
<html-formatter.version>23.0.0-SNAPSHOT</html-formatter.version>
<junit-xml-formatter.version>0.12.0-SNAPSHOT</junit-xml-formatter.version>
<messages.version>32.0.0-SNAPSHOT</messages.version>
<pretty-formatter.version>3.0.0-SNAPSHOT</pretty-formatter.version>
<query.version>15.0.0-SNAPSHOT</query.version>
<tag-expressions.version>9.0.0-SNAPSHOT</tag-expressions.version>
<teamcity-formatter.version>0.3.0-SNAPSHOT</teamcity-formatter.version>
<testng-xml-formatter.version>0.8.0-SNAPSHOT</testng-xml-formatter.version>
<usage-formatter.version>0.2.0-SNAPSHOT</usage-formatter.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@NullMarked
package io.cucumber.cdi2;

import org.jspecify.annotations.NullMarked;
6 changes: 5 additions & 1 deletion cucumber-core/src/main/java/cucumber/api/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
* @deprecated use {@link io.cucumber.core.cli.Main} instead.
*/
@Deprecated
public class Main {
public final class Main {

private static final Logger log = LoggerFactory.getLogger(Main.class);

private Main(){
/* no-op */
}

public static void main(String[] argv) {
byte exitStatus = run(argv, Thread.currentThread().getContextClassLoader());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@NullMarked
package cucumber.api.cli;

import org.jspecify.annotations.NullMarked;
68 changes: 0 additions & 68 deletions cucumber-core/src/main/java/io/cucumber/core/api/TypeRegistry.java

This file was deleted.

20 changes: 15 additions & 5 deletions cucumber-core/src/main/java/io/cucumber/core/backend/Backend.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.cucumber.core.backend;

import org.apiguardian.api.API;
import org.jspecify.annotations.Nullable;

import java.net.URI;
import java.util.List;
Expand All @@ -15,21 +16,30 @@ public interface Backend {
* @param glue Glue that provides the steps to be executed.
* @param gluePaths The locations for the glue to be loaded.
*/
void loadGlue(Glue glue, List<URI> gluePaths);
default void loadGlue(Glue glue, List<URI> gluePaths){

}

/**
* Invoked before a new scenario starts. Implementations should do any
* necessary setup of new, isolated state here. Additional scenario scoped
* step definitions can be loaded here. These step definitions should
* implement {@link ScenarioScoped}
*/
void buildWorld();
default void buildWorld() {

}

/**
* Invoked at the end of a scenario, after hooks
*/
void disposeWorld();

Snippet getSnippet();
default void disposeWorld(){

}

@Nullable
default Snippet getSnippet(){
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ enum HookType {

BEFORE_STEP,

AFTER_STEP;
AFTER_STEP
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
public interface Located {

/**
* Return true if this matches the location. This is used to filter stack traces.
*
* @param stackTraceElement The location of the step.
* @return Return true if this matches the location. This
* is used to filter stack traces.
* @return Return true if this matches the location.
*/
boolean isDefinedAt(StackTraceElement stackTraceElement);

Expand Down
43 changes: 25 additions & 18 deletions cucumber-core/src/main/java/io/cucumber/core/backend/Snippet.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,35 @@ public interface Snippet {

/**
* The language of the generated snippet.
*
* @see io.cucumber.messages.types.Snippet#getLanguage()
*
* @return the language of the generated snippet.
* @see io.cucumber.messages.types.Snippet#getLanguage()
*/
default Optional<String> language() {
return Optional.empty();
}

/**
* @return a {@link java.text.MessageFormat} template used to generate a
* snippet. The template can access the following variables:
* <ul>
* <li>{0} : Step Keyword</li>
* <li>{1} : Value of {@link #escapePattern(String)}</li>
* <li>{2} : Function name</li>
* <li>{3} : Value of {@link #arguments(Map)}</li>
* <li>{4} : Regexp hint comment</li>
* <li>{5} : value of {@link #tableHint()} if the step has a
* table</li>
* </ul>
* Returns a {@link java.text.MessageFormat} template used to generate a snippet.
*
* <p>The template can access the following variables:
* <ul>
* <li>{0} : Step Keyword</li>
* <li>{1} : Value of {@link #escapePattern(String)}</li>
* <li>{2} : Function name</li>
* <li>{3} : Value of {@link #arguments(Map)}</li>
* <li>{4} : Regexp hint comment</li>
* <li>{5} : value of {@link #tableHint()} if the step has a
* table</li>
* </ul>
*
* @return a template used to generate a snippet.
*/
MessageFormat template();

/**
* Returns a hint about alternative ways to declare a table argument
*
* @return a hint about alternative ways to declare a table argument
*/
String tableHint();
Expand All @@ -45,15 +50,17 @@ default Optional<String> language() {
* should accept. The arguments are provided a map of (suggested) names and
* types. The arguments are ordered by their position.
*
* @param arguments ordered pairs of names and types
* @return a string representation of the arguments
* @param arguments ordered pairs of names and types
* @return a string representation of the arguments
*/
String arguments(Map<String, Type> arguments);

/**
* @param pattern the computed pattern that will match an undefined step
* @return an escaped representation of the pattern, if escaping is
* necessary.
* Escape representation of the pattern, if escaping is necessary.
*
* @param pattern the computed pattern that will match an undefined step
* @return an escaped representation of the pattern, if escaping is
* necessary.
*/
String escapePattern(String pattern);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import static java.util.Objects.requireNonNull;

public class StackTraceElementReference implements SourceReference {
public final class StackTraceElementReference implements SourceReference {

private final String className;
private final String methodName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ public interface StepDefinition extends Located {
* Invokes the step definition. The method should raise a Throwable if the
* invocation fails, which will cause the step to fail.
*
* @param args The arguments for the step
* @param args The arguments for the step
* @throws CucumberBackendException of a failure to invoke the step
* @throws CucumberInvocationTargetException in case of a failure in the
* step.
*/
void execute(Object[] args) throws CucumberBackendException, CucumberInvocationTargetException;

/**
* Return parameter information.
*
* @return parameter information, may not return null
*/
List<ParameterInfo> parameterInfos();

/**
* @return the pattern associated with this instance. Used for error
* reporting only.
* Return the pattern associated with this instance. Used for error reporting only.
*
* @return the pattern associated with this instance.
*/
String getPattern();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@NullMarked
package io.cucumber.core.backend;

import org.jspecify.annotations.NullMarked;
6 changes: 5 additions & 1 deletion cucumber-core/src/main/java/io/cucumber/core/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
* {@link CommandlineOptions}.
*/
@API(status = API.Status.STABLE)
public class Main {
public final class Main {

private Main(){
/* no-op */
}

public static void main(String... argv) {
byte exitStatus = run(argv, Thread.currentThread().getContextClassLoader());
System.exit(exitStatus);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@NullMarked
package io.cucumber.core.cli;

import org.jspecify.annotations.NullMarked;
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

public abstract class AbstractEventBus extends AbstractEventPublisher implements EventBus {

/**
* Send all events.
*
* <p>May be overridden, but must be called.
*/
@Override
public <T> void sendAll(Iterable<T> queue) {
super.sendAll(queue);
}

/**
* Send a single event.
*
* <p>May be overridden, but must be called.
*/
@Override
public <T> void send(T event) {
super.send(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ public final <T> void removeHandlerFor(Class<T> eventType, EventHandler<T> handl
}
}

/**
* Send all events.
*
* <p>May be overridden, but must be called.
*/
protected <T> void sendAll(Iterable<T> events) {
for (T event : events) {
send(event);
}
}

/**
* Send a single event.
*
* <p>May be overridden, but must be called.
*/
protected <T> void send(T event) {
if (handlers.containsKey(Event.class) && event instanceof Event) {
for (EventHandler handler : handlers.get(Event.class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ public UUID generateId() {
" capacity. Please generate using a new instance or use another " +
UuidGenerator.class.getSimpleName() + "implementation.");
}
long leastSigBits = counterValue | 0x8000000000000000L; // set variant
// set variant
long leastSigBits = counterValue | 0x8000000000000000L;
return new UUID(msb, leastSigBits);
}
}
Loading