Skip to content
Permalink
Browse files

TIKA-2978 -- setter for maxMainMemoryBytes should be of type long

  • Loading branch information
tballison committed Nov 8, 2019
1 parent 51aa28c commit 770719a07f57d4804383f262fa8cccc8ec172fc0
@@ -529,6 +529,10 @@ public void setInitializableProblemHandler(InitializableProblemHandler initializ
this.initializableProblemHandler = initializableProblemHandler;
}

@Field
public void setMaxMainMemoryBytes(long maxMainMemoryBytes) {
defaultConfig.setMaxMainMemoryBytes(maxMainMemoryBytes);
}
/**
* This is a no-op. There is no need to initialize multiple fields.
* The regular field loading should happen without this.
@@ -238,7 +238,7 @@ private void init(InputStream is) {
accessChecker = new AccessChecker(allowExtractionForAccessibility);
}

maxMainMemoryBytes = getIntProp(props.getProperty("maxMainMemoryBytes"), -1);
maxMainMemoryBytes = getLongProp(props.getProperty("maxMainMemoryBytes"), -1);
detectAngles = getBooleanProp(props.getProperty("detectAngles"), false);
}

@@ -701,10 +701,19 @@ public long getMaxMainMemoryBytes() {
return maxMainMemoryBytes;
}

/**
* @deprecated use {@link #setMaxMainMemoryBytes(long)}
* @param maxMainMemoryBytes
*/
@Deprecated
public void setMaxMainMemoryBytes(int maxMainMemoryBytes) {
this.maxMainMemoryBytes = maxMainMemoryBytes;
}

public void setMaxMainMemoryBytes(long maxMainMemoryBytes) {
this.maxMainMemoryBytes = maxMainMemoryBytes;
}

/**
* <p>
* Whether to call <code>System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider")</code>.
@@ -31,7 +31,7 @@
<param name="ocrImageQuality" type="float">2.1</param>
<param name="ocrImageFormatName" type="string">jpeg</param>
<param name="ocrImageScale" type="float">1.3</param>
<param name="maxMainMemoryBytes" type="int">524288000</param>
<param name="maxMainMemoryBytes" type="long">524288000</param>
<!-- we really should throw an exception for this!! -->
<param name="someRandomThingOrOther" type="bool">true</param>
</params>

0 comments on commit 770719a

Please sign in to comment.
You can’t perform that action at this time.