replace tabs with spaces

This commit is contained in:
William Cheng 2022-01-24 17:10:24 +08:00
parent a68babe86d
commit d91a2e4221

View File

@ -311,13 +311,13 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements
* The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python
* does not support this in as natural a way so it needs to convert it. See * does not support this in as natural a way so it needs to convert it. See
* https://docs.python.org/2/howto/regex.html#compilation-flags for details. * https://docs.python.org/2/howto/regex.html#compilation-flags for details.
* *
* @param pattern (the String pattern to convert from python to Perl convention) * @param pattern (the String pattern to convert from python to Perl convention)
* @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/) * @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/)
* @return void * @return void
* @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention * @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention
* *
* Includes fix for issue #6675 * Includes fix for issue #6675
*/ */
public void postProcessPattern(String pattern, Map<String, Object> vendorExtensions) { public void postProcessPattern(String pattern, Map<String, Object> vendorExtensions) {
if (pattern != null) { if (pattern != null) {
@ -328,9 +328,9 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements
throw new IllegalArgumentException("Pattern must follow the Perl " throw new IllegalArgumentException("Pattern must follow the Perl "
+ "/pattern/modifiers convention. " + pattern + " is not valid."); + "/pattern/modifiers convention. " + pattern + " is not valid.");
} }
//check for instances of extra backslash that could cause compile issues and remove //check for instances of extra backslash that could cause compile issues and remove
int firstBackslash = pattern.indexOf("\\"); int firstBackslash = pattern.indexOf("\\");
int bracket = pattern.indexOf("["); int bracket = pattern.indexOf("[");
if (firstBackslash == 0 || firstBackslash == 1 || firstBackslash == bracket+1) { if (firstBackslash == 0 || firstBackslash == 1 || firstBackslash == bracket+1) {
pattern = pattern.substring(0,firstBackslash)+pattern.substring(firstBackslash+1); pattern = pattern.substring(0,firstBackslash)+pattern.substring(firstBackslash+1);