Skip to content

Commit

Permalink
added try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
JayanthyChengan committed Apr 11, 2024
1 parent 9a3f18e commit 935f64a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
17 changes: 12 additions & 5 deletions src/main/java/edu/harvard/iq/dataverse/Dataverse.java
Original file line number Diff line number Diff line change
Expand Up @@ -697,16 +697,23 @@ public void setAlias(String alias) {

ResourceBundle bundle = BundleUtil.getResourceBundle("affiliation", new Locale("en"));
String newKey = "affiliation_"+alias+"_federationcegeps";
String isitCegep = bundle.getString(newKey);
if(isitCegep.equalsIgnoreCase("true"))
{
this.alias = "federationcegeps";
try {
String isitCegep = bundle.getString(newKey);
if(isitCegep.equalsIgnoreCase("true"))
{
this.alias = "federationcegeps";
}
else {
this.alias = alias;
}
}
else {
catch(Exception e)
{
this.alias = alias;
}



/*
if(alias.equalsIgnoreCase("jonquiere") ||
alias.equalsIgnoreCase("montmorency") ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ public String getAlias(String userAffiliation) {
if (value.equalsIgnoreCase(userAffiliation)) {
String alias = next.substring(next.indexOf(".") + 1);
String newKey = next.replace(".","_")+"_federationcegeps";
String isitCegep = bundle.getString(newKey);
if(isitCegep.equalsIgnoreCase("true"))
try {
String isitCegep = bundle.getString(newKey);
if (isitCegep.equalsIgnoreCase("true")) {
return "federationcegeps";
} else {
return alias;
}
}catch (Exception e)
{
return "federationcegeps";
}
else
{
return alias;

}
return alias;
/*
if(alias.equalsIgnoreCase("jonquiere") ||
alias.equalsIgnoreCase("montmorency") ||
Expand Down

0 comments on commit 935f64a

Please sign in to comment.