Skip to content

Comments

User signup#3

Open
shota-matsumoto-lm wants to merge 8 commits intomasterfrom
user-signup
Open

User signup#3
shota-matsumoto-lm wants to merge 8 commits intomasterfrom
user-signup

Conversation

@shota-matsumoto-lm
Copy link

No description provided.

import org.rosuda.REngine.REXPMismatchException;
import org.rosuda.REngine.RList;
import org.rosuda.REngine.Rserve.RConnection;
import org.rosuda.REngine.Rserve.RserveException;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.rosuda.REngine.* は使われていないように見えます。(今手元でビルドしようとしたら、ここが原因でコンパイルエラーになりました)。おそらく対応するjarがないので、もし必要なのであれば追加をお願いします。



private void onSuccessOperation(String result, DialogBox dialogBox, Label infoLabel) {
if (result.equals("success") || Boolean.valueOf(result) || result == "Logout") {
Copy link
Author

@shota-matsumoto-lm shota-matsumoto-lm Mar 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このような文字列の判定をここで行うと、サーバ側とクライアント側での対応関係が取りづらくなるので、
例えばサーバ側は成功時に常に"success"を返し、それ以外であればエラーの内容を返すように決めてしまうほうがいいと思います。
if (result.equals("success"))

あとresult == "Logout"のように書くと比較対象が文字列リテラルじゃない場合に判定失敗するので、Javaではresult.equals("Logout")と書くのが正しいです。

History.newItem(currentLang + GutFloraConstant.NAVI_LINK_SAMPLE);
History.fireCurrentHistoryState();
} else {
String message = result == "false" ? "Incorrect ID or password." : result;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも上のコメントと同様に、単にresultをそのまま表示できる仕組みにする方がいいと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants