Skip to content

Commit dcca185

Browse files
author
lucaijun
committed
AJ-447: cancel process the negative number build month
1 parent 11f0d41 commit dcca185

File tree

4 files changed

+3
-38
lines changed

4 files changed

+3
-38
lines changed

src/com/xxdb/data/BasicIntVector.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ public BasicIntVector(int[] array, boolean copy){
5454
this.size = values.length;
5555
capaticy = values.length;
5656
}
57-
58-
protected BasicIntVector(DATA_FORM df) {
59-
super(df);
60-
}
6157

6258
protected BasicIntVector(DATA_FORM df, int size){
6359
super(df);

src/com/xxdb/data/BasicMonth.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ public class BasicMonth extends BasicInt{
2020

2121
public BasicMonth(int year, Month month){
2222
super(year * 12 + month.getValue()-1);
23-
if (getInt() < 0 && !isNull())
24-
throw new DateTimeException(String.format("year %d is invalid, it must be non-negative integer", year));
2523
}
2624
public BasicMonth(Calendar calendar){
2725
super((calendar.get(Calendar.YEAR)) * 12 + calendar.get(Calendar.MONTH));
@@ -36,8 +34,6 @@ public BasicMonth(ExtendedDataInput in) throws IOException {
3634

3735
protected BasicMonth(int value){
3836
super(value);
39-
if (getInt() < 0 && !isNull())
40-
throw new DateTimeException(String.format("number %d is invalid, it must be non-negative integer", getInt()));
4137
}
4238

4339

src/com/xxdb/data/BasicMonthVector.java

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,15 @@ public BasicMonthVector(int size){
2121
}
2222

2323
public BasicMonthVector(List<Integer> list) {
24-
super(DATA_FORM.DF_VECTOR);
25-
if (list != null) {
26-
values = new int[list.size()];
27-
for (int i = 0; i < list.size(); ++i) {
28-
if (list.get(i) != null) {
29-
if (list.get(i) < 0 && !list.get(i).equals(Integer.MIN_VALUE))
30-
throw new DateTimeException("Arrays cannot contain negative numbers");
31-
else
32-
values[i] = list.get(i);
33-
} else {
34-
values[i] = Integer.MIN_VALUE;
35-
}
36-
}
37-
}
38-
size = values.length;
39-
capaticy = values.length;
24+
super(list);
4025
}
4126

4227
public BasicMonthVector(int[] array) {
43-
this(array, true);
28+
super(array);
4429
}
4530

4631
protected BasicMonthVector(int[] array, boolean copy) {
47-
super(DATA_FORM.DF_VECTOR);
48-
for (int j : array) {
49-
if (j < 0 && j != Integer.MIN_VALUE) throw new DateTimeException("Arrays cannot contain negative numbers");
50-
}
51-
if (copy)
52-
values = array.clone();
53-
else
54-
values = array;
55-
size = values.length;
56-
capaticy = values.length;
32+
super(array, copy);
5733
}
5834

5935
protected BasicMonthVector(DATA_FORM df, int size){

src/com/xxdb/data/Utils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ public static int countMonths(int days){
6969

7070

7171
public static YearMonth parseMonth(int value){
72-
if (value < 0){
73-
throw new DateTimeException(String.format("number %d is invalid, it must be non-negative integer",value));
74-
}
7572
return YearMonth.of(value/12, value % 12 + 1);
7673
}
7774

0 commit comments

Comments
 (0)