From 021ebc63f3a1bc2b6d3faed1a56386dacc11eeae Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 27 Jul 2019 11:17:48 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=8E=A8=20Add=20@Nullable=20annotation=20to?= =?utf8?q?=20parseSone()=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../net/pterodactylus/sone/core/SoneParser.java | 43 +++++++--------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index b12866a..d37c647 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -1,42 +1,24 @@ package net.pterodactylus.sone.core; import static java.util.concurrent.TimeUnit.*; -import static java.util.logging.Logger.getLogger; -import static net.pterodactylus.sone.utils.NumberParsers.parseInt; -import static net.pterodactylus.sone.utils.NumberParsers.parseLong; +import static java.util.logging.Logger.*; +import static net.pterodactylus.sone.utils.NumberParsers.*; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.*; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.io.*; +import java.util.*; +import java.util.logging.*; -import javax.inject.Inject; +import javax.annotation.*; +import javax.inject.*; -import net.pterodactylus.sone.data.Album; -import net.pterodactylus.sone.data.Client; -import net.pterodactylus.sone.data.Image; -import net.pterodactylus.sone.data.Post; -import net.pterodactylus.sone.data.PostReply; -import net.pterodactylus.sone.data.Profile; -import net.pterodactylus.sone.data.Profile.DuplicateField; -import net.pterodactylus.sone.data.Profile.EmptyFieldName; -import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.database.Database; -import net.pterodactylus.sone.database.PostBuilder; -import net.pterodactylus.sone.database.PostReplyBuilder; -import net.pterodactylus.sone.database.SoneBuilder; -import net.pterodactylus.util.xml.SimpleXML; -import net.pterodactylus.util.xml.XML; +import net.pterodactylus.sone.data.*; +import net.pterodactylus.sone.data.Profile.*; +import net.pterodactylus.sone.database.*; +import net.pterodactylus.util.xml.*; import com.codahale.metrics.*; import com.google.common.base.*; -import org.w3c.dom.Document; +import org.w3c.dom.*; /** * Parses a {@link Sone} from an XML {@link InputStream}. @@ -54,6 +36,7 @@ public class SoneParser { this.soneParsingDurationHistogram = metricRegistry.histogram("sone.parsing.duration"); } + @Nullable public Sone parseSone(Sone originalSone, InputStream soneInputStream) throws SoneException { /* TODO - impose a size limit? */ -- 2.7.4