-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix link reference #129
base: main
Are you sure you want to change the base?
Fix link reference #129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a test case that fails before the fix? It helps me to understand the root cause.
@@ -120,27 +159,43 @@ else if (uid != "") | |||
return specList; | |||
} | |||
|
|||
/** | |||
* Populate the links for references based on a UID. Looker generates mappings for local context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Populate the links for references based on a UID. Looker generates mappings for local context | |
* Populates the links for references based on a UID. Looker generates mappings for local context |
@@ -28,7 +28,7 @@ items: | |||
fullName: "com.microsoft.samples.google.SpeechSettings" | |||
type: "Class" | |||
package: "com.microsoft.samples.google" | |||
summary: "Settings class to configure an instance of <xref uid=\"com.microsoft.samples.google.v1p1alpha.SpeechClient\" data-throw-if-not-resolved=\"false\">SpeechClient</xref>.\n\n <p>The default instance has everything set to sensible defaults:\n\n <ul>\n <li>The default service address (speech.googleapis.com) and default port (443) are used.\n <li>Credentials are acquired automatically through Application Default Credentials.\n <li>Retries are configured for idempotent methods but not for non-idempotent methods.\n </ul>\n\n <p>The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n <p>For example, to set the total timeout of recognize to 30 seconds:\n\n <pre class=\"prettyprint lang-java\"><code>\n SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();\n speechSettingsBuilder\n .recognizeSettings()\n .setRetrySettings(\n speechSettingsBuilder\n .recognizeSettings()\n .getRetrySettings()\n .toBuilder()\n .setTotalTimeout(Duration.ofSeconds(30))\n .build());\n SpeechSettings speechSettings = speechSettingsBuilder.build();\n </code></pre>" | |||
summary: "Settings class to configure an instance of <xref uid=\"com.microsoft.samples.google.SpeechClient\" data-throw-if-not-resolved=\"false\">SpeechClient</xref>.\n\n <p>The default instance has everything set to sensible defaults:\n\n <ul>\n <li>The default service address (speech.googleapis.com) and default port (443) are used.\n <li>Credentials are acquired automatically through Application Default Credentials.\n <li>Retries are configured for idempotent methods but not for non-idempotent methods.\n </ul>\n\n <p>The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n <p>For example, to set the total timeout of recognize to 30 seconds:\n\n <pre class=\"prettyprint lang-java\"><code>\n SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();\n speechSettingsBuilder\n .recognizeSettings()\n .setRetrySettings(\n speechSettingsBuilder\n .recognizeSettings()\n .getRetrySettings()\n .toBuilder()\n .setTotalTimeout(Duration.ofSeconds(30))\n .build());\n SpeechSettings speechSettings = speechSettingsBuilder.build();\n </code></pre>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Since packages (v1 and v1beta) may contain the same generated java file names, there may be some | ||
* conflicts between which link it should be. | ||
* | ||
* The Looker#consumer() function guarantees that the UID (+ other combinations) will be put into the LookupContext. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is Looker?
* Since packages (v1 and v1beta) may contain the same generated java file names, there may be some | ||
* conflicts between which link it should be. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add why Javac doesn't have the problem of ambiguity but this tool via javadoc has trouble finding the exact class?
static String resolveUidFromLinkContent(String linkContent, String packageName, LookupContext lookupContext) { | ||
if (StringUtils.isBlank(linkContent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lqiu96 Is this PR still needed? I'm happy to help take it on if this fix is still needed; just wanted to double check. |
Unfortunately, I didn't create an issue with what I was fixing (my mistake), so I forgot what this is trying to fix. IIRC (and could be wrong), this was trying to fix link references in one package (v1) from referencing another package (v1beta1) if there are duplicates. Link references should try to find the reference in the same package. I think this is something that should be fixed eventually. |
Fixes #<issue_number_goes_here>