From ad67514d8fd1ffca03a158f09fceef51e48fc5f7 Mon Sep 17 00:00:00 2001 From: Gianluca Finocchiaro Date: Mon, 21 Aug 2017 10:27:36 +0200 Subject: [PATCH] Remove synchronized from nextSerialNumber Here I guess that the synchronized keyword is a typo. --- lowlevel/AtomicSerialNumbers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lowlevel/AtomicSerialNumbers.java b/lowlevel/AtomicSerialNumbers.java index 53547bcc..ed063c86 100644 --- a/lowlevel/AtomicSerialNumbers.java +++ b/lowlevel/AtomicSerialNumbers.java @@ -8,7 +8,7 @@ public class AtomicSerialNumbers extends SerialNumbers { private AtomicInteger serialNumber = new AtomicInteger(); - public synchronized int nextSerialNumber() { + public int nextSerialNumber() { return serialNumber.getAndIncrement(); } public static void main(String[] args) {