-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added default value if exists #5
base: develop
Are you sure you want to change the base?
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.
Format the code indentations properly
Matcher m = Pattern.compile(Regex.GETMETHODHEADERPARAMETER).matcher(paramUnformatted); | ||
while (m.find() && isDefaultValue) { | ||
List<String> paramUnformattedTest = new ArrayList<String>(); | ||
paramUnformattedTest.add(m.group()); |
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.
Die Liste paramUnformattedTest
enthält höchstens einen Wert. Du kannst mit dem String direkt arbeiten.
paramUnformattedTest.add(m.group()); | ||
for (int i = 0; i < paramUnformattedTest.size(); i++) { | ||
if (paramUnformattedTest.get(i).contains("@DefaultValue")) { | ||
createMapFromParameters(paramUnformatted); |
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.
Die Methode gibt eine Map zurück, der Rückgabewert wird aber nie verwendet.
String param = paramUnformatted.replaceAll("[\\s]*" + Regex.ANNOTATION + "[\\s]*", "").trim(); | ||
|
||
List<String> defaultValue = new ArrayList<String>(); |
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.
Namensgebung: Damit man direkt sehen kann, dass es mehrere Werte sind, lieber umbenennen zu defaultValues
if (isDefaultValue) { | ||
parameter.setLocation("query"); | ||
// parameter.setType(type); | ||
for (int i = 0; i < defaultValue.size(); i++) { |
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.
Ich bevorzuge for-Schleifen mit der Doppelpunkt-Schreibweise
for (String value: defaultValue) { }
parameter.setLocation("query"); | ||
// parameter.setType(type); | ||
for (int i = 0; i < defaultValue.size(); i++) { | ||
parameter.setDefaultValue(defaultValue.get(i)); |
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.
Aktuell ist es so, wenn es mehrere defaultValues
gibt, wird nur das letzte genommen.
Kann es überhaupt mehrere geben?
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.
improvements and best practices
No description provided.