From 5252a7e481a33b1f6b83fed71f5dbc7bffbeb236 Mon Sep 17 00:00:00 2001 From: Zhangmei Li Date: Mon, 24 Jul 2017 18:45:28 +0800 Subject: [PATCH] HugeGraph-410: improve code style Change-Id: Idce80465ea4cbe92ac836bbc8d293e77ad7c7c5c --- .../baidu/hugegraph/concurrent/KeyLock.java | 1 + .../hugegraph/concurrent/LockManager.java | 19 +++++++++++ .../hugegraph/config/ConfigException.java | 33 +++++++++++++++++++ .../baidu/hugegraph/config/ConfigOption.java | 19 +++++++++++ .../baidu/hugegraph/config/HugeConfig.java | 18 ++++++++-- .../baidu/hugegraph/config/OptionChecker.java | 19 +++++++++++ .../baidu/hugegraph/config/OptionHolder.java | 23 +++++++++++-- .../baidu/hugegraph/config/OptionSpace.java | 19 +++++++++++ .../java/com/baidu/hugegraph/event/Event.java | 19 +++++++++++ .../com/baidu/hugegraph/event/EventHub.java | 3 +- .../baidu/hugegraph/event/EventListener.java | 19 +++++++++++ .../hugegraph/exception/ConfigException.java | 14 -------- .../com/baidu/hugegraph/perf/PerfUtil.java | 19 +++++++++++ .../com/baidu/hugegraph/perf/Stopwatch.java | 14 ++++---- .../hugegraph/type/ExtendableIterator.java | 19 +++++++++++ .../java/com/baidu/hugegraph/type/Shard.java | 19 +++++++++++ .../com/baidu/hugegraph/type/TriFunction.java | 19 +++++++++++ .../baidu/hugegraph/util/CollectionUtil.java | 19 +++++++++++ src/main/java/com/baidu/hugegraph/util/E.java | 19 +++++++++++ .../com/baidu/hugegraph/util/HashUtil.java | 19 +++++++++++ .../baidu/hugegraph/util/ReflectionUtil.java | 19 +++++++++++ .../com/baidu/hugegraph/util/TimeUtil.java | 19 +++++++++++ 22 files changed, 365 insertions(+), 26 deletions(-) create mode 100644 src/main/java/com/baidu/hugegraph/config/ConfigException.java delete mode 100644 src/main/java/com/baidu/hugegraph/exception/ConfigException.java diff --git a/src/main/java/com/baidu/hugegraph/concurrent/KeyLock.java b/src/main/java/com/baidu/hugegraph/concurrent/KeyLock.java index dd4be060b..00a3be4c8 100644 --- a/src/main/java/com/baidu/hugegraph/concurrent/KeyLock.java +++ b/src/main/java/com/baidu/hugegraph/concurrent/KeyLock.java @@ -28,6 +28,7 @@ public class KeyLock { private Striped locks; public KeyLock() { + // The default size is availableProcessors() * 4 this(Runtime.getRuntime().availableProcessors() << 2); } diff --git a/src/main/java/com/baidu/hugegraph/concurrent/LockManager.java b/src/main/java/com/baidu/hugegraph/concurrent/LockManager.java index e7a08aead..7f6eb4957 100644 --- a/src/main/java/com/baidu/hugegraph/concurrent/LockManager.java +++ b/src/main/java/com/baidu/hugegraph/concurrent/LockManager.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.concurrent; import java.util.Map; diff --git a/src/main/java/com/baidu/hugegraph/config/ConfigException.java b/src/main/java/com/baidu/hugegraph/config/ConfigException.java new file mode 100644 index 000000000..b8a7d367a --- /dev/null +++ b/src/main/java/com/baidu/hugegraph/config/ConfigException.java @@ -0,0 +1,33 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.baidu.hugegraph.config; + +public class ConfigException extends RuntimeException { + + private static final long serialVersionUID = -8711375282196157058L; + + public ConfigException(String message) { + super(message); + } + + public ConfigException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/src/main/java/com/baidu/hugegraph/config/ConfigOption.java b/src/main/java/com/baidu/hugegraph/config/ConfigOption.java index a9dccb149..fa21225a9 100644 --- a/src/main/java/com/baidu/hugegraph/config/ConfigOption.java +++ b/src/main/java/com/baidu/hugegraph/config/ConfigOption.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.config; import java.util.Set; diff --git a/src/main/java/com/baidu/hugegraph/config/HugeConfig.java b/src/main/java/com/baidu/hugegraph/config/HugeConfig.java index 6e16fd23d..faef62e5c 100644 --- a/src/main/java/com/baidu/hugegraph/config/HugeConfig.java +++ b/src/main/java/com/baidu/hugegraph/config/HugeConfig.java @@ -1,5 +1,20 @@ /* - * Copyright (C) 2017 Baidu, Inc. All Rights Reserved. + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package com.baidu.hugegraph.config; @@ -17,7 +32,6 @@ import org.apache.commons.configuration.PropertiesConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.baidu.hugegraph.exception.ConfigException; import com.baidu.hugegraph.util.E; public class HugeConfig extends PropertiesConfiguration { diff --git a/src/main/java/com/baidu/hugegraph/config/OptionChecker.java b/src/main/java/com/baidu/hugegraph/config/OptionChecker.java index 7c76aa910..71d4016ea 100644 --- a/src/main/java/com/baidu/hugegraph/config/OptionChecker.java +++ b/src/main/java/com/baidu/hugegraph/config/OptionChecker.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.config; import java.lang.reflect.Array; diff --git a/src/main/java/com/baidu/hugegraph/config/OptionHolder.java b/src/main/java/com/baidu/hugegraph/config/OptionHolder.java index 100f25acf..6b30a11e6 100644 --- a/src/main/java/com/baidu/hugegraph/config/OptionHolder.java +++ b/src/main/java/com/baidu/hugegraph/config/OptionHolder.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.config; import java.lang.reflect.Field; @@ -7,8 +26,6 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.baidu.hugegraph.exception.ConfigException; - /** * Created by liningrui on 2017/5/25. */ @@ -39,6 +56,6 @@ public class OptionHolder { } public Map options() { - return options; + return this.options; } } diff --git a/src/main/java/com/baidu/hugegraph/config/OptionSpace.java b/src/main/java/com/baidu/hugegraph/config/OptionSpace.java index 7e75c2a3c..3d47e67cf 100644 --- a/src/main/java/com/baidu/hugegraph/config/OptionSpace.java +++ b/src/main/java/com/baidu/hugegraph/config/OptionSpace.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.config; import java.util.Map; diff --git a/src/main/java/com/baidu/hugegraph/event/Event.java b/src/main/java/com/baidu/hugegraph/event/Event.java index 2fba77192..53b58cfae 100644 --- a/src/main/java/com/baidu/hugegraph/event/Event.java +++ b/src/main/java/com/baidu/hugegraph/event/Event.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.event; import java.util.Arrays; diff --git a/src/main/java/com/baidu/hugegraph/event/EventHub.java b/src/main/java/com/baidu/hugegraph/event/EventHub.java index 0187cef85..b584127a6 100644 --- a/src/main/java/com/baidu/hugegraph/event/EventHub.java +++ b/src/main/java/com/baidu/hugegraph/event/EventHub.java @@ -41,8 +41,9 @@ public class EventHub { private static final Logger logger = LoggerFactory.getLogger(EventHub.class); - // Event executor public static final String ANY_EVENT = "*"; + + // Event executor private static ExecutorService executor = null; private String name; diff --git a/src/main/java/com/baidu/hugegraph/event/EventListener.java b/src/main/java/com/baidu/hugegraph/event/EventListener.java index 38b2a3adf..7e5144f85 100644 --- a/src/main/java/com/baidu/hugegraph/event/EventListener.java +++ b/src/main/java/com/baidu/hugegraph/event/EventListener.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.event; public interface EventListener extends java.util.EventListener { diff --git a/src/main/java/com/baidu/hugegraph/exception/ConfigException.java b/src/main/java/com/baidu/hugegraph/exception/ConfigException.java deleted file mode 100644 index e1914112c..000000000 --- a/src/main/java/com/baidu/hugegraph/exception/ConfigException.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baidu.hugegraph.exception; - -public class ConfigException extends RuntimeException { - - private static final long serialVersionUID = -8711375282196157058L; - - public ConfigException(String message) { - super(message); - } - - public ConfigException(String msg, Throwable cause) { - super(msg, cause); - } -} diff --git a/src/main/java/com/baidu/hugegraph/perf/PerfUtil.java b/src/main/java/com/baidu/hugegraph/perf/PerfUtil.java index ee280e952..ce7d50bd1 100644 --- a/src/main/java/com/baidu/hugegraph/perf/PerfUtil.java +++ b/src/main/java/com/baidu/hugegraph/perf/PerfUtil.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.perf; import java.io.IOException; diff --git a/src/main/java/com/baidu/hugegraph/perf/Stopwatch.java b/src/main/java/com/baidu/hugegraph/perf/Stopwatch.java index 13216dbe9..f543d752f 100644 --- a/src/main/java/com/baidu/hugegraph/perf/Stopwatch.java +++ b/src/main/java/com/baidu/hugegraph/perf/Stopwatch.java @@ -20,6 +20,7 @@ package com.baidu.hugegraph.perf; public class Stopwatch implements Cloneable { + private long lastStartTime = -1L; private long totalCost = 0L; @@ -37,7 +38,7 @@ public class Stopwatch implements Cloneable { } public String id() { - return id(this.parent, this.name); + return Stopwatch.id(this.parent, this.name); } public static String id(String parent, String name) { @@ -56,22 +57,23 @@ public class Stopwatch implements Cloneable { } public void startTime(long time) { - assert this.lastStartTime == -1; + assert this.lastStartTime == -1L; + this.lastStartTime = time; this.times++; } public void endTime(long time) { - assert time >= this.lastStartTime && this.lastStartTime != -1; + assert time >= this.lastStartTime && this.lastStartTime != -1L; long cost = time - this.lastStartTime; this.totalCost += cost; - this.lastStartTime = -1; + this.lastStartTime = -1L; this.updateMinMax(cost); } protected void updateMinMax(long cost) { - if (this.minCost > cost || this.minCost == 0) { + if (this.minCost > cost || this.minCost == 0L) { this.minCost = cost; } if (this.maxCost < cost) { @@ -111,7 +113,7 @@ public class Stopwatch implements Cloneable { public String toString() { return String.format( "{totalCost:%sms, minCost:%sns, maxCost:%sns, times:%s}", - this.totalCost / 1000000.0, + this.totalCost / 1000000.0F, this.minCost, this.maxCost, this.times); } diff --git a/src/main/java/com/baidu/hugegraph/type/ExtendableIterator.java b/src/main/java/com/baidu/hugegraph/type/ExtendableIterator.java index 7a1b54bdf..cbc3d81d8 100644 --- a/src/main/java/com/baidu/hugegraph/type/ExtendableIterator.java +++ b/src/main/java/com/baidu/hugegraph/type/ExtendableIterator.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.type; import java.util.Deque; diff --git a/src/main/java/com/baidu/hugegraph/type/Shard.java b/src/main/java/com/baidu/hugegraph/type/Shard.java index 65d2c6379..462dfa64d 100644 --- a/src/main/java/com/baidu/hugegraph/type/Shard.java +++ b/src/main/java/com/baidu/hugegraph/type/Shard.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.type; /** diff --git a/src/main/java/com/baidu/hugegraph/type/TriFunction.java b/src/main/java/com/baidu/hugegraph/type/TriFunction.java index 1bf121c9f..bb469440c 100644 --- a/src/main/java/com/baidu/hugegraph/type/TriFunction.java +++ b/src/main/java/com/baidu/hugegraph/type/TriFunction.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.type; public interface TriFunction { diff --git a/src/main/java/com/baidu/hugegraph/util/CollectionUtil.java b/src/main/java/com/baidu/hugegraph/util/CollectionUtil.java index 7d83051fd..687e87718 100644 --- a/src/main/java/com/baidu/hugegraph/util/CollectionUtil.java +++ b/src/main/java/com/baidu/hugegraph/util/CollectionUtil.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.util; import java.util.Collection; diff --git a/src/main/java/com/baidu/hugegraph/util/E.java b/src/main/java/com/baidu/hugegraph/util/E.java index b627036b3..9ced5a754 100644 --- a/src/main/java/com/baidu/hugegraph/util/E.java +++ b/src/main/java/com/baidu/hugegraph/util/E.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.util; import java.util.Collection; diff --git a/src/main/java/com/baidu/hugegraph/util/HashUtil.java b/src/main/java/com/baidu/hugegraph/util/HashUtil.java index 293678cd1..b2b1d32bd 100644 --- a/src/main/java/com/baidu/hugegraph/util/HashUtil.java +++ b/src/main/java/com/baidu/hugegraph/util/HashUtil.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.util; import java.nio.charset.Charset; diff --git a/src/main/java/com/baidu/hugegraph/util/ReflectionUtil.java b/src/main/java/com/baidu/hugegraph/util/ReflectionUtil.java index 7fcdd7dbb..50883e0f6 100644 --- a/src/main/java/com/baidu/hugegraph/util/ReflectionUtil.java +++ b/src/main/java/com/baidu/hugegraph/util/ReflectionUtil.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.util; import java.io.IOException; diff --git a/src/main/java/com/baidu/hugegraph/util/TimeUtil.java b/src/main/java/com/baidu/hugegraph/util/TimeUtil.java index 1b76b28c0..8ea7feea5 100644 --- a/src/main/java/com/baidu/hugegraph/util/TimeUtil.java +++ b/src/main/java/com/baidu/hugegraph/util/TimeUtil.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017 HugeGraph Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + package com.baidu.hugegraph.util; import java.util.Date;