code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
@Override
public void isEqualTo(@NullableDecl Object expected) {
// TODO(user): Do better here when MessageLite descriptors are available.
if (Objects.equal(actual(), expected)) {
return;
}
if (actual() == null || expected == null) {
super.isEqualTo(expected);
} else if (actual().getClass() != expected.getClass()) {
failWithoutActual(
simpleFact(
lenientFormat(
"Not true that (%s) %s is equal to the expected (%s) object. "
+ "They are not of the same class.",
actual().getClass().getName(),
internalCustomName() != null ? internalCustomName() + " (proto)" : "proto",
expected.getClass().getName())));
} else {
/*
* TODO(cpovirk): If we someday let subjects override formatActualOrExpected(), change this
* class to do so, and make this code path always delegate to super.isEqualTo().
*/
String ourString = getTrimmedToString(actual());
String theirString = getTrimmedToString((MessageLite) expected);
if (!ourString.equals(theirString)) {
check().that(ourString).isEqualTo(theirString); // fails
} else {
// This will include the Object.toString() headers.
super.isEqualTo(expected);
}
}
} }
|
public class class_name {
@Override
public void isEqualTo(@NullableDecl Object expected) {
// TODO(user): Do better here when MessageLite descriptors are available.
if (Objects.equal(actual(), expected)) {
return; // depends on control dependency: [if], data = [none]
}
if (actual() == null || expected == null) {
super.isEqualTo(expected); // depends on control dependency: [if], data = [none]
} else if (actual().getClass() != expected.getClass()) {
failWithoutActual(
simpleFact(
lenientFormat(
"Not true that (%s) %s is equal to the expected (%s) object. "
+ "They are not of the same class.",
actual().getClass().getName(),
internalCustomName() != null ? internalCustomName() + " (proto)" : "proto",
expected.getClass().getName()))); // depends on control dependency: [if], data = [none]
} else {
/*
* TODO(cpovirk): If we someday let subjects override formatActualOrExpected(), change this
* class to do so, and make this code path always delegate to super.isEqualTo().
*/
String ourString = getTrimmedToString(actual());
String theirString = getTrimmedToString((MessageLite) expected);
if (!ourString.equals(theirString)) {
check().that(ourString).isEqualTo(theirString); // fails // depends on control dependency: [if], data = [none]
} else {
// This will include the Object.toString() headers.
super.isEqualTo(expected); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
protected void gotPong (PongResponse pong)
{
// if we're not currently calculating our delta, then we can throw away the pong
if (_dcalc != null) {
// we update the delta after every receipt so as to immediately obtain an estimate of
// the clock delta and then refine it as more packets come in
_dcalc.gotPong(pong);
_serverDelta = _dcalc.getTimeDelta();
}
} }
|
public class class_name {
protected void gotPong (PongResponse pong)
{
// if we're not currently calculating our delta, then we can throw away the pong
if (_dcalc != null) {
// we update the delta after every receipt so as to immediately obtain an estimate of
// the clock delta and then refine it as more packets come in
_dcalc.gotPong(pong); // depends on control dependency: [if], data = [none]
_serverDelta = _dcalc.getTimeDelta(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private static List<SecretRange> getAWSSecretPos(String text)
{
// log before and after in case this is causing StackOverflowError
LOGGER.debug("pre-regex getAWSSecretPos");
Matcher matcher = AWS_KEY_PATTERN.matcher(text);
ArrayList<SecretRange> awsSecretRanges = new ArrayList<>();
while (matcher.find())
{
int beginPos = Math.min(matcher.end() + LOOK_AHEAD, text.length());
while (beginPos > 0 && beginPos < text.length() &&
isBase64(text.charAt(beginPos)))
{
beginPos--;
}
int endPos = Math.min(matcher.end() + LOOK_AHEAD, text.length());
while (endPos < text.length() && isBase64(text.charAt(endPos)))
{
endPos++;
}
if (beginPos < text.length() && endPos <= text.length()
&& beginPos >= 0 && endPos >= 0)
{
awsSecretRanges.add(new SecretRange(beginPos + 1, endPos));
}
}
LOGGER.debug("post-regex getAWSSecretPos");
return awsSecretRanges;
} }
|
public class class_name {
private static List<SecretRange> getAWSSecretPos(String text)
{
// log before and after in case this is causing StackOverflowError
LOGGER.debug("pre-regex getAWSSecretPos");
Matcher matcher = AWS_KEY_PATTERN.matcher(text);
ArrayList<SecretRange> awsSecretRanges = new ArrayList<>();
while (matcher.find())
{
int beginPos = Math.min(matcher.end() + LOOK_AHEAD, text.length());
while (beginPos > 0 && beginPos < text.length() &&
isBase64(text.charAt(beginPos)))
{
beginPos--; // depends on control dependency: [while], data = [none]
}
int endPos = Math.min(matcher.end() + LOOK_AHEAD, text.length());
while (endPos < text.length() && isBase64(text.charAt(endPos)))
{
endPos++; // depends on control dependency: [while], data = [none]
}
if (beginPos < text.length() && endPos <= text.length()
&& beginPos >= 0 && endPos >= 0)
{
awsSecretRanges.add(new SecretRange(beginPos + 1, endPos)); // depends on control dependency: [if], data = [(beginPos]
}
}
LOGGER.debug("post-regex getAWSSecretPos");
return awsSecretRanges;
} }
|
public class class_name {
private static void process(List<File> srcDirs, List<String> srcFileNames, File dstDir, boolean unpacked, boolean verbose) {
// build actual jar files
Map<Object, Object> deduplicateMap = new HashMap<Object, Object>();
Map<String, SortedMap<String, ZoneRules>> allBuiltZones = new TreeMap<String, SortedMap<String, ZoneRules>>();
Set<String> allRegionIds = new TreeSet<String>();
Set<ZoneRules> allRules = new HashSet<ZoneRules>();
SortedMap<LocalDate, Byte> bestLeapSeconds = null;
for (File srcDir : srcDirs) {
// source files in this directory
List<File> srcFiles = new ArrayList<File>();
for (String srcFileName : srcFileNames) {
File file = new File(srcDir, srcFileName);
if (file.exists()) {
srcFiles.add(file);
}
}
if (srcFiles.isEmpty()) {
continue; // nothing to process
}
File leapSecondsFile = new File(srcDir, "leapseconds");
if (!leapSecondsFile.exists()) {
System.out.println("Version " + srcDir.getName() + " does not include leap seconds information.");
leapSecondsFile = null;
}
// compile
String loopVersion = srcDir.getName();
TzdbZoneRulesCompiler compiler = new TzdbZoneRulesCompiler(loopVersion, srcFiles, leapSecondsFile, verbose);
compiler.setDeduplicateMap(deduplicateMap);
try {
// compile
compiler.compile();
SortedMap<String, ZoneRules> builtZones = compiler.getZones();
SortedMap<LocalDate, Byte> parsedLeapSeconds = compiler.getLeapSeconds();
// output version-specific file
if (unpacked == false) {
File dstFile = new File(dstDir, "threeten-TZDB-" + loopVersion + ".jar");
if (verbose) {
System.out.println("Outputting file: " + dstFile);
}
outputFile(dstFile, loopVersion, builtZones, parsedLeapSeconds);
}
// create totals
allBuiltZones.put(loopVersion, builtZones);
allRegionIds.addAll(builtZones.keySet());
allRules.addAll(builtZones.values());
// track best possible leap seconds collection
if (compiler.getMostRecentLeapSecond() != null) {
// we've got a live one!
if (bestLeapSeconds == null || compiler.getMostRecentLeapSecond().compareTo(bestLeapSeconds.lastKey()) > 0) {
// found the first one, or found a better one
bestLeapSeconds = parsedLeapSeconds;
}
}
} catch (Exception ex) {
System.out.println("Failed: " + ex.toString());
ex.printStackTrace();
System.exit(1);
}
}
// output merged file
if (unpacked) {
if (verbose) {
System.out.println("Outputting combined files: " + dstDir);
}
outputFilesDat(dstDir, allBuiltZones, allRegionIds, allRules, bestLeapSeconds);
} else {
File dstFile = new File(dstDir, "threeten-TZDB-all.jar");
if (verbose) {
System.out.println("Outputting combined file: " + dstFile);
}
outputFile(dstFile, allBuiltZones, allRegionIds, allRules, bestLeapSeconds);
}
} }
|
public class class_name {
private static void process(List<File> srcDirs, List<String> srcFileNames, File dstDir, boolean unpacked, boolean verbose) {
// build actual jar files
Map<Object, Object> deduplicateMap = new HashMap<Object, Object>();
Map<String, SortedMap<String, ZoneRules>> allBuiltZones = new TreeMap<String, SortedMap<String, ZoneRules>>();
Set<String> allRegionIds = new TreeSet<String>();
Set<ZoneRules> allRules = new HashSet<ZoneRules>();
SortedMap<LocalDate, Byte> bestLeapSeconds = null;
for (File srcDir : srcDirs) {
// source files in this directory
List<File> srcFiles = new ArrayList<File>();
for (String srcFileName : srcFileNames) {
File file = new File(srcDir, srcFileName);
if (file.exists()) {
srcFiles.add(file); // depends on control dependency: [if], data = [none]
}
}
if (srcFiles.isEmpty()) {
continue; // nothing to process
}
File leapSecondsFile = new File(srcDir, "leapseconds");
if (!leapSecondsFile.exists()) {
System.out.println("Version " + srcDir.getName() + " does not include leap seconds information."); // depends on control dependency: [if], data = [none]
leapSecondsFile = null; // depends on control dependency: [if], data = [none]
}
// compile
String loopVersion = srcDir.getName();
TzdbZoneRulesCompiler compiler = new TzdbZoneRulesCompiler(loopVersion, srcFiles, leapSecondsFile, verbose);
compiler.setDeduplicateMap(deduplicateMap); // depends on control dependency: [for], data = [none]
try {
// compile
compiler.compile(); // depends on control dependency: [try], data = [none]
SortedMap<String, ZoneRules> builtZones = compiler.getZones();
SortedMap<LocalDate, Byte> parsedLeapSeconds = compiler.getLeapSeconds();
// output version-specific file
if (unpacked == false) {
File dstFile = new File(dstDir, "threeten-TZDB-" + loopVersion + ".jar");
if (verbose) {
System.out.println("Outputting file: " + dstFile); // depends on control dependency: [if], data = [none]
}
outputFile(dstFile, loopVersion, builtZones, parsedLeapSeconds); // depends on control dependency: [if], data = [none]
}
// create totals
allBuiltZones.put(loopVersion, builtZones); // depends on control dependency: [try], data = [none]
allRegionIds.addAll(builtZones.keySet()); // depends on control dependency: [try], data = [none]
allRules.addAll(builtZones.values()); // depends on control dependency: [try], data = [none]
// track best possible leap seconds collection
if (compiler.getMostRecentLeapSecond() != null) {
// we've got a live one!
if (bestLeapSeconds == null || compiler.getMostRecentLeapSecond().compareTo(bestLeapSeconds.lastKey()) > 0) {
// found the first one, or found a better one
bestLeapSeconds = parsedLeapSeconds; // depends on control dependency: [if], data = [none]
}
}
} catch (Exception ex) {
System.out.println("Failed: " + ex.toString());
ex.printStackTrace();
System.exit(1);
} // depends on control dependency: [catch], data = [none]
}
// output merged file
if (unpacked) {
if (verbose) {
System.out.println("Outputting combined files: " + dstDir); // depends on control dependency: [if], data = [none]
}
outputFilesDat(dstDir, allBuiltZones, allRegionIds, allRules, bestLeapSeconds); // depends on control dependency: [if], data = [none]
} else {
File dstFile = new File(dstDir, "threeten-TZDB-all.jar");
if (verbose) {
System.out.println("Outputting combined file: " + dstFile);
}
outputFile(dstFile, allBuiltZones, allRegionIds, allRules, bestLeapSeconds);
}
} }
|
public class class_name {
private static String executePowerShellCommand(String command) {
try {
String[] commandList = {POWER_SHELL, POWER_SHELL_COMMAND, command};
ProcessBuilder pb = new ProcessBuilder(commandList);
Process process = pb.start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
if (line.startsWith(COMMON_NAME_PARAMETER)) {
String[] values = line.split(COMMA_SPLIT);
return values[0].substring(values[0].indexOf(EQUAL_SPLIT) + 1);
}
}
} catch (Exception e) {
// do nothing
}
return null;
} }
|
public class class_name {
private static String executePowerShellCommand(String command) {
try {
String[] commandList = {POWER_SHELL, POWER_SHELL_COMMAND, command};
ProcessBuilder pb = new ProcessBuilder(commandList);
Process process = pb.start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
if (line.startsWith(COMMON_NAME_PARAMETER)) {
String[] values = line.split(COMMA_SPLIT);
return values[0].substring(values[0].indexOf(EQUAL_SPLIT) + 1); // depends on control dependency: [if], data = [none]
}
}
} catch (Exception e) {
// do nothing
} // depends on control dependency: [catch], data = [none]
return null;
} }
|
public class class_name {
private void parseCharRef(boolean doFlush) throws SAXException, IOException {
int value = 0;
char c;
if (tryRead('x')) {
loop1: while (true) {
c = readCh();
if (c == ';') {
break loop1;
} else {
int n = Character.digit(c, 16);
if (n == -1) {
fatal("illegal character in character reference", c,
null);
break loop1;
}
value *= 16;
value += n;
}
}
} else {
loop2: while (true) {
c = readCh();
if (c == ';') {
break loop2;
} else {
int n = Character.digit(c, 10);
if (n == -1) {
fatal("illegal character in character reference", c,
null);
break loop2;
}
value *= 10;
value += c - '0';
}
}
}
// check for character refs being legal XML
if (((value < 0x0020) && !((value == '\n') || (value == '\t') || (value == '\r')))
|| ((value >= 0xD800) && (value <= 0xDFFF))
|| (value == 0xFFFE)
|| (value == 0xFFFF) || (value > 0x0010ffff)) {
fatal("illegal XML character reference U+"
+ Integer.toHexString(value));
} else if ((value >= 0x007F) && (value <= 0x009F)) // 2006-11-13 hsivonen
{
handler.warn("Character reference expands to a control character: U+00"
+ Integer.toHexString(value) + ".");
}
if (isPrivateUse(value)) {
warnAboutPrivateUseChar();
}
// Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz
// (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz:
if (value <= 0x0000ffff) {
// no surrogates needed
dataBufferAppend((char) value);
} else if (value <= 0x0010ffff) {
value -= 0x10000;
// > 16 bits, surrogate needed
dataBufferAppend((char) (0xd800 | (value >> 10)));
dataBufferAppend((char) (0xdc00 | (value & 0x0003ff)));
} else {
// too big for surrogate
fatal("character reference " + value + " is too large for UTF-16",
Integer.valueOf(value).toString(), null);
}
if (doFlush) {
dataBufferFlush();
}
} }
|
public class class_name {
private void parseCharRef(boolean doFlush) throws SAXException, IOException {
int value = 0;
char c;
if (tryRead('x')) {
loop1: while (true) {
c = readCh(); // depends on control dependency: [while], data = [none]
if (c == ';') {
break loop1;
} else {
int n = Character.digit(c, 16);
if (n == -1) {
fatal("illegal character in character reference", c,
null); // depends on control dependency: [if], data = [none]
break loop1;
}
value *= 16; // depends on control dependency: [if], data = [none]
value += n; // depends on control dependency: [if], data = [none]
}
}
} else {
loop2: while (true) {
c = readCh(); // depends on control dependency: [while], data = [none]
if (c == ';') {
break loop2;
} else {
int n = Character.digit(c, 10);
if (n == -1) {
fatal("illegal character in character reference", c,
null); // depends on control dependency: [if], data = [none]
break loop2;
}
value *= 10; // depends on control dependency: [if], data = [none]
value += c - '0'; // depends on control dependency: [if], data = [none]
}
}
}
// check for character refs being legal XML
if (((value < 0x0020) && !((value == '\n') || (value == '\t') || (value == '\r')))
|| ((value >= 0xD800) && (value <= 0xDFFF))
|| (value == 0xFFFE)
|| (value == 0xFFFF) || (value > 0x0010ffff)) {
fatal("illegal XML character reference U+"
+ Integer.toHexString(value));
} else if ((value >= 0x007F) && (value <= 0x009F)) // 2006-11-13 hsivonen
{
handler.warn("Character reference expands to a control character: U+00"
+ Integer.toHexString(value) + ".");
}
if (isPrivateUse(value)) {
warnAboutPrivateUseChar();
}
// Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz
// (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz:
if (value <= 0x0000ffff) {
// no surrogates needed
dataBufferAppend((char) value);
} else if (value <= 0x0010ffff) {
value -= 0x10000;
// > 16 bits, surrogate needed
dataBufferAppend((char) (0xd800 | (value >> 10)));
dataBufferAppend((char) (0xdc00 | (value & 0x0003ff)));
} else {
// too big for surrogate
fatal("character reference " + value + " is too large for UTF-16",
Integer.valueOf(value).toString(), null);
}
if (doFlush) {
dataBufferFlush();
}
} }
|
public class class_name {
public static boolean isFullWidthCharacter(char c) {
// 全角空格为12288,半角空格为32
// 其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
// 全角空格 || 其他全角字符
if (c == 12288 || (c > 65280 && c < 65375)) {
return true;
}
// 中文全部是全角
if (isChineseCharacter(c)) {
return true;
}
// 日文判断
// 全角平假名 u3040 - u309F
// 全角片假名 u30A0 - u30FF
if (c >= '\u3040' && c <= '\u30FF') {
return true;
}
return false;
} }
|
public class class_name {
public static boolean isFullWidthCharacter(char c) {
// 全角空格为12288,半角空格为32
// 其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
// 全角空格 || 其他全角字符
if (c == 12288 || (c > 65280 && c < 65375)) {
return true;
// depends on control dependency: [if], data = [none]
}
// 中文全部是全角
if (isChineseCharacter(c)) {
return true;
// depends on control dependency: [if], data = [none]
}
// 日文判断
// 全角平假名 u3040 - u309F
// 全角片假名 u30A0 - u30FF
if (c >= '\u3040' && c <= '\u30FF') {
return true;
// depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
@SuppressWarnings("squid:S2259")
public void value(String expectedValue) {
String value = checkValue(expectedValue, 0, 0);
String reason = NO_ELEMENT_FOUND;
if (value == null && getElement().is().present()) {
reason = "Element not input";
}
assertNotNull(reason, value);
assertFalse("Value found: element value of '" + value + CONTAINS + expectedValue + "'", value.contains(expectedValue));
} }
|
public class class_name {
@SuppressWarnings("squid:S2259")
public void value(String expectedValue) {
String value = checkValue(expectedValue, 0, 0);
String reason = NO_ELEMENT_FOUND;
if (value == null && getElement().is().present()) {
reason = "Element not input"; // depends on control dependency: [if], data = [none]
}
assertNotNull(reason, value);
assertFalse("Value found: element value of '" + value + CONTAINS + expectedValue + "'", value.contains(expectedValue));
} }
|
public class class_name {
public java.util.List<String> getAddIamRoles() {
if (addIamRoles == null) {
addIamRoles = new com.amazonaws.internal.SdkInternalList<String>();
}
return addIamRoles;
} }
|
public class class_name {
public java.util.List<String> getAddIamRoles() {
if (addIamRoles == null) {
addIamRoles = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none]
}
return addIamRoles;
} }
|
public class class_name {
public void getRecordGeneratedKey(PreparedStatement pst, Record record, String[] pKeys) throws SQLException {
ResultSet rs = pst.getGeneratedKeys();
for (String pKey : pKeys) {
if (record.get(pKey) == null || isOracle()) {
if (rs.next()) {
record.set(pKey, rs.getObject(1)); // It returns Long for int colType for mysql
}
}
}
rs.close();
} }
|
public class class_name {
public void getRecordGeneratedKey(PreparedStatement pst, Record record, String[] pKeys) throws SQLException {
ResultSet rs = pst.getGeneratedKeys();
for (String pKey : pKeys) {
if (record.get(pKey) == null || isOracle()) {
if (rs.next()) {
record.set(pKey, rs.getObject(1)); // It returns Long for int colType for mysql
// depends on control dependency: [if], data = [none]
}
}
}
rs.close();
} }
|
public class class_name {
private void drawDistribution( Graphics2D g2 , List<Point2D_F64> candidates ,
int offX, int offY , double scale) {
findStatistics();
// draw all the features, adjusting their size based on the first score
g2.setColor(Color.RED);
g2.setStroke(new BasicStroke(3));
double normalizer;
if( scorer.getScoreType().isZeroBest() )
normalizer = best*containmentFraction;
else
normalizer = Math.abs(best)*(Math.exp(-1.0/containmentFraction));
for( int i = 0; i < candidates.size(); i++ ) {
Point2D_F64 p = candidates.get(i);
double s = associationScore[i];
// scale the circle based on how bad it is
double ratio = 1-Math.abs(s-best)/normalizer;
if( ratio < 0 )
continue;
int r = maxCircleRadius - (int)(maxCircleRadius*ratio);
if( r > 0 ) {
int x = (int)(p.x*scale+offX);
int y = (int)(p.y*scale+offY);
g2.drawOval(x-r,y-r,r*2+1,r*2+1);
}
}
// draw the best feature
g2.setColor(Color.GREEN);
g2.setStroke(new BasicStroke(10));
int w = maxCircleRadius*2+1;
Point2D_F64 p = candidates.get(indexBest);
int x = (int)(p.x*scale+offX);
int y = (int)(p.y*scale+offY);
g2.drawOval(x-maxCircleRadius,y-maxCircleRadius,w,w);
} }
|
public class class_name {
private void drawDistribution( Graphics2D g2 , List<Point2D_F64> candidates ,
int offX, int offY , double scale) {
findStatistics();
// draw all the features, adjusting their size based on the first score
g2.setColor(Color.RED);
g2.setStroke(new BasicStroke(3));
double normalizer;
if( scorer.getScoreType().isZeroBest() )
normalizer = best*containmentFraction;
else
normalizer = Math.abs(best)*(Math.exp(-1.0/containmentFraction));
for( int i = 0; i < candidates.size(); i++ ) {
Point2D_F64 p = candidates.get(i);
double s = associationScore[i];
// scale the circle based on how bad it is
double ratio = 1-Math.abs(s-best)/normalizer;
if( ratio < 0 )
continue;
int r = maxCircleRadius - (int)(maxCircleRadius*ratio);
if( r > 0 ) {
int x = (int)(p.x*scale+offX);
int y = (int)(p.y*scale+offY);
g2.drawOval(x-r,y-r,r*2+1,r*2+1); // depends on control dependency: [if], data = [none]
}
}
// draw the best feature
g2.setColor(Color.GREEN);
g2.setStroke(new BasicStroke(10));
int w = maxCircleRadius*2+1;
Point2D_F64 p = candidates.get(indexBest);
int x = (int)(p.x*scale+offX);
int y = (int)(p.y*scale+offY);
g2.drawOval(x-maxCircleRadius,y-maxCircleRadius,w,w);
} }
|
public class class_name {
public void marshall(CreateCloudFormationChangeSetRequest createCloudFormationChangeSetRequest, ProtocolMarshaller protocolMarshaller) {
if (createCloudFormationChangeSetRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getApplicationId(), APPLICATIONID_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getCapabilities(), CAPABILITIES_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getChangeSetName(), CHANGESETNAME_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getClientToken(), CLIENTTOKEN_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getDescription(), DESCRIPTION_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getNotificationArns(), NOTIFICATIONARNS_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getParameterOverrides(), PARAMETEROVERRIDES_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getResourceTypes(), RESOURCETYPES_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getRollbackConfiguration(), ROLLBACKCONFIGURATION_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getSemanticVersion(), SEMANTICVERSION_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getStackName(), STACKNAME_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getTags(), TAGS_BINDING);
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getTemplateId(), TEMPLATEID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(CreateCloudFormationChangeSetRequest createCloudFormationChangeSetRequest, ProtocolMarshaller protocolMarshaller) {
if (createCloudFormationChangeSetRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getApplicationId(), APPLICATIONID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getCapabilities(), CAPABILITIES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getChangeSetName(), CHANGESETNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getClientToken(), CLIENTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getNotificationArns(), NOTIFICATIONARNS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getParameterOverrides(), PARAMETEROVERRIDES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getResourceTypes(), RESOURCETYPES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getRollbackConfiguration(), ROLLBACKCONFIGURATION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getSemanticVersion(), SEMANTICVERSION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getStackName(), STACKNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getTags(), TAGS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCloudFormationChangeSetRequest.getTemplateId(), TEMPLATEID_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public EClass getTRN() {
if (trnEClass == null) {
trnEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(343);
}
return trnEClass;
} }
|
public class class_name {
public EClass getTRN() {
if (trnEClass == null) {
trnEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(343); // depends on control dependency: [if], data = [none]
}
return trnEClass;
} }
|
public class class_name {
private void sendHubHeartbeats()
{
RackHeartbeat rack = _rack;
UpdateRackHeartbeat updateRack = rack.getUpdate();
UpdatePodSystem updatePod = getUpdatePodSystem();
long now = CurrentTime.currentTime();
if (! isJoinComplete()) {
updatePod = null;
}
// send hub update to all servers in the rack
for (ServerHeartbeat rackServer : _rack.getServers()) {
if (rackServer == null || rackServer == _serverSelf) {
continue;
}
ServerTarget target = createTargetServer(rackServer);
target.hubHeartbeat(getServerSelf().getUpdate(),
updateRack,
updatePod,
now);
}
} }
|
public class class_name {
private void sendHubHeartbeats()
{
RackHeartbeat rack = _rack;
UpdateRackHeartbeat updateRack = rack.getUpdate();
UpdatePodSystem updatePod = getUpdatePodSystem();
long now = CurrentTime.currentTime();
if (! isJoinComplete()) {
updatePod = null; // depends on control dependency: [if], data = [none]
}
// send hub update to all servers in the rack
for (ServerHeartbeat rackServer : _rack.getServers()) {
if (rackServer == null || rackServer == _serverSelf) {
continue;
}
ServerTarget target = createTargetServer(rackServer);
target.hubHeartbeat(getServerSelf().getUpdate(),
updateRack,
updatePod,
now); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
public void marshall(DescribeProductAsAdminRequest describeProductAsAdminRequest, ProtocolMarshaller protocolMarshaller) {
if (describeProductAsAdminRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeProductAsAdminRequest.getAcceptLanguage(), ACCEPTLANGUAGE_BINDING);
protocolMarshaller.marshall(describeProductAsAdminRequest.getId(), ID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(DescribeProductAsAdminRequest describeProductAsAdminRequest, ProtocolMarshaller protocolMarshaller) {
if (describeProductAsAdminRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeProductAsAdminRequest.getAcceptLanguage(), ACCEPTLANGUAGE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(describeProductAsAdminRequest.getId(), ID_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
static CompressedTexture load(InputStream stream, int maxLength,
boolean closeStream)
throws IOException {
byte[] data;
try {
data = maxLength >= 0
? readBytes(stream, maxLength)
: readBytes(stream);
} finally {
if (closeStream) {
stream.close();
}
}
Reader reader = new Reader(data);
GVRCompressedTextureLoader valid = null;
List<GVRCompressedTextureLoader> loaders = GVRCompressedTextureLoader
.getLoaders();
synchronized (loaders) {
for (GVRCompressedTextureLoader loader : loaders) {
if (loader.sniff(data, reader)) {
if (valid != null) {
throw new IllegalArgumentException(
"Multiple loaders think this smells right");
}
valid = loader;
}
reader.reset();
}
if (valid == null) {
throw new IllegalArgumentException(
"No loader thinks this smells right");
}
return valid.parse(data, reader);
}
} }
|
public class class_name {
static CompressedTexture load(InputStream stream, int maxLength,
boolean closeStream)
throws IOException {
byte[] data;
try {
data = maxLength >= 0
? readBytes(stream, maxLength)
: readBytes(stream);
} finally {
if (closeStream) {
stream.close(); // depends on control dependency: [if], data = [none]
}
}
Reader reader = new Reader(data);
GVRCompressedTextureLoader valid = null;
List<GVRCompressedTextureLoader> loaders = GVRCompressedTextureLoader
.getLoaders();
synchronized (loaders) {
for (GVRCompressedTextureLoader loader : loaders) {
if (loader.sniff(data, reader)) {
if (valid != null) {
throw new IllegalArgumentException(
"Multiple loaders think this smells right");
}
valid = loader; // depends on control dependency: [if], data = [none]
}
reader.reset(); // depends on control dependency: [for], data = [none]
}
if (valid == null) {
throw new IllegalArgumentException(
"No loader thinks this smells right");
}
return valid.parse(data, reader);
}
} }
|
public class class_name {
public void setServices(java.util.Collection<Service> services) {
if (services == null) {
this.services = null;
return;
}
this.services = new com.amazonaws.internal.SdkInternalList<Service>(services);
} }
|
public class class_name {
public void setServices(java.util.Collection<Service> services) {
if (services == null) {
this.services = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.services = new com.amazonaws.internal.SdkInternalList<Service>(services);
} }
|
public class class_name {
private synchronized void removeExpiredEntriesSynced(long pTime) {
if (pTime > nextExpiryTime) {
////
long next = Long.MAX_VALUE;
nextExpiryTime = next; // Avoid multiple runs...
for (Iterator<Entry<K, V>> iterator = new EntryIterator(); iterator.hasNext();) {
TimedEntry<K, V> entry = (TimedEntry<K, V>) iterator.next();
////
long expires = entry.expires();
if (expires < next) {
next = expires;
}
////
}
////
nextExpiryTime = next;
}
} }
|
public class class_name {
private synchronized void removeExpiredEntriesSynced(long pTime) {
if (pTime > nextExpiryTime) {
////
long next = Long.MAX_VALUE;
nextExpiryTime = next; // Avoid multiple runs...
// depends on control dependency: [if], data = [none]
for (Iterator<Entry<K, V>> iterator = new EntryIterator(); iterator.hasNext();) {
TimedEntry<K, V> entry = (TimedEntry<K, V>) iterator.next();
////
long expires = entry.expires();
if (expires < next) {
next = expires;
// depends on control dependency: [if], data = [none]
}
////
}
////
nextExpiryTime = next;
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void addScriptProperties(Content head) {
HtmlTree javascript = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
head.addContent(javascript);
if (configuration.createindex) {
if (pathToRoot != null && script != null) {
String ptrPath = pathToRoot.isEmpty() ? "." : pathToRoot.getPath();
script.addContent(new RawHtml("var pathtoroot = \"" + ptrPath + "/\";loadScripts(document, \'script\');"));
}
addJQueryFile(head, DocPaths.JSZIP_MIN);
addJQueryFile(head, DocPaths.JSZIPUTILS_MIN);
head.addContent(new RawHtml("<!--[if IE]>"));
addJQueryFile(head, DocPaths.JSZIPUTILS_IE_MIN);
head.addContent(new RawHtml("<![endif]-->"));
addJQueryFile(head, DocPaths.JQUERY_JS_1_10);
addJQueryFile(head, DocPaths.JQUERY_JS);
}
} }
|
public class class_name {
public void addScriptProperties(Content head) {
HtmlTree javascript = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
head.addContent(javascript);
if (configuration.createindex) {
if (pathToRoot != null && script != null) {
String ptrPath = pathToRoot.isEmpty() ? "." : pathToRoot.getPath();
script.addContent(new RawHtml("var pathtoroot = \"" + ptrPath + "/\";loadScripts(document, \'script\');")); // depends on control dependency: [if], data = [none]
}
addJQueryFile(head, DocPaths.JSZIP_MIN); // depends on control dependency: [if], data = [none]
addJQueryFile(head, DocPaths.JSZIPUTILS_MIN); // depends on control dependency: [if], data = [none]
head.addContent(new RawHtml("<!--[if IE]>")); // depends on control dependency: [if], data = [none]
addJQueryFile(head, DocPaths.JSZIPUTILS_IE_MIN); // depends on control dependency: [if], data = [none]
head.addContent(new RawHtml("<![endif]-->")); // depends on control dependency: [if], data = [none]
addJQueryFile(head, DocPaths.JQUERY_JS_1_10); // depends on control dependency: [if], data = [none]
addJQueryFile(head, DocPaths.JQUERY_JS); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private Symbol getSymbolForTypeHelper(JSType type, boolean linkToCtor) {
if (type == null) {
return null;
}
if (type.isGlobalThisType()) {
return globalScope.getSlot(GLOBAL_THIS);
} else if (type.isNominalConstructor()) {
return linkToCtor
? globalScope.getSlot("Function")
: getSymbolDeclaredBy(type.toMaybeFunctionType());
} else if (type.isFunctionPrototypeType()) {
FunctionType ownerFn = ((ObjectType) type).getOwnerFunction();
if (!ownerFn.isConstructor() && !ownerFn.isInterface()) {
return null;
}
return linkToCtor ? getSymbolDeclaredBy(ownerFn) : getSymbolForInstancesOf(ownerFn);
} else if (type.isInstanceType()) {
FunctionType ownerFn = ((ObjectType) type).getConstructor();
return linkToCtor ? getSymbolDeclaredBy(ownerFn) : getSymbolForInstancesOf(ownerFn);
} else if (type.isFunctionType()) {
return linkToCtor
? globalScope.getSlot("Function")
: globalScope.getQualifiedSlot("Function.prototype");
} else if (type.autoboxesTo() != null) {
return getSymbolForTypeHelper(type.autoboxesTo(), linkToCtor);
} else {
return null;
}
} }
|
public class class_name {
private Symbol getSymbolForTypeHelper(JSType type, boolean linkToCtor) {
if (type == null) {
return null; // depends on control dependency: [if], data = [none]
}
if (type.isGlobalThisType()) {
return globalScope.getSlot(GLOBAL_THIS); // depends on control dependency: [if], data = [none]
} else if (type.isNominalConstructor()) {
return linkToCtor
? globalScope.getSlot("Function")
: getSymbolDeclaredBy(type.toMaybeFunctionType()); // depends on control dependency: [if], data = [none]
} else if (type.isFunctionPrototypeType()) {
FunctionType ownerFn = ((ObjectType) type).getOwnerFunction();
if (!ownerFn.isConstructor() && !ownerFn.isInterface()) {
return null; // depends on control dependency: [if], data = [none]
}
return linkToCtor ? getSymbolDeclaredBy(ownerFn) : getSymbolForInstancesOf(ownerFn); // depends on control dependency: [if], data = [none]
} else if (type.isInstanceType()) {
FunctionType ownerFn = ((ObjectType) type).getConstructor();
return linkToCtor ? getSymbolDeclaredBy(ownerFn) : getSymbolForInstancesOf(ownerFn); // depends on control dependency: [if], data = [none]
} else if (type.isFunctionType()) {
return linkToCtor
? globalScope.getSlot("Function")
: globalScope.getQualifiedSlot("Function.prototype"); // depends on control dependency: [if], data = [none]
} else if (type.autoboxesTo() != null) {
return getSymbolForTypeHelper(type.autoboxesTo(), linkToCtor); // depends on control dependency: [if], data = [(type.autoboxesTo()]
} else {
return null; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public StorableIndex<S> findKeyIndex(StorableKey<S> key) {
if (key == null) {
throw new IllegalArgumentException();
}
Set<? extends OrderedProperty<S>> orderedProps = key.getProperties();
Set<StorableProperty<S>> keyProps = new HashSet<StorableProperty<S>>();
for (OrderedProperty<S> orderedProp : orderedProps) {
keyProps.add(orderedProp.getChainedProperty().getPrimeProperty());
}
search: for (StorableIndex<S> index : this) {
if (!index.isUnique() || index.getPropertyCount() != keyProps.size()) {
continue search;
}
for (int i=index.getPropertyCount(); --i>=0; ) {
if (!keyProps.contains(index.getProperty(i))) {
continue search;
}
}
return index;
}
return null;
} }
|
public class class_name {
public StorableIndex<S> findKeyIndex(StorableKey<S> key) {
if (key == null) {
throw new IllegalArgumentException();
}
Set<? extends OrderedProperty<S>> orderedProps = key.getProperties();
Set<StorableProperty<S>> keyProps = new HashSet<StorableProperty<S>>();
for (OrderedProperty<S> orderedProp : orderedProps) {
keyProps.add(orderedProp.getChainedProperty().getPrimeProperty());
// depends on control dependency: [for], data = [orderedProp]
}
search: for (StorableIndex<S> index : this) {
if (!index.isUnique() || index.getPropertyCount() != keyProps.size()) {
continue search;
}
for (int i=index.getPropertyCount(); --i>=0; ) {
if (!keyProps.contains(index.getProperty(i))) {
continue search;
}
}
return index;
// depends on control dependency: [for], data = [index]
}
return null;
} }
|
public class class_name {
public boolean isRestartScheduled() {
for (UpdateCenterJob job : getJobs()) {
if (job instanceof RestartJenkinsJob) {
RestartJenkinsJob.RestartJenkinsJobStatus status = ((RestartJenkinsJob) job).status;
if (status instanceof RestartJenkinsJob.Pending
|| status instanceof RestartJenkinsJob.Running) {
return true;
}
}
}
return false;
} }
|
public class class_name {
public boolean isRestartScheduled() {
for (UpdateCenterJob job : getJobs()) {
if (job instanceof RestartJenkinsJob) {
RestartJenkinsJob.RestartJenkinsJobStatus status = ((RestartJenkinsJob) job).status;
if (status instanceof RestartJenkinsJob.Pending
|| status instanceof RestartJenkinsJob.Running) {
return true; // depends on control dependency: [if], data = [none]
}
}
}
return false;
} }
|
public class class_name {
public static Compressor getCompressor(CompressionCodec codec) {
Compressor compressor = borrow(compressorPool, codec.getCompressorType());
if (compressor == null) {
compressor = codec.createCompressor();
LOG.info("Got brand-new compressor");
} else {
LOG.debug("Got recycled compressor");
}
return compressor;
} }
|
public class class_name {
public static Compressor getCompressor(CompressionCodec codec) {
Compressor compressor = borrow(compressorPool, codec.getCompressorType());
if (compressor == null) {
compressor = codec.createCompressor(); // depends on control dependency: [if], data = [none]
LOG.info("Got brand-new compressor"); // depends on control dependency: [if], data = [none]
} else {
LOG.debug("Got recycled compressor"); // depends on control dependency: [if], data = [none]
}
return compressor;
} }
|
public class class_name {
public void triggerMaximisation(Component component) {
if (componentMaximiser == null) {
return;
}
if (componentMaximiser.isComponentMaximised()) {
componentMaximiser.unmaximiseComponent();
} else if (confirmMaximisation()) {
componentMaximiser.maximiseComponent(component);
}
} }
|
public class class_name {
public void triggerMaximisation(Component component) {
if (componentMaximiser == null) {
return; // depends on control dependency: [if], data = [none]
}
if (componentMaximiser.isComponentMaximised()) {
componentMaximiser.unmaximiseComponent(); // depends on control dependency: [if], data = [none]
} else if (confirmMaximisation()) {
componentMaximiser.maximiseComponent(component); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public final BELStatementParser.param_return param() throws RecognitionException {
BELStatementParser.param_return retval = new BELStatementParser.param_return();
retval.start = input.LT(1);
Object root_0 = null;
Token nsp=null;
Token NS_VALUE9=null;
Token QUOTED_VALUE10=null;
Object nsp_tree=null;
Object NS_VALUE9_tree=null;
Object QUOTED_VALUE10_tree=null;
try {
// BELStatement.g:131:28: ( (nsp= NS_PREFIX )? ( NS_VALUE | QUOTED_VALUE ) )
// BELStatement.g:132:5: (nsp= NS_PREFIX )? ( NS_VALUE | QUOTED_VALUE )
{
root_0 = (Object)adaptor.nil();
// BELStatement.g:132:8: (nsp= NS_PREFIX )?
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==NS_PREFIX) ) {
alt9=1;
}
switch (alt9) {
case 1 :
// BELStatement.g:132:8: nsp= NS_PREFIX
{
nsp=(Token)match(input,NS_PREFIX,FOLLOW_NS_PREFIX_in_param510);
nsp_tree = (Object)adaptor.create(nsp);
adaptor.addChild(root_0, nsp_tree);
}
break;
}
// BELStatement.g:133:5: ( NS_VALUE | QUOTED_VALUE )
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==NS_VALUE) ) {
alt10=1;
}
else if ( (LA10_0==QUOTED_VALUE) ) {
alt10=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 10, 0, input);
throw nvae;
}
switch (alt10) {
case 1 :
// BELStatement.g:134:9: NS_VALUE
{
NS_VALUE9=(Token)match(input,NS_VALUE,FOLLOW_NS_VALUE_in_param527);
NS_VALUE9_tree = (Object)adaptor.create(NS_VALUE9);
adaptor.addChild(root_0, NS_VALUE9_tree);
Namespace ns = null;
if(nsp != null) {
String prefix = nsp.getText();
prefix = prefix.substring(0, prefix.length() - 1);
ns = new Namespace(prefix, "FIX_ME");
}
retval.r = new Parameter();
retval.r.setValue(NS_VALUE9.getText());
retval.r.setNamespace(ns);
}
break;
case 2 :
// BELStatement.g:147:9: QUOTED_VALUE
{
QUOTED_VALUE10=(Token)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_param541);
QUOTED_VALUE10_tree = (Object)adaptor.create(QUOTED_VALUE10);
adaptor.addChild(root_0, QUOTED_VALUE10_tree);
Namespace ns = null;
if(nsp != null) {
String prefix = nsp.getText();
prefix = prefix.substring(0, prefix.length() - 1);
ns = new Namespace(prefix, "FIX_ME");
}
retval.r = new Parameter();
retval.r.setNamespace(ns);
// Strip quotes
String quoted = QUOTED_VALUE10.getText();
retval.r.setValue(quoted.substring(1, quoted.length() - 1));
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
}
return retval;
} }
|
public class class_name {
public final BELStatementParser.param_return param() throws RecognitionException {
BELStatementParser.param_return retval = new BELStatementParser.param_return();
retval.start = input.LT(1);
Object root_0 = null;
Token nsp=null;
Token NS_VALUE9=null;
Token QUOTED_VALUE10=null;
Object nsp_tree=null;
Object NS_VALUE9_tree=null;
Object QUOTED_VALUE10_tree=null;
try {
// BELStatement.g:131:28: ( (nsp= NS_PREFIX )? ( NS_VALUE | QUOTED_VALUE ) )
// BELStatement.g:132:5: (nsp= NS_PREFIX )? ( NS_VALUE | QUOTED_VALUE )
{
root_0 = (Object)adaptor.nil();
// BELStatement.g:132:8: (nsp= NS_PREFIX )?
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==NS_PREFIX) ) {
alt9=1; // depends on control dependency: [if], data = [none]
}
switch (alt9) {
case 1 :
// BELStatement.g:132:8: nsp= NS_PREFIX
{
nsp=(Token)match(input,NS_PREFIX,FOLLOW_NS_PREFIX_in_param510);
nsp_tree = (Object)adaptor.create(nsp);
adaptor.addChild(root_0, nsp_tree);
}
break;
}
// BELStatement.g:133:5: ( NS_VALUE | QUOTED_VALUE )
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==NS_VALUE) ) {
alt10=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA10_0==QUOTED_VALUE) ) {
alt10=2; // depends on control dependency: [if], data = [none]
}
else {
NoViableAltException nvae =
new NoViableAltException("", 10, 0, input);
throw nvae;
}
switch (alt10) {
case 1 :
// BELStatement.g:134:9: NS_VALUE
{
NS_VALUE9=(Token)match(input,NS_VALUE,FOLLOW_NS_VALUE_in_param527);
NS_VALUE9_tree = (Object)adaptor.create(NS_VALUE9);
adaptor.addChild(root_0, NS_VALUE9_tree);
Namespace ns = null;
if(nsp != null) {
String prefix = nsp.getText();
prefix = prefix.substring(0, prefix.length() - 1); // depends on control dependency: [if], data = [none]
ns = new Namespace(prefix, "FIX_ME"); // depends on control dependency: [if], data = [none]
}
retval.r = new Parameter();
retval.r.setValue(NS_VALUE9.getText());
retval.r.setNamespace(ns);
}
break;
case 2 :
// BELStatement.g:147:9: QUOTED_VALUE
{
QUOTED_VALUE10=(Token)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_param541);
QUOTED_VALUE10_tree = (Object)adaptor.create(QUOTED_VALUE10);
adaptor.addChild(root_0, QUOTED_VALUE10_tree);
Namespace ns = null;
if(nsp != null) {
String prefix = nsp.getText();
prefix = prefix.substring(0, prefix.length() - 1); // depends on control dependency: [if], data = [none]
ns = new Namespace(prefix, "FIX_ME"); // depends on control dependency: [if], data = [none]
}
retval.r = new Parameter();
retval.r.setNamespace(ns);
// Strip quotes
String quoted = QUOTED_VALUE10.getText();
retval.r.setValue(quoted.substring(1, quoted.length() - 1));
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
}
return retval;
} }
|
public class class_name {
public static void removeConsecutiveSeparators(JPopupMenu popupMenu) {
for (int i = 1; i < popupMenu.getComponentCount(); i++) {
if (isPopupMenuSeparator(popupMenu.getComponent(i))) {
if (isPopupMenuSeparator(popupMenu.getComponent(i - 1))) {
popupMenu.remove(i);
i--;
}
}
}
} }
|
public class class_name {
public static void removeConsecutiveSeparators(JPopupMenu popupMenu) {
for (int i = 1; i < popupMenu.getComponentCount(); i++) {
if (isPopupMenuSeparator(popupMenu.getComponent(i))) {
if (isPopupMenuSeparator(popupMenu.getComponent(i - 1))) {
popupMenu.remove(i); // depends on control dependency: [if], data = [none]
i--; // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public void delete(String name)
throws CertificateException, IOException {
// check if immutable
if (readOnly)
throw new CertificateException("cannot over-write existing"
+ " certificate");
X509AttributeName attr = new X509AttributeName(name);
String id = attr.getPrefix();
if (!(id.equalsIgnoreCase(NAME))) {
throw new CertificateException("Invalid root of attribute name,"
+ " expected ["
+ NAME + "], received " + id);
}
attr = new X509AttributeName(attr.getSuffix());
id = attr.getPrefix();
if (id.equalsIgnoreCase(INFO)) {
if (attr.getSuffix() != null) {
info = null;
} else {
info.delete(attr.getSuffix());
}
} else if (id.equalsIgnoreCase(ALG_ID)) {
algId = null;
} else if (id.equalsIgnoreCase(SIGNATURE)) {
signature = null;
} else if (id.equalsIgnoreCase(SIGNED_CERT)) {
signedCert = null;
} else {
throw new CertificateException("Attribute name not recognized or " +
"delete() not allowed for the same: " + id);
}
} }
|
public class class_name {
public void delete(String name)
throws CertificateException, IOException {
// check if immutable
if (readOnly)
throw new CertificateException("cannot over-write existing"
+ " certificate");
X509AttributeName attr = new X509AttributeName(name);
String id = attr.getPrefix();
if (!(id.equalsIgnoreCase(NAME))) {
throw new CertificateException("Invalid root of attribute name,"
+ " expected ["
+ NAME + "], received " + id);
}
attr = new X509AttributeName(attr.getSuffix());
id = attr.getPrefix();
if (id.equalsIgnoreCase(INFO)) {
if (attr.getSuffix() != null) {
info = null; // depends on control dependency: [if], data = [none]
} else {
info.delete(attr.getSuffix()); // depends on control dependency: [if], data = [(attr.getSuffix()]
}
} else if (id.equalsIgnoreCase(ALG_ID)) {
algId = null;
} else if (id.equalsIgnoreCase(SIGNATURE)) {
signature = null;
} else if (id.equalsIgnoreCase(SIGNED_CERT)) {
signedCert = null;
} else {
throw new CertificateException("Attribute name not recognized or " +
"delete() not allowed for the same: " + id);
}
} }
|
public class class_name {
@Override
protected void addColumnComponents(HtmlDataTable dataTable, Map<String, String> attributes, NodeList elements,
StaticXmlMetawidget metawidget)
{
super.addColumnComponents(dataTable, attributes, elements, metawidget);
if (dataTable.getChildren().isEmpty())
{
return;
}
if (!attributes.containsKey(N_TO_MANY) || metawidget.isReadOnly())
{
return;
}
HtmlCommandLink removeLink = new HtmlCommandLink();
removeLink.putAttribute("styleClass", "remove-button");
String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));
HtmlColumn column = new HtmlColumn();
column.putAttribute("headerClass", "remove-column");
column.putAttribute("footerClass", "remove-column");
column.getChildren().add(removeLink);
dataTable.getChildren().add(column);
// If bidirectional, an 'Add' button too
String inverseRelationship = attributes.get(INVERSE_RELATIONSHIP);
if (inverseRelationship != null)
{
String componentType = WidgetBuilderUtils.getComponentType(attributes);
if (componentType != null)
{
String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));
HtmlCommandLink addLink = new HtmlCommandLink();
addLink.putAttribute("styleClass", "add-button");
String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));
// Use a f:setPropertyActionListener to initialize the bidirectional relationship
SetPropertyActionListener setPropertyActionListener = new SetPropertyActionListener();
setPropertyActionListener.putAttribute(
"target",
StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);
if (bindingProcessor != null)
{
bindingProcessor.processWidget(setPropertyActionListener, ENTITY, attributes,
(StaticUIMetawidget) metawidget);
}
addLink.getChildren().add(setPropertyActionListener);
// (id is useful for unit tests)
String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
+ StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";
addLink.putAttribute("id", StringUtils.camelCase(id, StringUtils.SEPARATOR_DOT_CHAR));
Facet footerFacet = new Facet();
footerFacet.putAttribute("name", "footer");
footerFacet.getChildren().add(addLink);
column.getChildren().add(footerFacet);
}
}
} }
|
public class class_name {
@Override
protected void addColumnComponents(HtmlDataTable dataTable, Map<String, String> attributes, NodeList elements,
StaticXmlMetawidget metawidget)
{
super.addColumnComponents(dataTable, attributes, elements, metawidget);
if (dataTable.getChildren().isEmpty())
{
return; // depends on control dependency: [if], data = [none]
}
if (!attributes.containsKey(N_TO_MANY) || metawidget.isReadOnly())
{
return; // depends on control dependency: [if], data = [none]
}
HtmlCommandLink removeLink = new HtmlCommandLink();
removeLink.putAttribute("styleClass", "remove-button");
String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));
HtmlColumn column = new HtmlColumn();
column.putAttribute("headerClass", "remove-column");
column.putAttribute("footerClass", "remove-column");
column.getChildren().add(removeLink);
dataTable.getChildren().add(column);
// If bidirectional, an 'Add' button too
String inverseRelationship = attributes.get(INVERSE_RELATIONSHIP);
if (inverseRelationship != null)
{
String componentType = WidgetBuilderUtils.getComponentType(attributes);
if (componentType != null)
{
String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType));
HtmlCommandLink addLink = new HtmlCommandLink();
addLink.putAttribute("styleClass", "add-button"); // depends on control dependency: [if], data = [none]
String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression)); // depends on control dependency: [if], data = [none]
// Use a f:setPropertyActionListener to initialize the bidirectional relationship
SetPropertyActionListener setPropertyActionListener = new SetPropertyActionListener();
setPropertyActionListener.putAttribute(
"target",
StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship)); // depends on control dependency: [if], data = [none]
StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);
if (bindingProcessor != null)
{
bindingProcessor.processWidget(setPropertyActionListener, ENTITY, attributes,
(StaticUIMetawidget) metawidget); // depends on control dependency: [if], data = [none]
}
addLink.getChildren().add(setPropertyActionListener); // depends on control dependency: [if], data = [none]
// (id is useful for unit tests)
String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
+ StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";
addLink.putAttribute("id", StringUtils.camelCase(id, StringUtils.SEPARATOR_DOT_CHAR)); // depends on control dependency: [if], data = [none]
Facet footerFacet = new Facet();
footerFacet.putAttribute("name", "footer"); // depends on control dependency: [if], data = [none]
footerFacet.getChildren().add(addLink); // depends on control dependency: [if], data = [none]
column.getChildren().add(footerFacet); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
@Override
public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, final @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) {
if (!mirrored) {
return super.getObjectsAsync(objectIDs, attributesToRetrieve, requestOptions, completionHandler);
} else {
return new OnlineOfflineGetObjectsRequest(new ArrayList(objectIDs), new ArrayList(attributesToRetrieve), requestOptions, completionHandler).start();
}
} }
|
public class class_name {
@Override
public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, final @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) {
if (!mirrored) {
return super.getObjectsAsync(objectIDs, attributesToRetrieve, requestOptions, completionHandler); // depends on control dependency: [if], data = [none]
} else {
return new OnlineOfflineGetObjectsRequest(new ArrayList(objectIDs), new ArrayList(attributesToRetrieve), requestOptions, completionHandler).start(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Override
public Iterator<T> iterator() {
/*
* We make a copy of the allResults list to iterate over in order to
* avoid ConcurrentModificationExceptions caused by other methods
* loading more results into the list while someone iterates over it.
* This is a more severe problem than it might seem, because even
* innocuous-seeming operations such as contains() can modify the
* underlying result set.
*/
final List<T> allResultsCopy = new ArrayList<T>();
allResultsCopy.addAll(allResults);
final Iterator<T> iter = allResultsCopy.iterator();
return new Iterator<T>() {
Iterator<T> iterator = iter;
int pos = 0;
@Override
public boolean hasNext() {
return iterator.hasNext() || nextResultsAvailable();
}
@Override
public T next() {
if ( !iterator.hasNext() ) {
/*
* Our private copy of the result list may be out of date
* with the full one. If it is, we just need to update our
* private copy to get more results. If it's not, we need to
* fetch more results from the service.
*/
if ( allResults.size() == allResultsCopy.size() ) {
if ( !nextResultsAvailable() ) {
throw new NoSuchElementException();
}
moveNextResults();
}
if ( allResults.size() > allResultsCopy.size() )
allResultsCopy.addAll(allResults.subList(allResultsCopy.size(), allResults.size()));
iterator = allResultsCopy.listIterator(pos);
}
pos++;
return iterator.next();
}
@Override
public void remove() {
throw new UnsupportedOperationException(UNMODIFIABLE_MESSAGE);
}
};
} }
|
public class class_name {
@Override
public Iterator<T> iterator() {
/*
* We make a copy of the allResults list to iterate over in order to
* avoid ConcurrentModificationExceptions caused by other methods
* loading more results into the list while someone iterates over it.
* This is a more severe problem than it might seem, because even
* innocuous-seeming operations such as contains() can modify the
* underlying result set.
*/
final List<T> allResultsCopy = new ArrayList<T>();
allResultsCopy.addAll(allResults);
final Iterator<T> iter = allResultsCopy.iterator();
return new Iterator<T>() {
Iterator<T> iterator = iter;
int pos = 0;
@Override
public boolean hasNext() {
return iterator.hasNext() || nextResultsAvailable();
}
@Override
public T next() {
if ( !iterator.hasNext() ) {
/*
* Our private copy of the result list may be out of date
* with the full one. If it is, we just need to update our
* private copy to get more results. If it's not, we need to
* fetch more results from the service.
*/
if ( allResults.size() == allResultsCopy.size() ) {
if ( !nextResultsAvailable() ) {
throw new NoSuchElementException();
}
moveNextResults(); // depends on control dependency: [if], data = [none]
}
if ( allResults.size() > allResultsCopy.size() )
allResultsCopy.addAll(allResults.subList(allResultsCopy.size(), allResults.size()));
iterator = allResultsCopy.listIterator(pos); // depends on control dependency: [if], data = [none]
}
pos++;
return iterator.next();
}
@Override
public void remove() {
throw new UnsupportedOperationException(UNMODIFIABLE_MESSAGE);
}
};
} }
|
public class class_name {
private String getSymbolExceptions() {
if (TextUtils.isEmpty(filteredMask)) return "";
StringBuilder maskSymbolException = new StringBuilder();
for (char c : filteredMask.toCharArray()) {
if (!Character.isDigit(c) && maskSymbolException.indexOf(String.valueOf(c)) == -1) {
maskSymbolException.append(c);
}
}
maskSymbolException.append(replacementChar);
return maskSymbolException.toString();
} }
|
public class class_name {
private String getSymbolExceptions() {
if (TextUtils.isEmpty(filteredMask)) return "";
StringBuilder maskSymbolException = new StringBuilder();
for (char c : filteredMask.toCharArray()) {
if (!Character.isDigit(c) && maskSymbolException.indexOf(String.valueOf(c)) == -1) {
maskSymbolException.append(c); // depends on control dependency: [if], data = [none]
}
}
maskSymbolException.append(replacementChar);
return maskSymbolException.toString();
} }
|
public class class_name {
private String generateFilename() {
String counter = "";
if (capabilities.getInstance() > 0) {
counter = "_" + capabilities.getInstance();
}
return test + counter;
} }
|
public class class_name {
private String generateFilename() {
String counter = "";
if (capabilities.getInstance() > 0) {
counter = "_" + capabilities.getInstance(); // depends on control dependency: [if], data = [none]
}
return test + counter;
} }
|
public class class_name {
public static byte[] toBytes(long value) {
if (isLessThan(value, 253)) {
return new byte[] { (byte) value };
} else if (isLessThan(value, 65536)) {
return new byte[] { (byte) 253, (byte) (value), (byte) (value >> 8) };
} else if (isLessThan(value, 4294967295L)) {
byte[] bytes = new byte[5];
bytes[0] = (byte) 254;
BitUtils.uint32ToByteArrayLE(value, bytes, 1);
return bytes;
} else {
byte[] bytes = new byte[9];
bytes[0] = (byte) 255;
BitUtils.uint32ToByteArrayLE(value, bytes, 1);
BitUtils.uint32ToByteArrayLE(value >>> 32, bytes, 5);
return bytes;
}
} }
|
public class class_name {
public static byte[] toBytes(long value) {
if (isLessThan(value, 253)) {
return new byte[] { (byte) value }; // depends on control dependency: [if], data = [none]
} else if (isLessThan(value, 65536)) {
return new byte[] { (byte) 253, (byte) (value), (byte) (value >> 8) }; // depends on control dependency: [if], data = [none]
} else if (isLessThan(value, 4294967295L)) {
byte[] bytes = new byte[5];
bytes[0] = (byte) 254; // depends on control dependency: [if], data = [none]
BitUtils.uint32ToByteArrayLE(value, bytes, 1); // depends on control dependency: [if], data = [none]
return bytes; // depends on control dependency: [if], data = [none]
} else {
byte[] bytes = new byte[9];
bytes[0] = (byte) 255; // depends on control dependency: [if], data = [none]
BitUtils.uint32ToByteArrayLE(value, bytes, 1); // depends on control dependency: [if], data = [none]
BitUtils.uint32ToByteArrayLE(value >>> 32, bytes, 5); // depends on control dependency: [if], data = [none]
return bytes; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private ConnectionDefinition attachConnectionDefinition(String mcf, javax.resource.spi.ConnectionDefinition cd,
ClassLoader classLoader,
ArrayList<? extends ConfigProperty> configProperties,
ArrayList<? extends ConfigProperty> plainConfigProperties)
throws Exception
{
if (trace)
log.trace("Processing: " + cd);
ArrayList<ConfigProperty> validProperties = new ArrayList<ConfigProperty>();
if (configProperties != null)
{
for (ConfigProperty configProperty : configProperties)
{
if (mcf.equals(((ConfigPropertyImpl) configProperty).getAttachedClassName()))
{
if (trace)
log.tracef("Attaching: %s (%s)", configProperty, mcf);
validProperties.add(configProperty);
}
}
}
if (plainConfigProperties != null)
{
Set<String> mcfClasses = getClasses(mcf, classLoader);
for (ConfigProperty configProperty : plainConfigProperties)
{
if (mcfClasses.contains(((ConfigPropertyImpl) configProperty).getAttachedClassName()))
{
if (trace)
log.tracef("Attaching: %s (%s)", configProperty, mcf);
validProperties.add(configProperty);
}
}
}
validProperties.trimToSize();
XsdString connectionfactoryInterface = new XsdString(cd.connectionFactory().getName(), null);
XsdString managedconnectionfactoryClass = new XsdString(mcf, null);
XsdString connectionImplClass = new XsdString(cd.connectionImpl().getName(), null);
XsdString connectionfactoryImplClass = new XsdString(cd.connectionFactoryImpl().getName(), null);
XsdString connectionInterface = new XsdString(cd.connection().getName(), null);
return new ConnectionDefinitionImpl(managedconnectionfactoryClass, validProperties,
connectionfactoryInterface,
connectionfactoryImplClass, connectionInterface, connectionImplClass, null);
} }
|
public class class_name {
private ConnectionDefinition attachConnectionDefinition(String mcf, javax.resource.spi.ConnectionDefinition cd,
ClassLoader classLoader,
ArrayList<? extends ConfigProperty> configProperties,
ArrayList<? extends ConfigProperty> plainConfigProperties)
throws Exception
{
if (trace)
log.trace("Processing: " + cd);
ArrayList<ConfigProperty> validProperties = new ArrayList<ConfigProperty>();
if (configProperties != null)
{
for (ConfigProperty configProperty : configProperties)
{
if (mcf.equals(((ConfigPropertyImpl) configProperty).getAttachedClassName()))
{
if (trace)
log.tracef("Attaching: %s (%s)", configProperty, mcf);
validProperties.add(configProperty); // depends on control dependency: [if], data = [none]
}
}
}
if (plainConfigProperties != null)
{
Set<String> mcfClasses = getClasses(mcf, classLoader);
for (ConfigProperty configProperty : plainConfigProperties)
{
if (mcfClasses.contains(((ConfigPropertyImpl) configProperty).getAttachedClassName()))
{
if (trace)
log.tracef("Attaching: %s (%s)", configProperty, mcf);
validProperties.add(configProperty);
}
}
}
validProperties.trimToSize();
XsdString connectionfactoryInterface = new XsdString(cd.connectionFactory().getName(), null);
XsdString managedconnectionfactoryClass = new XsdString(mcf, null);
XsdString connectionImplClass = new XsdString(cd.connectionImpl().getName(), null);
XsdString connectionfactoryImplClass = new XsdString(cd.connectionFactoryImpl().getName(), null);
XsdString connectionInterface = new XsdString(cd.connection().getName(), null);
return new ConnectionDefinitionImpl(managedconnectionfactoryClass, validProperties,
connectionfactoryInterface,
connectionfactoryImplClass, connectionInterface, connectionImplClass, null);
} }
|
public class class_name {
public boolean removeItem (T item)
{
int index = _items.indexOf(item);
if (index == -1) {
return false;
}
_items.remove(index);
removeItem(index);
return true;
} }
|
public class class_name {
public boolean removeItem (T item)
{
int index = _items.indexOf(item);
if (index == -1) {
return false; // depends on control dependency: [if], data = [none]
}
_items.remove(index);
removeItem(index);
return true;
} }
|
public class class_name {
@Override
protected void handleTransliterate(Replaceable text,
Position index, boolean incremental) {
/* Call each transliterator with the same start value and
* initial cursor index, but with the limit index as modified
* by preceding transliterators. The cursor index must be
* reset for each transliterator to give each a chance to
* transliterate the text. The initial cursor index is known
* to still point to the same place after each transliterator
* is called because each transliterator will not change the
* text between start and the initial value of cursor.
*
* IMPORTANT: After the first transliterator, each subsequent
* transliterator only gets to transliterate text committed by
* preceding transliterators; that is, the cursor (output
* value) of transliterator i becomes the limit (input value)
* of transliterator i+1. Finally, the overall limit is fixed
* up before we return.
*
* Assumptions we make here:
* (1) contextStart <= start <= limit <= contextLimit <= text.length()
* (2) start <= start' <= limit' ;cursor doesn't move back
* (3) start <= limit' ;text before cursor unchanged
* - start' is the value of start after calling handleKT
* - limit' is the value of limit after calling handleKT
*/
/**
* Example: 3 transliterators. This example illustrates the
* mechanics we need to implement. C, S, and L are the contextStart,
* start, and limit. gl is the globalLimit. contextLimit is
* equal to limit throughout.
*
* 1. h-u, changes hex to Unicode
*
* 4 7 a d 0 4 7 a
* abc/u0061/u => abca/u
* C S L C S L gl=f->a
*
* 2. upup, changes "x" to "XX"
*
* 4 7 a 4 7 a
* abca/u => abcAA/u
* C SL C S
* L gl=a->b
* 3. u-h, changes Unicode to hex
*
* 4 7 a 4 7 a d 0 3
* abcAA/u => abc/u0041/u0041/u
* C S L C S
* L gl=b->15
* 4. return
*
* 4 7 a d 0 3
* abc/u0041/u0041/u
* C S L
*/
if (trans.length < 1) {
index.start = index.limit;
return; // Short circuit for empty compound transliterators
}
// compoundLimit is the limit value for the entire compound
// operation. We overwrite index.limit with the previous
// index.start. After each transliteration, we update
// compoundLimit for insertions or deletions that have happened.
int compoundLimit = index.limit;
// compoundStart is the start for the entire compound
// operation.
int compoundStart = index.start;
int delta = 0; // delta in length
StringBuffer log = null;
///CLOVER:OFF
if (DEBUG) {
log = new StringBuffer("CompoundTransliterator{" + getID() +
(incremental ? "}i: IN=" : "}: IN="));
UtilityExtensions.formatInput(log, text, index);
System.out.println(Utility.escape(log.toString()));
}
///CLOVER:ON
// Give each transliterator a crack at the run of characters.
// See comments at the top of the method for more detail.
for (int i=0; i<trans.length; ++i) {
index.start = compoundStart; // Reset start
int limit = index.limit;
if (index.start == index.limit) {
// Short circuit for empty range
///CLOVER:OFF
if (DEBUG) {
System.out.println("CompoundTransliterator[" + i +
".." + (trans.length-1) +
(incremental ? "]i: " : "]: ") +
UtilityExtensions.formatInput(text, index) +
" (NOTHING TO DO)");
}
///CLOVER:ON
break;
}
///CLOVER:OFF
if (DEBUG) {
log.setLength(0);
log.append("CompoundTransliterator[" + i + "=" +
trans[i].getID() +
(incremental ? "]i: " : "]: "));
UtilityExtensions.formatInput(log, text, index);
}
///CLOVER:ON
trans[i].filteredTransliterate(text, index, incremental);
// In a properly written transliterator, start == limit after
// handleTransliterate() returns when incremental is false.
// Catch cases where the subclass doesn't do this, and throw
// an exception. (Just pinning start to limit is a bad idea,
// because what's probably happening is that the subclass
// isn't transliterating all the way to the end, and it should
// in non-incremental mode.)
if (!incremental && index.start != index.limit) {
throw new RuntimeException("ERROR: Incomplete non-incremental transliteration by " + trans[i].getID());
}
///CLOVER:OFF
if (DEBUG) {
log.append(" => ");
UtilityExtensions.formatInput(log, text, index);
System.out.println(Utility.escape(log.toString()));
}
///CLOVER:ON
// Cumulative delta for insertions/deletions
delta += index.limit - limit;
if (incremental) {
// In the incremental case, only allow subsequent
// transliterators to modify what has already been
// completely processed by prior transliterators. In the
// non-incrmental case, allow each transliterator to
// process the entire text.
index.limit = index.start;
}
}
compoundLimit += delta;
// Start is good where it is -- where the last transliterator left
// it. Limit needs to be put back where it was, modulo
// adjustments for deletions/insertions.
index.limit = compoundLimit;
///CLOVER:OFF
if (DEBUG) {
log.setLength(0);
log.append("CompoundTransliterator{" + getID() +
(incremental ? "}i: OUT=" : "}: OUT="));
UtilityExtensions.formatInput(log, text, index);
System.out.println(Utility.escape(log.toString()));
}
///CLOVER:ON
} }
|
public class class_name {
@Override
protected void handleTransliterate(Replaceable text,
Position index, boolean incremental) {
/* Call each transliterator with the same start value and
* initial cursor index, but with the limit index as modified
* by preceding transliterators. The cursor index must be
* reset for each transliterator to give each a chance to
* transliterate the text. The initial cursor index is known
* to still point to the same place after each transliterator
* is called because each transliterator will not change the
* text between start and the initial value of cursor.
*
* IMPORTANT: After the first transliterator, each subsequent
* transliterator only gets to transliterate text committed by
* preceding transliterators; that is, the cursor (output
* value) of transliterator i becomes the limit (input value)
* of transliterator i+1. Finally, the overall limit is fixed
* up before we return.
*
* Assumptions we make here:
* (1) contextStart <= start <= limit <= contextLimit <= text.length()
* (2) start <= start' <= limit' ;cursor doesn't move back
* (3) start <= limit' ;text before cursor unchanged
* - start' is the value of start after calling handleKT
* - limit' is the value of limit after calling handleKT
*/
/**
* Example: 3 transliterators. This example illustrates the
* mechanics we need to implement. C, S, and L are the contextStart,
* start, and limit. gl is the globalLimit. contextLimit is
* equal to limit throughout.
*
* 1. h-u, changes hex to Unicode
*
* 4 7 a d 0 4 7 a
* abc/u0061/u => abca/u
* C S L C S L gl=f->a
*
* 2. upup, changes "x" to "XX"
*
* 4 7 a 4 7 a
* abca/u => abcAA/u
* C SL C S
* L gl=a->b
* 3. u-h, changes Unicode to hex
*
* 4 7 a 4 7 a d 0 3
* abcAA/u => abc/u0041/u0041/u
* C S L C S
* L gl=b->15
* 4. return
*
* 4 7 a d 0 3
* abc/u0041/u0041/u
* C S L
*/
if (trans.length < 1) {
index.start = index.limit; // depends on control dependency: [if], data = [none]
return; // Short circuit for empty compound transliterators // depends on control dependency: [if], data = [none]
}
// compoundLimit is the limit value for the entire compound
// operation. We overwrite index.limit with the previous
// index.start. After each transliteration, we update
// compoundLimit for insertions or deletions that have happened.
int compoundLimit = index.limit;
// compoundStart is the start for the entire compound
// operation.
int compoundStart = index.start;
int delta = 0; // delta in length
StringBuffer log = null;
///CLOVER:OFF
if (DEBUG) {
log = new StringBuffer("CompoundTransliterator{" + getID() +
(incremental ? "}i: IN=" : "}: IN=")); // depends on control dependency: [if], data = [none]
UtilityExtensions.formatInput(log, text, index); // depends on control dependency: [if], data = [none]
System.out.println(Utility.escape(log.toString())); // depends on control dependency: [if], data = [none]
}
///CLOVER:ON
// Give each transliterator a crack at the run of characters.
// See comments at the top of the method for more detail.
for (int i=0; i<trans.length; ++i) {
index.start = compoundStart; // Reset start // depends on control dependency: [for], data = [none]
int limit = index.limit;
if (index.start == index.limit) {
// Short circuit for empty range
///CLOVER:OFF
if (DEBUG) {
System.out.println("CompoundTransliterator[" + i +
".." + (trans.length-1) +
(incremental ? "]i: " : "]: ") +
UtilityExtensions.formatInput(text, index) +
" (NOTHING TO DO)");
}
///CLOVER:ON
break;
}
///CLOVER:OFF
if (DEBUG) {
log.setLength(0); // depends on control dependency: [if], data = [none]
log.append("CompoundTransliterator[" + i + "=" +
trans[i].getID() +
(incremental ? "]i: " : "]: ")); // depends on control dependency: [if], data = [none]
UtilityExtensions.formatInput(log, text, index); // depends on control dependency: [if], data = [none]
}
///CLOVER:ON
trans[i].filteredTransliterate(text, index, incremental); // depends on control dependency: [if], data = [none]
// In a properly written transliterator, start == limit after
// handleTransliterate() returns when incremental is false.
// Catch cases where the subclass doesn't do this, and throw
// an exception. (Just pinning start to limit is a bad idea,
// because what's probably happening is that the subclass
// isn't transliterating all the way to the end, and it should
// in non-incremental mode.)
if (!incremental && index.start != index.limit) {
throw new RuntimeException("ERROR: Incomplete non-incremental transliteration by " + trans[i].getID());
}
///CLOVER:OFF
if (DEBUG) {
log.append(" => "); // depends on control dependency: [if], data = [none]
UtilityExtensions.formatInput(log, text, index); // depends on control dependency: [if], data = [none]
System.out.println(Utility.escape(log.toString())); // depends on control dependency: [if], data = [none]
}
///CLOVER:ON
// Cumulative delta for insertions/deletions
delta += index.limit - limit; // depends on control dependency: [if], data = [none]
if (incremental) {
// In the incremental case, only allow subsequent
// transliterators to modify what has already been
// completely processed by prior transliterators. In the
// non-incrmental case, allow each transliterator to
// process the entire text.
index.limit = index.start; // depends on control dependency: [if], data = [none]
}
}
compoundLimit += delta; // depends on control dependency: [for], data = [none]
// Start is good where it is -- where the last transliterator left
// it. Limit needs to be put back where it was, modulo
// adjustments for deletions/insertions.
index.limit = compoundLimit; // depends on control dependency: [for], data = [none]
///CLOVER:OFF
if (DEBUG) {
log.setLength(0); // depends on control dependency: [if], data = [none]
log.append("CompoundTransliterator{" + getID() +
(incremental ? "}i: OUT=" : "}: OUT=")); // depends on control dependency: [if], data = [none]
UtilityExtensions.formatInput(log, text, index); // depends on control dependency: [if], data = [none]
System.out.println(Utility.escape(log.toString())); // depends on control dependency: [if], data = [none]
}
///CLOVER:ON
} }
|
public class class_name {
public void initiateAllControllers() {
for (final ViewController controller : controllers.values()) {
initiateView(controller);
}
for (final ViewDialogController controller : dialogControllers.values()) {
if (controller instanceof AnnotatedViewDialogController) {
final AnnotatedViewDialogController dialogController = (AnnotatedViewDialogController) controller;
if (!dialogController.isInitiated() && dialogController.isCachingInstance()) {
dialogController.prepareDialogInstance();
}
}
}
} }
|
public class class_name {
public void initiateAllControllers() {
for (final ViewController controller : controllers.values()) {
initiateView(controller); // depends on control dependency: [for], data = [controller]
}
for (final ViewDialogController controller : dialogControllers.values()) {
if (controller instanceof AnnotatedViewDialogController) {
final AnnotatedViewDialogController dialogController = (AnnotatedViewDialogController) controller;
if (!dialogController.isInitiated() && dialogController.isCachingInstance()) {
dialogController.prepareDialogInstance(); // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public Comparator comparator( Map<String, FieldAccess> fields ) {
if ( comparator == null ) {
comparator = universalComparator(this.getName(), fields,
this.getType(), this.childComparators(fields));
}
return comparator;
} }
|
public class class_name {
public Comparator comparator( Map<String, FieldAccess> fields ) {
if ( comparator == null ) {
comparator = universalComparator(this.getName(), fields,
this.getType(), this.childComparators(fields)); // depends on control dependency: [if], data = [none]
}
return comparator;
} }
|
public class class_name {
@Action(semantics = SemanticsOf.SAFE)
public List<ApplicationUser> findMatching(final String search) {
if (search != null && search.length() > 0) {
return find(search);
}
return Lists.newArrayList();
} }
|
public class class_name {
@Action(semantics = SemanticsOf.SAFE)
public List<ApplicationUser> findMatching(final String search) {
if (search != null && search.length() > 0) {
return find(search); // depends on control dependency: [if], data = [(search]
}
return Lists.newArrayList();
} }
|
public class class_name {
private static Type buildCommonType(final Class<?> type,
final Map<Class<?>, LinkedHashMap<String, Type>> firstContext,
final Map<Class<?>, LinkedHashMap<String, Type>> secondContext,
final boolean alwaysIncludeInterfaces,
final PathsCache cache) {
final TypeVariable<? extends Class<?>>[] typeParameters = type.getTypeParameters();
if (typeParameters.length > 0) {
final Type[] params = new Type[typeParameters.length];
final Map<String, Type> firstGenerics = firstContext.get(type);
final Map<String, Type> secondGenerics = secondContext.get(type);
int i = 0;
boolean notAllObject = false;
for (TypeVariable var : typeParameters) {
final Type sub1 = firstGenerics.get(var.getName());
final Type sub2 = secondGenerics.get(var.getName());
final Type paramType = buildParameterType(type, sub1, sub2, alwaysIncludeInterfaces, cache);
if (paramType != Object.class) {
notAllObject = true;
}
params[i++] = paramType;
}
final Type outer = TypeUtils.getOuter(type);
// simplify to avoid redundant (actually absent) parametrization
return outer != null || notAllObject
? new ParameterizedTypeImpl(type, params, outer)
: type;
} else {
return type;
}
} }
|
public class class_name {
private static Type buildCommonType(final Class<?> type,
final Map<Class<?>, LinkedHashMap<String, Type>> firstContext,
final Map<Class<?>, LinkedHashMap<String, Type>> secondContext,
final boolean alwaysIncludeInterfaces,
final PathsCache cache) {
final TypeVariable<? extends Class<?>>[] typeParameters = type.getTypeParameters();
if (typeParameters.length > 0) {
final Type[] params = new Type[typeParameters.length];
final Map<String, Type> firstGenerics = firstContext.get(type);
final Map<String, Type> secondGenerics = secondContext.get(type);
int i = 0;
boolean notAllObject = false;
for (TypeVariable var : typeParameters) {
final Type sub1 = firstGenerics.get(var.getName());
final Type sub2 = secondGenerics.get(var.getName());
final Type paramType = buildParameterType(type, sub1, sub2, alwaysIncludeInterfaces, cache);
if (paramType != Object.class) {
notAllObject = true; // depends on control dependency: [if], data = [none]
}
params[i++] = paramType; // depends on control dependency: [for], data = [none]
}
final Type outer = TypeUtils.getOuter(type);
// simplify to avoid redundant (actually absent) parametrization
return outer != null || notAllObject
? new ParameterizedTypeImpl(type, params, outer)
: type; // depends on control dependency: [if], data = [none]
} else {
return type; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void setDate(String itemName, Date date) {
if (date == null) {
setItem(itemName, null);
} else {
setItem(itemName, DateUtil.toHL7(date));
}
} }
|
public class class_name {
public void setDate(String itemName, Date date) {
if (date == null) {
setItem(itemName, null); // depends on control dependency: [if], data = [null)]
} else {
setItem(itemName, DateUtil.toHL7(date)); // depends on control dependency: [if], data = [(date]
}
} }
|
public class class_name {
private static boolean checkSuccess(HttpResponse response, boolean dryRun, TaskListener listener) {
StatusLine status = response.getStatusLine();
String content = "";
try {
content = ExtractorUtils.entityToString(response.getEntity());
ExtractorUtils.validateStringNotBlank(content);
JSONObject json = JSONObject.fromObject(content);
String message = json.getString("message");
if (assertResponseStatus(dryRun, listener, status, message)) {
listener.getLogger().println(message);
return true;
}
} catch (IOException e) {
String parsingErrorStr = "Failed parsing distribution response";
if (StringUtils.isNotBlank(content)) {
parsingErrorStr = ": " + content;
}
e.printStackTrace(listener.error(parsingErrorStr));
}
return false;
} }
|
public class class_name {
private static boolean checkSuccess(HttpResponse response, boolean dryRun, TaskListener listener) {
StatusLine status = response.getStatusLine();
String content = "";
try {
content = ExtractorUtils.entityToString(response.getEntity()); // depends on control dependency: [try], data = [none]
ExtractorUtils.validateStringNotBlank(content); // depends on control dependency: [try], data = [none]
JSONObject json = JSONObject.fromObject(content);
String message = json.getString("message");
if (assertResponseStatus(dryRun, listener, status, message)) {
listener.getLogger().println(message); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
} catch (IOException e) {
String parsingErrorStr = "Failed parsing distribution response";
if (StringUtils.isNotBlank(content)) {
parsingErrorStr = ": " + content; // depends on control dependency: [if], data = [none]
}
e.printStackTrace(listener.error(parsingErrorStr));
} // depends on control dependency: [catch], data = [none]
return false;
} }
|
public class class_name {
public static boolean isEqualOrNull( Map s1,
Map s2 ) {
if ( s1 == null
&& s2 == null ) {
return true;
} else if ( s1 != null
&& s2 != null
&& s1.size() == s2.size() ) {
return true;
}
return false;
} }
|
public class class_name {
public static boolean isEqualOrNull( Map s1,
Map s2 ) {
if ( s1 == null
&& s2 == null ) {
return true; // depends on control dependency: [if], data = [none]
} else if ( s1 != null
&& s2 != null
&& s1.size() == s2.size() ) {
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
@Override
protected boolean beforeHandleRequest(final Request request) {
// Clear open request (if set)
setOpenRequestItemId(null);
// Check if is targeted request (ie item image)
String targetParam = request.getParameter(Environment.TARGET_ID);
boolean targetted = (targetParam != null && targetParam.equals(getTargetId()));
if (targetted) {
handleItemImageRequest(request);
return false;
}
// Check if open item request
if (isOpenItemRequest(request)) {
// Set the expanded rows
handleExpandedState(request);
// Handle open request
handleOpenItemRequest(request);
return false;
}
// Check if shuffle items
if (isShuffle() && isShuffleRequest(request)) {
handleShuffleState(request);
return false;
}
return true;
} }
|
public class class_name {
@Override
protected boolean beforeHandleRequest(final Request request) {
// Clear open request (if set)
setOpenRequestItemId(null);
// Check if is targeted request (ie item image)
String targetParam = request.getParameter(Environment.TARGET_ID);
boolean targetted = (targetParam != null && targetParam.equals(getTargetId()));
if (targetted) {
handleItemImageRequest(request); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
// Check if open item request
if (isOpenItemRequest(request)) {
// Set the expanded rows
handleExpandedState(request); // depends on control dependency: [if], data = [none]
// Handle open request
handleOpenItemRequest(request); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
// Check if shuffle items
if (isShuffle() && isShuffleRequest(request)) {
handleShuffleState(request); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
return true;
} }
|
public class class_name {
public static boolean isAllowedInXml(final int c) {
boolean ok = false;
if(c >= 0x10000 && c <= 0x10FFFF) {
ok = true;
} else if(c >= 0xE000 && c <= 0xFFFD) {
ok = true;
} else if(c >= 0x20 && c <= 0xD7FF) {
ok = true;
} else if(c == 0x9 || c == 0xA || c == 0xD) {
ok = true;
}
return ok;
} }
|
public class class_name {
public static boolean isAllowedInXml(final int c) {
boolean ok = false;
if(c >= 0x10000 && c <= 0x10FFFF) {
ok = true; // depends on control dependency: [if], data = [none]
} else if(c >= 0xE000 && c <= 0xFFFD) {
ok = true; // depends on control dependency: [if], data = [none]
} else if(c >= 0x20 && c <= 0xD7FF) {
ok = true; // depends on control dependency: [if], data = [none]
} else if(c == 0x9 || c == 0xA || c == 0xD) {
ok = true; // depends on control dependency: [if], data = [none]
}
return ok;
} }
|
public class class_name {
public String get_campaigns_v2(Map<String, Object> data) {
String type = data.get("type").toString();
String status = data.get("status").toString();
String page = data.get("page").toString();
String page_limit = data.get("page_limit").toString();
String url;
if (EMPTY_STRING.equals(type) && EMPTY_STRING.equals(status) && EMPTY_STRING.equals(page) && EMPTY_STRING.equals(page_limit)) {
url = "campaign/detailsv2/";
}
else {
url = "campaign/detailsv2/type/" + type + "/status/" + status + "/page/" + page + "/page_limit/" + page_limit + "/";
}
return get(url, EMPTY_STRING);
} }
|
public class class_name {
public String get_campaigns_v2(Map<String, Object> data) {
String type = data.get("type").toString();
String status = data.get("status").toString();
String page = data.get("page").toString();
String page_limit = data.get("page_limit").toString();
String url;
if (EMPTY_STRING.equals(type) && EMPTY_STRING.equals(status) && EMPTY_STRING.equals(page) && EMPTY_STRING.equals(page_limit)) {
url = "campaign/detailsv2/"; // depends on control dependency: [if], data = [none]
}
else {
url = "campaign/detailsv2/type/" + type + "/status/" + status + "/page/" + page + "/page_limit/" + page_limit + "/"; // depends on control dependency: [if], data = [none]
}
return get(url, EMPTY_STRING);
} }
|
public class class_name {
private int transSweep(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, int start) {
boolean try_ = true;
Ptr ipp = null;
Ptr opp = null;
while (try_) {
try_ = false;
for (int i = start; i < numTranscoders; i++) {
EConvElement te = elements[i];
final int is, os;
final byte[] ibytes, obytes;
EConvElement previousTE = null;
boolean ippIsStart = false;
boolean oppIsEnd = false;
if (i == 0) {
ipp = inPtr;
is = inStop;
ibytes = in;
} else {
previousTE = elements[i - 1];
ipp = new Ptr(previousTE.dataStart);
ippIsStart = true;
is = previousTE.dataEnd;
ibytes = previousTE.bytes;
}
if (i == numTranscoders - 1) {
opp = outPtr;
os = outStop;
obytes = out;
} else {
if (te.bufStart != te.dataStart) {
int len = te.dataEnd - te.dataStart;
int off = te.dataStart - te.bufStart;
System.arraycopy(te.bytes, te.dataStart, te.bytes, te.bufStart, len);
te.dataStart = te.bufStart;
te.dataEnd -= off;
}
opp = new Ptr(te.dataEnd);
oppIsEnd = true;
os = te.bufEnd;
obytes = te.bytes;
}
int f = flags;
if (numFinished != i) f |= PARTIAL_INPUT;
if (i == 0 && (flags & AFTER_OUTPUT) != 0) {
start = 1;
flags &= ~AFTER_OUTPUT;
}
if (i != 0) f &= ~AFTER_OUTPUT;
int iold = ipp.p;
int oold = opp.p;
EConvResult res;
te.lastResult = res = te.transcoding.convert(ibytes, ipp, is, obytes, opp, os, f);
if (ippIsStart) previousTE.dataStart = ipp.p;
if (oppIsEnd) te.dataEnd = opp.p;
if (iold != ipp.p || oold != opp.p) try_ = true;
switch (res) {
case InvalidByteSequence:
case IncompleteInput:
case UndefinedConversion:
case AfterOutput:
return i;
case DestinationBufferFull:
case SourceBufferEmpty:
break;
case Finished:
numFinished = i + 1;
break;
}
}
}
return -1;
} }
|
public class class_name {
private int transSweep(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, int start) {
boolean try_ = true;
Ptr ipp = null;
Ptr opp = null;
while (try_) {
try_ = false;
// depends on control dependency: [while], data = [none]
for (int i = start; i < numTranscoders; i++) {
EConvElement te = elements[i];
final int is, os;
final byte[] ibytes, obytes;
EConvElement previousTE = null;
boolean ippIsStart = false;
boolean oppIsEnd = false;
if (i == 0) {
ipp = inPtr;
// depends on control dependency: [if], data = [none]
is = inStop;
// depends on control dependency: [if], data = [none]
ibytes = in;
// depends on control dependency: [if], data = [none]
} else {
previousTE = elements[i - 1];
// depends on control dependency: [if], data = [none]
ipp = new Ptr(previousTE.dataStart);
// depends on control dependency: [if], data = [none]
ippIsStart = true;
// depends on control dependency: [if], data = [none]
is = previousTE.dataEnd;
// depends on control dependency: [if], data = [none]
ibytes = previousTE.bytes;
// depends on control dependency: [if], data = [none]
}
if (i == numTranscoders - 1) {
opp = outPtr;
// depends on control dependency: [if], data = [none]
os = outStop;
// depends on control dependency: [if], data = [none]
obytes = out;
// depends on control dependency: [if], data = [none]
} else {
if (te.bufStart != te.dataStart) {
int len = te.dataEnd - te.dataStart;
int off = te.dataStart - te.bufStart;
System.arraycopy(te.bytes, te.dataStart, te.bytes, te.bufStart, len);
// depends on control dependency: [if], data = [none]
te.dataStart = te.bufStart;
// depends on control dependency: [if], data = [none]
te.dataEnd -= off;
// depends on control dependency: [if], data = [none]
}
opp = new Ptr(te.dataEnd);
// depends on control dependency: [if], data = [none]
oppIsEnd = true;
// depends on control dependency: [if], data = [none]
os = te.bufEnd;
// depends on control dependency: [if], data = [none]
obytes = te.bytes;
// depends on control dependency: [if], data = [none]
}
int f = flags;
if (numFinished != i) f |= PARTIAL_INPUT;
if (i == 0 && (flags & AFTER_OUTPUT) != 0) {
start = 1;
// depends on control dependency: [if], data = [none]
flags &= ~AFTER_OUTPUT;
// depends on control dependency: [if], data = [none]
}
if (i != 0) f &= ~AFTER_OUTPUT;
int iold = ipp.p;
int oold = opp.p;
EConvResult res;
te.lastResult = res = te.transcoding.convert(ibytes, ipp, is, obytes, opp, os, f);
// depends on control dependency: [for], data = [none]
if (ippIsStart) previousTE.dataStart = ipp.p;
if (oppIsEnd) te.dataEnd = opp.p;
if (iold != ipp.p || oold != opp.p) try_ = true;
switch (res) {
case InvalidByteSequence:
case IncompleteInput:
case UndefinedConversion:
case AfterOutput:
return i;
case DestinationBufferFull:
case SourceBufferEmpty:
break;
case Finished:
numFinished = i + 1;
break;
}
}
}
return -1;
} }
|
public class class_name {
public static List<Field> getAllFields(Class<?> cls) {
final List<Field> allFields = new ArrayList<Field>();
Class<?> currentClass = cls;
while (currentClass != null) {
final Field[] declaredFields = currentClass.getDeclaredFields();
Collections.addAll(allFields, declaredFields);
currentClass = currentClass.getSuperclass();
}
return allFields;
} }
|
public class class_name {
public static List<Field> getAllFields(Class<?> cls) {
final List<Field> allFields = new ArrayList<Field>();
Class<?> currentClass = cls;
while (currentClass != null) {
final Field[] declaredFields = currentClass.getDeclaredFields();
Collections.addAll(allFields, declaredFields); // depends on control dependency: [while], data = [none]
currentClass = currentClass.getSuperclass(); // depends on control dependency: [while], data = [none]
}
return allFields;
} }
|
public class class_name {
public void add(Type type, String message, Throwable exception)
{
String queueMessage = message;
if ( (type == Type.ERROR) && (exception != null) )
{
queueMessage += " (" + getExceptionMessage(exception) + ")";
}
if ( type.addToUI() )
{
while ( queue.size() > windowSizeLines ) // NOTE: due to concurrency, this may make the queue shorter than MAX - that's OK (and in some cases longer)
{
queue.remove();
}
queue.add(new Message(queueMessage, type));
}
type.log(message, exception);
} }
|
public class class_name {
public void add(Type type, String message, Throwable exception)
{
String queueMessage = message;
if ( (type == Type.ERROR) && (exception != null) )
{
queueMessage += " (" + getExceptionMessage(exception) + ")"; // depends on control dependency: [if], data = [none]
}
if ( type.addToUI() )
{
while ( queue.size() > windowSizeLines ) // NOTE: due to concurrency, this may make the queue shorter than MAX - that's OK (and in some cases longer)
{
queue.remove(); // depends on control dependency: [while], data = [none]
}
queue.add(new Message(queueMessage, type)); // depends on control dependency: [if], data = [none]
}
type.log(message, exception);
} }
|
public class class_name {
public synchronized void releasePreservingBuffers()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "releasePreservingBuffers");
released = true;
valid = false;
if (receivedData != null)
{
receivedData.release();
receivedData = null;
}
// Simply null out the received buffer
receivedBuffer = null;
dataList.clear();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "releasePreservingBuffers");
} }
|
public class class_name {
public synchronized void releasePreservingBuffers()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "releasePreservingBuffers");
released = true;
valid = false;
if (receivedData != null)
{
receivedData.release(); // depends on control dependency: [if], data = [none]
receivedData = null; // depends on control dependency: [if], data = [none]
}
// Simply null out the received buffer
receivedBuffer = null;
dataList.clear();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "releasePreservingBuffers");
} }
|
public class class_name {
@Override
public EClass getIfcFeatureElementSubtraction() {
if (ifcFeatureElementSubtractionEClass == null) {
ifcFeatureElementSubtractionEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(267);
}
return ifcFeatureElementSubtractionEClass;
} }
|
public class class_name {
@Override
public EClass getIfcFeatureElementSubtraction() {
if (ifcFeatureElementSubtractionEClass == null) {
ifcFeatureElementSubtractionEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(267);
// depends on control dependency: [if], data = [none]
}
return ifcFeatureElementSubtractionEClass;
} }
|
public class class_name {
public static GatewayBean unmarshallGateway(Map<String, Object> source) {
if (source == null) {
return null;
}
GatewayBean bean = new GatewayBean();
bean.setId(asString(source.get("id")));
bean.setName(asString(source.get("name")));
bean.setDescription(asString(source.get("description")));
bean.setType(asEnum(source.get("type"), GatewayType.class));
bean.setConfiguration(asString(source.get("configuration")));
bean.setCreatedBy(asString(source.get("createdBy")));
bean.setCreatedOn(asDate(source.get("createdOn")));
bean.setModifiedBy(asString(source.get("modifiedBy")));
bean.setModifiedOn(asDate(source.get("modifiedOn")));
postMarshall(bean);
return bean;
} }
|
public class class_name {
public static GatewayBean unmarshallGateway(Map<String, Object> source) {
if (source == null) {
return null; // depends on control dependency: [if], data = [none]
}
GatewayBean bean = new GatewayBean();
bean.setId(asString(source.get("id")));
bean.setName(asString(source.get("name")));
bean.setDescription(asString(source.get("description")));
bean.setType(asEnum(source.get("type"), GatewayType.class));
bean.setConfiguration(asString(source.get("configuration")));
bean.setCreatedBy(asString(source.get("createdBy")));
bean.setCreatedOn(asDate(source.get("createdOn")));
bean.setModifiedBy(asString(source.get("modifiedBy")));
bean.setModifiedOn(asDate(source.get("modifiedOn")));
postMarshall(bean);
return bean;
} }
|
public class class_name {
public static String prechomp(String str, String sep) {
int idx = str.indexOf(sep);
if (idx == -1) {
return str;
}
return str.substring(idx + sep.length());
} }
|
public class class_name {
public static String prechomp(String str, String sep) {
int idx = str.indexOf(sep);
if (idx == -1) {
return str; // depends on control dependency: [if], data = [none]
}
return str.substring(idx + sep.length());
} }
|
public class class_name {
private boolean isWildcardWithoutBounds() {
if (this.type instanceof WildcardType) {
WildcardType wt = (WildcardType) this.type;
if (wt.getLowerBounds().length == 0) {
Type[] upperBounds = wt.getUpperBounds();
if (upperBounds.length == 0 || (upperBounds.length == 1 && Object.class == upperBounds[0])) {
return true;
}
}
}
return false;
} }
|
public class class_name {
private boolean isWildcardWithoutBounds() {
if (this.type instanceof WildcardType) {
WildcardType wt = (WildcardType) this.type;
if (wt.getLowerBounds().length == 0) {
Type[] upperBounds = wt.getUpperBounds();
if (upperBounds.length == 0 || (upperBounds.length == 1 && Object.class == upperBounds[0])) {
return true; // depends on control dependency: [if], data = [none]
}
}
}
return false;
} }
|
public class class_name {
public static void main(final String[] args) throws Exception {
if (args.length < 4) {
throw new IllegalArgumentException();
} // end of if
// ---
if (new File(args[1]).exists()) { // driver path
final Properties conf = new Properties();
conf.put("jdbc.url", args[0]);
conf.put("jdbc.driverPath", args[1]);
conf.put("db.user", args[2]);
conf.put("db.charset", args[3]);
execWith(sysAppender, conf, args, 4);
return;
} // end of if
// ---
final File config = Studio.preferencesFile();
if (!config.exists()) {
throw new IllegalArgumentException("Cannot find configuration");
} // end of if
// ---
FileInputStream in = null;
try {
in = new FileInputStream(config);
final Properties conf = new Properties();
conf.load(in);
execWith(sysAppender, conf, args, 0);
} catch (Exception e) {
throw new RuntimeException("Fails to load configuration: " +
config.getAbsolutePath(), e);
} finally {
if (in != null) {
try {
in.close();
} catch (Exception e) {
e.printStackTrace();
} // end of catch
} // end of if
} // end of finally
} }
|
public class class_name {
public static void main(final String[] args) throws Exception {
if (args.length < 4) {
throw new IllegalArgumentException();
} // end of if
// ---
if (new File(args[1]).exists()) { // driver path
final Properties conf = new Properties();
conf.put("jdbc.url", args[0]);
conf.put("jdbc.driverPath", args[1]);
conf.put("db.user", args[2]);
conf.put("db.charset", args[3]);
execWith(sysAppender, conf, args, 4);
return;
} // end of if
// ---
final File config = Studio.preferencesFile();
if (!config.exists()) {
throw new IllegalArgumentException("Cannot find configuration");
} // end of if
// ---
FileInputStream in = null;
try {
in = new FileInputStream(config);
final Properties conf = new Properties();
conf.load(in);
execWith(sysAppender, conf, args, 0);
} catch (Exception e) {
throw new RuntimeException("Fails to load configuration: " +
config.getAbsolutePath(), e);
} finally {
if (in != null) {
try {
in.close(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
e.printStackTrace();
} // end of catch // depends on control dependency: [catch], data = [none]
} // end of if
} // end of finally
} }
|
public class class_name {
public static String formatChineseDate(Date date, boolean isUppercase) {
if (null == date) {
return null;
}
String format = DatePattern.CHINESE_DATE_FORMAT.format(date);
if (isUppercase) {
final StringBuilder builder = StrUtil.builder(format.length());
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(0, 1)), false));
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(1, 2)), false));
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(2, 3)), false));
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(3, 4)), false));
builder.append(format.substring(4, 5));
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(5, 7)), false));
builder.append(format.substring(7, 8));
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(8, 10)), false));
builder.append(format.substring(10));
format = builder.toString().replace('零', '〇');
}
return format;
} }
|
public class class_name {
public static String formatChineseDate(Date date, boolean isUppercase) {
if (null == date) {
return null;
// depends on control dependency: [if], data = [none]
}
String format = DatePattern.CHINESE_DATE_FORMAT.format(date);
if (isUppercase) {
final StringBuilder builder = StrUtil.builder(format.length());
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(0, 1)), false));
// depends on control dependency: [if], data = [none]
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(1, 2)), false));
// depends on control dependency: [if], data = [none]
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(2, 3)), false));
// depends on control dependency: [if], data = [none]
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(3, 4)), false));
// depends on control dependency: [if], data = [none]
builder.append(format.substring(4, 5));
// depends on control dependency: [if], data = [none]
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(5, 7)), false));
// depends on control dependency: [if], data = [none]
builder.append(format.substring(7, 8));
// depends on control dependency: [if], data = [none]
builder.append(Convert.numberToChinese(Integer.parseInt(format.substring(8, 10)), false));
// depends on control dependency: [if], data = [none]
builder.append(format.substring(10));
// depends on control dependency: [if], data = [none]
format = builder.toString().replace('零', '〇');
// depends on control dependency: [if], data = [none]
}
return format;
} }
|
public class class_name {
@Weight(Weight.Unit.NORMAL)
public static boolean isEmpty() {
final boolean result = REGISTRY.get().isEmpty();
if (result) {
REGISTRY.remove();
}
return result;
} }
|
public class class_name {
@Weight(Weight.Unit.NORMAL)
public static boolean isEmpty() {
final boolean result = REGISTRY.get().isEmpty();
if (result) {
REGISTRY.remove(); // depends on control dependency: [if], data = [none]
}
return result;
} }
|
public class class_name {
@SuppressWarnings("deprecation")
private EntityCollectionResponse retrieveEntityCollectionInternal(
String entityTypeId,
EntityCollectionRequest request,
Set<String> attributesSet,
Map<String, Set<String>> attributeExpandsSet) {
EntityType meta = dataService.getEntityType(entityTypeId);
Repository<Entity> repository = dataService.getRepository(entityTypeId);
// convert sort
Sort sort;
SortV1 sortV1 = request.getSort();
if (sortV1 != null) {
sort = new Sort();
for (SortV1.OrderV1 orderV1 : sortV1) {
sort.on(
orderV1.getProperty(),
orderV1.getDirection() == SortV1.DirectionV1.ASC
? Sort.Direction.ASC
: Sort.Direction.DESC);
}
} else {
sort = null;
}
List<QueryRule> queryRules = request.getQ() == null ? Collections.emptyList() : request.getQ();
Query<Entity> q =
new QueryImpl<>(queryRules)
.pageSize(request.getNum())
.offset(request.getStart())
.sort(sort);
Iterable<Entity> it = () -> dataService.findAll(entityTypeId, q).iterator();
Long count = repository.count(new QueryImpl<>(q).setOffset(0).setPageSize(0));
EntityPager pager = new EntityPager(request.getStart(), request.getNum(), count, it);
List<Map<String, Object>> entities = new ArrayList<>();
for (Entity entity : it) {
entities.add(getEntityAsMap(entity, meta, attributesSet, attributeExpandsSet));
}
return new EntityCollectionResponse(
pager,
entities,
UriUtils.createEntityCollectionUriPath(entityTypeId),
meta,
permissionService,
dataService);
} }
|
public class class_name {
@SuppressWarnings("deprecation")
private EntityCollectionResponse retrieveEntityCollectionInternal(
String entityTypeId,
EntityCollectionRequest request,
Set<String> attributesSet,
Map<String, Set<String>> attributeExpandsSet) {
EntityType meta = dataService.getEntityType(entityTypeId);
Repository<Entity> repository = dataService.getRepository(entityTypeId);
// convert sort
Sort sort;
SortV1 sortV1 = request.getSort();
if (sortV1 != null) {
sort = new Sort(); // depends on control dependency: [if], data = [none]
for (SortV1.OrderV1 orderV1 : sortV1) {
sort.on(
orderV1.getProperty(),
orderV1.getDirection() == SortV1.DirectionV1.ASC
? Sort.Direction.ASC
: Sort.Direction.DESC); // depends on control dependency: [for], data = [none]
}
} else {
sort = null; // depends on control dependency: [if], data = [none]
}
List<QueryRule> queryRules = request.getQ() == null ? Collections.emptyList() : request.getQ();
Query<Entity> q =
new QueryImpl<>(queryRules)
.pageSize(request.getNum())
.offset(request.getStart())
.sort(sort);
Iterable<Entity> it = () -> dataService.findAll(entityTypeId, q).iterator();
Long count = repository.count(new QueryImpl<>(q).setOffset(0).setPageSize(0));
EntityPager pager = new EntityPager(request.getStart(), request.getNum(), count, it);
List<Map<String, Object>> entities = new ArrayList<>();
for (Entity entity : it) {
entities.add(getEntityAsMap(entity, meta, attributesSet, attributeExpandsSet)); // depends on control dependency: [for], data = [entity]
}
return new EntityCollectionResponse(
pager,
entities,
UriUtils.createEntityCollectionUriPath(entityTypeId),
meta,
permissionService,
dataService);
} }
|
public class class_name {
public void marshall(ListBusinessReportSchedulesRequest listBusinessReportSchedulesRequest, ProtocolMarshaller protocolMarshaller) {
if (listBusinessReportSchedulesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listBusinessReportSchedulesRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(listBusinessReportSchedulesRequest.getMaxResults(), MAXRESULTS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(ListBusinessReportSchedulesRequest listBusinessReportSchedulesRequest, ProtocolMarshaller protocolMarshaller) {
if (listBusinessReportSchedulesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listBusinessReportSchedulesRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listBusinessReportSchedulesRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void installUI(JComponent c) {
super.installUI(c);
root = (JRootPane) c;
updateTextured();
int style = root.getWindowDecorationStyle();
Container parent = root.getParent();
if (parent != null && (parent instanceof JFrame || parent instanceof JDialog) && style != JRootPane.NONE) {
installClientDecorations(root);
}
} }
|
public class class_name {
public void installUI(JComponent c) {
super.installUI(c);
root = (JRootPane) c;
updateTextured();
int style = root.getWindowDecorationStyle();
Container parent = root.getParent();
if (parent != null && (parent instanceof JFrame || parent instanceof JDialog) && style != JRootPane.NONE) {
installClientDecorations(root); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void listErrors(final Result result) {
for (JSError warning : result.warnings) {
getLog().warn(warning.toString());
}
for (JSError error : result.errors) {
getLog().error(error.toString());
}
} }
|
public class class_name {
private void listErrors(final Result result) {
for (JSError warning : result.warnings) {
getLog().warn(warning.toString()); // depends on control dependency: [for], data = [warning]
}
for (JSError error : result.errors) {
getLog().error(error.toString()); // depends on control dependency: [for], data = [error]
}
} }
|
public class class_name {
private AWSCredentials getCredentials() {
String awsProfile = getParamString("aws_profile");
if (!Utils.isEmpty(awsProfile)) {
m_logger.info("Using AWS profile: {}", awsProfile);
ProfileCredentialsProvider credsProvider = null;
String awsCredentialsFile = getParamString("aws_credentials_file");
if (!Utils.isEmpty(awsCredentialsFile)) {
credsProvider = new ProfileCredentialsProvider(awsCredentialsFile, awsProfile);
} else {
credsProvider = new ProfileCredentialsProvider(awsProfile);
}
return credsProvider.getCredentials();
}
String awsAccessKey = getParamString("aws_access_key");
Utils.require(!Utils.isEmpty(awsAccessKey),
"Either 'aws_profile' or 'aws_access_key' must be defined for tenant: " + m_tenant.getName());
String awsSecretKey = getParamString("aws_secret_key");
Utils.require(!Utils.isEmpty(awsSecretKey),
"'aws_secret_key' must be defined when 'aws_access_key' is defined. " +
"'aws_profile' is preferred over aws_access_key/aws_secret_key. Tenant: " + m_tenant.getName());
return new BasicAWSCredentials(awsAccessKey, awsSecretKey);
} }
|
public class class_name {
private AWSCredentials getCredentials() {
String awsProfile = getParamString("aws_profile");
if (!Utils.isEmpty(awsProfile)) {
m_logger.info("Using AWS profile: {}", awsProfile); // depends on control dependency: [if], data = [none]
ProfileCredentialsProvider credsProvider = null;
String awsCredentialsFile = getParamString("aws_credentials_file");
if (!Utils.isEmpty(awsCredentialsFile)) {
credsProvider = new ProfileCredentialsProvider(awsCredentialsFile, awsProfile); // depends on control dependency: [if], data = [none]
} else {
credsProvider = new ProfileCredentialsProvider(awsProfile); // depends on control dependency: [if], data = [none]
}
return credsProvider.getCredentials(); // depends on control dependency: [if], data = [none]
}
String awsAccessKey = getParamString("aws_access_key");
Utils.require(!Utils.isEmpty(awsAccessKey),
"Either 'aws_profile' or 'aws_access_key' must be defined for tenant: " + m_tenant.getName());
String awsSecretKey = getParamString("aws_secret_key");
Utils.require(!Utils.isEmpty(awsSecretKey),
"'aws_secret_key' must be defined when 'aws_access_key' is defined. " +
"'aws_profile' is preferred over aws_access_key/aws_secret_key. Tenant: " + m_tenant.getName());
return new BasicAWSCredentials(awsAccessKey, awsSecretKey);
} }
|
public class class_name {
@Override
public void flush()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "flush");
// Cleanup any pending NACK alarms. Since we're flushing we don't
// care about these anymore.
synchronized (pendingAlarms)
{
for (Iterator i = getAlarms(this); i.hasNext();)
{
NRTExpiryHandle next = (NRTExpiryHandle) i.next();
next.timer.cancel();
i.remove();
}
}
// SIB0115
// If nack alarms are cancelled then deregister the health state for detected gaps
getControlAdapter().getHealthState().deregister(HealthStateListener.GAP_DETECTED_STATE);
// We shouldn't be flushed if we have pending unacked data. But
// just as a sanity check, throw an exception here if we have
// something undelivered.
if (oststream
.containsState(
new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
TickRange.Value)
|| oststream.containsState(
new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
TickRange.Uncommitted))
{
//TODO: throw some interesting exception
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "flush");
} }
|
public class class_name {
@Override
public void flush()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "flush");
// Cleanup any pending NACK alarms. Since we're flushing we don't
// care about these anymore.
synchronized (pendingAlarms)
{
for (Iterator i = getAlarms(this); i.hasNext();)
{
NRTExpiryHandle next = (NRTExpiryHandle) i.next();
next.timer.cancel(); // depends on control dependency: [for], data = [none]
i.remove(); // depends on control dependency: [for], data = [i]
}
}
// SIB0115
// If nack alarms are cancelled then deregister the health state for detected gaps
getControlAdapter().getHealthState().deregister(HealthStateListener.GAP_DETECTED_STATE);
// We shouldn't be flushed if we have pending unacked data. But
// just as a sanity check, throw an exception here if we have
// something undelivered.
if (oststream
.containsState(
new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
TickRange.Value)
|| oststream.containsState(
new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
TickRange.Uncommitted))
{
//TODO: throw some interesting exception
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "flush");
} }
|
public class class_name {
public ZoomBounds set(State state) {
float imageWidth = settings.getImageW();
float imageHeight = settings.getImageH();
float areaWidth = settings.getMovementAreaW();
float areaHeight = settings.getMovementAreaH();
if (imageWidth == 0f || imageHeight == 0f || areaWidth == 0f || areaHeight == 0f) {
minZoom = maxZoom = fitZoom = 1f;
return this;
}
minZoom = settings.getMinZoom();
maxZoom = settings.getMaxZoom();
final float rotation = state.getRotation();
if (!State.equals(rotation, 0f)) {
if (settings.getFitMethod() == Settings.Fit.OUTSIDE) {
// Computing movement area size taking rotation into account. We need to inverse
// rotation, since it will be applied to the area, not to the image itself.
tmpMatrix.setRotate(-rotation);
tmpRectF.set(0, 0, areaWidth, areaHeight);
tmpMatrix.mapRect(tmpRectF);
areaWidth = tmpRectF.width();
areaHeight = tmpRectF.height();
} else {
// Computing image bounding size taking rotation into account.
tmpMatrix.setRotate(rotation);
tmpRectF.set(0, 0, imageWidth, imageHeight);
tmpMatrix.mapRect(tmpRectF);
imageWidth = tmpRectF.width();
imageHeight = tmpRectF.height();
}
}
switch (settings.getFitMethod()) {
case HORIZONTAL:
fitZoom = areaWidth / imageWidth;
break;
case VERTICAL:
fitZoom = areaHeight / imageHeight;
break;
case INSIDE:
fitZoom = Math.min(areaWidth / imageWidth, areaHeight / imageHeight);
break;
case OUTSIDE:
fitZoom = Math.max(areaWidth / imageWidth, areaHeight / imageHeight);
break;
case NONE:
default:
fitZoom = minZoom > 0f ? minZoom : 1f;
}
if (minZoom <= 0f) {
minZoom = fitZoom;
}
if (maxZoom <= 0f) {
maxZoom = fitZoom;
}
if (fitZoom > maxZoom) {
if (settings.isFillViewport()) {
// zooming to fill entire viewport
maxZoom = fitZoom;
} else {
// restricting fit zoom
fitZoom = maxZoom;
}
}
// Now we have: fitZoom <= maxZoom
if (minZoom > maxZoom) {
minZoom = maxZoom;
}
// Now we have: minZoom <= maxZoom
if (fitZoom < minZoom) {
if (settings.isFillViewport()) {
// zooming to fill entire viewport
minZoom = fitZoom;
} else {
// restricting fit zoom
fitZoom = minZoom;
}
}
// Now we have: minZoom <= fitZoom <= maxZoom
return this;
} }
|
public class class_name {
public ZoomBounds set(State state) {
float imageWidth = settings.getImageW();
float imageHeight = settings.getImageH();
float areaWidth = settings.getMovementAreaW();
float areaHeight = settings.getMovementAreaH();
if (imageWidth == 0f || imageHeight == 0f || areaWidth == 0f || areaHeight == 0f) {
minZoom = maxZoom = fitZoom = 1f; // depends on control dependency: [if], data = [none]
return this; // depends on control dependency: [if], data = [none]
}
minZoom = settings.getMinZoom();
maxZoom = settings.getMaxZoom();
final float rotation = state.getRotation();
if (!State.equals(rotation, 0f)) {
if (settings.getFitMethod() == Settings.Fit.OUTSIDE) {
// Computing movement area size taking rotation into account. We need to inverse
// rotation, since it will be applied to the area, not to the image itself.
tmpMatrix.setRotate(-rotation); // depends on control dependency: [if], data = [none]
tmpRectF.set(0, 0, areaWidth, areaHeight); // depends on control dependency: [if], data = [none]
tmpMatrix.mapRect(tmpRectF); // depends on control dependency: [if], data = [none]
areaWidth = tmpRectF.width(); // depends on control dependency: [if], data = [none]
areaHeight = tmpRectF.height(); // depends on control dependency: [if], data = [none]
} else {
// Computing image bounding size taking rotation into account.
tmpMatrix.setRotate(rotation); // depends on control dependency: [if], data = [none]
tmpRectF.set(0, 0, imageWidth, imageHeight); // depends on control dependency: [if], data = [none]
tmpMatrix.mapRect(tmpRectF); // depends on control dependency: [if], data = [none]
imageWidth = tmpRectF.width(); // depends on control dependency: [if], data = [none]
imageHeight = tmpRectF.height(); // depends on control dependency: [if], data = [none]
}
}
switch (settings.getFitMethod()) {
case HORIZONTAL:
fitZoom = areaWidth / imageWidth;
break;
case VERTICAL:
fitZoom = areaHeight / imageHeight;
break;
case INSIDE:
fitZoom = Math.min(areaWidth / imageWidth, areaHeight / imageHeight);
break;
case OUTSIDE:
fitZoom = Math.max(areaWidth / imageWidth, areaHeight / imageHeight);
break;
case NONE:
default:
fitZoom = minZoom > 0f ? minZoom : 1f;
}
if (minZoom <= 0f) {
minZoom = fitZoom;
}
if (maxZoom <= 0f) {
maxZoom = fitZoom;
}
if (fitZoom > maxZoom) {
if (settings.isFillViewport()) {
// zooming to fill entire viewport
maxZoom = fitZoom; // depends on control dependency: [if], data = [none]
} else {
// restricting fit zoom
fitZoom = maxZoom; // depends on control dependency: [if], data = [none]
}
}
// Now we have: fitZoom <= maxZoom
if (minZoom > maxZoom) {
minZoom = maxZoom;
}
// Now we have: minZoom <= maxZoom
if (fitZoom < minZoom) {
if (settings.isFillViewport()) {
// zooming to fill entire viewport
minZoom = fitZoom;
} else {
// restricting fit zoom
fitZoom = minZoom;
}
}
// Now we have: minZoom <= fitZoom <= maxZoom
return this;
} }
|
public class class_name {
public Bundle saveInstanceState(Bundle savedInstanceState) {
if (savedInstanceState != null) {
savedInstanceState.putBoolean(BUNDLE_CROSS_FADED, mCrossFadeSlidingPaneLayout.isOpen());
}
return savedInstanceState;
} }
|
public class class_name {
public Bundle saveInstanceState(Bundle savedInstanceState) {
if (savedInstanceState != null) {
savedInstanceState.putBoolean(BUNDLE_CROSS_FADED, mCrossFadeSlidingPaneLayout.isOpen()); // depends on control dependency: [if], data = [none]
}
return savedInstanceState;
} }
|
public class class_name {
protected boolean canConsumeThisString(String string, boolean consume) {
if (string == null) {
return false;
}
for (int i = 0; i < string.length(); i++) {
if (!input.next(i).is(string.charAt(i))) {
return false;
}
}
if (consume) {
input.consume(string.length());
}
return true;
} }
|
public class class_name {
protected boolean canConsumeThisString(String string, boolean consume) {
if (string == null) {
return false; // depends on control dependency: [if], data = [none]
}
for (int i = 0; i < string.length(); i++) {
if (!input.next(i).is(string.charAt(i))) {
return false; // depends on control dependency: [if], data = [none]
}
}
if (consume) {
input.consume(string.length()); // depends on control dependency: [if], data = [none]
}
return true;
} }
|
public class class_name {
private boolean updateConsistent(N node, N parent, Transition<A, S> transition) {
// parent.getG().add(this.costFunction.evaluate(transition));
C accumulatedCost = add.apply(parent.getG(), costFunction.evaluate(transition));
if (node.getG().compareTo(accumulatedCost) > 0) {
node.setPreviousNode(parent);
// node.previousNode = parent;
node.setG(accumulatedCost);
node.setState(transition.getState());
node.setAction(transition.getAction());
// node.state = transition;
node.setKey(new es.usc.citius.hipster.model.ADStarNode.Key<C>(node.getG(), node.getV(),
heuristicFunction.estimate(transition.getState()), epsilon, add, scale));
return true;
}
return false;
} }
|
public class class_name {
private boolean updateConsistent(N node, N parent, Transition<A, S> transition) {
// parent.getG().add(this.costFunction.evaluate(transition));
C accumulatedCost = add.apply(parent.getG(), costFunction.evaluate(transition));
if (node.getG().compareTo(accumulatedCost) > 0) {
node.setPreviousNode(parent); // depends on control dependency: [if], data = [none]
// node.previousNode = parent;
node.setG(accumulatedCost); // depends on control dependency: [if], data = [none]
node.setState(transition.getState()); // depends on control dependency: [if], data = [none]
node.setAction(transition.getAction()); // depends on control dependency: [if], data = [none]
// node.state = transition;
node.setKey(new es.usc.citius.hipster.model.ADStarNode.Key<C>(node.getG(), node.getV(),
heuristicFunction.estimate(transition.getState()), epsilon, add, scale)); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
ConfigurableApplicationContext addConfigFilesToEnvironment() {
ConfigurableApplicationContext capture = null;
try {
StandardEnvironment environment = copyEnvironment(
this.context.getEnvironment());
SpringApplicationBuilder builder = new SpringApplicationBuilder(Empty.class)
.bannerMode(Mode.OFF).web(WebApplicationType.NONE)
.environment(environment);
// Just the listeners that affect the environment (e.g. excluding logging
// listener because it has side effects)
builder.application()
.setListeners(Arrays.asList(new BootstrapApplicationListener(),
new ConfigFileApplicationListener()));
capture = builder.run();
if (environment.getPropertySources().contains(REFRESH_ARGS_PROPERTY_SOURCE)) {
environment.getPropertySources().remove(REFRESH_ARGS_PROPERTY_SOURCE);
}
MutablePropertySources target = this.context.getEnvironment()
.getPropertySources();
String targetName = null;
for (PropertySource<?> source : environment.getPropertySources()) {
String name = source.getName();
if (target.contains(name)) {
targetName = name;
}
if (!this.standardSources.contains(name)) {
if (target.contains(name)) {
target.replace(name, source);
}
else {
if (targetName != null) {
target.addAfter(targetName, source);
}
else {
// targetName was null so we are at the start of the list
target.addFirst(source);
targetName = name;
}
}
}
}
}
finally {
ConfigurableApplicationContext closeable = capture;
while (closeable != null) {
try {
closeable.close();
}
catch (Exception e) {
// Ignore;
}
if (closeable.getParent() instanceof ConfigurableApplicationContext) {
closeable = (ConfigurableApplicationContext) closeable.getParent();
}
else {
break;
}
}
}
return capture;
} }
|
public class class_name {
ConfigurableApplicationContext addConfigFilesToEnvironment() {
ConfigurableApplicationContext capture = null;
try {
StandardEnvironment environment = copyEnvironment(
this.context.getEnvironment());
SpringApplicationBuilder builder = new SpringApplicationBuilder(Empty.class)
.bannerMode(Mode.OFF).web(WebApplicationType.NONE)
.environment(environment);
// Just the listeners that affect the environment (e.g. excluding logging
// listener because it has side effects)
builder.application()
.setListeners(Arrays.asList(new BootstrapApplicationListener(),
new ConfigFileApplicationListener())); // depends on control dependency: [try], data = [none]
capture = builder.run(); // depends on control dependency: [try], data = [none]
if (environment.getPropertySources().contains(REFRESH_ARGS_PROPERTY_SOURCE)) {
environment.getPropertySources().remove(REFRESH_ARGS_PROPERTY_SOURCE); // depends on control dependency: [if], data = [none]
}
MutablePropertySources target = this.context.getEnvironment()
.getPropertySources();
String targetName = null;
for (PropertySource<?> source : environment.getPropertySources()) {
String name = source.getName();
if (target.contains(name)) {
targetName = name; // depends on control dependency: [if], data = [none]
}
if (!this.standardSources.contains(name)) {
if (target.contains(name)) {
target.replace(name, source); // depends on control dependency: [if], data = [none]
}
else {
if (targetName != null) {
target.addAfter(targetName, source); // depends on control dependency: [if], data = [(targetName]
}
else {
// targetName was null so we are at the start of the list
target.addFirst(source); // depends on control dependency: [if], data = [none]
targetName = name; // depends on control dependency: [if], data = [none]
}
}
}
}
}
finally {
ConfigurableApplicationContext closeable = capture;
while (closeable != null) {
try {
closeable.close(); // depends on control dependency: [try], data = [none]
}
catch (Exception e) {
// Ignore;
} // depends on control dependency: [catch], data = [none]
if (closeable.getParent() instanceof ConfigurableApplicationContext) {
closeable = (ConfigurableApplicationContext) closeable.getParent(); // depends on control dependency: [if], data = [none]
}
else {
break;
}
}
}
return capture;
} }
|
public class class_name {
public void onValueChange(ValueChangeEvent<String> event) {
cancelQuickFilterTimer();
if (event.getSource() == m_sortSelectBox) {
// depending on the sort value the tab may or may not have the quick filter ability
if (hasQuickFilter()) {
if (m_quickSearch == null) {
createQuickBox();
}
} else {
removeQuickBox();
}
getTabHandler().onSort(event.getValue(), hasQuickFilter() ? m_quickSearch.getFormValueAsString() : null);
}
if ((event.getSource() == m_quickSearch)) {
if (hasQuickFilter()) {
if ((CmsStringUtil.isEmptyOrWhitespaceOnly(event.getValue()) || (event.getValue().length() >= 3))) {
// only act if filter length is at least 3 characters or empty
if ((m_lastQuickSearchValue == null) || !m_lastQuickSearchValue.equals(event.getValue())) {
scheduleQuickFilterTimer();
}
m_lastQuickSearchValue = event.getValue();
}
} else {
checkQuickSearchStatus();
}
}
} }
|
public class class_name {
public void onValueChange(ValueChangeEvent<String> event) {
cancelQuickFilterTimer();
if (event.getSource() == m_sortSelectBox) {
// depending on the sort value the tab may or may not have the quick filter ability
if (hasQuickFilter()) {
if (m_quickSearch == null) {
createQuickBox(); // depends on control dependency: [if], data = [none]
}
} else {
removeQuickBox(); // depends on control dependency: [if], data = [none]
}
getTabHandler().onSort(event.getValue(), hasQuickFilter() ? m_quickSearch.getFormValueAsString() : null); // depends on control dependency: [if], data = [none]
}
if ((event.getSource() == m_quickSearch)) {
if (hasQuickFilter()) {
if ((CmsStringUtil.isEmptyOrWhitespaceOnly(event.getValue()) || (event.getValue().length() >= 3))) {
// only act if filter length is at least 3 characters or empty
if ((m_lastQuickSearchValue == null) || !m_lastQuickSearchValue.equals(event.getValue())) {
scheduleQuickFilterTimer(); // depends on control dependency: [if], data = [none]
}
m_lastQuickSearchValue = event.getValue(); // depends on control dependency: [if], data = [none]
}
} else {
checkQuickSearchStatus(); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public void close() throws OpenViduJavaClientException, OpenViduHttpException {
HttpDelete request = new HttpDelete(OpenVidu.urlOpenViduServer + OpenVidu.API_SESSIONS + "/" + this.sessionId);
request.setHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");
HttpResponse response;
try {
response = OpenVidu.httpClient.execute(request);
} catch (IOException e) {
throw new OpenViduJavaClientException(e.getMessage(), e.getCause());
}
try {
int statusCode = response.getStatusLine().getStatusCode();
if ((statusCode == org.apache.http.HttpStatus.SC_NO_CONTENT)) {
OpenVidu.activeSessions.remove(this.sessionId);
log.info("Session {} closed", this.sessionId);
} else {
throw new OpenViduHttpException(statusCode);
}
} finally {
EntityUtils.consumeQuietly(response.getEntity());
}
} }
|
public class class_name {
public void close() throws OpenViduJavaClientException, OpenViduHttpException {
HttpDelete request = new HttpDelete(OpenVidu.urlOpenViduServer + OpenVidu.API_SESSIONS + "/" + this.sessionId);
request.setHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");
HttpResponse response;
try {
response = OpenVidu.httpClient.execute(request);
} catch (IOException e) {
throw new OpenViduJavaClientException(e.getMessage(), e.getCause());
}
try {
int statusCode = response.getStatusLine().getStatusCode();
if ((statusCode == org.apache.http.HttpStatus.SC_NO_CONTENT)) {
OpenVidu.activeSessions.remove(this.sessionId); // depends on control dependency: [if], data = [none]
log.info("Session {} closed", this.sessionId); // depends on control dependency: [if], data = [none]
} else {
throw new OpenViduHttpException(statusCode);
}
} finally {
EntityUtils.consumeQuietly(response.getEntity());
}
} }
|
public class class_name {
public long calcEntryCount() {
long _count = 0;
for (Entry e : entries) {
while (e != null) {
_count++;
e = e.another;
}
}
return _count;
} }
|
public class class_name {
public long calcEntryCount() {
long _count = 0;
for (Entry e : entries) {
while (e != null) {
_count++; // depends on control dependency: [while], data = [none]
e = e.another; // depends on control dependency: [while], data = [none]
}
}
return _count;
} }
|
public class class_name {
public static DenseVector rand(final int size, final Random random) {
final DenseVector vec = new DenseVector(size);
for (int i = 0; i < size; ++i) {
vec.values[i] = random.nextDouble();
}
return vec;
} }
|
public class class_name {
public static DenseVector rand(final int size, final Random random) {
final DenseVector vec = new DenseVector(size);
for (int i = 0; i < size; ++i) {
vec.values[i] = random.nextDouble(); // depends on control dependency: [for], data = [i]
}
return vec;
} }
|
public class class_name {
@Override
public void make()
{
synchronized (this) {
if (CurrentTime.currentTime() < _lastMakeTime + 2000)
return;
try {
makeImpl();
} catch (Exception e) {
log.log(Level.FINER, e.toString(), e);
}
_lastMakeTime = CurrentTime.currentTime();
}
} }
|
public class class_name {
@Override
public void make()
{
synchronized (this) {
if (CurrentTime.currentTime() < _lastMakeTime + 2000)
return;
try {
makeImpl(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
log.log(Level.FINER, e.toString(), e);
} // depends on control dependency: [catch], data = [none]
_lastMakeTime = CurrentTime.currentTime();
}
} }
|
public class class_name {
protected void actionGoingToResources()
{
if (checker.canExtract())
{
for (final ExtractorListener listener : listeners)
{
listener.notifyStartExtraction(resourceType, resourceLocation);
}
state = ExtractorState.EXTRACTING;
}
} }
|
public class class_name {
protected void actionGoingToResources()
{
if (checker.canExtract())
{
for (final ExtractorListener listener : listeners)
{
listener.notifyStartExtraction(resourceType, resourceLocation); // depends on control dependency: [for], data = [listener]
}
state = ExtractorState.EXTRACTING; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public List<File> resolve(Request request) {
List<File> result;
String actual;
boolean variantSeen;
result = new ArrayList<File>();
variantSeen = false;
for (File file : files) {
if (file.getType().equals(request.type)) {
actual = file.getVariant();
if (actual == null) {
result.add(file);
} else {
variantSeen = true;
}
}
}
if (variantSeen) {
addVariant(request.type, getBest(request.type, request.variant), result);
}
return result;
} }
|
public class class_name {
public List<File> resolve(Request request) {
List<File> result;
String actual;
boolean variantSeen;
result = new ArrayList<File>();
variantSeen = false;
for (File file : files) {
if (file.getType().equals(request.type)) {
actual = file.getVariant(); // depends on control dependency: [if], data = [none]
if (actual == null) {
result.add(file); // depends on control dependency: [if], data = [none]
} else {
variantSeen = true; // depends on control dependency: [if], data = [none]
}
}
}
if (variantSeen) {
addVariant(request.type, getBest(request.type, request.variant), result); // depends on control dependency: [if], data = [none]
}
return result;
} }
|
public class class_name {
public EClass getIfcDocumentElectronicFormat() {
if (ifcDocumentElectronicFormatEClass == null) {
ifcDocumentElectronicFormatEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(166);
}
return ifcDocumentElectronicFormatEClass;
} }
|
public class class_name {
public EClass getIfcDocumentElectronicFormat() {
if (ifcDocumentElectronicFormatEClass == null) {
ifcDocumentElectronicFormatEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(166);
// depends on control dependency: [if], data = [none]
}
return ifcDocumentElectronicFormatEClass;
} }
|
public class class_name {
public void stopDrag() {
mPhysicsDragger.stopDrag();
mPhysicsContext.runOnPhysicsThread(new Runnable() {
@Override
public void run() {
if (mRigidBodyDragMe != null) {
NativePhysics3DWorld.stopDrag(getNative());
mRigidBodyDragMe = null;
}
}
});
} }
|
public class class_name {
public void stopDrag() {
mPhysicsDragger.stopDrag();
mPhysicsContext.runOnPhysicsThread(new Runnable() {
@Override
public void run() {
if (mRigidBodyDragMe != null) {
NativePhysics3DWorld.stopDrag(getNative()); // depends on control dependency: [if], data = [none]
mRigidBodyDragMe = null; // depends on control dependency: [if], data = [none]
}
}
});
} }
|
public class class_name {
public java.util.List<ConfigureShard> getReplicaConfiguration() {
if (replicaConfiguration == null) {
replicaConfiguration = new com.amazonaws.internal.SdkInternalList<ConfigureShard>();
}
return replicaConfiguration;
} }
|
public class class_name {
public java.util.List<ConfigureShard> getReplicaConfiguration() {
if (replicaConfiguration == null) {
replicaConfiguration = new com.amazonaws.internal.SdkInternalList<ConfigureShard>(); // depends on control dependency: [if], data = [none]
}
return replicaConfiguration;
} }
|
public class class_name {
@Override
public void invoke( final Request request, final Response response ) throws IOException, ServletException {
final String requestId = getURIWithQueryString( request );
if(!_enabled.get() || !_msmContext.equals(request.getContext())) {
getNext().invoke( request, response );
} else if ( _ignorePattern != null && _ignorePattern.matcher( requestId ).matches() ) {
if(_log.isDebugEnabled()) {
_log.debug( ">>>>>> Ignoring: " + requestId + " (requestedSessionId "+ request.getRequestedSessionId() +") ==================" );
}
try {
storeRequestThreadLocal( request );
request.setNote(REQUEST_IGNORED, Boolean.TRUE);
getNext().invoke( request, response );
} finally {
if(request.getNote(REQUEST_PROCESSED) == Boolean.TRUE) {
final String sessionId = getSessionId(request, response);
if(sessionId != null) {
_sessionBackupService.requestFinished(sessionId, requestId);
}
}
resetRequestThreadLocal();
}
if(_log.isDebugEnabled()) {
_log.debug( "<<<<<< Ignored: " + requestId + " ==================" );
}
} else {
request.setNote(REQUEST_PROCESS, Boolean.TRUE);
if ( _log.isDebugEnabled() ) {
_log.debug( ">>>>>> Request starting: " + requestId + " (requestedSessionId "+ request.getRequestedSessionId() +") ==================" );
}
try {
storeRequestThreadLocal( request );
getNext().invoke( request, response );
} finally {
final Boolean sessionIdChanged = (Boolean) request.getNote(SESSION_ID_CHANGED);
backupSession( request, response, sessionIdChanged == null ? false : sessionIdChanged.booleanValue() );
resetRequestThreadLocal();
}
if ( _log.isDebugEnabled() ) {
logDebugRequestSessionCookie( request );
logDebugResponseCookie( response );
_log.debug( "<<<<<< Request finished: " + requestId + " ==================" );
}
}
} }
|
public class class_name {
@Override
public void invoke( final Request request, final Response response ) throws IOException, ServletException {
final String requestId = getURIWithQueryString( request );
if(!_enabled.get() || !_msmContext.equals(request.getContext())) {
getNext().invoke( request, response );
} else if ( _ignorePattern != null && _ignorePattern.matcher( requestId ).matches() ) {
if(_log.isDebugEnabled()) {
_log.debug( ">>>>>> Ignoring: " + requestId + " (requestedSessionId "+ request.getRequestedSessionId() +") ==================" ); // depends on control dependency: [if], data = [none]
}
try {
storeRequestThreadLocal( request ); // depends on control dependency: [try], data = [none]
request.setNote(REQUEST_IGNORED, Boolean.TRUE); // depends on control dependency: [try], data = [none]
getNext().invoke( request, response ); // depends on control dependency: [try], data = [none]
} finally {
if(request.getNote(REQUEST_PROCESSED) == Boolean.TRUE) {
final String sessionId = getSessionId(request, response);
if(sessionId != null) {
_sessionBackupService.requestFinished(sessionId, requestId); // depends on control dependency: [if], data = [(sessionId]
}
}
resetRequestThreadLocal();
}
if(_log.isDebugEnabled()) {
_log.debug( "<<<<<< Ignored: " + requestId + " ==================" ); // depends on control dependency: [if], data = [none]
}
} else {
request.setNote(REQUEST_PROCESS, Boolean.TRUE);
if ( _log.isDebugEnabled() ) {
_log.debug( ">>>>>> Request starting: " + requestId + " (requestedSessionId "+ request.getRequestedSessionId() +") ==================" ); // depends on control dependency: [if], data = [none]
}
try {
storeRequestThreadLocal( request ); // depends on control dependency: [try], data = [none]
getNext().invoke( request, response ); // depends on control dependency: [try], data = [none]
} finally {
final Boolean sessionIdChanged = (Boolean) request.getNote(SESSION_ID_CHANGED);
backupSession( request, response, sessionIdChanged == null ? false : sessionIdChanged.booleanValue() );
resetRequestThreadLocal();
}
if ( _log.isDebugEnabled() ) {
logDebugRequestSessionCookie( request ); // depends on control dependency: [if], data = [none]
logDebugResponseCookie( response ); // depends on control dependency: [if], data = [none]
_log.debug( "<<<<<< Request finished: " + requestId + " ==================" ); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
protected boolean isPossibleFunctionType(int idx) {
if (idx < arguments.getArgumentCount()) {
XExpression argument = arguments.getArgument(idx);
if (argument instanceof XClosure) {
XClosure closure = (XClosure) argument;
LightweightTypeReference declaredType = arguments.getDeclaredTypeForLambda(idx);
if (declaredType != null && !declaredType.isType(Object.class)) {
CommonTypeComputationServices services = getState().getReferenceOwner().getServices();
JvmOperation operation = services.getFunctionTypes().findImplementingOperation(declaredType);
if (operation == null) {
return false;
}
if (closure.isExplicitSyntax() && closure.getDeclaredFormalParameters().size() != operation.getParameters().size()) {
return false;
}
}
}
}
return true;
} }
|
public class class_name {
protected boolean isPossibleFunctionType(int idx) {
if (idx < arguments.getArgumentCount()) {
XExpression argument = arguments.getArgument(idx);
if (argument instanceof XClosure) {
XClosure closure = (XClosure) argument;
LightweightTypeReference declaredType = arguments.getDeclaredTypeForLambda(idx);
if (declaredType != null && !declaredType.isType(Object.class)) {
CommonTypeComputationServices services = getState().getReferenceOwner().getServices();
JvmOperation operation = services.getFunctionTypes().findImplementingOperation(declaredType);
if (operation == null) {
return false; // depends on control dependency: [if], data = [none]
}
if (closure.isExplicitSyntax() && closure.getDeclaredFormalParameters().size() != operation.getParameters().size()) {
return false; // depends on control dependency: [if], data = [none]
}
}
}
}
return true;
} }
|
public class class_name {
public ReferSubscriber refer(Dialog dialog, SipURI referToUri, String eventId, long timeout,
ArrayList<Header> additionalHeaders, ArrayList<Header> replaceHeaders, String body) {
initErrorInfo();
if ((referToUri == null) || (dialog == null)) {
setReturnCode(INVALID_ARGUMENT);
setErrorMessage("Null referToUri or dialog");
return null;
}
ReferSubscriber sub = null;
try {
sub = new ReferSubscriber(dialog.getRemoteParty().getURI().toString(), referToUri, this,
dialog);
Request req = sub.createReferMessage(referToUri, eventId, null);
if (req != null) {
synchronized (refererList) {
refererList.add(sub);
}
if (sub.startSubscription(req, timeout, false, additionalHeaders, replaceHeaders,
body) == true) {
return sub;
}
}
setReturnCode(sub.getReturnCode());
setErrorMessage(sub.getErrorMessage());
setException(sub.getException());
} catch (Exception e) {
setReturnCode(SipSession.EXCEPTION_ENCOUNTERED);
setException(e);
setErrorMessage("Exception: " + e.getClass().getName() + ": " + e.getMessage());
}
if (sub != null) {
synchronized (refererList) {
refererList.remove(sub);
}
}
return null;
} }
|
public class class_name {
public ReferSubscriber refer(Dialog dialog, SipURI referToUri, String eventId, long timeout,
ArrayList<Header> additionalHeaders, ArrayList<Header> replaceHeaders, String body) {
initErrorInfo();
if ((referToUri == null) || (dialog == null)) {
setReturnCode(INVALID_ARGUMENT); // depends on control dependency: [if], data = [none]
setErrorMessage("Null referToUri or dialog"); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
ReferSubscriber sub = null;
try {
sub = new ReferSubscriber(dialog.getRemoteParty().getURI().toString(), referToUri, this,
dialog); // depends on control dependency: [try], data = [none]
Request req = sub.createReferMessage(referToUri, eventId, null);
if (req != null) {
synchronized (refererList) { // depends on control dependency: [if], data = [none]
refererList.add(sub);
}
if (sub.startSubscription(req, timeout, false, additionalHeaders, replaceHeaders,
body) == true) {
return sub; // depends on control dependency: [if], data = [none]
}
}
setReturnCode(sub.getReturnCode()); // depends on control dependency: [try], data = [none]
setErrorMessage(sub.getErrorMessage()); // depends on control dependency: [try], data = [none]
setException(sub.getException()); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
setReturnCode(SipSession.EXCEPTION_ENCOUNTERED);
setException(e);
setErrorMessage("Exception: " + e.getClass().getName() + ": " + e.getMessage());
} // depends on control dependency: [catch], data = [none]
if (sub != null) {
synchronized (refererList) { // depends on control dependency: [if], data = [none]
refererList.remove(sub);
}
}
return null;
} }
|
public class class_name {
@Override
public void removeByG_A(long groupId, boolean active) {
for (CommerceTaxMethod commerceTaxMethod : findByG_A(groupId, active,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceTaxMethod);
}
} }
|
public class class_name {
@Override
public void removeByG_A(long groupId, boolean active) {
for (CommerceTaxMethod commerceTaxMethod : findByG_A(groupId, active,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceTaxMethod); // depends on control dependency: [for], data = [commerceTaxMethod]
}
} }
|
public class class_name {
public Filters withChannels(Channel... channels) {
java.util.ArrayList<String> channelsCopy = new java.util.ArrayList<String>(channels.length);
for (Channel value : channels) {
channelsCopy.add(value.toString());
}
if (getChannels() == null) {
setChannels(channelsCopy);
} else {
getChannels().addAll(channelsCopy);
}
return this;
} }
|
public class class_name {
public Filters withChannels(Channel... channels) {
java.util.ArrayList<String> channelsCopy = new java.util.ArrayList<String>(channels.length);
for (Channel value : channels) {
channelsCopy.add(value.toString()); // depends on control dependency: [for], data = [value]
}
if (getChannels() == null) {
setChannels(channelsCopy); // depends on control dependency: [if], data = [none]
} else {
getChannels().addAll(channelsCopy); // depends on control dependency: [if], data = [none]
}
return this;
} }
|
public class class_name {
public void setLocalNetwork(String localNetwork) {
IPAddressType currNetworkType = IPAddressCompare.getAddressType(localNetwork);
this.currNetworkType = currNetworkType;
this.localNetworkString = localNetwork;
if (currNetworkType == IPAddressType.IPV4) {
this.localNetwork = IPAddressCompare.addressToByteArrayV4(localNetwork);
} else if (currNetworkType == IPAddressType.IPV6) {
this.localNetwork = IPAddressCompare.addressToByteArrayV6(localNetwork);
}
} }
|
public class class_name {
public void setLocalNetwork(String localNetwork) {
IPAddressType currNetworkType = IPAddressCompare.getAddressType(localNetwork);
this.currNetworkType = currNetworkType;
this.localNetworkString = localNetwork;
if (currNetworkType == IPAddressType.IPV4) {
this.localNetwork = IPAddressCompare.addressToByteArrayV4(localNetwork); // depends on control dependency: [if], data = [none]
} else if (currNetworkType == IPAddressType.IPV6) {
this.localNetwork = IPAddressCompare.addressToByteArrayV6(localNetwork); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void runScript(Connection conn, Reader reader) throws IOException,
SQLException {
StringBuffer command = null;
try {
LineNumberReader lineReader = new LineNumberReader(reader);
String line;
while ((line = lineReader.readLine()) != null) {
if (command == null) {
command = new StringBuffer();
}
String trimmedLine = line.trim();
final Matcher delimMatch = delimP.matcher(trimmedLine);
if (trimmedLine.length() < 1
|| trimmedLine.startsWith("//")) {
// Do nothing
} else if (delimMatch.matches()) {
setDelimiter(delimMatch.group(2), false);
} else if (trimmedLine.startsWith("--")) {
logger.debug(trimmedLine);
} else if (trimmedLine.length() < 1
|| trimmedLine.startsWith("--")) {
// Do nothing
} else if (!fullLineDelimiter
&& trimmedLine.endsWith(getDelimiter())
|| fullLineDelimiter
&& trimmedLine.equals(getDelimiter())) {
command.append(line.substring(0, line
.lastIndexOf(getDelimiter())));
command.append(" ");
this.execCommand(conn, command, lineReader);
command = null;
} else {
command.append(line);
command.append("\n");
}
}
if (command != null && command.length() > 0) {
this.execCommand(conn, command, lineReader);
}
if (!autoCommit) {
conn.commit();
}
}
catch (IOException e) {
throw new IOException(String.format("Error executing '%s': %s", command, e.getMessage()), e);
} finally {
conn.rollback();
}
} }
|
public class class_name {
private void runScript(Connection conn, Reader reader) throws IOException,
SQLException {
StringBuffer command = null;
try {
LineNumberReader lineReader = new LineNumberReader(reader);
String line;
while ((line = lineReader.readLine()) != null) {
if (command == null) {
command = new StringBuffer(); // depends on control dependency: [if], data = [none]
}
String trimmedLine = line.trim();
final Matcher delimMatch = delimP.matcher(trimmedLine);
if (trimmedLine.length() < 1
|| trimmedLine.startsWith("//")) {
// Do nothing
} else if (delimMatch.matches()) {
setDelimiter(delimMatch.group(2), false);
} else if (trimmedLine.startsWith("--")) {
logger.debug(trimmedLine);
} else if (trimmedLine.length() < 1
|| trimmedLine.startsWith("--")) {
// Do nothing
} else if (!fullLineDelimiter
&& trimmedLine.endsWith(getDelimiter())
|| fullLineDelimiter
&& trimmedLine.equals(getDelimiter())) {
command.append(line.substring(0, line
.lastIndexOf(getDelimiter())));
command.append(" ");
this.execCommand(conn, command, lineReader);
command = null;
} else {
command.append(line);
command.append("\n");
}
}
if (command != null && command.length() > 0) {
this.execCommand(conn, command, lineReader);
}
if (!autoCommit) {
conn.commit();
}
}
catch (IOException e) {
throw new IOException(String.format("Error executing '%s': %s", command, e.getMessage()), e);
} finally {
conn.rollback();
}
} }
|
public class class_name {
private static List<String> getAllInterfaceMethodInfo(List<InterfaceInfo> interfaceInfoList) {
List<String> names = new ArrayList<>();
if (interfaceInfoList == null || interfaceInfoList.isEmpty()){
return names;
}
interfaceInfoList.forEach((InterfaceInfo interfaceInfo) -> {
if (interfaceInfo.getMethodNames() != null && !interfaceInfo.getMethodNames().isEmpty()){
names.addAll(interfaceInfo.getMethodNames());
}
names.addAll(getAllInterfaceMethodInfo(interfaceInfo.getExtendedInterfaces()));
});
return names;
} }
|
public class class_name {
private static List<String> getAllInterfaceMethodInfo(List<InterfaceInfo> interfaceInfoList) {
List<String> names = new ArrayList<>();
if (interfaceInfoList == null || interfaceInfoList.isEmpty()){
return names; // depends on control dependency: [if], data = [none]
}
interfaceInfoList.forEach((InterfaceInfo interfaceInfo) -> {
if (interfaceInfo.getMethodNames() != null && !interfaceInfo.getMethodNames().isEmpty()){
names.addAll(interfaceInfo.getMethodNames());
}
names.addAll(getAllInterfaceMethodInfo(interfaceInfo.getExtendedInterfaces()));
});
return names;
} }
|
public class class_name {
@Override
public Integer generateKey(FacesContext facesContext)
{
ExternalContext externalContext = facesContext.getExternalContext();
Object sessionObj = externalContext.getSession(true);
Integer sequence = null;
// synchronized to increase sequence if multiple requests
// are handled at the same time for the session
synchronized (sessionObj)
{
Map<String, Object> map = externalContext.getSessionMap();
sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);
if (sequence == null || sequence.intValue() == Integer.MAX_VALUE)
{
sequence = Integer.valueOf(1);
}
else
{
sequence = Integer.valueOf(sequence.intValue() + 1);
}
map.put(RendererUtils.SEQUENCE_PARAM, sequence);
}
return sequence;
} }
|
public class class_name {
@Override
public Integer generateKey(FacesContext facesContext)
{
ExternalContext externalContext = facesContext.getExternalContext();
Object sessionObj = externalContext.getSession(true);
Integer sequence = null;
// synchronized to increase sequence if multiple requests
// are handled at the same time for the session
synchronized (sessionObj)
{
Map<String, Object> map = externalContext.getSessionMap();
sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);
if (sequence == null || sequence.intValue() == Integer.MAX_VALUE)
{
sequence = Integer.valueOf(1); // depends on control dependency: [if], data = [none]
}
else
{
sequence = Integer.valueOf(sequence.intValue() + 1); // depends on control dependency: [if], data = [(sequence]
}
map.put(RendererUtils.SEQUENCE_PARAM, sequence);
}
return sequence;
} }
|
public class class_name {
@Sensitive
protected String restoreHostNameToURL(@Sensitive String referrerURL, String url) {
if ((referrerURL.startsWith("/")) || (referrerURL.length() == 0)) {
int doubleSlash = url.indexOf("//");
int firstSingleSlash = url.indexOf("/", doubleSlash + 2);
referrerURL = url.substring(0, firstSingleSlash) + referrerURL;
} else {
try {
URL referrer = new URL(referrerURL);
String referrerHost = referrer.getHost();
if ((referrerHost == null) || (referrerHost.length() == 0)) {
URL currentURL = new URL(url);
String currentHost = currentURL.getHost();
int doubleSlash = referrerURL.indexOf("//");
StringBuffer newURLBuf = new StringBuffer(referrerURL);
newURLBuf.insert(doubleSlash + 2, currentHost);
referrerURL = newURLBuf.toString();
}
} catch (java.net.MalformedURLException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "restoreHostNameToURL", new Object[] { e });
}
}
}
return referrerURL;
} }
|
public class class_name {
@Sensitive
protected String restoreHostNameToURL(@Sensitive String referrerURL, String url) {
if ((referrerURL.startsWith("/")) || (referrerURL.length() == 0)) {
int doubleSlash = url.indexOf("//");
int firstSingleSlash = url.indexOf("/", doubleSlash + 2);
referrerURL = url.substring(0, firstSingleSlash) + referrerURL; // depends on control dependency: [if], data = [none]
} else {
try {
URL referrer = new URL(referrerURL);
String referrerHost = referrer.getHost();
if ((referrerHost == null) || (referrerHost.length() == 0)) {
URL currentURL = new URL(url);
String currentHost = currentURL.getHost();
int doubleSlash = referrerURL.indexOf("//");
StringBuffer newURLBuf = new StringBuffer(referrerURL);
newURLBuf.insert(doubleSlash + 2, currentHost); // depends on control dependency: [if], data = [none]
referrerURL = newURLBuf.toString(); // depends on control dependency: [if], data = [none]
}
} catch (java.net.MalformedURLException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "restoreHostNameToURL", new Object[] { e }); // depends on control dependency: [if], data = [none]
}
} // depends on control dependency: [catch], data = [none]
}
return referrerURL;
} }
|
public class class_name {
public void register(Class<? extends ValueReader> reader) {
Assert.notNull(reader, "Missing reader class!");
boolean registered = false;
Consumes found = reader.getAnnotation(Consumes.class);
if (found != null) {
MediaType[] consumes = MediaTypeHelper.getMediaTypes(found.value());
if (consumes != null && consumes.length > 0) {
for (MediaType type : consumes) {
register(type, reader);
}
}
registered = true;
}
Assert.isTrue(registered,
"Failed to register reader: '" + reader.getName() + "', missing @Consumes annotation!");
} }
|
public class class_name {
public void register(Class<? extends ValueReader> reader) {
Assert.notNull(reader, "Missing reader class!");
boolean registered = false;
Consumes found = reader.getAnnotation(Consumes.class);
if (found != null) {
MediaType[] consumes = MediaTypeHelper.getMediaTypes(found.value());
if (consumes != null && consumes.length > 0) {
for (MediaType type : consumes) {
register(type, reader); // depends on control dependency: [for], data = [type]
}
}
registered = true; // depends on control dependency: [if], data = [none]
}
Assert.isTrue(registered,
"Failed to register reader: '" + reader.getName() + "', missing @Consumes annotation!");
} }
|
public class class_name {
public ByteBuffer preProcessOneWriteBuffer() {
// We can process the single buffer case more efficiently than if we
// include it as a part of the multi-buffer logic
WsByteBufferImpl wsBuffImpl = null;
try {
wsBuffImpl = (WsByteBufferImpl) getBuffer();
} catch (ClassCastException cce) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Writing with a non-WsByteBufferImpl");
}
return getBuffer().getWrappedByteBuffer();
}
if (!wsBuffImpl.isDirect() && wsBuffImpl.hasArray()) {
wsBuffImpl.copyToDirectBuffer();
return wsBuffImpl.oWsBBDirect;
}
return wsBuffImpl.getWrappedByteBufferNonSafe();
} }
|
public class class_name {
public ByteBuffer preProcessOneWriteBuffer() {
// We can process the single buffer case more efficiently than if we
// include it as a part of the multi-buffer logic
WsByteBufferImpl wsBuffImpl = null;
try {
wsBuffImpl = (WsByteBufferImpl) getBuffer(); // depends on control dependency: [try], data = [none]
} catch (ClassCastException cce) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Writing with a non-WsByteBufferImpl"); // depends on control dependency: [if], data = [none]
}
return getBuffer().getWrappedByteBuffer();
} // depends on control dependency: [catch], data = [none]
if (!wsBuffImpl.isDirect() && wsBuffImpl.hasArray()) {
wsBuffImpl.copyToDirectBuffer(); // depends on control dependency: [if], data = [none]
return wsBuffImpl.oWsBBDirect; // depends on control dependency: [if], data = [none]
}
return wsBuffImpl.getWrappedByteBufferNonSafe();
} }
|
public class class_name {
public static String getContentType(Calendar calendar, Charset charset) {
final StringBuilder b = new StringBuilder("text/calendar");
final Method method = calendar.getProperty(Property.METHOD);
if (method != null) {
b.append("; method=");
b.append(method.getValue());
}
if (charset != null) {
b.append("; charset=");
b.append(charset);
}
return b.toString();
} }
|
public class class_name {
public static String getContentType(Calendar calendar, Charset charset) {
final StringBuilder b = new StringBuilder("text/calendar");
final Method method = calendar.getProperty(Property.METHOD);
if (method != null) {
b.append("; method="); // depends on control dependency: [if], data = [none]
b.append(method.getValue()); // depends on control dependency: [if], data = [(method]
}
if (charset != null) {
b.append("; charset="); // depends on control dependency: [if], data = [none]
b.append(charset); // depends on control dependency: [if], data = [(charset]
}
return b.toString();
} }
|
public class class_name {
public EClass getIfcGeometricRepresentationSubContext() {
if (ifcGeometricRepresentationSubContextEClass == null) {
ifcGeometricRepresentationSubContextEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(269);
}
return ifcGeometricRepresentationSubContextEClass;
} }
|
public class class_name {
public EClass getIfcGeometricRepresentationSubContext() {
if (ifcGeometricRepresentationSubContextEClass == null) {
ifcGeometricRepresentationSubContextEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(269);
// depends on control dependency: [if], data = [none]
}
return ifcGeometricRepresentationSubContextEClass;
} }
|
public class class_name {
protected void setupBeginTimeExp(StringBuilder sb, TransactionSavedRecentResult result) {
sb.append("(");
final Long beginMillis = result.getBeginMillis();
if (beginMillis != null) {
sb.append(toDateExp(beginMillis));
} else {
sb.append("*unknown time");
}
sb.append(")");
} }
|
public class class_name {
protected void setupBeginTimeExp(StringBuilder sb, TransactionSavedRecentResult result) {
sb.append("(");
final Long beginMillis = result.getBeginMillis();
if (beginMillis != null) {
sb.append(toDateExp(beginMillis)); // depends on control dependency: [if], data = [(beginMillis]
} else {
sb.append("*unknown time"); // depends on control dependency: [if], data = [none]
}
sb.append(")");
} }
|
public class class_name {
public List<String> getExtensionsWithDeps() {
if (extensionsWithDeps.isEmpty()) {
return Collections.emptyList();
}
List<String> extensionClassnames = new ArrayList<>(extensionsWithDeps.size());
for (ExtensionWithDeps extension : extensionsWithDeps) {
extensionClassnames.add(extension.getClassname());
}
return extensionClassnames;
} }
|
public class class_name {
public List<String> getExtensionsWithDeps() {
if (extensionsWithDeps.isEmpty()) {
return Collections.emptyList();
// depends on control dependency: [if], data = [none]
}
List<String> extensionClassnames = new ArrayList<>(extensionsWithDeps.size());
for (ExtensionWithDeps extension : extensionsWithDeps) {
extensionClassnames.add(extension.getClassname());
// depends on control dependency: [for], data = [extension]
}
return extensionClassnames;
} }
|
public class class_name {
private void justify() {
if (m_staffLines.size()>1) {
double maxWidth = ((JStaffLine)m_staffLines.elementAt(0)).getWidth();
for (int i=1; i<m_staffLines.size();i++){
JStaffLine currentStaffLine = (JStaffLine)m_staffLines.elementAt(i);
maxWidth = Math.max(maxWidth, currentStaffLine.getWidth());
}
for (int i=0; i<m_staffLines.size();i++) {
JStaffLine currentStaffLine = (JStaffLine)m_staffLines.elementAt(i);
if (currentStaffLine.getWidth()>maxWidth/2)
currentStaffLine.scaleToWidth(maxWidth);
}
}
} }
|
public class class_name {
private void justify() {
if (m_staffLines.size()>1) {
double maxWidth = ((JStaffLine)m_staffLines.elementAt(0)).getWidth();
for (int i=1; i<m_staffLines.size();i++){
JStaffLine currentStaffLine = (JStaffLine)m_staffLines.elementAt(i);
maxWidth = Math.max(maxWidth, currentStaffLine.getWidth());
// depends on control dependency: [for], data = [none]
}
for (int i=0; i<m_staffLines.size();i++) {
JStaffLine currentStaffLine = (JStaffLine)m_staffLines.elementAt(i);
if (currentStaffLine.getWidth()>maxWidth/2)
currentStaffLine.scaleToWidth(maxWidth);
}
}
} }
|
public class class_name {
public static void close(Socket socket) {
if (socket == null) {
return;
}
try {
socket.close();
} catch (IOException e) {
Logger.getLogger(IOUtil.class).finest("closeResource failed", e);
}
} }
|
public class class_name {
public static void close(Socket socket) {
if (socket == null) {
return; // depends on control dependency: [if], data = [none]
}
try {
socket.close(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
Logger.getLogger(IOUtil.class).finest("closeResource failed", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void addGoogRequire(GoogRequire require) {
GoogRequire oldRequire = googRequires.put(require.symbol(), require);
if (oldRequire != null) {
googRequires.put(require.symbol(), require.merge(oldRequire));
}
} }
|
public class class_name {
public void addGoogRequire(GoogRequire require) {
GoogRequire oldRequire = googRequires.put(require.symbol(), require);
if (oldRequire != null) {
googRequires.put(require.symbol(), require.merge(oldRequire)); // depends on control dependency: [if], data = [(oldRequire]
}
} }
|
public class class_name {
@Deprecated
@Override
public DERObject toASN1Object()
{
ASN1EncodableVector v = new ASN1EncodableVector();
// We only do policyIdentifier yet...
for (int i = 0; i < policies.size(); i++)
{
v.add(new DERSequence(policies.elementAt(i)));
}
return new DERSequence(v);
} }
|
public class class_name {
@Deprecated
@Override
public DERObject toASN1Object()
{
ASN1EncodableVector v = new ASN1EncodableVector();
// We only do policyIdentifier yet...
for (int i = 0; i < policies.size(); i++)
{
v.add(new DERSequence(policies.elementAt(i))); // depends on control dependency: [for], data = [i]
}
return new DERSequence(v);
} }
|
public class class_name {
public boolean hasNextFloat() {
setRadix(10);
boolean result = hasNext(floatPattern());
if (result) { // Cache it
try {
String s = processFloatToken(hasNextResult);
typeCache = Float.valueOf(Float.parseFloat(s));
} catch (NumberFormatException nfe) {
result = false;
}
}
return result;
} }
|
public class class_name {
public boolean hasNextFloat() {
setRadix(10);
boolean result = hasNext(floatPattern());
if (result) { // Cache it
try {
String s = processFloatToken(hasNextResult);
typeCache = Float.valueOf(Float.parseFloat(s)); // depends on control dependency: [try], data = [none]
} catch (NumberFormatException nfe) {
result = false;
} // depends on control dependency: [catch], data = [none]
}
return result;
} }
|
public class class_name {
private int synchroizeTaskIDToHierarchy(Task parentTask, int currentID)
{
for (Task task : parentTask.getChildTasks())
{
task.setID(Integer.valueOf(currentID++));
add(task);
currentID = synchroizeTaskIDToHierarchy(task, currentID);
}
return currentID;
} }
|
public class class_name {
private int synchroizeTaskIDToHierarchy(Task parentTask, int currentID)
{
for (Task task : parentTask.getChildTasks())
{
task.setID(Integer.valueOf(currentID++)); // depends on control dependency: [for], data = [task]
add(task); // depends on control dependency: [for], data = [task]
currentID = synchroizeTaskIDToHierarchy(task, currentID); // depends on control dependency: [for], data = [task]
}
return currentID;
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.