Loading app/core/src/main/java/com/fsck/k9/search/ConditionsTreeNode.java +9 −21 Original line number Diff line number Diff line Loading @@ -164,9 +164,8 @@ public class ConditionsTreeNode implements Parcelable { * * @param expr Expression to 'AND' with. * @return New top AND node. * @throws Exception */ public ConditionsTreeNode and(ConditionsTreeNode expr) throws Exception { public ConditionsTreeNode and(ConditionsTreeNode expr) { return add(expr, Operator.AND); } Loading @@ -179,13 +178,8 @@ public class ConditionsTreeNode implements Parcelable { * @return New top AND node, new root. */ public ConditionsTreeNode and(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return and(tmp); } catch (Exception e) { // impossible return null; } } /** Loading @@ -194,9 +188,8 @@ public class ConditionsTreeNode implements Parcelable { * * @param expr Expression to 'OR' with. * @return New top OR node. * @throws Exception */ public ConditionsTreeNode or(ConditionsTreeNode expr) throws Exception { public ConditionsTreeNode or(ConditionsTreeNode expr) { return add(expr, Operator.OR); } Loading @@ -209,13 +202,8 @@ public class ConditionsTreeNode implements Parcelable { * @return New top OR node, new root. */ public ConditionsTreeNode or(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return or(tmp); } catch (Exception e) { // impossible return null; } } /** Loading Loading @@ -295,11 +283,11 @@ public class ConditionsTreeNode implements Parcelable { * @param node Node to add. * @param op Operator that will connect the new node with this one. * @return New parent node, containing the operator. * @throws Exception Throws when the provided new node does not have a null parent. * @throws IllegalArgumentException Throws when the provided new node does not have a null parent. */ private ConditionsTreeNode add(ConditionsTreeNode node, Operator op) throws Exception { private ConditionsTreeNode add(ConditionsTreeNode node, Operator op) { if (node.mParent != null) { throw new Exception("Can only add new expressions from root node down."); throw new IllegalArgumentException("Can only add new expressions from root node down."); } ConditionsTreeNode tmpNode = new ConditionsTreeNode(mParent, op); Loading app/core/src/main/java/com/fsck/k9/search/LocalSearch.java +6 −18 Original line number Diff line number Diff line Loading @@ -170,13 +170,8 @@ public class LocalSearch implements SearchSpecification { * @return New top AND node, new root. */ public ConditionsTreeNode and(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return and(tmp); } catch (Exception e) { // impossible return null; } } /** Loading @@ -185,9 +180,8 @@ public class LocalSearch implements SearchSpecification { * * @param node Node to 'AND' with. * @return New top AND node, new root. * @throws Exception */ public ConditionsTreeNode and(ConditionsTreeNode node) throws Exception { public ConditionsTreeNode and(ConditionsTreeNode node) { mLeafSet.addAll(node.getLeafSet()); if (mConditions == null) { Loading @@ -207,13 +201,8 @@ public class LocalSearch implements SearchSpecification { * @return New top OR node, new root. */ public ConditionsTreeNode or(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return or(tmp); } catch (Exception e) { // impossible return null; } } /** Loading @@ -222,9 +211,8 @@ public class LocalSearch implements SearchSpecification { * * @param node Node to 'OR' with. * @return New top OR node, new root. * @throws Exception */ public ConditionsTreeNode or(ConditionsTreeNode node) throws Exception { public ConditionsTreeNode or(ConditionsTreeNode node) { mLeafSet.addAll(node.getLeafSet()); if (mConditions == null) { Loading Loading
app/core/src/main/java/com/fsck/k9/search/ConditionsTreeNode.java +9 −21 Original line number Diff line number Diff line Loading @@ -164,9 +164,8 @@ public class ConditionsTreeNode implements Parcelable { * * @param expr Expression to 'AND' with. * @return New top AND node. * @throws Exception */ public ConditionsTreeNode and(ConditionsTreeNode expr) throws Exception { public ConditionsTreeNode and(ConditionsTreeNode expr) { return add(expr, Operator.AND); } Loading @@ -179,13 +178,8 @@ public class ConditionsTreeNode implements Parcelable { * @return New top AND node, new root. */ public ConditionsTreeNode and(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return and(tmp); } catch (Exception e) { // impossible return null; } } /** Loading @@ -194,9 +188,8 @@ public class ConditionsTreeNode implements Parcelable { * * @param expr Expression to 'OR' with. * @return New top OR node. * @throws Exception */ public ConditionsTreeNode or(ConditionsTreeNode expr) throws Exception { public ConditionsTreeNode or(ConditionsTreeNode expr) { return add(expr, Operator.OR); } Loading @@ -209,13 +202,8 @@ public class ConditionsTreeNode implements Parcelable { * @return New top OR node, new root. */ public ConditionsTreeNode or(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return or(tmp); } catch (Exception e) { // impossible return null; } } /** Loading Loading @@ -295,11 +283,11 @@ public class ConditionsTreeNode implements Parcelable { * @param node Node to add. * @param op Operator that will connect the new node with this one. * @return New parent node, containing the operator. * @throws Exception Throws when the provided new node does not have a null parent. * @throws IllegalArgumentException Throws when the provided new node does not have a null parent. */ private ConditionsTreeNode add(ConditionsTreeNode node, Operator op) throws Exception { private ConditionsTreeNode add(ConditionsTreeNode node, Operator op) { if (node.mParent != null) { throw new Exception("Can only add new expressions from root node down."); throw new IllegalArgumentException("Can only add new expressions from root node down."); } ConditionsTreeNode tmpNode = new ConditionsTreeNode(mParent, op); Loading
app/core/src/main/java/com/fsck/k9/search/LocalSearch.java +6 −18 Original line number Diff line number Diff line Loading @@ -170,13 +170,8 @@ public class LocalSearch implements SearchSpecification { * @return New top AND node, new root. */ public ConditionsTreeNode and(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return and(tmp); } catch (Exception e) { // impossible return null; } } /** Loading @@ -185,9 +180,8 @@ public class LocalSearch implements SearchSpecification { * * @param node Node to 'AND' with. * @return New top AND node, new root. * @throws Exception */ public ConditionsTreeNode and(ConditionsTreeNode node) throws Exception { public ConditionsTreeNode and(ConditionsTreeNode node) { mLeafSet.addAll(node.getLeafSet()); if (mConditions == null) { Loading @@ -207,13 +201,8 @@ public class LocalSearch implements SearchSpecification { * @return New top OR node, new root. */ public ConditionsTreeNode or(SearchCondition condition) { try { ConditionsTreeNode tmp = new ConditionsTreeNode(condition); return or(tmp); } catch (Exception e) { // impossible return null; } } /** Loading @@ -222,9 +211,8 @@ public class LocalSearch implements SearchSpecification { * * @param node Node to 'OR' with. * @return New top OR node, new root. * @throws Exception */ public ConditionsTreeNode or(ConditionsTreeNode node) throws Exception { public ConditionsTreeNode or(ConditionsTreeNode node) { mLeafSet.addAll(node.getLeafSet()); if (mConditions == null) { Loading