#2981 - ENH: Add profile-line-number-mode with options none | all | auto ... to control adding line numbers to profile locations

This commit is contained in:
rob
2023-02-22 23:02:42 +13:00
parent 34dc4375da
commit 2e0dba3741
16 changed files with 85 additions and 26 deletions
@@ -17,15 +17,32 @@ public interface ProfileLocation {
}
/**
* Create and return a new ProfileLocation with a given lineNumber and label.
* Create and return a new ProfileLocation with line number.
*/
static ProfileLocation create(int lineNumber, String label) {
return XServiceProvider.profileLocationFactory().create(lineNumber, label);
static ProfileLocation createWithLine() {
return XServiceProvider.profileLocationFactory().createWithLine();
}
/**
* Create and return a new ProfileLocation with a given lineNumber and label.
*/
static ProfileLocation create(String label) {
return XServiceProvider.profileLocationFactory().create(label);
}
/**
* Deprecated in favor of {@link #create(String)}.
*/
@Deprecated
static ProfileLocation create(int lineNumber, String label) {
return create(label);
}
/**
* Deprecated for removal - not used.
* Create and return a new ProfileLocation with a given location.
*/
@Deprecated
static ProfileLocation createAt(String location) {
return XServiceProvider.profileLocationFactory().createAt(location);
}
@@ -12,6 +12,11 @@ public interface SpiProfileLocationFactory {
*/
ProfileLocation create();
/**
* Create a profile location with line numbering.
*/
ProfileLocation createWithLine();
/**
* Create with a given label - used only with {@code @Transaction}.
*
@@ -19,16 +24,6 @@ public interface SpiProfileLocationFactory {
*/
ProfileLocation create(String label);
/**
* Create a profile location with a line number.
*
* @param lineNumber always 0
* @param label the label for the transaction
*/
default ProfileLocation create(int lineNumber, String label) {
return create(label);
}
/**
* Create a known location.
*/