-
Notifications
You must be signed in to change notification settings - Fork 12
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.
Good, but a few parts of the code are unnecessary complicated.
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/ListParameterImpl.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/ListParameterImpl.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/MapParameterImpl.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/MapParameterImpl.scala
Outdated
Show resolved
Hide resolved
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.
Sorry but I think the map and list code is still .
It would be way cleaner to just use the scala collections and return the java versions by using .asJava
.
I agreed with skate that this changes should be made but if you can finish them fast we might be able to include your PR in pre-alpha3 as you requested 😄.
Also Url, LocalTime, LocalDate and LocalDateTime parameters are still missing 😉.
If you really don't want to do them I can do It once you are finished.
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/ColorParameterImpl.scala
Outdated
Show resolved
Hide resolved
@joblo2213 Hi there. Thanks for the feedback. Could you do the time parameter? |
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/ColorParameterImpl.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/UriParameterImpl.scala
Show resolved
Hide resolved
After commit aacdd21 and the changes @daniel0611 requested I think there is some confusion about how exception handling should work for the parameters: I think it should be the following way: try {
val reqContent = loadedRequirementType.get.newInstance().asInstanceOf[io.Serializable]
requirements.getAccess.setRequirementContent(requirementId, reqContent)
reqContent.deserialize(content)
logger info s"Created requirement content for '$requirementId' and deserialized its content."
true
} catch {
case e: Exception =>
logger error s"Unable to instantiate requirement content. Exception: ${e.getMessage}"
false
} Here all exceptions that are thown while deserializing are cought and logged, and the framework keeps the information that not all requirements could be fullfilled so that it could also be displayed to the gui. Thats why form my point of view no messages need to be logged and all exceptions may be uncought. The only thing we may think about is making sure that the message of the exception does tell the user what actually is wrong. |
Just removed Error handlers from Parameter classes. |
Closes #54
Added:
API Pullrequest: codeoverflow-org/chatoverflow-api#18