Skip to content

Commit a4f9aeb

Browse files
committed
Fixed synchronization in LineProtocolParser
1 parent a9e2b4e commit a4f9aeb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Sat Mar 24 19:28:43 MSK 2018
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

parser/src/main/kotlin/io/sniffy/influxdb/parser/LineProtocolParser.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ class LineProtocolParser(private val reader: Reader, private val failFast: Boole
1313
private val sb = StringBuilder()
1414
private val sb2 = StringBuilder()
1515

16-
@Volatile private var nextPoint: Point? = null
16+
private var nextPoint: Point? = null
1717

1818
constructor(string: String, failFast: Boolean = false) :
1919
this(StringReader(string), failFast)
2020

2121
constructor(inputStream: InputStream, failFast: Boolean = false) :
2222
this(InputStreamReader(inputStream, Charsets.UTF_8), failFast)
2323

24+
@Synchronized
2425
override fun hasNext(): Boolean {
2526
nextPoint = parseNext()
2627
return nextPoint != null
2728
}
2829

30+
@Synchronized
2931
override fun next(): Point {
3032
return nextPoint ?: throw NoSuchElementException()
3133
}
@@ -61,8 +63,7 @@ class LineProtocolParser(private val reader: Reader, private val failFast: Boole
6163

6264
}
6365

64-
internal @Synchronized
65-
fun parseNext(): Point? {
66+
private fun parseNext(): Point? {
6667

6768
val builder = Point.Builder()
6869

0 commit comments

Comments
 (0)