Skip to content

Commit

Permalink
MONDRIAN: Integrate new checkFile rule from main to 3.2; fix violations.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 13380]
  • Loading branch information
julianhyde committed Feb 8, 2010
1 parent 2d9a0db commit 8df6d23
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 39 deletions.
3 changes: 3 additions & 0 deletions bin/checkFile.awk
Expand Up @@ -356,6 +356,9 @@ match(s, /(\.|->)$/, a) {
error(fname, FNR, "operator '" a[1] "' must not be at end of line");
}
}
match(s, /^ *(=) /, a) {
error(fname, FNR, "operator '" a[1] "' must not be at start of line");
}
s ~ /\<[[:digit:][:lower:]][[:alnum:]_]*</ {
# E.g. "p<" but not "Map<"
if (!matchFile(fname)) {}
Expand Down
14 changes: 7 additions & 7 deletions src/main/mondrian/olap/fun/NativizeSetFunDef.java
Expand Up @@ -2,7 +2,7 @@
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2009-2009 Julian Hyde and others
// Copyright (C) 2009-2010 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
Expand Down Expand Up @@ -368,8 +368,8 @@ private boolean isHighCardinality(
}
}

boolean isHighCardinality
= (estimatedCardinality >= nativizeMinThreshold);
boolean isHighCardinality =
(estimatedCardinality >= nativizeMinThreshold);

