From 7e966914050e66219689001ff4ab601a49eef0ac Mon Sep 17 00:00:00 2001 From: Instrumental Date: Fri, 7 Sep 2018 13:43:23 -0500 Subject: Mass whitespace changes (Style Warnings) Issue-ID: AAF-473 Change-Id: Ia1b3825a527bd56299949b5962bb9354dffbeef8 Signed-off-by: Instrumental --- .../org/onap/aaf/misc/env/BaseDataFactory.java | 16 +++---- .../main/java/org/onap/aaf/misc/env/LogTarget.java | 10 ++-- .../main/java/org/onap/aaf/misc/env/StoreImpl.java | 38 +++++++-------- .../java/org/onap/aaf/misc/env/impl/AbsTrans.java | 36 +++++++------- .../java/org/onap/aaf/misc/env/impl/BasicEnv.java | 56 +++++++++++----------- .../onap/aaf/misc/env/impl/JavaUtilLogTarget.java | 16 +++---- .../org/onap/aaf/misc/env/impl/Log4JLogTarget.java | 6 +-- .../java/org/onap/aaf/misc/env/jaxb/JAXBDF.java | 2 +- .../java/org/onap/aaf/misc/env/jaxb/JAXBData.java | 20 ++++---- .../java/org/onap/aaf/misc/env/jaxb/JAXBmar.java | 14 +++--- .../java/org/onap/aaf/misc/env/jaxb/JAXBumar.java | 6 +-- .../java/org/onap/aaf/misc/env/util/Chrono.java | 18 +++---- .../onap/aaf/misc/env/util/DoubleOutputStream.java | 12 ++--- .../aaf/misc/env/util/RefreshableThreadObject.java | 6 +-- .../java/org/onap/aaf/misc/env/util/Split.java | 22 ++++----- .../misc/env/util/StringBuilderOutputStream.java | 2 +- 16 files changed, 140 insertions(+), 140 deletions(-) (limited to 'misc/env/src/main') diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/BaseDataFactory.java b/misc/env/src/main/java/org/onap/aaf/misc/env/BaseDataFactory.java index d72222e8..a8f0951e 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/BaseDataFactory.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/BaseDataFactory.java @@ -71,13 +71,13 @@ public class BaseDataFactory { env.staticSlot(EnvFactory.SCHEMA_DIR), EnvFactory.DEFAULT_SCHEMA_DIR); File dir = new File(schemaDir); - if(!dir.exists())throw new APIException("Schema Directory " + schemaDir + " does not exist. You can set this with " + EnvFactory.SCHEMA_DIR + " property"); + if (!dir.exists())throw new APIException("Schema Directory " + schemaDir + " does not exist. You can set this with " + EnvFactory.SCHEMA_DIR + " property"); FileInputStream[] fis = new FileInputStream[filenames.length]; Source[] sources = new Source[filenames.length]; File f; - for(int i=0; i clss) throws APIException { // Obtain the Necessary info for QName from Requirement XmlRootElement xre = clss.getAnnotation(XmlRootElement.class); - if(xre==null)throw new APIException(clss.getName() + " does not have an XmlRootElement annotation"); + if (xre==null)throw new APIException(clss.getName() + " does not have an XmlRootElement annotation"); Package pkg = clss.getPackage(); XmlSchema xs = pkg.getAnnotation(XmlSchema.class); - if(xs==null) throw new APIException(clss.getName() + " package-info does not have an XmlSchema annotation"); + if (xs==null) throw new APIException(clss.getName() + " package-info does not have an XmlSchema annotation"); return new QName(xs.namespace(),xre.name()); } @@ -367,7 +367,7 @@ public class BaseDataFactory { // */ // public Character objectify(Env env, String input) throws APIException { // int length = input.length(); -// if(length<1 || length>1) { +// if (length<1 || length>1) { // throw new APIException("String [" + input + "] does not represent a single Character"); // } // return input.charAt(0); diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/LogTarget.java b/misc/env/src/main/java/org/onap/aaf/misc/env/LogTarget.java index aa74edc9..f2b539a3 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/LogTarget.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/LogTarget.java @@ -68,8 +68,8 @@ public interface LogTarget { PrintStream out = System.out; out.print(org.onap.aaf.misc.env.util.Chrono.dateFmt.format(new Date())); out.print(": "); - for(Object str : msgs) { - if(str!=null) { + for (Object str : msgs) { + if (str!=null) { out.print(str.toString()); out.print(' '); } else { @@ -83,7 +83,7 @@ public interface LogTarget { PrintStream out = System.out; out.print(Chrono.dateFmt.format(new Date())); out.print(": "); - for(Object str : msgs) { + for (Object str : msgs) { out.print(str.toString()); out.print(' '); } @@ -108,7 +108,7 @@ public interface LogTarget { PrintStream out = System.err; out.print(Chrono.dateFmt.format(new Date())); out.print(": "); - for(Object str : msgs) { + for (Object str : msgs) { out.print(str.toString()); out.print(' '); } @@ -120,7 +120,7 @@ public interface LogTarget { PrintStream out = System.err; out.print(Chrono.dateFmt.format(new Date())); out.print(": "); - for(Object str : msgs) { + for (Object str : msgs) { out.print(str.toString()); out.print(' '); } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java index b8a8e03a..6848be09 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java @@ -81,15 +81,15 @@ public class StoreImpl implements Store { staticMap = new HashMap<>(); localMap = new HashMap<>(); - if(tag!=null) { + if (tag!=null) { String tequals = tag + '='; - for(String arg : args) { - if(arg.startsWith(tequals) && !arg.equals(tequals)) { // needs to have something after = + for (String arg : args) { + if (arg.startsWith(tequals) && !arg.equals(tequals)) { // needs to have something after = Properties props = new Properties(); - for(String f : Split.split(File.pathSeparatorChar,arg.substring(tequals.length()))) { + for (String f : Split.split(File.pathSeparatorChar,arg.substring(tequals.length()))) { moreProps(new File(f),props); } - for(Entry es : props.entrySet()) { + for (Entry es : props.entrySet()) { put(staticSlot(es.getKey().toString()),es.getValue()); } } @@ -105,29 +105,29 @@ public class StoreImpl implements Store { staticMap = new HashMap<>(); localMap = new HashMap<>(); - if(tag!=null) { + if (tag!=null) { String fname = props.getProperty(tag); - if(fname!=null) { - for(String f : Split.split(File.pathSeparatorChar,fname)) { - if(!moreProps(new File(f),props)) { + if (fname!=null) { + for (String f : Split.split(File.pathSeparatorChar,fname)) { + if (!moreProps(new File(f),props)) { System.err.println("Unable to load Properties from " + f); } } } } - for(Entry es : props.entrySet()) { + for (Entry es : props.entrySet()) { put(staticSlot(es.getKey().toString()),es.getValue()); } } public void propsFromArgs(String tag, String[] args) { - if(tag!=null) { - for(String arg : args) { + if (tag!=null) { + for (String arg : args) { String sarg[] = Split.split('=',arg); - if(sarg.length==2) { - if(tag.equals(sarg[0])) { - for(String fname : Split.split(File.pathSeparatorChar,sarg[1])) { + if (sarg.length==2) { + if (tag.equals(sarg[0])) { + for (String fname : Split.split(File.pathSeparatorChar,sarg[1])) { moreProps(new File(fname),null /* no target */); } } @@ -138,22 +138,22 @@ public class StoreImpl implements Store { } private boolean moreProps(File f, Properties target) { - if(f.exists()) { + if (f.exists()) { Properties props = new Properties(); try { FileInputStream fis = new FileInputStream(f); try { props.load(fis); - if(target!=null) { + if (target!=null) { target.load(fis); } } finally { fis.close(); } - } catch(IOException e) { + } catch (IOException e) { System.err.println(e); } - for(Entry es : props.entrySet()) { + for (Entry es : props.entrySet()) { put(staticSlot(es.getKey().toString()),es.getValue()); } return true; diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java index b86b4fbb..c0e7bde7 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java @@ -124,7 +124,7 @@ public abstract class AbsTrans implements TransStore { Metric metric = new Metric(); int last = (metric.entries = trail.size()) -1; metric.buckets = flags.length==0?EMPTYF:new float[flags.length]; - if(last>=0) { + if (last>=0) { TimeTaken first = trail.get(0); // If first entry is sub, then it's actually the last "end" as well // otherwise, check end @@ -133,48 +133,48 @@ public abstract class AbsTrans implements TransStore { metric.total = (end - first.start) / 1000000f; } - if(sb==null) { - for(TimeTaken tt : trail) { + if (sb==null) { + for (TimeTaken tt : trail) { float ms = tt.millis(); - for(int i=0;i stack = new Stack(); - for(TimeTaken tt : trail) { + for (TimeTaken tt : trail) { // Create Indentation based on SUB - while(!stack.isEmpty() && tt.end()>stack.peek()) { + while (!stack.isEmpty() && tt.end()>stack.peek()) { --indent; stack.pop(); } - for(int i=0;i implements TransStore { Object o; try { o = slot.get(state); - } catch(ArrayIndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Env State Size has changed because of dynamic Object creation... Rare event, but needs to be covered Object[] temp = ((StoreImpl) delegate).newTransState(); System.arraycopy(state, 0, temp, 0, state.length); diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java index 94f7d47b..6fbfacdb 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java @@ -86,9 +86,9 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate(); // String value; -// for(int i=0;i=0) { + if (size>=0) { sb.append(" size: "); sb.append(Long.toString(size)); } @@ -185,11 +185,11 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate0) { + for (String key : existingStaticSlotNames()) { + if (filter.length>0) { yes = false; - for(String f : filter) { - if(key.startsWith(f)) { + for (String f : filter) { + if (key.startsWith(f)) { yes = true; break; } @@ -197,9 +197,9 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate DataFactory newDataFactory(Class... classes) throws APIException { -// if(String.class.isAssignableFrom(classes[0])) +// if (String.class.isAssignableFrom(classes[0])) // return (DataFactory) new StringDF(this); return new JAXBDF(this,classes); } @@ -250,7 +250,7 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate DataFactory newDataFactory(Schema schema, Class... classes) throws APIException { -// if(String.class.isAssignableFrom(classes[0])) +// if (String.class.isAssignableFrom(classes[0])) // return (DataFactory) new StringDF(this); return new JAXBDF(this, schema, classes); } @@ -258,7 +258,7 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate DataFactory newDataFactory(QName qName, Class ... classes) throws APIException { -// if(String.class.isAssignableFrom(classes[0])) +// if (String.class.isAssignableFrom(classes[0])) // return (DataFactory) new StringDF(this); return new JAXBDF(this, qName, classes); } @@ -274,9 +274,9 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate0) { + if (msg!=null && msg.length()>0) { int sbl = sb.length(); - if(sbl>0) { + if (sbl>0) { char last = sb.charAt(sbl-1); - if(" (.".indexOf(last)<0 && "().".indexOf(msg.charAt(0))<0)sb.append(' '); + if (" (.".indexOf(last)<0 && "().".indexOf(msg.charAt(0))<0)sb.append(' '); } sb.append(msg); } @@ -69,10 +69,10 @@ public class JavaUtilLogTarget implements LogTarget { public void log(Throwable e, Object ... msgs) { String str = e.getLocalizedMessage(); - if(str==null) { + if (str==null) { str = e.getMessage(); } - if(str==null) { + if (str==null) { str = e.getClass().getName(); } log.log(level,str,msgs); @@ -83,7 +83,7 @@ public class JavaUtilLogTarget implements LogTarget { */ @Override public void printf(String fmt, Object ... vars) { - if(log.isLoggable(level)) { + if (log.isLoggable(level)) { log.log(level,String.format(fmt,vars)); } } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/Log4JLogTarget.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/Log4JLogTarget.java index 81d9c1b2..b144852a 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/Log4JLogTarget.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/Log4JLogTarget.java @@ -61,7 +61,7 @@ public class Log4JLogTarget implements LogTarget { // @Override public void log(Throwable e, Object... msgs) { - if (log.isEnabledFor(level)) { + if (log.isEnabledFor (level)) { StringBuilder sb = new StringBuilder(); String msg; @@ -69,7 +69,7 @@ public class Log4JLogTarget implements LogTarget { e.printStackTrace(new PrintWriter(new StringBuilderWriter(sb))); } for (int i = 0; i < msgs.length; ++i) { - if(msgs[i]!=null) { + if (msgs[i]!=null) { msg = msgs[i].toString(); if (msg != null && msg.length() > 0) { int sbl = sb.length(); @@ -92,7 +92,7 @@ public class Log4JLogTarget implements LogTarget { */ @Override public void printf(String fmt, Object ... vars) { - if(log.isEnabledFor(level)) { + if (log.isEnabledFor (level)) { log.log(level,String.format(fmt,vars)); } } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBDF.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBDF.java index dc7ee192..d140a6b8 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBDF.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBDF.java @@ -152,7 +152,7 @@ public class JAXBDF extends BaseDataFactory implements OldDataFactory,IOOb try { T t = jumar.unmarshal(env.debug(), input); return new JAXBData(primaryEnv, this, new JAXBStringifier(jmar), new JAXBObjectifier(jumar),t); - } catch(JAXBException e) { + } catch (JAXBException e) { throw new APIException(e); } } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBData.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBData.java index 38977a35..6d83aca4 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBData.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBData.java @@ -114,7 +114,7 @@ public final class JAXBData implements Data{ * @throws APIException */ public String asString(EnvJAXB env) throws APIException { - if(dataAsString!=null) { + if (dataAsString!=null) { return dataAsString; } else { return dataAsString = stringifier.stringify(env, dataAsObject); @@ -131,7 +131,7 @@ public final class JAXBData implements Data{ */ // @Override public String asString() throws APIException { - if(dataAsString!=null) { + if (dataAsString!=null) { return dataAsString; } else { return dataAsString = stringifier.stringify(creatingEnv, dataAsObject,options); @@ -139,7 +139,7 @@ public final class JAXBData implements Data{ } public Data to(OutputStream os) throws APIException, IOException { - if(dataAsString!=null) { + if (dataAsString!=null) { os.write(dataAsString.getBytes()); } else if (stringifier instanceof IOStringifier){ ((IOStringifier)stringifier).stringify(creatingEnv, dataAsObject, os, options); @@ -153,7 +153,7 @@ public final class JAXBData implements Data{ // @Override public JAXBData to(Writer writer) throws APIException, IOException { - if(dataAsString!=null) { + if (dataAsString!=null) { writer.write(dataAsString); } else if (stringifier instanceof IOStringifier){ ((IOStringifier)stringifier).stringify(creatingEnv, dataAsObject, writer, options); @@ -166,7 +166,7 @@ public final class JAXBData implements Data{ public InputStream getInputStream() throws APIException { - if(dataAsString==null) { + if (dataAsString==null) { dataAsString = stringifier.stringify(creatingEnv,dataAsObject,options); } return new ByteArrayInputStream(dataAsString.getBytes()); @@ -184,7 +184,7 @@ public final class JAXBData implements Data{ */ public T asObject(EnvJAXB env) throws APIException { - if(dataAsObject !=null) { + if (dataAsObject !=null) { return dataAsObject; } else { // Some Java compilers need two statements here @@ -204,7 +204,7 @@ public final class JAXBData implements Data{ */ // @Override public T asObject() throws APIException { - if(dataAsObject !=null) { + if (dataAsObject !=null) { return dataAsObject; } else { // Some Java compilers need two statements here @@ -239,7 +239,7 @@ public final class JAXBData implements Data{ */ // @Override public String toString() { - if(dataAsString!=null) { + if (dataAsString!=null) { return dataAsString; } else { try { @@ -292,8 +292,8 @@ public final class JAXBData implements Data{ int count; do { count = input.read(b); - if(count>0)output.write(b, 0, count); - } while(count>=0); + if (count>0)output.write(b, 0, count); + } while (count>=0); } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java index 46c40ebb..524fc668 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java @@ -80,10 +80,10 @@ public class JAXBmar { } public Marshaller get(boolean pretty, boolean fragment) throws JAXBException { - if(pretty != p) { + if (pretty != p) { m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, p = pretty); } - if(fragment != f) { + if (fragment != f) { m.setProperty(Marshaller.JAXB_FRAGMENT, f = fragment); } return m; @@ -139,7 +139,7 @@ public class JAXBmar { Pool mp; synchronized(pools) { mp = pools.get(classes); - if(mp==null) { + if (mp==null) { pools.put(classes,mp = new Pool(new Creator(classes))); } } @@ -165,7 +165,7 @@ public class JAXBmar { fragment = options.length>1?options[1]:this.fragment; Pooled m = mpool.get(lt); try { - if(qname==null) { + if (qname==null) { m.content.get(pretty,fragment).marshal(o, writer); } else { m.content.get(pretty,fragment).marshal( @@ -185,7 +185,7 @@ public class JAXBmar { fragment = options.length>1?options[1]:this.fragment; Pooled m = mpool.get(lt); try { - if(qname==null) { + if (qname==null) { m.content.get(pretty,fragment).marshal(o, os); } else { m.content.get(pretty,fragment).marshal( @@ -200,7 +200,7 @@ public class JAXBmar { public O marshal(LogTarget lt, O o, Writer writer, Class clss) throws JAXBException, APIException { Pooled m = mpool.get(lt); try { - if(qname==null) { + if (qname==null) { m.content.get(pretty,fragment).marshal(o, writer); } else { m.content.get(pretty,fragment).marshal( @@ -216,7 +216,7 @@ public class JAXBmar { public O marshal(LogTarget lt, O o, OutputStream os, Class clss) throws JAXBException, APIException { Pooled m = mpool.get(lt); try { - if(qname==null) { + if (qname==null) { m.content.get(pretty,fragment).marshal(o, os); } else { m.content.get(pretty,fragment).marshal( diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java index fe3f0145..30345e7c 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java @@ -85,7 +85,7 @@ public class JAXBumar { } public Unmarshaller get(Schema schema) throws JAXBException { - if(s != schema) { + if (s != schema) { u.setSchema(s = schema); } return u; @@ -135,7 +135,7 @@ public class JAXBumar { Pool mp; synchronized(pools) { mp = pools.get(classes); - if(mp==null) { + if (mp==null) { pools.put(classes,mp = new Pool(new Creator(classes))); } } @@ -174,7 +174,7 @@ public class JAXBumar { @SuppressWarnings("unchecked") public O unmarshal(LogTarget env, String xml) throws JAXBException, APIException { - if(xml==null) throw new JAXBException("Null Input for String unmarshal"); + if (xml==null) throw new JAXBException("Null Input for String unmarshal"); Pooled s = mpool.get(env); try { return (O)s.content.get(schema).unmarshal( diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Chrono.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Chrono.java index ae78918c..553d7ade 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Chrono.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Chrono.java @@ -107,17 +107,17 @@ public class Chrono { } public static String utcStamp(Date date) { - if(date==null)return ""; + if (date==null)return ""; return utcFmt.format(date); } public static String utcStamp(GregorianCalendar gc) { - if(gc==null)return ""; + if (gc==null)return ""; return utcFmt.format(gc.getTime()); } public static String utcStamp(XMLGregorianCalendar xgc) { - if(xgc==null)return ""; + if (xgc==null)return ""; return utcFmt.format(xgc.toGregorianCalendar().getTime()); } @@ -126,17 +126,17 @@ public class Chrono { } public static String dateStamp(GregorianCalendar gc) { - if(gc == null)return ""; + if (gc == null)return ""; return dateFmt.format(gc.getTime()); } public static String dateStamp(Date date) { - if(date == null)return ""; + if (date == null)return ""; return dateFmt.format(date); } public static String dateStamp(XMLGregorianCalendar xgc) { - if(xgc==null)return ""; + if (xgc==null)return ""; return dateFmt.format(xgc.toGregorianCalendar().getTime()); } @@ -172,7 +172,7 @@ public class Chrono { * @return */ public static String dateTime(GregorianCalendar gc) { - if(gc == null)return ""; + if (gc == null)return ""; TimeZone tz = gc.getTimeZone(); int tz1 = (tz.getRawOffset()+tz.getDSTSavings())/0x8CA0; int tz1abs = Math.abs(tz1); @@ -251,7 +251,7 @@ public class Chrono { } public static GregorianCalendar firstMomentOfDay(GregorianCalendar begin) { - if(begin==null)begin = new GregorianCalendar(); + if (begin==null)begin = new GregorianCalendar(); begin.set(GregorianCalendar.HOUR, 0); begin.set(GregorianCalendar.AM_PM, GregorianCalendar.AM); begin.set(GregorianCalendar.MINUTE, 0); @@ -261,7 +261,7 @@ public class Chrono { } public static GregorianCalendar lastMomentOfDay(GregorianCalendar end) { - if(end==null)end = new GregorianCalendar(); + if (end==null)end = new GregorianCalendar(); end.set(GregorianCalendar.HOUR, 11); end.set(GregorianCalendar.MINUTE, 59); end.set(GregorianCalendar.SECOND, 59); diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/DoubleOutputStream.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/DoubleOutputStream.java index 97d9de99..b9191c00 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/DoubleOutputStream.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/DoubleOutputStream.java @@ -43,7 +43,7 @@ public class DoubleOutputStream extends OutputStream { */ @Override public void write(int c) throws IOException { - for(OutputStream os : oss) { + for (OutputStream os : oss) { os.write(c); } } @@ -58,14 +58,14 @@ public class DoubleOutputStream extends OutputStream { */ @Override public void write(byte bbuf[], int off, int len) throws IOException { - for(OutputStream os : oss) { + for (OutputStream os : oss) { os.write(bbuf,off,len); } } @Override public void write(byte[] b) throws IOException { - for(OutputStream os : oss) { + for (OutputStream os : oss) { os.write(b); } } @@ -75,8 +75,8 @@ public class DoubleOutputStream extends OutputStream { */ @Override public void close() throws IOException { - for(int i=0;i> { public T get(Env env) throws APIException { Thread t = Thread.currentThread(); T obj = objs.get(t); - if(obj==null || refreshed>obj.created()) { + if (obj==null || refreshed>obj.created()) { try { obj = cnst.newInstance(new Object[]{env}); } catch (InvocationTargetException e) { @@ -96,7 +96,7 @@ public class RefreshableThreadObject> { throw new APIException(e); } T destroyMe = objs.put(t,obj); - if(destroyMe!=null) { + if (destroyMe!=null) { destroyMe.destroy(env); } } @@ -118,7 +118,7 @@ public class RefreshableThreadObject> { */ public void remove(Env env) { T obj = objs.remove(Thread.currentThread()); - if(obj!=null) + if (obj!=null) obj.destroy(env); } } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java index 4069c329..b0da8ba2 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java @@ -33,20 +33,20 @@ public class Split { private static final String[] BLANK = new String[0]; public static String[] split(char c, String value) { - if(value==null) { + if (value==null) { return BLANK; } // Count items to preallocate Array (memory alloc is more expensive than counting twice) int count,idx; - for(count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count); + for (count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count); String[] rv = new String[count]; - if(count==1) { + if (count==1) { rv[0]=value; } else { int last=0; count=-1; - for(idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,idx)) { + for (idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,idx)) { rv[++count]=value.substring(last,idx); last = ++idx; } @@ -56,19 +56,19 @@ public class Split { } public static String[] splitTrim(char c, String value) { - if(value==null) { + if (value==null) { return BLANK; } // Count items to preallocate Array (memory alloc is more expensive than counting twice) int count,idx; - for(count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count); + for (count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count); String[] rv = new String[count]; - if(count==1) { + if (count==1) { rv[0]=value.trim(); } else { int last=0; count=-1; - for(idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,idx)) { + for (idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,idx)) { rv[++count]=value.substring(last,idx).trim(); last = ++idx; } @@ -78,19 +78,19 @@ public class Split { } public static String[] splitTrim(char c, String value, int size) { - if(value==null) { + if (value==null) { return BLANK; } int idx; String[] rv = new String[size]; - if(size==1) { + if (size==1) { rv[0]=value.trim(); } else { int last=0; int count=-1; size-=2; - for(idx=value.indexOf(c);idx>=0 && count=0 && count