Skip to content

Commit 735eab4

Browse files
committed
[Core] Remove detail parameter from getLocation
All glue definition classes implemented a `getLocation(boolean detail)` method. This would provide a long form method description. However in practice this method was always invoked with true. Removing the parameter cleans up the API. This also revealed that `Invoker` is only used for the `timeout` in `cucumber-java8`. This means that class can be moved to `cucumber-java` and with that `MethodFormat` can also be moved to `cucumber-java`.
1 parent bd539c3 commit 735eab4

File tree

43 files changed

+82
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+82
-96
lines changed

core/src/main/java/io/cucumber/core/backend/DataTableTypeDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public interface DataTableTypeDefinition {
1212
* The source line where the data table type is defined.
1313
* Example: com/example/app/Cucumber.test():42
1414
*
15-
* @param detail true if extra detailed location information should be included.
1615
* @return The source line of the step definition.
1716
*/
18-
String getLocation(boolean detail);
17+
String getLocation();
1918
}

core/src/main/java/io/cucumber/core/backend/DefaultDataTableCellTransformerDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ public interface DefaultDataTableCellTransformerDefinition {
1212
* The source line where the default data table cell is defined.
1313
* Example: com/example/app/Cucumber.test():42
1414
*
15-
* @param detail true if extra detailed location information should be included.
1615
* @return The source line of the step definition.
1716
*/
18-
String getLocation(boolean detail);
17+
String getLocation();
1918

2019
}

core/src/main/java/io/cucumber/core/backend/DefaultDataTableEntryTransformerDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public interface DefaultDataTableEntryTransformerDefinition {
1414
* The source line where the default table entry transformer is defined.
1515
* Example: com/example/app/Cucumber.test():42
1616
*
17-
* @param detail true if extra detailed location information should be included.
1817
* @return The source line of the step definition.
1918
*/
20-
String getLocation(boolean detail);
19+
String getLocation();
2120
}

core/src/main/java/io/cucumber/core/backend/DefaultParameterTransformerDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public interface DefaultParameterTransformerDefinition {
1212
* The source line where the default parameter transformer is defined.
1313
* Example: com/example/app/Cucumber.test():42
1414
*
15-
* @param detail true if extra detailed location information should be included.
1615
* @return The source line of the step definition.
1716
*/
18-
String getLocation(boolean detail);
17+
String getLocation();
1918
}

core/src/main/java/io/cucumber/core/backend/DocStringTypeDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public interface DocStringTypeDefinition {
1212
* The source line where the parameter type is defined.
1313
* Example: com/example/app/Cucumber.test():42
1414
*
15-
* @param detail true if extra detailed location information should be included.
1615
* @return The source line of the step definition.
1716
*/
18-
String getLocation(boolean detail);
17+
String getLocation();
1918
}

core/src/main/java/io/cucumber/core/backend/HookDefinition.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
public interface HookDefinition {
77
/**
88
* The source line where the step definition is defined.
9-
* Example: foo/bar/Zap.brainfuck:42
9+
* Example: com/example/app/Cucumber.test():42
1010
*
11-
* @param detail true if extra detailed location information should be included.
1211
* @return The source line where the step definition is defined.
1312
*/
14-
String getLocation(boolean detail);
13+
String getLocation();
1514

1615
void execute(Scenario scenario) throws Throwable;
1716

core/src/main/java/io/cucumber/core/backend/ParameterTypeDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public interface ParameterTypeDefinition {
1212
* The source line where the parameter type is defined.
1313
* Example: com/example/app/Cucumber.test():42
1414
*
15-
* @param detail true if extra detailed location information should be included.
1615
* @return The source line of the step definition.
1716
*/
18-
String getLocation(boolean detail);
17+
String getLocation();
1918
}

core/src/main/java/io/cucumber/core/event/StepDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ public interface StepDefinition {
1010
* The source line where the step definition is defined.
1111
* Example: com/example/app/Cucumber.test():42
1212
*
13-
* @param detail true if extra detailed location information should be included.
1413
* @return The source line of the step definition.
1514
*/
16-
String getLocation(boolean detail);
15+
String getLocation();
1716

1817
/**
1918
* @return the pattern associated with this instance. Used for error reporting only.

core/src/main/java/io/cucumber/core/options/Constants.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.cucumber.core.options;
22

3+
import io.cucumber.core.runtime.ObjectFactoryServiceLoader;
4+
35
public final class Constants {
46

57
/**
@@ -125,7 +127,7 @@ public final class Constants {
125127
* Property name used to select a specific object factory implementation:
126128
* {@value}
127129
*
128-
* @see io.cucumber.core.backend.ObjectFactoryServiceLoader
130+
* @see ObjectFactoryServiceLoader
129131
*/
130132
public static final String OBJECT_FACTORY_PROPERTY_NAME = "cucumber.object-factory";
131133

core/src/main/java/io/cucumber/core/plugin/UnusedStepsSummaryPrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void setEventPublisher(EventPublisher publisher) {
3333
}
3434

3535
private void handleStepDefinedEvent(StepDefinedEvent event) {
36-
registeredSteps.put(event.getStepDefinition().getLocation(false), event.getStepDefinition().getPattern());
36+
registeredSteps.put(event.getStepDefinition().getLocation(), event.getStepDefinition().getPattern());
3737
}
3838

3939
private void handleTestStepFinished(TestStepFinished event) {

0 commit comments

Comments
 (0)