LOGGER.info(
String.format(
Expand Down Expand Up @@ -785,8 +785,8 @@ public ReassemblyGuide classifyMembers(
}

private List<Collection<String>> findNativeMembers() {
List<Collection<String>> nativeMembers
= new ArrayList<Collection<String>>(tupleSize);
List<Collection<String>> nativeMembers =
new ArrayList<Collection<String>>(tupleSize);

for (int i = 0; i < tupleSize; i++) {
nativeMembers.add(new LinkedHashSet<String>());
Expand Down Expand Up @@ -1400,8 +1400,8 @@ public void remove() {

private static class ReassemblyGuide {
private final int index;
private final List<ReassemblyCommand> commands
= new ArrayList<ReassemblyCommand>();
private final List<ReassemblyCommand> commands =
new ArrayList<ReassemblyCommand>();

public ReassemblyGuide(int index) {
this.index = index;
Expand Down
7 changes: 4 additions & 3 deletions src/main/mondrian/olap/fun/TupleFunDef.java
Expand Up @@ -4,7 +4,7 @@
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2002-2002 Kana Software, Inc.
// Copyright (C) 2002-2009 Julian Hyde and others
// Copyright (C) 2002-2010 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
Expand Down Expand Up @@ -95,8 +95,9 @@ public CalcImpl(ResolvedFunCall call, MemberCalc[] memberCalcs) {
public Member[] evaluateTuple(Evaluator evaluator) {
final Member[] members = new Member[memberCalcs.length];
for (int i = 0; i < members.length; i++) {
final Member member = members[i]
= memberCalcs[i].evaluateMember(evaluator);
final Member member =
members[i] =
memberCalcs[i].evaluateMember(evaluator);
if (member == null || member.isNull()) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/mondrian/olap/fun/vba/Vba.java
Expand Up @@ -32,8 +32,8 @@
public class Vba {
private static final long MILLIS_IN_A_DAY = 24 * 60 * 60 * 1000;

private static final DateFormatSymbols DATE_FORMAT_SYMBOLS
= new DateFormatSymbols(Locale.getDefault());
private static final DateFormatSymbols DATE_FORMAT_SYMBOLS =
new DateFormatSymbols(Locale.getDefault());

// Conversion

Expand Down
7 changes: 3 additions & 4 deletions src/main/mondrian/rolap/DefaultMemberChildrenConstraint.java
Expand Up @@ -3,7 +3,7 @@
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2004-2005 TONBELLER AG
// Copyright (C) 2006-2009 Julian Hyde and others
// Copyright (C) 2006-2010 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
Expand All @@ -25,9 +25,8 @@
public class DefaultMemberChildrenConstraint
implements MemberChildrenConstraint
{

private static final MemberChildrenConstraint instance
= new DefaultMemberChildrenConstraint();
private static final MemberChildrenConstraint instance =
new DefaultMemberChildrenConstraint();

/** we have no state, so all instances are equal */
private static final Object cacheKey = new Object();
Expand Down
6 changes: 3 additions & 3 deletions src/main/mondrian/rolap/RolapConnectionPool.java
Expand Up @@ -4,7 +4,7 @@
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2003-2006 Robin Bagot and others
// Copyright (C) 2003-2009 Julian Hyde
// Copyright (C) 2003-2010 Julian Hyde
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
Expand Down Expand Up @@ -203,8 +203,8 @@ private synchronized ObjectPool getPool(
// Flag to log stack traces for application code which abandoned a
// Statement or Connection
abandonedConfig.setLogAbandoned(true);
PoolableConnectionFactory poolableConnectionFactory
= new PoolableConnectionFactory(
PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(
// the connection factory
connectionFactory,
// the object pool
Expand Down
8 changes: 4 additions & 4 deletions src/main/mondrian/rolap/agg/Aggregation.java
Expand Up @@ -3,7 +3,7 @@
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2001-2009 Julian Hyde and others
// Copyright (C) 2001-2010 Julian Hyde and others
// Copyright (C) 2001-2002 Kana Software, Inc.
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
Expand Down Expand Up @@ -461,9 +461,9 @@ public void flush(
for (int i = 0; i < columns.length; i++) {
final Axis axis = segment.axes[i];
int keyCount = axis.getKeys().length;
final BitSet axisKeepBitSet
= axisKeepBitSets[i]
= new BitSet(keyCount);
final BitSet axisKeepBitSet =
axisKeepBitSets[i] =
new BitSet(keyCount);
final StarColumnPredicate predicate = axis.predicate;
assert predicate != null;

Expand Down
8 changes: 4 additions & 4 deletions src/main/mondrian/rolap/agg/Segment.java
Expand Up @@ -4,7 +4,7 @@
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2002-2002 Kana Software, Inc.
// Copyright (C) 2002-2009 Julian Hyde and others
// Copyright (C) 2002-2010 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
Expand Down Expand Up @@ -498,9 +498,9 @@ Segment createSubSegment(
axisPosMaps[j] = null; // identity map
} else {
List<Object> newAxisKeyList = new ArrayList<Object>();
Map<Integer, Integer> map
= axisPosMaps[j]
= new HashMap<Integer, Integer>();
Map<Integer, Integer> map =
axisPosMaps[j] =
new HashMap<Integer, Integer>();
for (int bit = keepBitSet.nextSetBit(0);
bit >= 0;
bit = keepBitSet.nextSetBit(bit + 1))
Expand Down
10 changes: 5 additions & 5 deletions src/main/mondrian/util/Format.java
Expand Up @@ -4,7 +4,7 @@
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2000-2002 Kana Software, Inc.
// Copyright (C) 2001-2009 Julian Hyde and others
// Copyright (C) 2001-2010 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
Expand Down Expand Up @@ -724,8 +724,8 @@ private static boolean shows(

void format(long n, StringBuilder buf)
{
mondrian.util.Format.FloatingDecimal fd
= new mondrian.util.Format.FloatingDecimal(n);
mondrian.util.Format.FloatingDecimal fd =
new mondrian.util.Format.FloatingDecimal(n);
fd.shift(decimalShift);
String s = fd.toJavaFormatString(
zeroesLeftOfPoint,
Expand Down Expand Up @@ -2446,8 +2446,8 @@ private String parseFormatString(
if (decimalShift != 0) {
for (int i = 0; i < formatList.size(); i++) {
if (formatList.get(i) instanceof NumericFormat) {
((NumericFormat) formatList.get(i)).decimalShift
= decimalShift;
((NumericFormat) formatList.get(i)).decimalShift =
decimalShift;
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions testsrc/main/mondrian/olap/fun/NativizeSetFunDefTest.java
Expand Up @@ -157,13 +157,13 @@ public void testNativeResultLimitBeforeMerge() {
public void testNativeResultLimitDuringMerge() {
// This query will return exactly 6 rows:
// {Female,Male,Agg}x{Married,Single}
String mdx
= "with member [gender].[agg] as"
+ " 'aggregate({[gender].[gender].members},[measures].[unit sales])'"
+ "select NativizeSet(CrossJoin( "
+ "{gender.gender.members, gender.agg}, "
+ "{[marital status].[marital status].members}"
+ ")) on 0 from sales";
String mdx =
"with member [gender].[agg] as"
+ " 'aggregate({[gender].[gender].members},[measures].[unit sales])'"
+ "select NativizeSet(CrossJoin( "
+ "{gender.gender.members, gender.agg}, "
+ "{[marital status].[marital status].members}"
+ ")) on 0 from sales";

// Set limit to exact size of result
propSaver.set(MondrianProperties.instance().NativizeMaxResults, 6);
Expand Down

0 comments on commit 8df6d23

Please sign in to comment.