From 0e04793c2c33d5451cc38c384bf4f8491e3e6933 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Sun, 29 Nov 2015 15:31:57 +0000 Subject: [PATCH] bug 57844: add NotImplemented annotation to SXSSFSheet.shiftRows git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717079 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/util/NotImplemented.java | 36 +++++++++++++++++++ .../apache/poi/xssf/streaming/SXSSFSheet.java | 5 ++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/java/org/apache/poi/util/NotImplemented.java diff --git a/src/java/org/apache/poi/util/NotImplemented.java b/src/java/org/apache/poi/util/NotImplemented.java new file mode 100644 index 000000000..e815c5d15 --- /dev/null +++ b/src/java/org/apache/poi/util/NotImplemented.java @@ -0,0 +1,36 @@ +/* ==================================================================== + 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 org.apache.poi.util; + +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; +import java.lang.annotation.Documented; + + +/** + * This feature has not been implemented yet. + * Calling this method will result in a raised Exception + * at runtime. + * + * @since POI-3.14beta1 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface NotImplemented { + String value() default ""; +} diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index f4a993c8f..9134eb97d 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -44,6 +44,7 @@ import org.apache.poi.ss.util.CellAddress; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.SheetUtil; import org.apache.poi.util.Internal; +import org.apache.poi.util.NotImplemented; import org.apache.poi.xssf.usermodel.XSSFComment; import org.apache.poi.xssf.usermodel.XSSFDataValidation; import org.apache.poi.xssf.usermodel.XSSFHyperlink; @@ -933,6 +934,7 @@ public class SXSSFSheet implements Sheet, Cloneable * @param endRow the row to end shifting * @param n the number of rows to shift */ + @NotImplemented @Override public void shiftRows(int startRow, int endRow, int n) { @@ -956,6 +958,7 @@ public class SXSSFSheet implements Sheet, Cloneable * @param copyRowHeight whether to copy the row height during the shift * @param resetOriginalRowHeight whether to set the original row's height to the default */ + @NotImplemented @Override public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight) { @@ -1306,7 +1309,7 @@ public class SXSSFSheet implements Sheet, Cloneable collapseRow(row); } else { //expandRow(rowIndex); - throw new RuntimeException("Not Implemented"); + throw new RuntimeException("Unable to expand row: Not Implemented"); } }