# Java Conventions are a little outdated

**URL:** <https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721>\
**Category:** Development\
**Tags:** java, styleguides, developers-forum\
**Created:** [September 4, 2018, 3:54am UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721 "2018-09-04T03:54:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ionkin42](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ionkin42/32/8147_2.png) [@ionkin42](https://talk.openmrs.org/u/ionkin42)\
**Post date:** [September 4, 2018, 3:54am UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/1 "2018-09-04T03:54:57Z")

</div>

[Java Conventions](https://wiki.openmrs.org/display/docs/Java+Conventions) for String concatenation seems to old, if the concatenation is not in a loop, because the Java compiler silently converts

```
  String a = b + c + d;

```

into

```
  String a = new StringBuilder(b).append(c).append(d).toString();

```

Source: [https://docs.oracle.com/javase/6/docs/api/java/lang/String.html](https://docs.oracle.com/javase/6/docs/api/java/lang/String.html)

Can I use simple concatenation?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 4, 2018, 5:57pm UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/2 "2018-09-04T17:57:17Z")

</div>

Would you like to edit our conventions page to reflect this?

---

<div class="post-metadata">

**Author:** ![judeniroshan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/judeniroshan/32/4503_2.png) [@judeniroshan](https://talk.openmrs.org/u/judeniroshan)\
**Post date:** [September 5, 2018, 10:38am UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/3 "2018-09-05T10:38:58Z")

</div>

Yes, Using `StringBuilder` is ideal when there are **more than 2 string operands** being concatenated. As we are always single threaded which initiated from the servlet container for each HTTP request, we do not need to worry about thread-safe behavior that provided by `StringBuffer` 😀

---

<div class="post-metadata">

**Author:** ![ionkin42](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ionkin42/32/8147_2.png) [@ionkin42](https://talk.openmrs.org/u/ionkin42)\
**Post date:** [September 5, 2018, 4:25pm UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/4 "2018-09-05T16:25:55Z")

</div>

Yes, I want do it. But now I can’t log in to Wiki with use OpenMRS ID (although I can log in to OpenMRS).

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 5, 2018, 6:25pm UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/5 "2018-09-05T18:25:45Z")

</div>

@ionkin42 did you report that to help desk?

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [September 5, 2018, 9:26pm UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/6 "2018-09-05T21:26:47Z")

</div>

> [@ionkin42](#):
>
> Yes, I want do it. But now I can’t log in to Wiki with use OpenMRS ID (although I can log in to OpenMRS).

Did yiu ever explicitly ask for access to JIRA and the wiki – they’re separate things. This was done to mitigate spam.

---

<div class="post-metadata">

**Author:** ![ionkin42](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ionkin42/32/8147_2.png) [@ionkin42](https://talk.openmrs.org/u/ionkin42)\
**Post date:** [September 6, 2018, 7:04am UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/7 "2018-09-06T07:04:48Z")

</div>

No, I did not report.

---

<div class="post-metadata">

**Author:** ![ionkin42](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ionkin42/32/8147_2.png) [@ionkin42](https://talk.openmrs.org/u/ionkin42)\
**Post date:** [September 8, 2018, 5:43pm UTC](https://talk.openmrs.org/t/java-conventions-are-a-little-outdated/19721/8 "2018-09-08T17:43:22Z")

</div>

It is common problem: [Unable to log into OpenMRS Wiki but I can log into id.openmrs.org](https://talk.openmrs.org/t/unable-to-log-into-openmrs-wiki-but-i-can-log-into-id-openmrs-org/8746) PS: I sent case to help desk. Can we edit a auth error description?
