code stringlengths 130 281k | code_dependency stringlengths 182 306k |
|---|---|
public class class_name {
public BooleanConditionBuilder must(ConditionBuilder... conditionBuilders) {
if (must == null) {
must = new ArrayList<>(conditionBuilders.length);
}
for (ConditionBuilder conditionBuilder : conditionBuilders) {
must.add(conditionBuilder.build());
}
return this;
} } | public class class_name {
public BooleanConditionBuilder must(ConditionBuilder... conditionBuilders) {
if (must == null) {
must = new ArrayList<>(conditionBuilders.length); // depends on control dependency: [if], data = [none]
}
for (ConditionBuilder conditionBuilder : conditionBuilders) {
must.add(conditionBuilder.build()); // depends on control dependency: [for], data = [conditionBuilder]
}
return this;
} } |
public class class_name {
protected Map<JvmIdentifiableElement, LightweightTypeReference> getFlattenedReassignedTypes() {
if (reassignedTypes == null || reassignedTypes.isEmpty()) {
return null;
}
if (reassignedTypes.size() == 1) {
Map.Entry<JvmIdentifiableElement, LightweightTypeReference> singleEntry = reassignedTypes.entrySet().iterator().next();
return Collections.singletonMap(singleEntry.getKey(), singleEntry.getValue());
}
return new HashMap<JvmIdentifiableElement, LightweightTypeReference>(reassignedTypes);
} } | public class class_name {
protected Map<JvmIdentifiableElement, LightweightTypeReference> getFlattenedReassignedTypes() {
if (reassignedTypes == null || reassignedTypes.isEmpty()) {
return null; // depends on control dependency: [if], data = [none]
}
if (reassignedTypes.size() == 1) {
Map.Entry<JvmIdentifiableElement, LightweightTypeReference> singleEntry = reassignedTypes.entrySet().iterator().next();
return Collections.singletonMap(singleEntry.getKey(), singleEntry.getValue()); // depends on control dependency: [if], data = [none]
}
return new HashMap<JvmIdentifiableElement, LightweightTypeReference>(reassignedTypes);
} } |
public class class_name {
public static String deCodeFileContent(Map<String, String> resData,String fileDirectory,String encoding) {
// 解析返回文件
String filePath = null;
String fileContent = resData.get(SDKConstants.param_fileContent);
if (null != fileContent && !"".equals(fileContent)) {
FileOutputStream out = null;
try {
byte[] fileArray = SDKUtil.inflater(SecureUtil
.base64Decode(fileContent.getBytes(encoding)));
if (SDKUtil.isEmpty(resData.get("fileName"))) {
filePath = fileDirectory + File.separator + resData.get("merId")
+ "_" + resData.get("batchNo") + "_"
+ resData.get("txnTime") + ".txt";
} else {
filePath = fileDirectory + File.separator + resData.get("fileName");
}
File file = new File(filePath);
if (file.exists()) {
file.delete();
}
file.createNewFile();
out = new FileOutputStream(file);
out.write(fileArray, 0, fileArray.length);
out.flush();
} catch (UnsupportedEncodingException e) {
LogUtil.writeErrorLog(e.getMessage(), e);
} catch (IOException e) {
LogUtil.writeErrorLog(e.getMessage(), e);
}finally{
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return filePath;
} } | public class class_name {
public static String deCodeFileContent(Map<String, String> resData,String fileDirectory,String encoding) {
// 解析返回文件
String filePath = null;
String fileContent = resData.get(SDKConstants.param_fileContent);
if (null != fileContent && !"".equals(fileContent)) {
FileOutputStream out = null;
try {
byte[] fileArray = SDKUtil.inflater(SecureUtil
.base64Decode(fileContent.getBytes(encoding)));
if (SDKUtil.isEmpty(resData.get("fileName"))) {
filePath = fileDirectory + File.separator + resData.get("merId")
+ "_" + resData.get("batchNo") + "_"
+ resData.get("txnTime") + ".txt"; // depends on control dependency: [if], data = [none]
} else {
filePath = fileDirectory + File.separator + resData.get("fileName"); // depends on control dependency: [if], data = [none]
}
File file = new File(filePath);
if (file.exists()) {
file.delete(); // depends on control dependency: [if], data = [none]
}
file.createNewFile(); // depends on control dependency: [try], data = [none]
out = new FileOutputStream(file); // depends on control dependency: [try], data = [none]
out.write(fileArray, 0, fileArray.length); // depends on control dependency: [try], data = [none]
out.flush(); // depends on control dependency: [try], data = [none]
} catch (UnsupportedEncodingException e) {
LogUtil.writeErrorLog(e.getMessage(), e);
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
LogUtil.writeErrorLog(e.getMessage(), e);
}finally{ // depends on control dependency: [catch], data = [none]
try {
out.close(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
}
}
return filePath;
} } |
public class class_name {
private void populateFaultInCDC(CDCQueryResult cdcQueryResult, QueryResult queryResult) {
if (queryResult != null) {
Fault fault = queryResult.getFault();
if (fault != null) {
cdcQueryResult.setFalut(fault);
}
}
} } | public class class_name {
private void populateFaultInCDC(CDCQueryResult cdcQueryResult, QueryResult queryResult) {
if (queryResult != null) {
Fault fault = queryResult.getFault();
if (fault != null) {
cdcQueryResult.setFalut(fault); // depends on control dependency: [if], data = [(fault]
}
}
} } |
public class class_name {
@Override
public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) throws IOException {
List<IAtomType> atomTypes;
if (ins == null) throw new IOException("There was a problem getting an input stream");
OWLAtomTypeReader reader = new OWLAtomTypeReader(new InputStreamReader(ins));
atomTypes = reader.readAtomTypes(builder);
for (IAtomType atomType : atomTypes) {
if (atomType == null) {
logger.debug("Expecting an object but found null!");
}
}
return atomTypes;
} } | public class class_name {
@Override
public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) throws IOException {
List<IAtomType> atomTypes;
if (ins == null) throw new IOException("There was a problem getting an input stream");
OWLAtomTypeReader reader = new OWLAtomTypeReader(new InputStreamReader(ins));
atomTypes = reader.readAtomTypes(builder);
for (IAtomType atomType : atomTypes) {
if (atomType == null) {
logger.debug("Expecting an object but found null!"); // depends on control dependency: [if], data = [none]
}
}
return atomTypes;
} } |
public class class_name {
public synchronized void reset() {
ensureOpen();
encodedBuf.clear();
if (decodedBuf.capacity() > FilteredConstants.DEFAULT_DECODER_CAPACITY) {
this.decodedBuf = CharBuffer.allocate(FilteredConstants.DEFAULT_DECODER_CAPACITY);
} else {
decodedBuf.clear();
}
decoder.reset();
} } | public class class_name {
public synchronized void reset() {
ensureOpen();
encodedBuf.clear();
if (decodedBuf.capacity() > FilteredConstants.DEFAULT_DECODER_CAPACITY) {
this.decodedBuf = CharBuffer.allocate(FilteredConstants.DEFAULT_DECODER_CAPACITY); // depends on control dependency: [if], data = [FilteredConstants.DEFAULT_DECODER_CAPACITY)]
} else {
decodedBuf.clear(); // depends on control dependency: [if], data = [none]
}
decoder.reset();
} } |
public class class_name {
public void visitEnd() {
String classname = workbench.getType().getClassName();
component.addAttribute(new Attribute("classname", classname));
// Generates the provides attribute.
component.addElement(ElementHelper.getProvidesElement(null));
// Detect that Controller is implemented
if (!workbench.getClassNode().interfaces.contains(Type.getInternalName(Controller.class))
&& !Type.getInternalName(DefaultController.class).equals(workbench.getClassNode().superName)) {
reporter.warn("Cannot ensure that the class " + workbench.getType().getClassName() + " implements the " +
Controller.class.getName() + " interface.");
}
if (workbench.getRoot() == null) {
workbench.setRoot(component);
// Add the instance
workbench.setInstance(ElementHelper.declareInstance(workbench));
} else {
// Error case: 2 component type's annotations (@Component and @Handler for example) on the same class
reporter.error("Multiple 'component type' annotations on the class '{%s}'.", classname);
reporter.warn("@Controller is ignored.");
}
} } | public class class_name {
public void visitEnd() {
String classname = workbench.getType().getClassName();
component.addAttribute(new Attribute("classname", classname));
// Generates the provides attribute.
component.addElement(ElementHelper.getProvidesElement(null));
// Detect that Controller is implemented
if (!workbench.getClassNode().interfaces.contains(Type.getInternalName(Controller.class))
&& !Type.getInternalName(DefaultController.class).equals(workbench.getClassNode().superName)) {
reporter.warn("Cannot ensure that the class " + workbench.getType().getClassName() + " implements the " +
Controller.class.getName() + " interface."); // depends on control dependency: [if], data = [none]
}
if (workbench.getRoot() == null) {
workbench.setRoot(component); // depends on control dependency: [if], data = [none]
// Add the instance
workbench.setInstance(ElementHelper.declareInstance(workbench)); // depends on control dependency: [if], data = [none]
} else {
// Error case: 2 component type's annotations (@Component and @Handler for example) on the same class
reporter.error("Multiple 'component type' annotations on the class '{%s}'.", classname); // depends on control dependency: [if], data = [none]
reporter.warn("@Controller is ignored."); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static byte[] getRawAddress(final String ipv4Address) {
final Matcher m = IPV4_ADDRESS.matcher(ipv4Address);
if (!m.find()) {
return null;
}
final byte[] addr = new byte[4];
for (int i = 0; i < 4; i++) {
final int intVal = Integer.parseInt(m.group(i+1)) & 0x00ff;
addr[i] = (byte) intVal;
}
return addr;
} } | public class class_name {
public static byte[] getRawAddress(final String ipv4Address) {
final Matcher m = IPV4_ADDRESS.matcher(ipv4Address);
if (!m.find()) {
return null; // depends on control dependency: [if], data = [none]
}
final byte[] addr = new byte[4];
for (int i = 0; i < 4; i++) {
final int intVal = Integer.parseInt(m.group(i+1)) & 0x00ff;
addr[i] = (byte) intVal; // depends on control dependency: [for], data = [i]
}
return addr;
} } |
public class class_name {
private static Object createAndPopulateVarArgsArray(Class<?> varArgsType, int varArgsStartPosition,
Object... arguments) {
Object arrayInstance = Array.newInstance(varArgsType, arguments.length - varArgsStartPosition);
for (int i = varArgsStartPosition; i < arguments.length; i++) {
Array.set(arrayInstance, i - varArgsStartPosition, arguments[i]);
}
return arrayInstance;
} } | public class class_name {
private static Object createAndPopulateVarArgsArray(Class<?> varArgsType, int varArgsStartPosition,
Object... arguments) {
Object arrayInstance = Array.newInstance(varArgsType, arguments.length - varArgsStartPosition);
for (int i = varArgsStartPosition; i < arguments.length; i++) {
Array.set(arrayInstance, i - varArgsStartPosition, arguments[i]); // depends on control dependency: [for], data = [i]
}
return arrayInstance;
} } |
public class class_name {
public synchronized void registerComponent(Class<?> _clazz) {
if (_clazz == null) {
return;
}
if (isIncluded(_clazz.getName()) || _clazz.getName().equals(this.getClass().getName())) {
String classVersion = getVersionWithReflection(_clazz);
if (classVersion != null) {
componentVersions.put(_clazz.getName(), classVersion);
}
}
} } | public class class_name {
public synchronized void registerComponent(Class<?> _clazz) {
if (_clazz == null) {
return; // depends on control dependency: [if], data = [none]
}
if (isIncluded(_clazz.getName()) || _clazz.getName().equals(this.getClass().getName())) {
String classVersion = getVersionWithReflection(_clazz);
if (classVersion != null) {
componentVersions.put(_clazz.getName(), classVersion); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
@Override
public int getPlacementForestIndex(DocumentURI uri) {
int idx = 0;
try {
idx = popAndInsert();
} catch (InterruptedException e) {
LOG.error("Statistical assignment gets interrupted");
}
return idx;
} } | public class class_name {
@Override
public int getPlacementForestIndex(DocumentURI uri) {
int idx = 0;
try {
idx = popAndInsert(); // depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
LOG.error("Statistical assignment gets interrupted");
} // depends on control dependency: [catch], data = [none]
return idx;
} } |
public class class_name {
public synchronized ListenableFuture<PagesSpatialIndex> createPagesSpatialIndex()
{
activeProbeOperators.retain();
if (pagesSpatialIndex != null) {
return immediateFuture(pagesSpatialIndex.get());
}
SettableFuture<PagesSpatialIndex> future = SettableFuture.create();
pagesSpatialIndexFutures.add(future);
return future;
} } | public class class_name {
public synchronized ListenableFuture<PagesSpatialIndex> createPagesSpatialIndex()
{
activeProbeOperators.retain();
if (pagesSpatialIndex != null) {
return immediateFuture(pagesSpatialIndex.get()); // depends on control dependency: [if], data = [(pagesSpatialIndex]
}
SettableFuture<PagesSpatialIndex> future = SettableFuture.create();
pagesSpatialIndexFutures.add(future);
return future;
} } |
public class class_name {
public static <V extends NumberVector> V randomVector(NumberVector.Factory<V> factory, int dim, Random r) {
double[] data = new double[dim];
for(int i = 0; i < dim; i++) {
data[i] = r.nextDouble();
}
return factory.newNumberVector(data);
} } | public class class_name {
public static <V extends NumberVector> V randomVector(NumberVector.Factory<V> factory, int dim, Random r) {
double[] data = new double[dim];
for(int i = 0; i < dim; i++) {
data[i] = r.nextDouble(); // depends on control dependency: [for], data = [i]
}
return factory.newNumberVector(data);
} } |
public class class_name {
@Override
public void send(MidiMessage message, long timeStamp) {
if (this.launchpadReceiver != null && message instanceof ShortMessage) {
ShortMessage sm = (ShortMessage) message;
Pad pad = Pad.findMidi(sm);
if (pad != null) {
this.launchpadReceiver.receive(pad);
}
}
} } | public class class_name {
@Override
public void send(MidiMessage message, long timeStamp) {
if (this.launchpadReceiver != null && message instanceof ShortMessage) {
ShortMessage sm = (ShortMessage) message;
Pad pad = Pad.findMidi(sm);
if (pad != null) {
this.launchpadReceiver.receive(pad); // depends on control dependency: [if], data = [(pad]
}
}
} } |
public class class_name {
public static void setReflectedEntityCacheDisabled(boolean disableReflectedEntityCache) {
if (TableServiceEntity.reflectedEntityCache != null && disableReflectedEntityCache) {
TableServiceEntity.reflectedEntityCache.clear();
}
TableServiceEntity.disableReflectedEntityCache = disableReflectedEntityCache;
} } | public class class_name {
public static void setReflectedEntityCacheDisabled(boolean disableReflectedEntityCache) {
if (TableServiceEntity.reflectedEntityCache != null && disableReflectedEntityCache) {
TableServiceEntity.reflectedEntityCache.clear(); // depends on control dependency: [if], data = [none]
}
TableServiceEntity.disableReflectedEntityCache = disableReflectedEntityCache;
} } |
public class class_name {
public static boolean portAvailable(int port) {
if (port < MIN_PORT || port > MAX_PORT) {
throw new InvalidArgument("port is out of range");
}
ServerSocket ss = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port);
ss.setReuseAddress(true);
ds = new DatagramSocket(port);
ds.setReuseAddress(true);
return true;
} catch (IOException e) {
// Do nothing
} finally {
if (ds != null) {
ds.close();
}
if (ss != null) {
try {
ss.close();
} catch (IOException e) {
/* should not be thrown */
}
}
}
return false;
} } | public class class_name {
public static boolean portAvailable(int port) {
if (port < MIN_PORT || port > MAX_PORT) {
throw new InvalidArgument("port is out of range");
}
ServerSocket ss = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port); // depends on control dependency: [try], data = [none]
ss.setReuseAddress(true); // depends on control dependency: [try], data = [none]
ds = new DatagramSocket(port); // depends on control dependency: [try], data = [none]
ds.setReuseAddress(true); // depends on control dependency: [try], data = [none]
return true; // depends on control dependency: [try], data = [none]
} catch (IOException e) {
// Do nothing
} finally { // depends on control dependency: [catch], data = [none]
if (ds != null) {
ds.close(); // depends on control dependency: [if], data = [none]
}
if (ss != null) {
try {
ss.close(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
/* should not be thrown */
} // depends on control dependency: [catch], data = [none]
}
}
return false;
} } |
public class class_name {
public ServiceFuture<List<NodeFile>> listFromComputeNodeAsync(final String poolId, final String nodeId, final Boolean recursive, final FileListFromComputeNodeOptions fileListFromComputeNodeOptions, final ListOperationCallback<NodeFile> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listFromComputeNodeSinglePageAsync(poolId, nodeId, recursive, fileListFromComputeNodeOptions),
new Func1<String, Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders>>>() {
@Override
public Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders>> call(String nextPageLink) {
FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = null;
if (fileListFromComputeNodeOptions != null) {
fileListFromComputeNodeNextOptions = new FileListFromComputeNodeNextOptions();
fileListFromComputeNodeNextOptions.withClientRequestId(fileListFromComputeNodeOptions.clientRequestId());
fileListFromComputeNodeNextOptions.withReturnClientRequestId(fileListFromComputeNodeOptions.returnClientRequestId());
fileListFromComputeNodeNextOptions.withOcpDate(fileListFromComputeNodeOptions.ocpDate());
}
return listFromComputeNodeNextSinglePageAsync(nextPageLink, fileListFromComputeNodeNextOptions);
}
},
serviceCallback);
} } | public class class_name {
public ServiceFuture<List<NodeFile>> listFromComputeNodeAsync(final String poolId, final String nodeId, final Boolean recursive, final FileListFromComputeNodeOptions fileListFromComputeNodeOptions, final ListOperationCallback<NodeFile> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listFromComputeNodeSinglePageAsync(poolId, nodeId, recursive, fileListFromComputeNodeOptions),
new Func1<String, Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders>>>() {
@Override
public Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders>> call(String nextPageLink) {
FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = null;
if (fileListFromComputeNodeOptions != null) {
fileListFromComputeNodeNextOptions = new FileListFromComputeNodeNextOptions(); // depends on control dependency: [if], data = [none]
fileListFromComputeNodeNextOptions.withClientRequestId(fileListFromComputeNodeOptions.clientRequestId()); // depends on control dependency: [if], data = [(fileListFromComputeNodeOptions]
fileListFromComputeNodeNextOptions.withReturnClientRequestId(fileListFromComputeNodeOptions.returnClientRequestId()); // depends on control dependency: [if], data = [(fileListFromComputeNodeOptions]
fileListFromComputeNodeNextOptions.withOcpDate(fileListFromComputeNodeOptions.ocpDate()); // depends on control dependency: [if], data = [(fileListFromComputeNodeOptions]
}
return listFromComputeNodeNextSinglePageAsync(nextPageLink, fileListFromComputeNodeNextOptions);
}
},
serviceCallback);
} } |
public class class_name {
protected String prepareEntryName(final String name, final boolean isClass) {
String entryName = name;
if (isClass) {
entryName = name.substring(0, name.length() - 6); // 6 == ".class".length()
entryName = StringUtil.replaceChar(entryName, '/', '.');
entryName = StringUtil.replaceChar(entryName, '\\', '.');
} else {
entryName = '/' + StringUtil.replaceChar(entryName, '\\', '/');
}
return entryName;
} } | public class class_name {
protected String prepareEntryName(final String name, final boolean isClass) {
String entryName = name;
if (isClass) {
entryName = name.substring(0, name.length() - 6); // 6 == ".class".length() // depends on control dependency: [if], data = [none]
entryName = StringUtil.replaceChar(entryName, '/', '.'); // depends on control dependency: [if], data = [none]
entryName = StringUtil.replaceChar(entryName, '\\', '.'); // depends on control dependency: [if], data = [none]
} else {
entryName = '/' + StringUtil.replaceChar(entryName, '\\', '/'); // depends on control dependency: [if], data = [none]
}
return entryName;
} } |
public class class_name {
public java.util.List<OptionSpecification> getOptionsToRemove() {
if (optionsToRemove == null) {
optionsToRemove = new com.amazonaws.internal.SdkInternalList<OptionSpecification>();
}
return optionsToRemove;
} } | public class class_name {
public java.util.List<OptionSpecification> getOptionsToRemove() {
if (optionsToRemove == null) {
optionsToRemove = new com.amazonaws.internal.SdkInternalList<OptionSpecification>(); // depends on control dependency: [if], data = [none]
}
return optionsToRemove;
} } |
public class class_name {
@Override
public void putAll(final Collection<T> values) {
if (values == null || values.size() == 0) {
return;
}
for (final T value : values) {
put(value);
}
} } | public class class_name {
@Override
public void putAll(final Collection<T> values) {
if (values == null || values.size() == 0) {
return; // depends on control dependency: [if], data = [none]
}
for (final T value : values) {
put(value); // depends on control dependency: [for], data = [value]
}
} } |
public class class_name {
public static HttpResponse executeGet(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final Map<String, Object> parameters) {
try {
return executeGet(url, basicAuthUsername, basicAuthPassword, parameters, new HashMap<>());
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
}
return null;
} } | public class class_name {
public static HttpResponse executeGet(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final Map<String, Object> parameters) {
try {
return executeGet(url, basicAuthUsername, basicAuthPassword, parameters, new HashMap<>()); // depends on control dependency: [try], data = [none]
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
return null;
} } |
public class class_name {
public static GraphicalModel readFromProto(GraphicalModelProto.GraphicalModel proto) {
if (proto == null) return null;
GraphicalModel model = new GraphicalModel();
model.modelMetaData = readMetaDataFromProto(proto.getMetaData());
model.variableMetaData = new ArrayList<>();
for (int i = 0; i < proto.getVariableMetaDataCount(); i++) {
model.variableMetaData.add(readMetaDataFromProto(proto.getVariableMetaData(i)));
}
for (int i = 0; i < proto.getFactorCount(); i++) {
model.factors.add(Factor.readFromProto(proto.getFactor(i)));
}
return model;
} } | public class class_name {
public static GraphicalModel readFromProto(GraphicalModelProto.GraphicalModel proto) {
if (proto == null) return null;
GraphicalModel model = new GraphicalModel();
model.modelMetaData = readMetaDataFromProto(proto.getMetaData());
model.variableMetaData = new ArrayList<>();
for (int i = 0; i < proto.getVariableMetaDataCount(); i++) {
model.variableMetaData.add(readMetaDataFromProto(proto.getVariableMetaData(i))); // depends on control dependency: [for], data = [i]
}
for (int i = 0; i < proto.getFactorCount(); i++) {
model.factors.add(Factor.readFromProto(proto.getFactor(i))); // depends on control dependency: [for], data = [i]
}
return model;
} } |
public class class_name {
public void free()
{
super.free(); // Free first in case you have to Update() the current record!
while (m_LinkageList.size() > 0)
{
TableLink tableLink = (TableLink)m_LinkageList.elementAt(0);
tableLink.free();
}
m_LinkageList.removeAllElements();
m_LinkageList = null;
m_vRecordList.free(); // Free all the records
m_vRecordList = null;
} } | public class class_name {
public void free()
{
super.free(); // Free first in case you have to Update() the current record!
while (m_LinkageList.size() > 0)
{
TableLink tableLink = (TableLink)m_LinkageList.elementAt(0);
tableLink.free(); // depends on control dependency: [while], data = [none]
}
m_LinkageList.removeAllElements();
m_LinkageList = null;
m_vRecordList.free(); // Free all the records
m_vRecordList = null;
} } |
public class class_name {
protected static void deleteDir(File dir) {
String files[] = dir.list();
if (files == null) {
files = new String[0];
}
for (int i = 0; i < files.length; i++) {
File file = new File(dir, files[i]);
if (file.isDirectory()) {
deleteDir(file);
} else {
try {
file.delete();
} catch (SecurityException se) {
log.error("The file " + file.getAbsolutePath() + " couldn't be deleted");
}
}
}
try {
dir.delete();
} catch (SecurityException se) {
log.error("The directory " + dir.getAbsolutePath() + " couldn't be deleted");
}
} } | public class class_name {
protected static void deleteDir(File dir) {
String files[] = dir.list();
if (files == null) {
files = new String[0]; // depends on control dependency: [if], data = [none]
}
for (int i = 0; i < files.length; i++) {
File file = new File(dir, files[i]);
if (file.isDirectory()) {
deleteDir(file); // depends on control dependency: [if], data = [none]
} else {
try {
file.delete(); // depends on control dependency: [try], data = [none]
} catch (SecurityException se) {
log.error("The file " + file.getAbsolutePath() + " couldn't be deleted");
}
}
}
try {
dir.delete();
} catch (SecurityException se) {
log.error("The directory " + dir.getAbsolutePath() + " couldn't be deleted");
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
@Override
public Node getParentNode(String parentNodeId)
{
NodeLink link = new NodeLink(parentNodeId, getNodeId());
if (this.parents == null)
{
return null;
}
else
{
return this.parents.get(link);
}
} } | public class class_name {
@Override
public Node getParentNode(String parentNodeId)
{
NodeLink link = new NodeLink(parentNodeId, getNodeId());
if (this.parents == null)
{
return null; // depends on control dependency: [if], data = [none]
}
else
{
return this.parents.get(link); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public String getInnerHtml() {
LagartoDomBuilderConfig lagartoDomBuilderConfig;
if (ownerDocument == null) {
lagartoDomBuilderConfig = ((Document) this).getConfig();
} else {
lagartoDomBuilderConfig = ownerDocument.getConfig();
}
LagartoHtmlRenderer lagartoHtmlRenderer =
lagartoDomBuilderConfig.getLagartoHtmlRenderer();
return lagartoHtmlRenderer.toInnerHtml(this, new StringBuilder());
} } | public class class_name {
public String getInnerHtml() {
LagartoDomBuilderConfig lagartoDomBuilderConfig;
if (ownerDocument == null) {
lagartoDomBuilderConfig = ((Document) this).getConfig(); // depends on control dependency: [if], data = [none]
} else {
lagartoDomBuilderConfig = ownerDocument.getConfig(); // depends on control dependency: [if], data = [none]
}
LagartoHtmlRenderer lagartoHtmlRenderer =
lagartoDomBuilderConfig.getLagartoHtmlRenderer();
return lagartoHtmlRenderer.toInnerHtml(this, new StringBuilder());
} } |
public class class_name {
public IsNullValue markInformationAsComingFromReturnValueOfMethod(XMethod methodInvoked) {
FieldDescriptor fieldDescriptor = methodInvoked.getAccessMethodForField();
if (fieldDescriptor != null) {
XField f = XFactory.getExactXField(fieldDescriptor);
return markInformationAsComingFromFieldValue(f);
}
int flag = RETURN_VAL;
if ("readLine".equals(methodInvoked.getName()) && "()Ljava/lang/String;".equals(methodInvoked.getSignature())) {
flag = READLINE_VAL;
}
if (getBaseKind() == NO_KABOOM_NN) {
return new IsNullValue(kind | flag, locationOfKaBoom);
}
return instanceByFlagsList[(getFlags() | flag) >> FLAG_SHIFT][getBaseKind()];
} } | public class class_name {
public IsNullValue markInformationAsComingFromReturnValueOfMethod(XMethod methodInvoked) {
FieldDescriptor fieldDescriptor = methodInvoked.getAccessMethodForField();
if (fieldDescriptor != null) {
XField f = XFactory.getExactXField(fieldDescriptor);
return markInformationAsComingFromFieldValue(f); // depends on control dependency: [if], data = [none]
}
int flag = RETURN_VAL;
if ("readLine".equals(methodInvoked.getName()) && "()Ljava/lang/String;".equals(methodInvoked.getSignature())) {
flag = READLINE_VAL;
}
if (getBaseKind() == NO_KABOOM_NN) {
return new IsNullValue(kind | flag, locationOfKaBoom);
}
return instanceByFlagsList[(getFlags() | flag) >> FLAG_SHIFT][getBaseKind()];
} } |
public class class_name {
private void parseParameterUndefinedOption(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) {
if (END_OPTIONS.equals(parameter)) {
parserState.setOptionsComplete();
return;
}
CliStyleHandling handling = this.cliState.getCliStyle().optionMixedShortForm();
Matcher matcher = PATTERN_MIXED_SHORT_OPTIONS.matcher(parameter);
if (matcher.matches()) {
// "-vlp" --> "-v", "-l", "-p"
RuntimeException mixedOptions = null;
if (handling != CliStyleHandling.OK) {
// TODO: declare proper exception for this purpose...
mixedOptions = new NlsIllegalArgumentException("Mixed options (" + parameter + ") should be avoided.");
}
handling.handle(getLogger(), mixedOptions);
String multiOptions = matcher.group(1);
for (int i = 0; i < multiOptions.length(); i++) {
String subArgument = PREFIX_SHORT_OPTION + multiOptions.charAt(i);
parseParameter(subArgument, parserState, CliParameterConsumer.EMPTY_INSTANCE);
}
} else if (parameter.startsWith(PREFIX_SHORT_OPTION)) {
throw new CliOptionUndefinedException(parameter);
} else {
// so it seems the options are completed and this is a regular argument
parserState.setOptionsComplete();
parseParameter(parameter, parserState, parameterConsumer);
}
} } | public class class_name {
private void parseParameterUndefinedOption(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) {
if (END_OPTIONS.equals(parameter)) {
parserState.setOptionsComplete(); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
CliStyleHandling handling = this.cliState.getCliStyle().optionMixedShortForm();
Matcher matcher = PATTERN_MIXED_SHORT_OPTIONS.matcher(parameter);
if (matcher.matches()) {
// "-vlp" --> "-v", "-l", "-p"
RuntimeException mixedOptions = null;
if (handling != CliStyleHandling.OK) {
// TODO: declare proper exception for this purpose...
mixedOptions = new NlsIllegalArgumentException("Mixed options (" + parameter + ") should be avoided.");
}
handling.handle(getLogger(), mixedOptions); // depends on control dependency: [if], data = [none]
String multiOptions = matcher.group(1);
for (int i = 0; i < multiOptions.length(); i++) {
String subArgument = PREFIX_SHORT_OPTION + multiOptions.charAt(i);
parseParameter(subArgument, parserState, CliParameterConsumer.EMPTY_INSTANCE); // depends on control dependency: [for], data = [none]
}
} else if (parameter.startsWith(PREFIX_SHORT_OPTION)) {
throw new CliOptionUndefinedException(parameter);
} else {
// so it seems the options are completed and this is a regular argument
parserState.setOptionsComplete(); // depends on control dependency: [if], data = [none]
parseParameter(parameter, parserState, parameterConsumer); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public Surface draw (Tile tile, float x, float y, float w, float h) {
if (!checkIntersection || intersects(x, y, w, h)) {
tile.addToBatch(batch, tint, tx(), x, y, w, h);
}
return this;
} } | public class class_name {
public Surface draw (Tile tile, float x, float y, float w, float h) {
if (!checkIntersection || intersects(x, y, w, h)) {
tile.addToBatch(batch, tint, tx(), x, y, w, h); // depends on control dependency: [if], data = [none]
}
return this;
} } |
public class class_name {
public void notice(String key, String a1) {
if (quiet) {
return;
}
messager.notice(key, a1);
} } | public class class_name {
public void notice(String key, String a1) {
if (quiet) {
return; // depends on control dependency: [if], data = [none]
}
messager.notice(key, a1);
} } |
public class class_name {
public static String[] getListOfDataDirs(Configuration conf) {
String[] configFilePath = conf.getStrings("dfs.datadir.confpath");
String[] dataDirs = null;
if(configFilePath != null && (configFilePath.length != 0)) {
try {
DataDirFileReader reader = new DataDirFileReader(configFilePath[0]);
dataDirs = reader.getArrayOfCurrentDataDirectories();
if(dataDirs == null) {
LOG.warn("File is empty, using dfs.data.dir directories");
}
} catch (Exception e) {
LOG.warn("Could not read file, using directories from dfs.data.dir" +
" Exception: ", e);
}
} else {
LOG.warn("No dfs.datadir.confpath not defined, now using default " +
"directories");
}
if(dataDirs == null) {
dataDirs = conf.getStrings("dfs.data.dir");
}
return dataDirs;
} } | public class class_name {
public static String[] getListOfDataDirs(Configuration conf) {
String[] configFilePath = conf.getStrings("dfs.datadir.confpath");
String[] dataDirs = null;
if(configFilePath != null && (configFilePath.length != 0)) {
try {
DataDirFileReader reader = new DataDirFileReader(configFilePath[0]);
dataDirs = reader.getArrayOfCurrentDataDirectories(); // depends on control dependency: [try], data = [none]
if(dataDirs == null) {
LOG.warn("File is empty, using dfs.data.dir directories"); // depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
LOG.warn("Could not read file, using directories from dfs.data.dir" +
" Exception: ", e);
} // depends on control dependency: [catch], data = [none]
} else {
LOG.warn("No dfs.datadir.confpath not defined, now using default " +
"directories"); // depends on control dependency: [if], data = [none]
}
if(dataDirs == null) {
dataDirs = conf.getStrings("dfs.data.dir"); // depends on control dependency: [if], data = [none]
}
return dataDirs;
} } |
public class class_name {
public static boolean isGraphic(CharSequence str) {
final int len = str.length();
for (int i=0; i<len; i++) {
int gc = Character.getType(str.charAt(i));
if (gc != Character.CONTROL
&& gc != Character.FORMAT
&& gc != Character.SURROGATE
&& gc != Character.UNASSIGNED
&& gc != Character.LINE_SEPARATOR
&& gc != Character.PARAGRAPH_SEPARATOR
&& gc != Character.SPACE_SEPARATOR) {
return true;
}
}
return false;
} } | public class class_name {
public static boolean isGraphic(CharSequence str) {
final int len = str.length();
for (int i=0; i<len; i++) {
int gc = Character.getType(str.charAt(i));
if (gc != Character.CONTROL
&& gc != Character.FORMAT
&& gc != Character.SURROGATE
&& gc != Character.UNASSIGNED
&& gc != Character.LINE_SEPARATOR
&& gc != Character.PARAGRAPH_SEPARATOR
&& gc != Character.SPACE_SEPARATOR) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} } |
public class class_name {
@Nullable
public MongoCredential getCredential() {
if (getCredentialsList().size() > 1) {
throw new IllegalStateException("Instance constructed with more than one MongoCredential");
} else if (getCredentialsList().isEmpty()) {
return null;
} else {
return getCredentialsList().get(0);
}
} } | public class class_name {
@Nullable
public MongoCredential getCredential() {
if (getCredentialsList().size() > 1) {
throw new IllegalStateException("Instance constructed with more than one MongoCredential");
} else if (getCredentialsList().isEmpty()) {
return null; // depends on control dependency: [if], data = [none]
} else {
return getCredentialsList().get(0); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void startRoundTripMeasurement() {
if (scheduler != null) {
if (pingInterval > 0) {
if (log.isDebugEnabled()) {
log.debug("startRoundTripMeasurement - {}", sessionId);
}
try {
// schedule with an initial delay of now + 2s to prevent ping messages during connect post processes
keepAliveTask = scheduler.scheduleWithFixedDelay(new KeepAliveTask(), new Date(System.currentTimeMillis() + 2000L), pingInterval);
if (log.isDebugEnabled()) {
log.debug("Keep alive scheduled for {}", sessionId);
}
} catch (Exception e) {
log.error("Error creating keep alive job for {}", sessionId, e);
}
}
} else {
log.error("startRoundTripMeasurement cannot be executed due to missing scheduler. This can happen if a connection drops before handshake is complete");
}
} } | public class class_name {
private void startRoundTripMeasurement() {
if (scheduler != null) {
if (pingInterval > 0) {
if (log.isDebugEnabled()) {
log.debug("startRoundTripMeasurement - {}", sessionId);
// depends on control dependency: [if], data = [none]
}
try {
// schedule with an initial delay of now + 2s to prevent ping messages during connect post processes
keepAliveTask = scheduler.scheduleWithFixedDelay(new KeepAliveTask(), new Date(System.currentTimeMillis() + 2000L), pingInterval);
// depends on control dependency: [try], data = [none]
if (log.isDebugEnabled()) {
log.debug("Keep alive scheduled for {}", sessionId);
// depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
log.error("Error creating keep alive job for {}", sessionId, e);
}
// depends on control dependency: [catch], data = [none]
}
} else {
log.error("startRoundTripMeasurement cannot be executed due to missing scheduler. This can happen if a connection drops before handshake is complete");
// depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private ClientRequest<?> completeClientRequest() {
ClientRequest<?> local = atomicNullOutClientRequest();
if(local == null) {
return null;
}
if(isExpired) {
local.timeOut();
}
else {
local.complete();
}
if(logger.isTraceEnabled())
logger.trace("Marked client associated with " + socketChannel.socket() + " as complete");
return local;
} } | public class class_name {
private ClientRequest<?> completeClientRequest() {
ClientRequest<?> local = atomicNullOutClientRequest();
if(local == null) {
return null; // depends on control dependency: [if], data = [none]
}
if(isExpired) {
local.timeOut(); // depends on control dependency: [if], data = [none]
}
else {
local.complete(); // depends on control dependency: [if], data = [none]
}
if(logger.isTraceEnabled())
logger.trace("Marked client associated with " + socketChannel.socket() + " as complete");
return local;
} } |
public class class_name {
@Override
public int lastIndexOf(Object o) {
IAtomContainer atomContainer = (IAtomContainer) o;
if (!atomContainer.getTitle().equals(title)) return -1;
if (atomContainer.getAtomCount() != coordinates.get(0).length) return -1;
boolean coordsMatch;
for (int j = coordinates.size() - 1; j >= 0; j--) {
Point3d[] coords = coordinates.get(j);
coordsMatch = true;
for (int i = 0; i < atomContainer.getAtomCount(); i++) {
Point3d p = atomContainer.getAtom(i).getPoint3d();
if (!(p.x == coords[i].x && p.y == coords[i].y && p.z == coords[i].z)) {
coordsMatch = false;
break;
}
}
if (coordsMatch) return j;
}
return -1;
} } | public class class_name {
@Override
public int lastIndexOf(Object o) {
IAtomContainer atomContainer = (IAtomContainer) o;
if (!atomContainer.getTitle().equals(title)) return -1;
if (atomContainer.getAtomCount() != coordinates.get(0).length) return -1;
boolean coordsMatch;
for (int j = coordinates.size() - 1; j >= 0; j--) {
Point3d[] coords = coordinates.get(j);
coordsMatch = true; // depends on control dependency: [for], data = [none]
for (int i = 0; i < atomContainer.getAtomCount(); i++) {
Point3d p = atomContainer.getAtom(i).getPoint3d();
if (!(p.x == coords[i].x && p.y == coords[i].y && p.z == coords[i].z)) {
coordsMatch = false; // depends on control dependency: [if], data = [none]
break;
}
}
if (coordsMatch) return j;
}
return -1;
} } |
public class class_name {
public boolean acceptsValue(String value) {
if (value==null) {
return false;
} else if (hasValues()) {
return getValuesList().contains(value);
} else {
return true;
}
} } | public class class_name {
public boolean acceptsValue(String value) {
if (value==null) {
return false; // depends on control dependency: [if], data = [none]
} else if (hasValues()) {
return getValuesList().contains(value); // depends on control dependency: [if], data = [none]
} else {
return true; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public Observable<ServiceResponse<RunbookDraftUndoEditResultInner>> undoEditWithServiceResponseAsync(String resourceGroupName, String automationAccountName, String runbookName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (automationAccountName == null) {
throw new IllegalArgumentException("Parameter automationAccountName is required and cannot be null.");
}
if (runbookName == null) {
throw new IllegalArgumentException("Parameter runbookName is required and cannot be null.");
}
final String apiVersion = "2015-10-31";
return service.undoEdit(this.client.subscriptionId(), resourceGroupName, automationAccountName, runbookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RunbookDraftUndoEditResultInner>>>() {
@Override
public Observable<ServiceResponse<RunbookDraftUndoEditResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RunbookDraftUndoEditResultInner> clientResponse = undoEditDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} } | public class class_name {
public Observable<ServiceResponse<RunbookDraftUndoEditResultInner>> undoEditWithServiceResponseAsync(String resourceGroupName, String automationAccountName, String runbookName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (automationAccountName == null) {
throw new IllegalArgumentException("Parameter automationAccountName is required and cannot be null.");
}
if (runbookName == null) {
throw new IllegalArgumentException("Parameter runbookName is required and cannot be null.");
}
final String apiVersion = "2015-10-31";
return service.undoEdit(this.client.subscriptionId(), resourceGroupName, automationAccountName, runbookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RunbookDraftUndoEditResultInner>>>() {
@Override
public Observable<ServiceResponse<RunbookDraftUndoEditResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RunbookDraftUndoEditResultInner> clientResponse = undoEditDelegate(response);
return Observable.just(clientResponse); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
return Observable.error(t);
} // depends on control dependency: [catch], data = [none]
}
});
} } |
public class class_name {
public static List<DirectoryListingEntryDTO> convertToEntries( final List<StoreResource> items )
{
final List<DirectoryListingEntryDTO> entries = new ArrayList<DirectoryListingEntryDTO>();
for ( final StoreResource resource : items )
{
entries.add( new DirectoryListingEntryDTO( resource.getStoreKey(), resource.getPath() ) );
}
return entries;
} } | public class class_name {
public static List<DirectoryListingEntryDTO> convertToEntries( final List<StoreResource> items )
{
final List<DirectoryListingEntryDTO> entries = new ArrayList<DirectoryListingEntryDTO>();
for ( final StoreResource resource : items )
{
entries.add( new DirectoryListingEntryDTO( resource.getStoreKey(), resource.getPath() ) ); // depends on control dependency: [for], data = [resource]
}
return entries;
} } |
public class class_name {
@Nonnull
public static String urlDecode (@Nonnull final String sValue, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sValue, "Value");
ValueEnforcer.notNull (aCharset, "Charset");
boolean bNeedToChange = false;
final int nLen = sValue.length ();
final StringBuilder aSB = new StringBuilder (nLen);
int nIndex = 0;
byte [] aBytes = null;
while (nIndex < nLen)
{
char c = sValue.charAt (nIndex);
switch (c)
{
case '+':
aSB.append (' ');
nIndex++;
bNeedToChange = true;
break;
case '%':
/*
* Starting with this instance of %, process all consecutive
* substrings of the form %xy. Each substring %xy will yield a byte.
* Convert all consecutive bytes obtained this way to whatever
* character(s) they represent in the provided encoding.
*/
try
{
// (numChars-i)/3 is an upper bound for the number
// of remaining bytes
if (aBytes == null)
aBytes = new byte [(nLen - nIndex) / 3];
int nPos = 0;
while ((nIndex + 2) < nLen && c == '%')
{
final int nValue = Integer.parseInt (sValue.substring (nIndex + 1, nIndex + 3), 16);
if (nValue < 0)
throw new IllegalArgumentException ("URLDecoder: Illegal hex characters in escape (%) pattern - negative value");
aBytes[nPos++] = (byte) nValue;
nIndex += 3;
if (nIndex < nLen)
c = sValue.charAt (nIndex);
}
// A trailing, incomplete byte encoding such as
// "%x" will cause an exception to be thrown
if (nIndex < nLen && c == '%')
throw new IllegalArgumentException ("URLDecoder: Incomplete trailing escape (%) pattern");
aSB.append (StringHelper.decodeBytesToChars (aBytes, 0, nPos, aCharset));
}
catch (final NumberFormatException e)
{
throw new IllegalArgumentException ("URLDecoder: Illegal hex characters in escape (%) pattern - " +
e.getMessage ());
}
bNeedToChange = true;
break;
default:
aSB.append (c);
nIndex++;
break;
}
}
return bNeedToChange ? aSB.toString () : sValue;
} } | public class class_name {
@Nonnull
public static String urlDecode (@Nonnull final String sValue, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sValue, "Value");
ValueEnforcer.notNull (aCharset, "Charset");
boolean bNeedToChange = false;
final int nLen = sValue.length ();
final StringBuilder aSB = new StringBuilder (nLen);
int nIndex = 0;
byte [] aBytes = null;
while (nIndex < nLen)
{
char c = sValue.charAt (nIndex);
switch (c)
{
case '+':
aSB.append (' ');
nIndex++;
bNeedToChange = true;
break;
case '%':
/*
* Starting with this instance of %, process all consecutive
* substrings of the form %xy. Each substring %xy will yield a byte.
* Convert all consecutive bytes obtained this way to whatever
* character(s) they represent in the provided encoding.
*/
try
{
// (numChars-i)/3 is an upper bound for the number
// of remaining bytes
if (aBytes == null)
aBytes = new byte [(nLen - nIndex) / 3];
int nPos = 0;
while ((nIndex + 2) < nLen && c == '%')
{
final int nValue = Integer.parseInt (sValue.substring (nIndex + 1, nIndex + 3), 16);
if (nValue < 0)
throw new IllegalArgumentException ("URLDecoder: Illegal hex characters in escape (%) pattern - negative value");
aBytes[nPos++] = (byte) nValue; // depends on control dependency: [while], data = [none]
nIndex += 3; // depends on control dependency: [while], data = [none]
if (nIndex < nLen)
c = sValue.charAt (nIndex);
}
// A trailing, incomplete byte encoding such as
// "%x" will cause an exception to be thrown
if (nIndex < nLen && c == '%')
throw new IllegalArgumentException ("URLDecoder: Incomplete trailing escape (%) pattern");
aSB.append (StringHelper.decodeBytesToChars (aBytes, 0, nPos, aCharset)); // depends on control dependency: [try], data = [none]
}
catch (final NumberFormatException e)
{
throw new IllegalArgumentException ("URLDecoder: Illegal hex characters in escape (%) pattern - " +
e.getMessage ());
} // depends on control dependency: [catch], data = [none]
bNeedToChange = true;
break;
default:
aSB.append (c);
nIndex++;
break;
}
}
return bNeedToChange ? aSB.toString () : sValue;
} } |
public class class_name {
public static SelectOptions getProjectSelectOptionsStatic(CmsObject cms, String startProject, Locale locale) {
List<CmsProject> allProjects;
try {
String ouFqn = "";
CmsUserSettings settings = new CmsUserSettings(cms);
if (!settings.getListAllProjects()) {
ouFqn = cms.getRequestContext().getCurrentUser().getOuFqn();
}
allProjects = OpenCms.getOrgUnitManager().getAllAccessibleProjects(
cms,
ouFqn,
settings.getListAllProjects());
} catch (CmsException e) {
// should usually never happen
if (LOG.isErrorEnabled()) {
LOG.error(e.getLocalizedMessage(), e);
}
allProjects = Collections.emptyList();
}
boolean singleOu = true;
String ouFqn = null;
Iterator<CmsProject> itProjects = allProjects.iterator();
while (itProjects.hasNext()) {
CmsProject prj = itProjects.next();
if (prj.isOnlineProject()) {
// skip the online project
continue;
}
if (ouFqn == null) {
// set the first ou
ouFqn = prj.getOuFqn();
}
if (!ouFqn.equals(prj.getOuFqn())) {
// break if one different ou is found
singleOu = false;
break;
}
}
List<String> options = new ArrayList<String>(allProjects.size());
List<String> values = new ArrayList<String>(allProjects.size());
int checkedIndex = 0;
for (int i = 0, n = allProjects.size(); i < n; i++) {
CmsProject project = allProjects.get(i);
String projectName = project.getSimpleName();
if (!singleOu && !project.isOnlineProject()) {
try {
projectName = projectName
+ " - "
+ OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName(
locale);
} catch (CmsException e) {
projectName = projectName + " - " + project.getOuFqn();
}
}
options.add(projectName);
values.add(project.getName());
if (startProject.equals(project.getName())) {
checkedIndex = i;
}
}
SelectOptions selectOptions = new SelectOptions(options, values, checkedIndex);
return selectOptions;
} } | public class class_name {
public static SelectOptions getProjectSelectOptionsStatic(CmsObject cms, String startProject, Locale locale) {
List<CmsProject> allProjects;
try {
String ouFqn = "";
CmsUserSettings settings = new CmsUserSettings(cms);
if (!settings.getListAllProjects()) {
ouFqn = cms.getRequestContext().getCurrentUser().getOuFqn(); // depends on control dependency: [if], data = [none]
}
allProjects = OpenCms.getOrgUnitManager().getAllAccessibleProjects(
cms,
ouFqn,
settings.getListAllProjects()); // depends on control dependency: [try], data = [none]
} catch (CmsException e) {
// should usually never happen
if (LOG.isErrorEnabled()) {
LOG.error(e.getLocalizedMessage(), e); // depends on control dependency: [if], data = [none]
}
allProjects = Collections.emptyList();
} // depends on control dependency: [catch], data = [none]
boolean singleOu = true;
String ouFqn = null;
Iterator<CmsProject> itProjects = allProjects.iterator();
while (itProjects.hasNext()) {
CmsProject prj = itProjects.next();
if (prj.isOnlineProject()) {
// skip the online project
continue;
}
if (ouFqn == null) {
// set the first ou
ouFqn = prj.getOuFqn(); // depends on control dependency: [if], data = [none]
}
if (!ouFqn.equals(prj.getOuFqn())) {
// break if one different ou is found
singleOu = false; // depends on control dependency: [if], data = [none]
break;
}
}
List<String> options = new ArrayList<String>(allProjects.size());
List<String> values = new ArrayList<String>(allProjects.size());
int checkedIndex = 0;
for (int i = 0, n = allProjects.size(); i < n; i++) {
CmsProject project = allProjects.get(i);
String projectName = project.getSimpleName();
if (!singleOu && !project.isOnlineProject()) {
try {
projectName = projectName
+ " - "
+ OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName(
locale); // depends on control dependency: [try], data = [none]
} catch (CmsException e) {
projectName = projectName + " - " + project.getOuFqn();
} // depends on control dependency: [catch], data = [none]
}
options.add(projectName); // depends on control dependency: [for], data = [none]
values.add(project.getName()); // depends on control dependency: [for], data = [none]
if (startProject.equals(project.getName())) {
checkedIndex = i; // depends on control dependency: [if], data = [none]
}
}
SelectOptions selectOptions = new SelectOptions(options, values, checkedIndex);
return selectOptions;
} } |
public class class_name {
public void addAllIfNotExist(Properties properties) {
for (String key : properties.stringPropertyNames()) {
if (!this.specProperties.containsKey(key) && !this.commonProperties.containsKey(key)) {
this.specProperties.setProperty(key, properties.getProperty(key));
}
}
} } | public class class_name {
public void addAllIfNotExist(Properties properties) {
for (String key : properties.stringPropertyNames()) {
if (!this.specProperties.containsKey(key) && !this.commonProperties.containsKey(key)) {
this.specProperties.setProperty(key, properties.getProperty(key)); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
@Nullable
private Method getLambdaMethod(String methodName) {
for (Method method : currentClass.getMethods()) {
if (methodName.equals(method.getName())) {
return method;
}
}
return null;
} } | public class class_name {
@Nullable
private Method getLambdaMethod(String methodName) {
for (Method method : currentClass.getMethods()) {
if (methodName.equals(method.getName())) {
return method; // depends on control dependency: [if], data = [none]
}
}
return null;
} } |
public class class_name {
@Override
public double[] mult(double[] source, double[] target) {
if (target == null || target.length < 3) {
target = new double[3];
}
if (source == target) {
throw new RuntimeException("The source and target vectors used in Matrix3D.mult() cannot be identical.");
}
if (target.length == 3) {
target[0] = m00 * source[0] + m01 * source[1] + m02 * source[2] + m03;
target[1] = m10 * source[0] + m11 * source[1] + m12 * source[2] + m13;
target[2] = m20 * source[0] + m21 * source[1] + m22 * source[2] + m23;
//double w = m30*source[0] + m31*source[1] + m32*source[2] + m33;
//if (w != 0 && w != 1) {
// target[0] /= w; target[1] /= w; target[2] /= w;
//}
} else if (target.length > 3) {
target[0] = m00 * source[0] + m01 * source[1] + m02 * source[2] + m03 * source[3];
target[1] = m10 * source[0] + m11 * source[1] + m12 * source[2] + m13 * source[3];
target[2] = m20 * source[0] + m21 * source[1] + m22 * source[2] + m23 * source[3];
target[3] = m30 * source[0] + m31 * source[1] + m32 * source[2] + m33 * source[3];
}
return target;
} } | public class class_name {
@Override
public double[] mult(double[] source, double[] target) {
if (target == null || target.length < 3) {
target = new double[3]; // depends on control dependency: [if], data = [none]
}
if (source == target) {
throw new RuntimeException("The source and target vectors used in Matrix3D.mult() cannot be identical.");
}
if (target.length == 3) {
target[0] = m00 * source[0] + m01 * source[1] + m02 * source[2] + m03; // depends on control dependency: [if], data = [none]
target[1] = m10 * source[0] + m11 * source[1] + m12 * source[2] + m13; // depends on control dependency: [if], data = [none]
target[2] = m20 * source[0] + m21 * source[1] + m22 * source[2] + m23; // depends on control dependency: [if], data = [none]
//double w = m30*source[0] + m31*source[1] + m32*source[2] + m33;
//if (w != 0 && w != 1) {
// target[0] /= w; target[1] /= w; target[2] /= w;
//}
} else if (target.length > 3) {
target[0] = m00 * source[0] + m01 * source[1] + m02 * source[2] + m03 * source[3]; // depends on control dependency: [if], data = [none]
target[1] = m10 * source[0] + m11 * source[1] + m12 * source[2] + m13 * source[3]; // depends on control dependency: [if], data = [none]
target[2] = m20 * source[0] + m21 * source[1] + m22 * source[2] + m23 * source[3]; // depends on control dependency: [if], data = [none]
target[3] = m30 * source[0] + m31 * source[1] + m32 * source[2] + m33 * source[3]; // depends on control dependency: [if], data = [none]
}
return target;
} } |
public class class_name {
public void marshall(TagResourceRequest tagResourceRequest, ProtocolMarshaller protocolMarshaller) {
if (tagResourceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(tagResourceRequest.getResource(), RESOURCE_BINDING);
protocolMarshaller.marshall(tagResourceRequest.getTags(), TAGS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(TagResourceRequest tagResourceRequest, ProtocolMarshaller protocolMarshaller) {
if (tagResourceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(tagResourceRequest.getResource(), RESOURCE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(tagResourceRequest.getTags(), TAGS_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 getImageSize() {
if (imageSizeEClass == null) {
imageSizeEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(387);
}
return imageSizeEClass;
} } | public class class_name {
public EClass getImageSize() {
if (imageSizeEClass == null) {
imageSizeEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(387); // depends on control dependency: [if], data = [none]
}
return imageSizeEClass;
} } |
public class class_name {
public static synchronized void releaseSharedResources() {
if (SHARED_EVENT_LOOP != null) {
SHARED_EVENT_LOOP.shutdownGracefully();
SHARED_EVENT_LOOP = null;
}
if (SHARED_WHEEL_TIMER != null) {
SHARED_WHEEL_TIMER.stop();
SHARED_WHEEL_TIMER = null;
}
if (SHARED_EXECUTOR != null) {
SHARED_EXECUTOR.shutdown();
SHARED_EXECUTOR = null;
}
if (SHARED_SCHEDULED_EXECUTOR != null) {
SHARED_SCHEDULED_EXECUTOR.shutdown();
SHARED_SCHEDULED_EXECUTOR = null;
}
} } | public class class_name {
public static synchronized void releaseSharedResources() {
if (SHARED_EVENT_LOOP != null) {
SHARED_EVENT_LOOP.shutdownGracefully(); // depends on control dependency: [if], data = [none]
SHARED_EVENT_LOOP = null; // depends on control dependency: [if], data = [none]
}
if (SHARED_WHEEL_TIMER != null) {
SHARED_WHEEL_TIMER.stop(); // depends on control dependency: [if], data = [none]
SHARED_WHEEL_TIMER = null; // depends on control dependency: [if], data = [none]
}
if (SHARED_EXECUTOR != null) {
SHARED_EXECUTOR.shutdown(); // depends on control dependency: [if], data = [none]
SHARED_EXECUTOR = null; // depends on control dependency: [if], data = [none]
}
if (SHARED_SCHEDULED_EXECUTOR != null) {
SHARED_SCHEDULED_EXECUTOR.shutdown(); // depends on control dependency: [if], data = [none]
SHARED_SCHEDULED_EXECUTOR = null; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void marshall(FileAccessLog fileAccessLog, ProtocolMarshaller protocolMarshaller) {
if (fileAccessLog == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(fileAccessLog.getPath(), PATH_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(FileAccessLog fileAccessLog, ProtocolMarshaller protocolMarshaller) {
if (fileAccessLog == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(fileAccessLog.getPath(), PATH_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 addSubtypes(NamedType... subtypes) {
if (this.subtypeList == null) {
this.subtypeList = new ArrayList<>();
}
this.subtypeList.addAll(Arrays.asList(subtypes));
} } | public class class_name {
public void addSubtypes(NamedType... subtypes) {
if (this.subtypeList == null) {
this.subtypeList = new ArrayList<>(); // depends on control dependency: [if], data = [none]
}
this.subtypeList.addAll(Arrays.asList(subtypes));
} } |
public class class_name {
public static boolean isRunningInExpectedThread(@Nullable Thread expected) {
Thread actual = Thread.currentThread();
if (expected != actual) {
String violationMsg = "Violation of main thread constraint detected: expected <"
+ expected + "> but running in <" + actual + ">.";
LOG.warn(violationMsg, new Exception(violationMsg));
return false;
}
return true;
} } | public class class_name {
public static boolean isRunningInExpectedThread(@Nullable Thread expected) {
Thread actual = Thread.currentThread();
if (expected != actual) {
String violationMsg = "Violation of main thread constraint detected: expected <"
+ expected + "> but running in <" + actual + ">."; // depends on control dependency: [if], data = [none]
LOG.warn(violationMsg, new Exception(violationMsg)); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
return true;
} } |
public class class_name {
public static CmsResourceInfo getOUInfo(CmsOrganizationalUnit ou) {
String style = OpenCmsTheme.ICON_OU;
if (ou.hasFlagWebuser()) {
style = OpenCmsTheme.ICON_OU_WEB;
}
CmsCssIcon image = new CmsCssIcon(style);
return new CmsResourceInfo(
ou.getDisplayName(A_CmsUI.get().getLocale()),
ou.getDescription(A_CmsUI.get().getLocale()),
image);
} } | public class class_name {
public static CmsResourceInfo getOUInfo(CmsOrganizationalUnit ou) {
String style = OpenCmsTheme.ICON_OU;
if (ou.hasFlagWebuser()) {
style = OpenCmsTheme.ICON_OU_WEB; // depends on control dependency: [if], data = [none]
}
CmsCssIcon image = new CmsCssIcon(style);
return new CmsResourceInfo(
ou.getDisplayName(A_CmsUI.get().getLocale()),
ou.getDescription(A_CmsUI.get().getLocale()),
image);
} } |
public class class_name {
StatementDMQL compileCallStatement(RangeVariable[] outerRanges,
boolean isStrictlyProcedure) {
read();
if (isIdentifier()) {
checkValidCatalogName(token.namePrePrefix);
RoutineSchema routineSchema =
(RoutineSchema) database.schemaManager.findSchemaObject(
token.tokenString,
session.getSchemaName(token.namePrefix),
SchemaObject.PROCEDURE);
if (routineSchema != null) {
read();
HsqlArrayList list = new HsqlArrayList();
readThis(Tokens.OPENBRACKET);
if (token.tokenType == Tokens.CLOSEBRACKET) {
read();
} else {
while (true) {
Expression e = XreadValueExpression();
list.add(e);
if (token.tokenType == Tokens.COMMA) {
read();
} else {
readThis(Tokens.CLOSEBRACKET);
break;
}
}
}
Expression[] arguments = new Expression[list.size()];
list.toArray(arguments);
Routine routine =
routineSchema.getSpecificRoutine(arguments.length);
HsqlList unresolved = null;
for (int i = 0; i < arguments.length; i++) {
Expression e = arguments[i];
if (e.isParam()) {
e.setAttributesAsColumn(
routine.getParameter(i),
routine.getParameter(i).isWriteable());
} else {
int paramMode =
routine.getParameter(i).getParameterMode();
unresolved =
arguments[i].resolveColumnReferences(outerRanges,
unresolved);
if (paramMode
!= SchemaObject.ParameterModes.PARAM_IN) {
if (e.getType() != OpTypes.VARIABLE) {
throw Error.error(ErrorCode.X_42603);
}
}
}
}
ExpressionColumn.checkColumnsResolved(unresolved);
for (int i = 0; i < arguments.length; i++) {
arguments[i].resolveTypes(session, null);
}
StatementDMQL cs = new StatementProcedure(session, routine,
arguments, compileContext);
return cs;
}
}
if (isStrictlyProcedure) {
throw Error.error(ErrorCode.X_42501, token.tokenString);
}
Expression expression = this.XreadValueExpression();
HsqlList unresolved = expression.resolveColumnReferences(outerRanges,
null);
ExpressionColumn.checkColumnsResolved(unresolved);
expression.resolveTypes(session, null);
// expression.paramMode = PARAM_OUT;
StatementDMQL cs = new StatementProcedure(session, expression,
compileContext);
return cs;
} } | public class class_name {
StatementDMQL compileCallStatement(RangeVariable[] outerRanges,
boolean isStrictlyProcedure) {
read();
if (isIdentifier()) {
checkValidCatalogName(token.namePrePrefix); // depends on control dependency: [if], data = [none]
RoutineSchema routineSchema =
(RoutineSchema) database.schemaManager.findSchemaObject(
token.tokenString,
session.getSchemaName(token.namePrefix),
SchemaObject.PROCEDURE);
if (routineSchema != null) {
read(); // depends on control dependency: [if], data = [none]
HsqlArrayList list = new HsqlArrayList();
readThis(Tokens.OPENBRACKET); // depends on control dependency: [if], data = [none]
if (token.tokenType == Tokens.CLOSEBRACKET) {
read(); // depends on control dependency: [if], data = [none]
} else {
while (true) {
Expression e = XreadValueExpression();
list.add(e); // depends on control dependency: [while], data = [none]
if (token.tokenType == Tokens.COMMA) {
read(); // depends on control dependency: [if], data = [none]
} else {
readThis(Tokens.CLOSEBRACKET); // depends on control dependency: [if], data = [none]
break;
}
}
}
Expression[] arguments = new Expression[list.size()];
list.toArray(arguments); // depends on control dependency: [if], data = [none]
Routine routine =
routineSchema.getSpecificRoutine(arguments.length);
HsqlList unresolved = null;
for (int i = 0; i < arguments.length; i++) {
Expression e = arguments[i];
if (e.isParam()) {
e.setAttributesAsColumn(
routine.getParameter(i),
routine.getParameter(i).isWriteable()); // depends on control dependency: [if], data = [none]
} else {
int paramMode =
routine.getParameter(i).getParameterMode();
unresolved =
arguments[i].resolveColumnReferences(outerRanges,
unresolved); // depends on control dependency: [if], data = [none]
if (paramMode
!= SchemaObject.ParameterModes.PARAM_IN) {
if (e.getType() != OpTypes.VARIABLE) {
throw Error.error(ErrorCode.X_42603);
}
}
}
}
ExpressionColumn.checkColumnsResolved(unresolved); // depends on control dependency: [if], data = [none]
for (int i = 0; i < arguments.length; i++) {
arguments[i].resolveTypes(session, null); // depends on control dependency: [for], data = [i]
}
StatementDMQL cs = new StatementProcedure(session, routine,
arguments, compileContext);
return cs; // depends on control dependency: [if], data = [none]
}
}
if (isStrictlyProcedure) {
throw Error.error(ErrorCode.X_42501, token.tokenString);
}
Expression expression = this.XreadValueExpression();
HsqlList unresolved = expression.resolveColumnReferences(outerRanges,
null);
ExpressionColumn.checkColumnsResolved(unresolved);
expression.resolveTypes(session, null);
// expression.paramMode = PARAM_OUT;
StatementDMQL cs = new StatementProcedure(session, expression,
compileContext);
return cs;
} } |
public class class_name {
@Override
protected void afterPaint(final RenderContext renderContext) {
super.afterPaint(renderContext);
final int size = getChildCount();
for (int i = 0; i < size; i++) {
WComponent child = getChildAt(i);
child.reset();
}
} } | public class class_name {
@Override
protected void afterPaint(final RenderContext renderContext) {
super.afterPaint(renderContext);
final int size = getChildCount();
for (int i = 0; i < size; i++) {
WComponent child = getChildAt(i);
child.reset(); // depends on control dependency: [for], data = [none]
}
} } |
public class class_name {
@Override
public void update(IPermission perm) throws AuthorizationException {
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sQuery = getUpdatePermissionSql();
if (log.isDebugEnabled()) log.debug("RDBMPermissionImpl.update(): " + sQuery);
PreparedStatement ps = conn.prepareStatement(sQuery);
try {
primUpdate(perm, ps);
} finally {
ps.close();
}
} catch (Exception ex) {
log.error("Exception updating permission [" + perm + "]", ex);
throw new AuthorizationException("Problem updating Permission " + perm);
} finally {
RDBMServices.releaseConnection(conn);
}
} } | public class class_name {
@Override
public void update(IPermission perm) throws AuthorizationException {
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sQuery = getUpdatePermissionSql();
if (log.isDebugEnabled()) log.debug("RDBMPermissionImpl.update(): " + sQuery);
PreparedStatement ps = conn.prepareStatement(sQuery);
try {
primUpdate(perm, ps); // depends on control dependency: [try], data = [none]
} finally {
ps.close();
}
} catch (Exception ex) {
log.error("Exception updating permission [" + perm + "]", ex);
throw new AuthorizationException("Problem updating Permission " + perm);
} finally {
RDBMServices.releaseConnection(conn);
}
} } |
public class class_name {
public void validateCreate(AppNewForm appNewForm) {
// trim
if (appNewForm.getApp() != null) {
appNewForm.setApp(appNewForm.getApp().trim());
}
if (appNewForm.getDesc() != null) {
appNewForm.setDesc(appNewForm.getDesc().trim());
}
App app = appMgr.getByName(appNewForm.getApp());
if (app != null) {
throw new FieldException(AppNewForm.APP, "app.exist", null);
}
} } | public class class_name {
public void validateCreate(AppNewForm appNewForm) {
// trim
if (appNewForm.getApp() != null) {
appNewForm.setApp(appNewForm.getApp().trim()); // depends on control dependency: [if], data = [(appNewForm.getApp()]
}
if (appNewForm.getDesc() != null) {
appNewForm.setDesc(appNewForm.getDesc().trim()); // depends on control dependency: [if], data = [(appNewForm.getDesc()]
}
App app = appMgr.getByName(appNewForm.getApp());
if (app != null) {
throw new FieldException(AppNewForm.APP, "app.exist", null);
}
} } |
public class class_name {
protected Element elementImpl(String name, String namespaceURI) {
assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
if (namespaceURI == null) {
return getDocument().createElement(name);
} else {
return getDocument().createElementNS(namespaceURI, name);
}
} } | public class class_name {
protected Element elementImpl(String name, String namespaceURI) {
assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
if (namespaceURI == null) {
return getDocument().createElement(name); // depends on control dependency: [if], data = [none]
} else {
return getDocument().createElementNS(namespaceURI, name); // depends on control dependency: [if], data = [(namespaceURI]
}
} } |
public class class_name {
private void initialize(JsMessagingEngine engineConfiguration, boolean isReload)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "initialize", new Object[] { "isReload=" + isReload, "Config=" + engineConfiguration });
_messagingEngine = engineConfiguration;
final WASConfiguration configuration = WASConfiguration.getDefaultWasConfiguration();
// Always support warm-restart. D178260
configuration.setCleanPersistenceOnStart(false);
//Venu Liberty change: changed the way we get FileStore config object
SIBFileStore fs = (SIBFileStore) _messagingEngine.getFilestore();
//there is no getLogFile !! lohith liberty change
configuration.setObjectManagerLogDirectory(fs.getPath());
configuration.setObjectManagerLogSize(fs.getLogFileSize());
configuration.setObjectManagerPermanentStoreDirectory(fs.getPath());
configuration.setObjectManagerMinimumPermanentStoreSize(fs.getMinPermanentFileStoreSize());
configuration.setObjectManagerMaximumPermanentStoreSize(fs.getMaxPermanentFileStoreSize());
configuration.setObjectManagerPermanentStoreSizeUnlimited(fs.isUnlimitedPermanentStoreSize());
configuration.setObjectManagerTemporaryStoreDirectory(fs.getPath());
configuration.setObjectManagerMinimumTemporaryStoreSize(fs.getMinTemporaryFileStoreSize());
configuration.setObjectManagerMaximumTemporaryStoreSize(fs.getMaxTemporaryFileStoreSize());
configuration.setObjectManagerTemporaryStoreSizeUnlimited(fs.isUnlimitedTemporaryStoreSize());
/*
* }
*/
// Finally, make sure that the message store type in the engine configuration has
// the corresponding configuration information. Otherwise, we're not going to get very far...
if ((engineConfiguration.getMessageStoreType() == JsMessagingEngine.MESSAGE_STORE_TYPE_DATASTORE) &&
(engineConfiguration.datastoreExists()))
{
configuration.setPersistentMessageStoreClassname(MessageStoreConstants.PERSISTENT_MESSAGE_STORE_CLASS_DATABASE);
// Defect 449837
if (!isReload)
{
SibTr.info(tc, "MESSAGING_ENGINE_PERSISTENCE_DATASTORE_SIMS1568", new Object[] { engineConfiguration.getName() });
}
}
else if ((engineConfiguration.getMessageStoreType() == JsMessagingEngine.MESSAGE_STORE_TYPE_FILESTORE) &&
(engineConfiguration.filestoreExists()))
{
configuration.setPersistentMessageStoreClassname(MessageStoreConstants.PERSISTENT_MESSAGE_STORE_CLASS_OBJECTMANAGER);
// Defect 449837
if (!isReload)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Messaging engine " + engineConfiguration.getName() + " is using a file store.");
}
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "initialize");
throw new IllegalStateException(nls.getString("MSGSTORE_CONFIGURATION_ERROR_SIMS0503"));
}
initialize(configuration, isReload);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "initialize");
} } | public class class_name {
private void initialize(JsMessagingEngine engineConfiguration, boolean isReload)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "initialize", new Object[] { "isReload=" + isReload, "Config=" + engineConfiguration });
_messagingEngine = engineConfiguration;
final WASConfiguration configuration = WASConfiguration.getDefaultWasConfiguration();
// Always support warm-restart. D178260
configuration.setCleanPersistenceOnStart(false);
//Venu Liberty change: changed the way we get FileStore config object
SIBFileStore fs = (SIBFileStore) _messagingEngine.getFilestore();
//there is no getLogFile !! lohith liberty change
configuration.setObjectManagerLogDirectory(fs.getPath());
configuration.setObjectManagerLogSize(fs.getLogFileSize());
configuration.setObjectManagerPermanentStoreDirectory(fs.getPath());
configuration.setObjectManagerMinimumPermanentStoreSize(fs.getMinPermanentFileStoreSize());
configuration.setObjectManagerMaximumPermanentStoreSize(fs.getMaxPermanentFileStoreSize());
configuration.setObjectManagerPermanentStoreSizeUnlimited(fs.isUnlimitedPermanentStoreSize());
configuration.setObjectManagerTemporaryStoreDirectory(fs.getPath());
configuration.setObjectManagerMinimumTemporaryStoreSize(fs.getMinTemporaryFileStoreSize());
configuration.setObjectManagerMaximumTemporaryStoreSize(fs.getMaxTemporaryFileStoreSize());
configuration.setObjectManagerTemporaryStoreSizeUnlimited(fs.isUnlimitedTemporaryStoreSize());
/*
* }
*/
// Finally, make sure that the message store type in the engine configuration has
// the corresponding configuration information. Otherwise, we're not going to get very far...
if ((engineConfiguration.getMessageStoreType() == JsMessagingEngine.MESSAGE_STORE_TYPE_DATASTORE) &&
(engineConfiguration.datastoreExists()))
{
configuration.setPersistentMessageStoreClassname(MessageStoreConstants.PERSISTENT_MESSAGE_STORE_CLASS_DATABASE); // depends on control dependency: [if], data = [none]
// Defect 449837
if (!isReload)
{
SibTr.info(tc, "MESSAGING_ENGINE_PERSISTENCE_DATASTORE_SIMS1568", new Object[] { engineConfiguration.getName() }); // depends on control dependency: [if], data = [none]
}
}
else if ((engineConfiguration.getMessageStoreType() == JsMessagingEngine.MESSAGE_STORE_TYPE_FILESTORE) &&
(engineConfiguration.filestoreExists()))
{
configuration.setPersistentMessageStoreClassname(MessageStoreConstants.PERSISTENT_MESSAGE_STORE_CLASS_OBJECTMANAGER); // depends on control dependency: [if], data = [none]
// Defect 449837
if (!isReload)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Messaging engine " + engineConfiguration.getName() + " is using a file store.");
}
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "initialize");
throw new IllegalStateException(nls.getString("MSGSTORE_CONFIGURATION_ERROR_SIMS0503"));
}
initialize(configuration, isReload);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "initialize");
} } |
public class class_name {
public final Mono<Void> and(Publisher<?> other) {
if (this instanceof MonoWhen) {
@SuppressWarnings("unchecked") MonoWhen o = (MonoWhen) this;
Mono<Void> result = o.whenAdditionalSource(other);
if (result != null) {
return result;
}
}
return when(this, other);
} } | public class class_name {
public final Mono<Void> and(Publisher<?> other) {
if (this instanceof MonoWhen) {
@SuppressWarnings("unchecked") MonoWhen o = (MonoWhen) this;
Mono<Void> result = o.whenAdditionalSource(other);
if (result != null) {
return result; // depends on control dependency: [if], data = [none]
}
}
return when(this, other);
} } |
public class class_name {
private static ImmutableSet<String> immutableTypeParametersInScope(
Symbol sym, VisitorState state, ImmutableAnalysis analysis) {
if (sym == null) {
return ImmutableSet.of();
}
ImmutableSet.Builder<String> result = ImmutableSet.builder();
OUTER:
for (Symbol s = sym; s.owner != null; s = s.owner) {
switch (s.getKind()) {
case INSTANCE_INIT:
continue;
case PACKAGE:
break OUTER;
default:
break;
}
AnnotationInfo annotation = analysis.getImmutableAnnotation(s, state);
if (annotation == null) {
continue;
}
for (TypeVariableSymbol typaram : s.getTypeParameters()) {
String name = typaram.getSimpleName().toString();
if (annotation.containerOf().contains(name)) {
result.add(name);
}
}
if (s.isStatic()) {
break;
}
}
return result.build();
} } | public class class_name {
private static ImmutableSet<String> immutableTypeParametersInScope(
Symbol sym, VisitorState state, ImmutableAnalysis analysis) {
if (sym == null) {
return ImmutableSet.of(); // depends on control dependency: [if], data = [none]
}
ImmutableSet.Builder<String> result = ImmutableSet.builder();
OUTER:
for (Symbol s = sym; s.owner != null; s = s.owner) {
switch (s.getKind()) {
case INSTANCE_INIT:
continue;
case PACKAGE:
break OUTER;
default:
break;
}
AnnotationInfo annotation = analysis.getImmutableAnnotation(s, state);
if (annotation == null) {
continue;
}
for (TypeVariableSymbol typaram : s.getTypeParameters()) {
String name = typaram.getSimpleName().toString();
if (annotation.containerOf().contains(name)) {
result.add(name); // depends on control dependency: [if], data = [none]
}
}
if (s.isStatic()) {
break;
}
}
return result.build();
} } |
public class class_name {
public UnicodeSet closeOver(int attribute) {
checkFrozen();
if ((attribute & (CASE | ADD_CASE_MAPPINGS)) != 0) {
UCaseProps csp = UCaseProps.INSTANCE;
UnicodeSet foldSet = new UnicodeSet(this);
ULocale root = ULocale.ROOT;
// start with input set to guarantee inclusion
// CASE: remove strings because the strings will actually be reduced (folded);
// therefore, start with no strings and add only those needed
if((attribute & CASE) != 0) {
foldSet.strings.clear();
}
int n = getRangeCount();
int result;
StringBuilder full = new StringBuilder();
for (int i=0; i<n; ++i) {
int start = getRangeStart(i);
int end = getRangeEnd(i);
if((attribute & CASE) != 0) {
// full case closure
for (int cp=start; cp<=end; ++cp) {
csp.addCaseClosure(cp, foldSet);
}
} else {
// add case mappings
// (does not add long s for regular s, or Kelvin for k, for example)
for (int cp=start; cp<=end; ++cp) {
result = csp.toFullLower(cp, null, full, UCaseProps.LOC_ROOT);
addCaseMapping(foldSet, result, full);
result = csp.toFullTitle(cp, null, full, UCaseProps.LOC_ROOT);
addCaseMapping(foldSet, result, full);
result = csp.toFullUpper(cp, null, full, UCaseProps.LOC_ROOT);
addCaseMapping(foldSet, result, full);
result = csp.toFullFolding(cp, full, 0);
addCaseMapping(foldSet, result, full);
}
}
}
if (!strings.isEmpty()) {
if ((attribute & CASE) != 0) {
for (String s : strings) {
String str = UCharacter.foldCase(s, 0);
if(!csp.addStringCaseClosure(str, foldSet)) {
foldSet.add(str); // does not map to code points: add the folded string itself
}
}
} else {
BreakIterator bi = BreakIterator.getWordInstance(root);
for (String str : strings) {
// TODO: call lower-level functions
foldSet.add(UCharacter.toLowerCase(root, str));
foldSet.add(UCharacter.toTitleCase(root, str, bi));
foldSet.add(UCharacter.toUpperCase(root, str));
foldSet.add(UCharacter.foldCase(str, 0));
}
}
}
set(foldSet);
}
return this;
} } | public class class_name {
public UnicodeSet closeOver(int attribute) {
checkFrozen();
if ((attribute & (CASE | ADD_CASE_MAPPINGS)) != 0) {
UCaseProps csp = UCaseProps.INSTANCE;
UnicodeSet foldSet = new UnicodeSet(this);
ULocale root = ULocale.ROOT;
// start with input set to guarantee inclusion
// CASE: remove strings because the strings will actually be reduced (folded);
// therefore, start with no strings and add only those needed
if((attribute & CASE) != 0) {
foldSet.strings.clear(); // depends on control dependency: [if], data = [none]
}
int n = getRangeCount();
int result;
StringBuilder full = new StringBuilder();
for (int i=0; i<n; ++i) {
int start = getRangeStart(i);
int end = getRangeEnd(i);
if((attribute & CASE) != 0) {
// full case closure
for (int cp=start; cp<=end; ++cp) {
csp.addCaseClosure(cp, foldSet); // depends on control dependency: [for], data = [cp]
}
} else {
// add case mappings
// (does not add long s for regular s, or Kelvin for k, for example)
for (int cp=start; cp<=end; ++cp) {
result = csp.toFullLower(cp, null, full, UCaseProps.LOC_ROOT); // depends on control dependency: [for], data = [cp]
addCaseMapping(foldSet, result, full); // depends on control dependency: [for], data = [none]
result = csp.toFullTitle(cp, null, full, UCaseProps.LOC_ROOT); // depends on control dependency: [for], data = [cp]
addCaseMapping(foldSet, result, full); // depends on control dependency: [for], data = [none]
result = csp.toFullUpper(cp, null, full, UCaseProps.LOC_ROOT); // depends on control dependency: [for], data = [cp]
addCaseMapping(foldSet, result, full); // depends on control dependency: [for], data = [none]
result = csp.toFullFolding(cp, full, 0); // depends on control dependency: [for], data = [cp]
addCaseMapping(foldSet, result, full); // depends on control dependency: [for], data = [none]
}
}
}
if (!strings.isEmpty()) {
if ((attribute & CASE) != 0) {
for (String s : strings) {
String str = UCharacter.foldCase(s, 0);
if(!csp.addStringCaseClosure(str, foldSet)) {
foldSet.add(str); // does not map to code points: add the folded string itself // depends on control dependency: [if], data = [none]
}
}
} else {
BreakIterator bi = BreakIterator.getWordInstance(root);
for (String str : strings) {
// TODO: call lower-level functions
foldSet.add(UCharacter.toLowerCase(root, str)); // depends on control dependency: [for], data = [str]
foldSet.add(UCharacter.toTitleCase(root, str, bi)); // depends on control dependency: [for], data = [str]
foldSet.add(UCharacter.toUpperCase(root, str)); // depends on control dependency: [for], data = [str]
foldSet.add(UCharacter.foldCase(str, 0)); // depends on control dependency: [for], data = [str]
}
}
}
set(foldSet); // depends on control dependency: [if], data = [none]
}
return this;
} } |
public class class_name {
public ClassInfoList intersect(final ClassInfoList... others) {
// Put the first ClassInfoList that is not being sorted by name at the head of the list,
// so that its order is preserved in the intersection (#238)
final ArrayDeque<ClassInfoList> intersectionOrder = new ArrayDeque<>();
intersectionOrder.add(this);
boolean foundFirst = false;
for (final ClassInfoList other : others) {
if (other.sortByName) {
intersectionOrder.add(other);
} else if (!foundFirst) {
foundFirst = true;
intersectionOrder.push(other);
} else {
intersectionOrder.add(other);
}
}
final ClassInfoList first = intersectionOrder.remove();
final Set<ClassInfo> reachableClassesIntersection = new LinkedHashSet<>(first);
while (!intersectionOrder.isEmpty()) {
reachableClassesIntersection.retainAll(intersectionOrder.remove());
}
final Set<ClassInfo> directlyRelatedClassesIntersection = new LinkedHashSet<>(directlyRelatedClasses);
for (final ClassInfoList other : others) {
directlyRelatedClassesIntersection.retainAll(other.directlyRelatedClasses);
}
return new ClassInfoList(reachableClassesIntersection, directlyRelatedClassesIntersection,
first.sortByName);
} } | public class class_name {
public ClassInfoList intersect(final ClassInfoList... others) {
// Put the first ClassInfoList that is not being sorted by name at the head of the list,
// so that its order is preserved in the intersection (#238)
final ArrayDeque<ClassInfoList> intersectionOrder = new ArrayDeque<>();
intersectionOrder.add(this);
boolean foundFirst = false;
for (final ClassInfoList other : others) {
if (other.sortByName) {
intersectionOrder.add(other); // depends on control dependency: [if], data = [none]
} else if (!foundFirst) {
foundFirst = true; // depends on control dependency: [if], data = [none]
intersectionOrder.push(other); // depends on control dependency: [if], data = [none]
} else {
intersectionOrder.add(other); // depends on control dependency: [if], data = [none]
}
}
final ClassInfoList first = intersectionOrder.remove();
final Set<ClassInfo> reachableClassesIntersection = new LinkedHashSet<>(first);
while (!intersectionOrder.isEmpty()) {
reachableClassesIntersection.retainAll(intersectionOrder.remove()); // depends on control dependency: [while], data = [none]
}
final Set<ClassInfo> directlyRelatedClassesIntersection = new LinkedHashSet<>(directlyRelatedClasses);
for (final ClassInfoList other : others) {
directlyRelatedClassesIntersection.retainAll(other.directlyRelatedClasses); // depends on control dependency: [for], data = [other]
}
return new ClassInfoList(reachableClassesIntersection, directlyRelatedClassesIntersection,
first.sortByName);
} } |
public class class_name {
public static Date getFromTimestamp(Timestamp timestamp) {
if (timestamp == null) {
return null;
}
return new Date(timestamp.getTime());
} } | public class class_name {
public static Date getFromTimestamp(Timestamp timestamp) {
if (timestamp == null) {
return null; // depends on control dependency: [if], data = [none]
}
return new Date(timestamp.getTime());
} } |
public class class_name {
public static Point2dfx convert(Tuple2D<?> tuple) {
if (tuple instanceof Point2dfx) {
return (Point2dfx) tuple;
}
return new Point2dfx(tuple.getX(), tuple.getY());
} } | public class class_name {
public static Point2dfx convert(Tuple2D<?> tuple) {
if (tuple instanceof Point2dfx) {
return (Point2dfx) tuple; // depends on control dependency: [if], data = [none]
}
return new Point2dfx(tuple.getX(), tuple.getY());
} } |
public class class_name {
public final EObject entryRuleXSwitchExpression() throws RecognitionException {
EObject current = null;
EObject iv_ruleXSwitchExpression = null;
try {
// InternalSARL.g:8533:58: (iv_ruleXSwitchExpression= ruleXSwitchExpression EOF )
// InternalSARL.g:8534:2: iv_ruleXSwitchExpression= ruleXSwitchExpression EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getXSwitchExpressionRule());
}
pushFollow(FOLLOW_1);
iv_ruleXSwitchExpression=ruleXSwitchExpression();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleXSwitchExpression;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} } | public class class_name {
public final EObject entryRuleXSwitchExpression() throws RecognitionException {
EObject current = null;
EObject iv_ruleXSwitchExpression = null;
try {
// InternalSARL.g:8533:58: (iv_ruleXSwitchExpression= ruleXSwitchExpression EOF )
// InternalSARL.g:8534:2: iv_ruleXSwitchExpression= ruleXSwitchExpression EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getXSwitchExpressionRule()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_1);
iv_ruleXSwitchExpression=ruleXSwitchExpression();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleXSwitchExpression; // depends on control dependency: [if], data = [none]
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} } |
public class class_name {
protected void paintTabArea(SeaGlassContext ss, Graphics g, int tabPlacement, int selectedIndex, Rectangle tabAreaBounds) {
Rectangle clipRect = g.getClipBounds();
ss.setComponentState(SynthConstants.ENABLED);
// Paint the tab area.
SeaGlassLookAndFeel.updateSubregion(ss, g, tabAreaBounds);
ss.getPainter().paintTabbedPaneTabAreaBackground(ss, g, tabAreaBounds.x, tabAreaBounds.y, tabAreaBounds.width,
tabAreaBounds.height, tabPlacement);
ss.getPainter().paintTabbedPaneTabAreaBorder(ss, g, tabAreaBounds.x, tabAreaBounds.y, tabAreaBounds.width, tabAreaBounds.height,
tabPlacement);
iconRect.setBounds(0, 0, 0, 0);
textRect.setBounds(0, 0, 0, 0);
if (runCount == 0) {
return;
}
if (scrollBackwardButton.isVisible()) {
paintScrollButtonBackground(ss, g, scrollBackwardButton);
}
if (scrollForwardButton.isVisible()) {
paintScrollButtonBackground(ss, g, scrollForwardButton);
}
for (int i = leadingTabIndex; i <= trailingTabIndex; i++) {
if (rects[i].intersects(clipRect) && selectedIndex != i) {
paintTab(tabContext, g, rects, i, iconRect, textRect);
}
}
if (selectedIndex >= 0) {
if (rects[selectedIndex].intersects(clipRect)) {
paintTab(tabContext, g, rects, selectedIndex, iconRect, textRect);
}
}
} } | public class class_name {
protected void paintTabArea(SeaGlassContext ss, Graphics g, int tabPlacement, int selectedIndex, Rectangle tabAreaBounds) {
Rectangle clipRect = g.getClipBounds();
ss.setComponentState(SynthConstants.ENABLED);
// Paint the tab area.
SeaGlassLookAndFeel.updateSubregion(ss, g, tabAreaBounds);
ss.getPainter().paintTabbedPaneTabAreaBackground(ss, g, tabAreaBounds.x, tabAreaBounds.y, tabAreaBounds.width,
tabAreaBounds.height, tabPlacement);
ss.getPainter().paintTabbedPaneTabAreaBorder(ss, g, tabAreaBounds.x, tabAreaBounds.y, tabAreaBounds.width, tabAreaBounds.height,
tabPlacement);
iconRect.setBounds(0, 0, 0, 0);
textRect.setBounds(0, 0, 0, 0);
if (runCount == 0) {
return; // depends on control dependency: [if], data = [none]
}
if (scrollBackwardButton.isVisible()) {
paintScrollButtonBackground(ss, g, scrollBackwardButton); // depends on control dependency: [if], data = [none]
}
if (scrollForwardButton.isVisible()) {
paintScrollButtonBackground(ss, g, scrollForwardButton); // depends on control dependency: [if], data = [none]
}
for (int i = leadingTabIndex; i <= trailingTabIndex; i++) {
if (rects[i].intersects(clipRect) && selectedIndex != i) {
paintTab(tabContext, g, rects, i, iconRect, textRect); // depends on control dependency: [if], data = [none]
}
}
if (selectedIndex >= 0) {
if (rects[selectedIndex].intersects(clipRect)) {
paintTab(tabContext, g, rects, selectedIndex, iconRect, textRect); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public HttpServer build() {
checkNotNull(baseUri);
StandaloneWebConverterConfiguration configuration = makeConfiguration();
// The configuration has to be configured both by a binder to make it injectable
// and directly in order to trigger life cycle methods on the deployment container.
ResourceConfig resourceConfig = ResourceConfig
.forApplication(new WebConverterApplication(configuration))
.register(configuration);
if (sslContext == null) {
return GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig);
} else {
return GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig, true, new SSLEngineConfigurator(sslContext));
}
} } | public class class_name {
public HttpServer build() {
checkNotNull(baseUri);
StandaloneWebConverterConfiguration configuration = makeConfiguration();
// The configuration has to be configured both by a binder to make it injectable
// and directly in order to trigger life cycle methods on the deployment container.
ResourceConfig resourceConfig = ResourceConfig
.forApplication(new WebConverterApplication(configuration))
.register(configuration);
if (sslContext == null) {
return GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig); // depends on control dependency: [if], data = [none]
} else {
return GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig, true, new SSLEngineConfigurator(sslContext)); // depends on control dependency: [if], data = [(sslContext]
}
} } |
public class class_name {
private boolean isPushedTypeMatch(final DitaClass targetClassAttribute, final DocumentFragment content) {
DitaClass clazz = null;
if (content.hasChildNodes()) {
final NodeList nodeList = content.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
final Node node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
final Element elem = (Element) node;
clazz = new DitaClass(elem.getAttribute(ATTRIBUTE_NAME_CLASS));
break;
// get type of the target element
}
}
}
return targetClassAttribute.matches(clazz);
} } | public class class_name {
private boolean isPushedTypeMatch(final DitaClass targetClassAttribute, final DocumentFragment content) {
DitaClass clazz = null;
if (content.hasChildNodes()) {
final NodeList nodeList = content.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
final Node node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
final Element elem = (Element) node;
clazz = new DitaClass(elem.getAttribute(ATTRIBUTE_NAME_CLASS)); // depends on control dependency: [if], data = [none]
break;
// get type of the target element
}
}
}
return targetClassAttribute.matches(clazz);
} } |
public class class_name {
private void performInitializations() {
try {
BMSClient.getInstance().initialize(getApplicationContext(), backendURL, backendGUID, BMSClient.REGION_US_SOUTH);
} catch (MalformedURLException e) {
e.printStackTrace();
}
MCAAuthorizationManager mcaAuthorizationManager = MCAAuthorizationManager.createInstance(this.getApplicationContext());
mcaAuthorizationManager.registerAuthenticationListener(customRealm, new MyChallengeHandler());
// to make the authorization happen next time
mcaAuthorizationManager.clearAuthorizationData();
BMSClient.getInstance().setAuthorizationManager(mcaAuthorizationManager);
Logger.setLogLevel(Logger.LEVEL.DEBUG);
Logger.setSDKDebugLoggingEnabled(true);
} } | public class class_name {
private void performInitializations() {
try {
BMSClient.getInstance().initialize(getApplicationContext(), backendURL, backendGUID, BMSClient.REGION_US_SOUTH); // depends on control dependency: [try], data = [none]
} catch (MalformedURLException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
MCAAuthorizationManager mcaAuthorizationManager = MCAAuthorizationManager.createInstance(this.getApplicationContext());
mcaAuthorizationManager.registerAuthenticationListener(customRealm, new MyChallengeHandler());
// to make the authorization happen next time
mcaAuthorizationManager.clearAuthorizationData();
BMSClient.getInstance().setAuthorizationManager(mcaAuthorizationManager);
Logger.setLogLevel(Logger.LEVEL.DEBUG);
Logger.setSDKDebugLoggingEnabled(true);
} } |
public class class_name {
private void addAncilliaryEntityData(StructAsym asym, int entityId, Entity entity, EntityInfo entityInfo) {
// Loop through each of the entity types and add the corresponding data
// We're assuming if data is duplicated between sources it is consistent
// This is a potentially huge assumption...
for (EntitySrcGen esg : entitySrcGens) {
if (! esg.getEntity_id().equals(asym.getEntity_id()))
continue;
addInformationFromESG(esg, entityId, entityInfo);
}
for (EntitySrcNat esn : entitySrcNats) {
if (! esn.getEntity_id().equals(asym.getEntity_id()))
continue;
addInformationFromESN(esn, entityId, entityInfo);
}
for (EntitySrcSyn ess : entitySrcSyns) {
if (! ess.getEntity_id().equals(asym.getEntity_id()))
continue;
addInfoFromESS(ess, entityId, entityInfo);
}
} } | public class class_name {
private void addAncilliaryEntityData(StructAsym asym, int entityId, Entity entity, EntityInfo entityInfo) {
// Loop through each of the entity types and add the corresponding data
// We're assuming if data is duplicated between sources it is consistent
// This is a potentially huge assumption...
for (EntitySrcGen esg : entitySrcGens) {
if (! esg.getEntity_id().equals(asym.getEntity_id()))
continue;
addInformationFromESG(esg, entityId, entityInfo); // depends on control dependency: [for], data = [esg]
}
for (EntitySrcNat esn : entitySrcNats) {
if (! esn.getEntity_id().equals(asym.getEntity_id()))
continue;
addInformationFromESN(esn, entityId, entityInfo); // depends on control dependency: [for], data = [esn]
}
for (EntitySrcSyn ess : entitySrcSyns) {
if (! ess.getEntity_id().equals(asym.getEntity_id()))
continue;
addInfoFromESS(ess, entityId, entityInfo); // depends on control dependency: [for], data = [ess]
}
} } |
public class class_name {
private Set<String> collectDescendingInstances(
String instanceId,
Map<String, List<CmsContainerBean>> containersByParent) {
Set<String> descendingInstances = new HashSet<String>();
descendingInstances.add(instanceId);
if (containersByParent.containsKey(instanceId)) {
for (CmsContainerBean container : containersByParent.get(instanceId)) {
for (CmsContainerElementBean element : container.getElements()) {
descendingInstances.addAll(collectDescendingInstances(element.getInstanceId(), containersByParent));
}
}
}
return descendingInstances;
} } | public class class_name {
private Set<String> collectDescendingInstances(
String instanceId,
Map<String, List<CmsContainerBean>> containersByParent) {
Set<String> descendingInstances = new HashSet<String>();
descendingInstances.add(instanceId);
if (containersByParent.containsKey(instanceId)) {
for (CmsContainerBean container : containersByParent.get(instanceId)) {
for (CmsContainerElementBean element : container.getElements()) {
descendingInstances.addAll(collectDescendingInstances(element.getInstanceId(), containersByParent)); // depends on control dependency: [for], data = [element]
}
}
}
return descendingInstances;
} } |
public class class_name {
public void marshall(Group group, ProtocolMarshaller protocolMarshaller) {
if (group == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(group.getId(), ID_BINDING);
protocolMarshaller.marshall(group.getEmail(), EMAIL_BINDING);
protocolMarshaller.marshall(group.getName(), NAME_BINDING);
protocolMarshaller.marshall(group.getState(), STATE_BINDING);
protocolMarshaller.marshall(group.getEnabledDate(), ENABLEDDATE_BINDING);
protocolMarshaller.marshall(group.getDisabledDate(), DISABLEDDATE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(Group group, ProtocolMarshaller protocolMarshaller) {
if (group == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(group.getId(), ID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(group.getEmail(), EMAIL_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(group.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(group.getState(), STATE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(group.getEnabledDate(), ENABLEDDATE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(group.getDisabledDate(), DISABLEDDATE_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 static List<WayDataBlock> toWayDataBlockList(Geometry geometry) {
List<WayDataBlock> res = new ArrayList<>();
if (geometry instanceof MultiPolygon) {
MultiPolygon mp = (MultiPolygon) geometry;
for (int i = 0; i < mp.getNumGeometries(); i++) {
Polygon p = (Polygon) mp.getGeometryN(i);
List<Integer> outer = toCoordinateList(p.getExteriorRing());
if (outer.size() / 2 > 0) {
List<List<Integer>> inner = new ArrayList<>();
for (int j = 0; j < p.getNumInteriorRing(); j++) {
List<Integer> innr = toCoordinateList(p.getInteriorRingN(j));
if (innr.size() / 2 > 0) {
inner.add(innr);
}
}
res.add(new WayDataBlock(outer, inner));
}
}
} else if (geometry instanceof Polygon) {
Polygon p = (Polygon) geometry;
List<Integer> outer = toCoordinateList(p.getExteriorRing());
if (outer.size() / 2 > 0) {
List<List<Integer>> inner = new ArrayList<>();
for (int i = 0; i < p.getNumInteriorRing(); i++) {
List<Integer> innr = toCoordinateList(p.getInteriorRingN(i));
if (innr.size() / 2 > 0) {
inner.add(innr);
}
}
res.add(new WayDataBlock(outer, inner));
}
} else if (geometry instanceof MultiLineString) {
MultiLineString ml = (MultiLineString) geometry;
for (int i = 0; i < ml.getNumGeometries(); i++) {
LineString l = (LineString) ml.getGeometryN(i);
List<Integer> outer = toCoordinateList(l);
if (outer.size() / 2 > 0) {
res.add(new WayDataBlock(outer, null));
}
}
} else if (geometry instanceof LinearRing || geometry instanceof LineString) {
List<Integer> outer = toCoordinateList(geometry);
if (outer.size() / 2 > 0) {
res.add(new WayDataBlock(outer, null));
}
} else if (geometry instanceof GeometryCollection) {
GeometryCollection gc = (GeometryCollection) geometry;
for (int i = 0; i < gc.getNumGeometries(); i++) {
List<WayDataBlock> recursiveResult = toWayDataBlockList(gc.getGeometryN(i));
for (WayDataBlock wayDataBlock : recursiveResult) {
List<Integer> outer = wayDataBlock.getOuterWay();
if (outer.size() / 2 > 0) {
res.add(wayDataBlock);
}
}
}
}
return res;
} } | public class class_name {
public static List<WayDataBlock> toWayDataBlockList(Geometry geometry) {
List<WayDataBlock> res = new ArrayList<>();
if (geometry instanceof MultiPolygon) {
MultiPolygon mp = (MultiPolygon) geometry;
for (int i = 0; i < mp.getNumGeometries(); i++) {
Polygon p = (Polygon) mp.getGeometryN(i);
List<Integer> outer = toCoordinateList(p.getExteriorRing());
if (outer.size() / 2 > 0) {
List<List<Integer>> inner = new ArrayList<>();
for (int j = 0; j < p.getNumInteriorRing(); j++) {
List<Integer> innr = toCoordinateList(p.getInteriorRingN(j));
if (innr.size() / 2 > 0) {
inner.add(innr); // depends on control dependency: [if], data = [none]
}
}
res.add(new WayDataBlock(outer, inner)); // depends on control dependency: [if], data = [none]
}
}
} else if (geometry instanceof Polygon) {
Polygon p = (Polygon) geometry;
List<Integer> outer = toCoordinateList(p.getExteriorRing());
if (outer.size() / 2 > 0) {
List<List<Integer>> inner = new ArrayList<>();
for (int i = 0; i < p.getNumInteriorRing(); i++) {
List<Integer> innr = toCoordinateList(p.getInteriorRingN(i));
if (innr.size() / 2 > 0) {
inner.add(innr); // depends on control dependency: [if], data = [none]
}
}
res.add(new WayDataBlock(outer, inner)); // depends on control dependency: [if], data = [none]
}
} else if (geometry instanceof MultiLineString) {
MultiLineString ml = (MultiLineString) geometry;
for (int i = 0; i < ml.getNumGeometries(); i++) {
LineString l = (LineString) ml.getGeometryN(i);
List<Integer> outer = toCoordinateList(l);
if (outer.size() / 2 > 0) {
res.add(new WayDataBlock(outer, null)); // depends on control dependency: [if], data = [none]
}
}
} else if (geometry instanceof LinearRing || geometry instanceof LineString) {
List<Integer> outer = toCoordinateList(geometry);
if (outer.size() / 2 > 0) {
res.add(new WayDataBlock(outer, null)); // depends on control dependency: [if], data = [none]
}
} else if (geometry instanceof GeometryCollection) {
GeometryCollection gc = (GeometryCollection) geometry;
for (int i = 0; i < gc.getNumGeometries(); i++) {
List<WayDataBlock> recursiveResult = toWayDataBlockList(gc.getGeometryN(i));
for (WayDataBlock wayDataBlock : recursiveResult) {
List<Integer> outer = wayDataBlock.getOuterWay();
if (outer.size() / 2 > 0) {
res.add(wayDataBlock); // depends on control dependency: [if], data = [none]
}
}
}
}
return res;
} } |
public class class_name {
private void initGUI() {
Font fFont = new Font("Dialog", Font.PLAIN, 12);
setLayout(new BorderLayout());
Panel p = new Panel();
p.setBackground(SystemColor.control);
p.setLayout(new GridLayout(16, 1));
tSourceTable = new TextField();
tSourceTable.setEnabled(false);
tDestTable = new TextField();
tDestTable.addActionListener(this);
tDestDrop = new TextField();
tDestDrop.addActionListener(this);
tDestCreate = new TextField();
tDestCreate.addActionListener(this);
tDestDelete = new TextField();
tDestDelete.addActionListener(this);
tDestCreateIndex = new TextField();
tDestCreateIndex.addActionListener(this);
tDestDropIndex = new TextField();
tDestDropIndex.addActionListener(this);
tSourceSelect = new TextField();
tSourceSelect.addActionListener(this);
tDestInsert = new TextField();
tDestInsert.addActionListener(this);
tDestAlter = new TextField();
tDestAlter.addActionListener(this);
cTransfer = new Checkbox("Transfer to destination table", true);
cTransfer.addItemListener(this);
cDrop = new Checkbox("Drop destination table (ignore error)", true);
cDrop.addItemListener(this);
cCreate = new Checkbox("Create destination table", true);
cCreate.addItemListener(this);
cDropIndex = new Checkbox("Drop destination index (ignore error)",
true);
cDropIndex.addItemListener(this);
cIdxForced = new Checkbox("force Idx_ prefix for indexes names",
false);
cIdxForced.addItemListener(this);
cCreateIndex = new Checkbox("Create destination index", true);
cCreateIndex.addItemListener(this);
cDelete = new Checkbox("Delete rows in destination table", true);
cDelete.addItemListener(this);
cInsert = new Checkbox("Insert into destination", true);
cInsert.addItemListener(this);
cFKForced = new Checkbox("force FK_ prefix for foreign key names",
false);
cFKForced.addItemListener(this);
cAlter = new Checkbox("Alter destination table", true);
cAlter.addItemListener(this);
p.add(createLabel("Source table"));
p.add(tSourceTable);
p.add(cTransfer);
p.add(tDestTable);
p.add(cDrop);
p.add(tDestDrop);
p.add(cCreate);
p.add(tDestCreate);
p.add(cDropIndex);
p.add(tDestDropIndex);
p.add(cCreateIndex);
p.add(tDestCreateIndex);
p.add(cDelete);
p.add(tDestDelete);
p.add(cAlter);
p.add(tDestAlter);
p.add(createLabel("Select source records"));
p.add(tSourceSelect);
p.add(cInsert);
p.add(tDestInsert);
p.add(createLabel(""));
p.add(createLabel(""));
p.add(cIdxForced);
p.add(cFKForced);
p.add(createLabel(""));
p.add(createLabel(""));
if (iTransferMode == TRFM_TRANSFER) {
bStart = new Button("Start Transfer");
bContinue = new Button("Continue Transfer");
bContinue.setEnabled(false);
} else if (iTransferMode == Transfer.TRFM_DUMP) {
bStart = new Button("Start Dump");
} else if (iTransferMode == Transfer.TRFM_RESTORE) {
bStart = new Button("Start Restore");
}
bStart.addActionListener(this);
p.add(bStart);
if (iTransferMode == TRFM_TRANSFER) {
bContinue.addActionListener(this);
p.add(bContinue);
}
bStart.setEnabled(false);
fMain.add("Center", createBorderPanel(p));
lTable = new java.awt.List(10);
lTable.addItemListener(this);
fMain.add("West", createBorderPanel(lTable));
tMessage = new TextField();
Panel pMessage = createBorderPanel(tMessage);
fMain.add("South", pMessage);
} } | public class class_name {
private void initGUI() {
Font fFont = new Font("Dialog", Font.PLAIN, 12);
setLayout(new BorderLayout());
Panel p = new Panel();
p.setBackground(SystemColor.control);
p.setLayout(new GridLayout(16, 1));
tSourceTable = new TextField();
tSourceTable.setEnabled(false);
tDestTable = new TextField();
tDestTable.addActionListener(this);
tDestDrop = new TextField();
tDestDrop.addActionListener(this);
tDestCreate = new TextField();
tDestCreate.addActionListener(this);
tDestDelete = new TextField();
tDestDelete.addActionListener(this);
tDestCreateIndex = new TextField();
tDestCreateIndex.addActionListener(this);
tDestDropIndex = new TextField();
tDestDropIndex.addActionListener(this);
tSourceSelect = new TextField();
tSourceSelect.addActionListener(this);
tDestInsert = new TextField();
tDestInsert.addActionListener(this);
tDestAlter = new TextField();
tDestAlter.addActionListener(this);
cTransfer = new Checkbox("Transfer to destination table", true);
cTransfer.addItemListener(this);
cDrop = new Checkbox("Drop destination table (ignore error)", true);
cDrop.addItemListener(this);
cCreate = new Checkbox("Create destination table", true);
cCreate.addItemListener(this);
cDropIndex = new Checkbox("Drop destination index (ignore error)",
true);
cDropIndex.addItemListener(this);
cIdxForced = new Checkbox("force Idx_ prefix for indexes names",
false);
cIdxForced.addItemListener(this);
cCreateIndex = new Checkbox("Create destination index", true);
cCreateIndex.addItemListener(this);
cDelete = new Checkbox("Delete rows in destination table", true);
cDelete.addItemListener(this);
cInsert = new Checkbox("Insert into destination", true);
cInsert.addItemListener(this);
cFKForced = new Checkbox("force FK_ prefix for foreign key names",
false);
cFKForced.addItemListener(this);
cAlter = new Checkbox("Alter destination table", true);
cAlter.addItemListener(this);
p.add(createLabel("Source table"));
p.add(tSourceTable);
p.add(cTransfer);
p.add(tDestTable);
p.add(cDrop);
p.add(tDestDrop);
p.add(cCreate);
p.add(tDestCreate);
p.add(cDropIndex);
p.add(tDestDropIndex);
p.add(cCreateIndex);
p.add(tDestCreateIndex);
p.add(cDelete);
p.add(tDestDelete);
p.add(cAlter);
p.add(tDestAlter);
p.add(createLabel("Select source records"));
p.add(tSourceSelect);
p.add(cInsert);
p.add(tDestInsert);
p.add(createLabel(""));
p.add(createLabel(""));
p.add(cIdxForced);
p.add(cFKForced);
p.add(createLabel(""));
p.add(createLabel(""));
if (iTransferMode == TRFM_TRANSFER) {
bStart = new Button("Start Transfer"); // depends on control dependency: [if], data = [none]
bContinue = new Button("Continue Transfer"); // depends on control dependency: [if], data = [none]
bContinue.setEnabled(false); // depends on control dependency: [if], data = [none]
} else if (iTransferMode == Transfer.TRFM_DUMP) {
bStart = new Button("Start Dump"); // depends on control dependency: [if], data = [none]
} else if (iTransferMode == Transfer.TRFM_RESTORE) {
bStart = new Button("Start Restore"); // depends on control dependency: [if], data = [none]
}
bStart.addActionListener(this);
p.add(bStart);
if (iTransferMode == TRFM_TRANSFER) {
bContinue.addActionListener(this); // depends on control dependency: [if], data = [none]
p.add(bContinue); // depends on control dependency: [if], data = [none]
}
bStart.setEnabled(false);
fMain.add("Center", createBorderPanel(p));
lTable = new java.awt.List(10);
lTable.addItemListener(this);
fMain.add("West", createBorderPanel(lTable));
tMessage = new TextField();
Panel pMessage = createBorderPanel(tMessage);
fMain.add("South", pMessage);
} } |
public class class_name {
public List<CmsListItem> filter(List<CmsListItem> items, String filter) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(filter)) {
return items;
}
String filterCriteria = filter;
if (m_caseInSensitive) {
filterCriteria = filter.toLowerCase();
}
List<CmsListItem> res = new ArrayList<CmsListItem>();
Iterator<CmsListItem> itItems = items.iterator();
while (itItems.hasNext()) {
CmsListItem item = itItems.next();
if (res.contains(item)) {
continue;
}
Iterator<CmsListColumnDefinition> itCols = m_columns.iterator();
while (itCols.hasNext()) {
CmsListColumnDefinition col = itCols.next();
if (item.get(col.getId()) == null) {
continue;
}
String columnValue = item.get(col.getId()).toString();
if (m_caseInSensitive) {
columnValue = columnValue.toLowerCase();
}
if (columnValue.indexOf(filterCriteria) > -1) {
res.add(item);
break;
}
}
}
return res;
} } | public class class_name {
public List<CmsListItem> filter(List<CmsListItem> items, String filter) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(filter)) {
return items; // depends on control dependency: [if], data = [none]
}
String filterCriteria = filter;
if (m_caseInSensitive) {
filterCriteria = filter.toLowerCase(); // depends on control dependency: [if], data = [none]
}
List<CmsListItem> res = new ArrayList<CmsListItem>();
Iterator<CmsListItem> itItems = items.iterator();
while (itItems.hasNext()) {
CmsListItem item = itItems.next();
if (res.contains(item)) {
continue;
}
Iterator<CmsListColumnDefinition> itCols = m_columns.iterator();
while (itCols.hasNext()) {
CmsListColumnDefinition col = itCols.next();
if (item.get(col.getId()) == null) {
continue;
}
String columnValue = item.get(col.getId()).toString();
if (m_caseInSensitive) {
columnValue = columnValue.toLowerCase(); // depends on control dependency: [if], data = [none]
}
if (columnValue.indexOf(filterCriteria) > -1) {
res.add(item); // depends on control dependency: [if], data = [none]
break;
}
}
}
return res;
} } |
public class class_name {
public void addPackageInternal(Package appPackage) {
int flags =
GET_ACTIVITIES
| GET_RECEIVERS
| GET_SERVICES
| GET_PROVIDERS
| GET_INSTRUMENTATION
| GET_INTENT_FILTERS
| GET_SIGNATURES
| GET_RESOLVED_FILTER
| GET_META_DATA
| GET_GIDS
| MATCH_DISABLED_COMPONENTS
| GET_SHARED_LIBRARY_FILES
| GET_URI_PERMISSION_PATTERNS
| GET_PERMISSIONS
| MATCH_UNINSTALLED_PACKAGES
| GET_CONFIGURATIONS
| MATCH_DISABLED_UNTIL_USED_COMPONENTS
| MATCH_DIRECT_BOOT_UNAWARE
| MATCH_DIRECT_BOOT_AWARE;
for (PermissionGroup permissionGroup : appPackage.permissionGroups) {
PermissionGroupInfo permissionGroupInfo =
PackageParser.generatePermissionGroupInfo(permissionGroup, flags);
addPermissionGroupInfo(permissionGroupInfo);
}
PackageInfo packageInfo =
reflector(_PackageParser_.class)
.generatePackageInfo(appPackage, new int[] {0}, flags, 0, 0);
packageInfo.applicationInfo.uid = Process.myUid();
packageInfo.applicationInfo.dataDir = createTempDir(packageInfo.packageName + "-dataDir");
installPackage(packageInfo);
addFilters(activityFilters, appPackage.activities);
addFilters(serviceFilters, appPackage.services);
addFilters(providerFilters, appPackage.providers);
addFilters(receiverFilters, appPackage.receivers);
} } | public class class_name {
public void addPackageInternal(Package appPackage) {
int flags =
GET_ACTIVITIES
| GET_RECEIVERS
| GET_SERVICES
| GET_PROVIDERS
| GET_INSTRUMENTATION
| GET_INTENT_FILTERS
| GET_SIGNATURES
| GET_RESOLVED_FILTER
| GET_META_DATA
| GET_GIDS
| MATCH_DISABLED_COMPONENTS
| GET_SHARED_LIBRARY_FILES
| GET_URI_PERMISSION_PATTERNS
| GET_PERMISSIONS
| MATCH_UNINSTALLED_PACKAGES
| GET_CONFIGURATIONS
| MATCH_DISABLED_UNTIL_USED_COMPONENTS
| MATCH_DIRECT_BOOT_UNAWARE
| MATCH_DIRECT_BOOT_AWARE;
for (PermissionGroup permissionGroup : appPackage.permissionGroups) {
PermissionGroupInfo permissionGroupInfo =
PackageParser.generatePermissionGroupInfo(permissionGroup, flags);
addPermissionGroupInfo(permissionGroupInfo); // depends on control dependency: [for], data = [permissionGroup]
}
PackageInfo packageInfo =
reflector(_PackageParser_.class)
.generatePackageInfo(appPackage, new int[] {0}, flags, 0, 0);
packageInfo.applicationInfo.uid = Process.myUid();
packageInfo.applicationInfo.dataDir = createTempDir(packageInfo.packageName + "-dataDir");
installPackage(packageInfo);
addFilters(activityFilters, appPackage.activities);
addFilters(serviceFilters, appPackage.services);
addFilters(providerFilters, appPackage.providers);
addFilters(receiverFilters, appPackage.receivers);
} } |
public class class_name {
private void setup(BeanMetaData bmd)
{
if (!ivSetup)
{
int slotSize = bmd.container.getEJBRuntime().getMetaDataSlotSize(MethodMetaData.class);
for (int i = 0; i < capacity; ++i)
{
EJBMethodInfoImpl methodInfo = bmd.createEJBMethodInfoImpl(slotSize);
methodInfo.initializeInstanceData(null, null, null, null, null, false);
elements[i] = methodInfo;
}
ivSetup = true;
}
} } | public class class_name {
private void setup(BeanMetaData bmd)
{
if (!ivSetup)
{
int slotSize = bmd.container.getEJBRuntime().getMetaDataSlotSize(MethodMetaData.class);
for (int i = 0; i < capacity; ++i)
{
EJBMethodInfoImpl methodInfo = bmd.createEJBMethodInfoImpl(slotSize);
methodInfo.initializeInstanceData(null, null, null, null, null, false); // depends on control dependency: [for], data = [none]
elements[i] = methodInfo; // depends on control dependency: [for], data = [i]
}
ivSetup = true; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public boolean fish(String bait, Permission pond) {
if(isDebug(bait)) {
boolean rv = false;
StringBuilder sb = new StringBuilder("Log for ");
sb.append(bait);
if(supports(bait)) {
User<PERM> user = getUser(bait);
if(user==null) {
sb.append("\n\tUser is not in Cache");
} else {
if(user.noPerms())sb.append("\n\tUser has no Perms");
if(user.permExpired()) {
sb.append("\n\tUser's perm expired [");
sb.append(new Date(user.permExpires()));
sb.append(']');
} else {
sb.append("\n\tUser's perm expires [");
sb.append(new Date(user.permExpires()));
sb.append(']');
}
}
if(user==null || (user.noPerms() && user.permExpired())) {
user = loadUser(bait);
sb.append("\n\tloadUser called");
}
if(user==null) {
sb.append("\n\tUser was not Loaded");
} else if(user.contains(pond)) {
sb.append("\n\tUser contains ");
sb.append(pond.getKey());
rv = true;
} else {
sb.append("\n\tUser does not contain ");
sb.append(pond.getKey());
List<Permission> perms = new ArrayList<Permission>();
user.copyPermsTo(perms);
for(Permission p : perms) {
sb.append("\n\t\t");
sb.append(p.getKey());
}
}
} else {
sb.append("AAF Lur does not support [");
sb.append(bait);
sb.append("]");
}
aaf.access.log(Level.INFO, sb);
return rv;
} else {
if(supports(bait)) {
User<PERM> user = getUser(bait);
if(user==null || (user.noPerms() && user.permExpired())) {
user = loadUser(bait);
}
return user==null?false:user.contains(pond);
}
return false;
}
} } | public class class_name {
public boolean fish(String bait, Permission pond) {
if(isDebug(bait)) {
boolean rv = false;
StringBuilder sb = new StringBuilder("Log for ");
sb.append(bait); // depends on control dependency: [if], data = [none]
if(supports(bait)) {
User<PERM> user = getUser(bait);
if(user==null) {
sb.append("\n\tUser is not in Cache"); // depends on control dependency: [if], data = [none]
} else {
if(user.noPerms())sb.append("\n\tUser has no Perms");
if(user.permExpired()) {
sb.append("\n\tUser's perm expired ["); // depends on control dependency: [if], data = [none]
sb.append(new Date(user.permExpires())); // depends on control dependency: [if], data = [none]
sb.append(']'); // depends on control dependency: [if], data = [none]
} else {
sb.append("\n\tUser's perm expires ["); // depends on control dependency: [if], data = [none]
sb.append(new Date(user.permExpires())); // depends on control dependency: [if], data = [none]
sb.append(']'); // depends on control dependency: [if], data = [none]
}
}
if(user==null || (user.noPerms() && user.permExpired())) {
user = loadUser(bait); // depends on control dependency: [if], data = [none]
sb.append("\n\tloadUser called"); // depends on control dependency: [if], data = [none]
}
if(user==null) {
sb.append("\n\tUser was not Loaded"); // depends on control dependency: [if], data = [none]
} else if(user.contains(pond)) {
sb.append("\n\tUser contains "); // depends on control dependency: [if], data = [none]
sb.append(pond.getKey()); // depends on control dependency: [if], data = [none]
rv = true; // depends on control dependency: [if], data = [none]
} else {
sb.append("\n\tUser does not contain "); // depends on control dependency: [if], data = [none]
sb.append(pond.getKey()); // depends on control dependency: [if], data = [none]
List<Permission> perms = new ArrayList<Permission>();
user.copyPermsTo(perms); // depends on control dependency: [if], data = [none]
for(Permission p : perms) {
sb.append("\n\t\t"); // depends on control dependency: [for], data = [p]
sb.append(p.getKey()); // depends on control dependency: [for], data = [p]
}
}
} else {
sb.append("AAF Lur does not support ["); // depends on control dependency: [if], data = [none]
sb.append(bait); // depends on control dependency: [if], data = [none]
sb.append("]"); // depends on control dependency: [if], data = [none]
}
aaf.access.log(Level.INFO, sb); // depends on control dependency: [if], data = [none]
return rv; // depends on control dependency: [if], data = [none]
} else {
if(supports(bait)) {
User<PERM> user = getUser(bait);
if(user==null || (user.noPerms() && user.permExpired())) {
user = loadUser(bait); // depends on control dependency: [if], data = [none]
}
return user==null?false:user.contains(pond); // depends on control dependency: [if], data = [none]
}
return false; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
protected void configureClientProxyFactoryBean(ClientProxyFactoryBean factory)
{
//Configure binding customization
if (customization != null)
{
//customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
serviceFactory.reset();
DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
configureBindingCustomization(serviceFactoryDataBinding, customization);
serviceFactory.setDataBinding(serviceFactoryDataBinding);
//customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
if (factory.getDataBinding() == null)
{
//set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
factory.setDataBinding(serviceFactoryDataBinding);
}
else
{
configureBindingCustomization(factory.getDataBinding(), customization);
}
}
//add other configurations here below
} } | public class class_name {
protected void configureClientProxyFactoryBean(ClientProxyFactoryBean factory)
{
//Configure binding customization
if (customization != null)
{
//customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
serviceFactory.reset(); // depends on control dependency: [if], data = [none]
DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
configureBindingCustomization(serviceFactoryDataBinding, customization); // depends on control dependency: [if], data = [none]
serviceFactory.setDataBinding(serviceFactoryDataBinding); // depends on control dependency: [if], data = [none]
//customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
if (factory.getDataBinding() == null)
{
//set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
factory.setDataBinding(serviceFactoryDataBinding); // depends on control dependency: [if], data = [none]
}
else
{
configureBindingCustomization(factory.getDataBinding(), customization); // depends on control dependency: [if], data = [(factory.getDataBinding()]
}
}
//add other configurations here below
} } |
public class class_name {
public synchronized Time getTime(int parameterIndex,
Calendar cal) throws SQLException {
TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME);
if (t == null) {
return null;
}
long millis = t.getSeconds() * 1000;
if (parameterTypes[--parameterIndex].isDateTimeTypeWithZone()) {}
else {
// UTC - calZO == (UTC - sessZO) + (sessionZO - calZO)
if (cal != null) {
int zoneOffset = HsqlDateTime.getZoneMillis(cal, millis);
millis += session.getZoneSeconds() * 1000 - zoneOffset;
}
}
return new Time(millis);
} } | public class class_name {
public synchronized Time getTime(int parameterIndex,
Calendar cal) throws SQLException {
TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME);
if (t == null) {
return null;
}
long millis = t.getSeconds() * 1000;
if (parameterTypes[--parameterIndex].isDateTimeTypeWithZone()) {}
else {
// UTC - calZO == (UTC - sessZO) + (sessionZO - calZO)
if (cal != null) {
int zoneOffset = HsqlDateTime.getZoneMillis(cal, millis);
millis += session.getZoneSeconds() * 1000 - zoneOffset; // depends on control dependency: [if], data = [none]
}
}
return new Time(millis);
} } |
public class class_name {
public void setAssessmentRunArns(java.util.Collection<String> assessmentRunArns) {
if (assessmentRunArns == null) {
this.assessmentRunArns = null;
return;
}
this.assessmentRunArns = new java.util.ArrayList<String>(assessmentRunArns);
} } | public class class_name {
public void setAssessmentRunArns(java.util.Collection<String> assessmentRunArns) {
if (assessmentRunArns == null) {
this.assessmentRunArns = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.assessmentRunArns = new java.util.ArrayList<String>(assessmentRunArns);
} } |
public class class_name {
public static Object loadAll(final PersistenceStoreType storeType) {
Object ret = null;
try {
File file = new File(persistenceStorePath + File.separator + storeType);
log.info("aws-mock: try to load objects from {}", file.getAbsolutePath());
ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
ret = in.readObject();
in.close();
} catch (FileNotFoundException e) {
// no saved file to load from
log.warn("no saved file to load from: {}", e.getMessage());
return null;
} catch (IOException e) {
// failed to load from the saved file
log.warn("failed to load from the saved file: {}", e.getMessage());
return null;
} catch (ClassNotFoundException e) {
log.error("ClassNotFoundException caught during loading object from file: "
+ e.getMessage());
}
return ret;
} } | public class class_name {
public static Object loadAll(final PersistenceStoreType storeType) {
Object ret = null;
try {
File file = new File(persistenceStorePath + File.separator + storeType);
log.info("aws-mock: try to load objects from {}", file.getAbsolutePath()); // depends on control dependency: [try], data = [none]
ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
ret = in.readObject(); // depends on control dependency: [try], data = [none]
in.close(); // depends on control dependency: [try], data = [none]
} catch (FileNotFoundException e) {
// no saved file to load from
log.warn("no saved file to load from: {}", e.getMessage());
return null;
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
// failed to load from the saved file
log.warn("failed to load from the saved file: {}", e.getMessage());
return null;
} catch (ClassNotFoundException e) { // depends on control dependency: [catch], data = [none]
log.error("ClassNotFoundException caught during loading object from file: "
+ e.getMessage());
} // depends on control dependency: [catch], data = [none]
return ret;
} } |
public class class_name {
@Override
public void handleRequest(final Request request) {
// Can only be an active DIALOG if it is AJAX targetted.
if (isAjaxTargeted()) {
if (getState() == INACTIVE_STATE) {
handleTriggerOpenAction(request);
}
getOrCreateComponentModel().state = ACTIVE_STATE;
} else if (getState() != INACTIVE_STATE) {
getOrCreateComponentModel().state = INACTIVE_STATE;
}
} } | public class class_name {
@Override
public void handleRequest(final Request request) {
// Can only be an active DIALOG if it is AJAX targetted.
if (isAjaxTargeted()) {
if (getState() == INACTIVE_STATE) {
handleTriggerOpenAction(request); // depends on control dependency: [if], data = [none]
}
getOrCreateComponentModel().state = ACTIVE_STATE; // depends on control dependency: [if], data = [none]
} else if (getState() != INACTIVE_STATE) {
getOrCreateComponentModel().state = INACTIVE_STATE; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public String getString(String key) {
Object obj = get(key);
if (obj != null && obj instanceof String) {
return (String) obj;
}
return null;
} } | public class class_name {
public String getString(String key) {
Object obj = get(key);
if (obj != null && obj instanceof String) {
return (String) obj;
// depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
private void readPredecessors(net.sf.mpxj.planner.schema.Task plannerTask)
{
Task mpxjTask = m_projectFile.getTaskByUniqueID(getInteger(plannerTask.getId()));
Predecessors predecessors = plannerTask.getPredecessors();
if (predecessors != null)
{
List<Predecessor> predecessorList = predecessors.getPredecessor();
for (Predecessor predecessor : predecessorList)
{
Integer predecessorID = getInteger(predecessor.getPredecessorId());
Task predecessorTask = m_projectFile.getTaskByUniqueID(predecessorID);
if (predecessorTask != null)
{
Duration lag = getDuration(predecessor.getLag());
if (lag == null)
{
lag = Duration.getInstance(0, TimeUnit.HOURS);
}
Relation relation = mpxjTask.addPredecessor(predecessorTask, RELATIONSHIP_TYPES.get(predecessor.getType()), lag);
m_eventManager.fireRelationReadEvent(relation);
}
}
}
//
// Process child tasks
//
List<net.sf.mpxj.planner.schema.Task> childTasks = plannerTask.getTask();
for (net.sf.mpxj.planner.schema.Task childTask : childTasks)
{
readPredecessors(childTask);
}
} } | public class class_name {
private void readPredecessors(net.sf.mpxj.planner.schema.Task plannerTask)
{
Task mpxjTask = m_projectFile.getTaskByUniqueID(getInteger(plannerTask.getId()));
Predecessors predecessors = plannerTask.getPredecessors();
if (predecessors != null)
{
List<Predecessor> predecessorList = predecessors.getPredecessor();
for (Predecessor predecessor : predecessorList)
{
Integer predecessorID = getInteger(predecessor.getPredecessorId());
Task predecessorTask = m_projectFile.getTaskByUniqueID(predecessorID);
if (predecessorTask != null)
{
Duration lag = getDuration(predecessor.getLag());
if (lag == null)
{
lag = Duration.getInstance(0, TimeUnit.HOURS); // depends on control dependency: [if], data = [none]
}
Relation relation = mpxjTask.addPredecessor(predecessorTask, RELATIONSHIP_TYPES.get(predecessor.getType()), lag);
m_eventManager.fireRelationReadEvent(relation); // depends on control dependency: [if], data = [none]
}
}
}
//
// Process child tasks
//
List<net.sf.mpxj.planner.schema.Task> childTasks = plannerTask.getTask();
for (net.sf.mpxj.planner.schema.Task childTask : childTasks)
{
readPredecessors(childTask); // depends on control dependency: [for], data = [childTask]
}
} } |
public class class_name {
public void addTargettingAlias(DestinationHandler aliasDestinationHandler)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addTargettingAlias", aliasDestinationHandler);
if (aliasesThatTargetThisDest == null)
{
aliasesThatTargetThisDest = new java.util.ArrayList<DestinationHandler>();
}
synchronized(aliasesThatTargetThisDest)
{
aliasesThatTargetThisDest.add(aliasDestinationHandler);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTargettingAlias");
} } | public class class_name {
public void addTargettingAlias(DestinationHandler aliasDestinationHandler)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addTargettingAlias", aliasDestinationHandler);
if (aliasesThatTargetThisDest == null)
{
aliasesThatTargetThisDest = new java.util.ArrayList<DestinationHandler>(); // depends on control dependency: [if], data = [none]
}
synchronized(aliasesThatTargetThisDest)
{
aliasesThatTargetThisDest.add(aliasDestinationHandler);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTargettingAlias");
} } |
public class class_name {
public void printSparseFeatureMatrix(PrintWriter pw) {
String sep = "\t";
for (int i = 0; i < size; i++) {
pw.print(labelIndex.get(labels[i]));
int[] datum = data[i];
for (int j : datum) {
pw.print(sep + featureIndex.get(j));
}
pw.println();
}
} } | public class class_name {
public void printSparseFeatureMatrix(PrintWriter pw) {
String sep = "\t";
for (int i = 0; i < size; i++) {
pw.print(labelIndex.get(labels[i]));
// depends on control dependency: [for], data = [i]
int[] datum = data[i];
for (int j : datum) {
pw.print(sep + featureIndex.get(j));
// depends on control dependency: [for], data = [j]
}
pw.println();
// depends on control dependency: [for], data = [none]
}
} } |
public class class_name {
@SuppressWarnings("InstanceofCatchParameter")
public WebApp startWebApplication(final ServletContext servletContext) {
try {
WebApp webApp = _start(servletContext);
log.info("Madvoc is up and running.");
return webApp;
}
catch (Exception ex) {
if (log != null) {
log.error("Madvoc startup failure.", ex);
} else {
ex.printStackTrace();
}
if (ex instanceof MadvocException) {
throw (MadvocException) ex;
}
throw new MadvocException(ex);
}
} } | public class class_name {
@SuppressWarnings("InstanceofCatchParameter")
public WebApp startWebApplication(final ServletContext servletContext) {
try {
WebApp webApp = _start(servletContext);
log.info("Madvoc is up and running."); // depends on control dependency: [try], data = [none]
return webApp; // depends on control dependency: [try], data = [none]
}
catch (Exception ex) {
if (log != null) {
log.error("Madvoc startup failure.", ex); // depends on control dependency: [if], data = [none]
} else {
ex.printStackTrace(); // depends on control dependency: [if], data = [none]
}
if (ex instanceof MadvocException) {
throw (MadvocException) ex;
}
throw new MadvocException(ex);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private Page<JpaRollout> findByCriteriaAPI(final Pageable pageable,
final List<Specification<JpaRollout>> specList) {
if (CollectionUtils.isEmpty(specList)) {
return rolloutRepository.findAll(pageable);
}
return rolloutRepository.findAll(SpecificationsBuilder.combineWithAnd(specList), pageable);
} } | public class class_name {
private Page<JpaRollout> findByCriteriaAPI(final Pageable pageable,
final List<Specification<JpaRollout>> specList) {
if (CollectionUtils.isEmpty(specList)) {
return rolloutRepository.findAll(pageable); // depends on control dependency: [if], data = [none]
}
return rolloutRepository.findAll(SpecificationsBuilder.combineWithAnd(specList), pageable);
} } |
public class class_name {
public Optional<QualityGateData> getQualityGate(DbSession dbSession, OrganizationDto organization, ComponentDto component) {
Optional<QualityGateData> res = dbClient.projectQgateAssociationDao().selectQGateIdByComponentId(dbSession, component.getId())
.map(qualityGateId -> dbClient.qualityGateDao().selectById(dbSession, qualityGateId))
.map(qualityGateDto -> new QualityGateData(qualityGateDto, false));
if (res.isPresent()) {
return res;
}
return ofNullable(dbClient.qualityGateDao().selectByOrganizationAndUuid(dbSession, organization, organization.getDefaultQualityGateUuid()))
.map(qualityGateDto -> new QualityGateData(qualityGateDto, true));
} } | public class class_name {
public Optional<QualityGateData> getQualityGate(DbSession dbSession, OrganizationDto organization, ComponentDto component) {
Optional<QualityGateData> res = dbClient.projectQgateAssociationDao().selectQGateIdByComponentId(dbSession, component.getId())
.map(qualityGateId -> dbClient.qualityGateDao().selectById(dbSession, qualityGateId))
.map(qualityGateDto -> new QualityGateData(qualityGateDto, false));
if (res.isPresent()) {
return res; // depends on control dependency: [if], data = [none]
}
return ofNullable(dbClient.qualityGateDao().selectByOrganizationAndUuid(dbSession, organization, organization.getDefaultQualityGateUuid()))
.map(qualityGateDto -> new QualityGateData(qualityGateDto, true));
} } |
public class class_name {
public boolean contains(LCMSDataSubset other) {
// compare ms levels
Set<Integer> msLvlsThis = getMsLvls();
Set<Integer> msLvlsThat = other.getMsLvls();
// if ms levels are null, this definitely matches any other subset
// so we need to check msLevelsThis frist!
if (msLvlsThis != null && msLvlsThat != null) {
if (!msLvlsThis.containsAll(msLvlsThat)) {
return false;
}
}
// compare mz ranges
List<DoubleRange> mzRangesThis = getMzRanges();
List<DoubleRange> mzRangesThat = other.getMzRanges();
if (mzRangesThis != null && mzRangesThat != null) {
if (!mzRangesThis.containsAll(mzRangesThat)) {
return false;
}
}
// compare scan number ranges
Integer scanNumLoThis = getScanNumLo();
Integer scanNumLoThat = other.getScanNumLo();
if (scanNumLoThis != null && scanNumLoThat != null) {
if (scanNumLoThis > scanNumLoThat) {
return false;
}
}
Integer scanNumHiThis = getScanNumHi();
Integer scanNumHiThat = other.getScanNumHi();
if (scanNumHiThis != null && scanNumHiThat != null) {
if (scanNumHiThis < scanNumHiThat) {
return false;
}
}
return true;
} } | public class class_name {
public boolean contains(LCMSDataSubset other) {
// compare ms levels
Set<Integer> msLvlsThis = getMsLvls();
Set<Integer> msLvlsThat = other.getMsLvls();
// if ms levels are null, this definitely matches any other subset
// so we need to check msLevelsThis frist!
if (msLvlsThis != null && msLvlsThat != null) {
if (!msLvlsThis.containsAll(msLvlsThat)) {
return false; // depends on control dependency: [if], data = [none]
}
}
// compare mz ranges
List<DoubleRange> mzRangesThis = getMzRanges();
List<DoubleRange> mzRangesThat = other.getMzRanges();
if (mzRangesThis != null && mzRangesThat != null) {
if (!mzRangesThis.containsAll(mzRangesThat)) {
return false; // depends on control dependency: [if], data = [none]
}
}
// compare scan number ranges
Integer scanNumLoThis = getScanNumLo();
Integer scanNumLoThat = other.getScanNumLo();
if (scanNumLoThis != null && scanNumLoThat != null) {
if (scanNumLoThis > scanNumLoThat) {
return false; // depends on control dependency: [if], data = [none]
}
}
Integer scanNumHiThis = getScanNumHi();
Integer scanNumHiThat = other.getScanNumHi();
if (scanNumHiThis != null && scanNumHiThat != null) {
if (scanNumHiThis < scanNumHiThat) {
return false; // depends on control dependency: [if], data = [none]
}
}
return true;
} } |
public class class_name {
private boolean isClientChannelClosed(Throwable cause) {
if (cause instanceof ClosedChannelException ||
cause instanceof Errors.NativeIoException) {
LOG.error("ZuulFilterChainHandler::isClientChannelClosed - IO Exception");
return true;
}
return false;
} } | public class class_name {
private boolean isClientChannelClosed(Throwable cause) {
if (cause instanceof ClosedChannelException ||
cause instanceof Errors.NativeIoException) {
LOG.error("ZuulFilterChainHandler::isClientChannelClosed - IO Exception"); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
return false;
} } |
public class class_name {
public final Stream<T> setProperty(final String name, @Nullable final Object value) {
Preconditions.checkNotNull(name);
synchronized (this.state) {
if (this.state.properties != null) {
this.state.properties.put(name, value);
} else if (value != null) {
this.state.properties = Maps.newHashMap();
this.state.properties.put(name, value);
}
}
return this;
} } | public class class_name {
public final Stream<T> setProperty(final String name, @Nullable final Object value) {
Preconditions.checkNotNull(name);
synchronized (this.state) {
if (this.state.properties != null) {
this.state.properties.put(name, value); // depends on control dependency: [if], data = [none]
} else if (value != null) {
this.state.properties = Maps.newHashMap(); // depends on control dependency: [if], data = [none]
this.state.properties.put(name, value); // depends on control dependency: [if], data = [none]
}
}
return this;
} } |
public class class_name {
@Override
public boolean hasNonPolyChain(String asymId){
int modelnr = 0;
List<Chain> chains = models.get(modelnr).getNonPolyChains();
for (Chain c : chains) {
// we check here with equals because we might want to distinguish between upper and lower case chains!
if (c.getId().equals(asymId)) {
return true;
}
}
return false;
} } | public class class_name {
@Override
public boolean hasNonPolyChain(String asymId){
int modelnr = 0;
List<Chain> chains = models.get(modelnr).getNonPolyChains();
for (Chain c : chains) {
// we check here with equals because we might want to distinguish between upper and lower case chains!
if (c.getId().equals(asymId)) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} } |
public class class_name {
@SuppressWarnings("unchecked")
public <T> TypeAdapter<T> getAdapter(TypeToken<T> type) {
TypeAdapter<?> cached = typeTokenCache.get(type == null ? NULL_KEY_SURROGATE : type);
if (cached != null) {
return (TypeAdapter<T>) cached;
}
Map<TypeToken<?>, FutureTypeAdapter<?>> threadCalls = calls.get();
boolean requiresThreadLocalCleanup = false;
if (threadCalls == null) {
threadCalls = new HashMap<TypeToken<?>, FutureTypeAdapter<?>>();
calls.set(threadCalls);
requiresThreadLocalCleanup = true;
}
// the key and value type parameters always agree
FutureTypeAdapter<T> ongoingCall = (FutureTypeAdapter<T>) threadCalls.get(type);
if (ongoingCall != null) {
return ongoingCall;
}
try {
FutureTypeAdapter<T> call = new FutureTypeAdapter<T>();
threadCalls.put(type, call);
for (TypeAdapterFactory factory : factories) {
TypeAdapter<T> candidate = factory.create(this, type);
if (candidate != null) {
call.setDelegate(candidate);
typeTokenCache.put(type, candidate);
return candidate;
}
}
throw new IllegalArgumentException("GSON (" + GsonBuildConfig.VERSION + ") cannot handle " + type);
} finally {
threadCalls.remove(type);
if (requiresThreadLocalCleanup) {
calls.remove();
}
}
} } | public class class_name {
@SuppressWarnings("unchecked")
public <T> TypeAdapter<T> getAdapter(TypeToken<T> type) {
TypeAdapter<?> cached = typeTokenCache.get(type == null ? NULL_KEY_SURROGATE : type);
if (cached != null) {
return (TypeAdapter<T>) cached; // depends on control dependency: [if], data = [none]
}
Map<TypeToken<?>, FutureTypeAdapter<?>> threadCalls = calls.get();
boolean requiresThreadLocalCleanup = false;
if (threadCalls == null) {
threadCalls = new HashMap<TypeToken<?>, FutureTypeAdapter<?>>();
calls.set(threadCalls); // depends on control dependency: [if], data = [none]
requiresThreadLocalCleanup = true; // depends on control dependency: [if], data = [none]
}
// the key and value type parameters always agree
FutureTypeAdapter<T> ongoingCall = (FutureTypeAdapter<T>) threadCalls.get(type);
if (ongoingCall != null) {
return ongoingCall; // depends on control dependency: [if], data = [none]
}
try {
FutureTypeAdapter<T> call = new FutureTypeAdapter<T>();
threadCalls.put(type, call); // depends on control dependency: [try], data = [none]
for (TypeAdapterFactory factory : factories) {
TypeAdapter<T> candidate = factory.create(this, type);
if (candidate != null) {
call.setDelegate(candidate); // depends on control dependency: [if], data = [(candidate]
typeTokenCache.put(type, candidate); // depends on control dependency: [if], data = [none]
return candidate; // depends on control dependency: [if], data = [none]
}
}
throw new IllegalArgumentException("GSON (" + GsonBuildConfig.VERSION + ") cannot handle " + type);
} finally {
threadCalls.remove(type);
if (requiresThreadLocalCleanup) {
calls.remove(); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
protected void parseArguments(String[] arguments) {
LinkedList<String> args = new LinkedList<String>(Arrays.asList(arguments));
boolean valid = true;
while (!args.isEmpty()) {
String arg = args.removeFirst();
boolean handled = false;
for (Option option : options) {
if (option.processOption(arg, args)) {
handled = true;
break;
}
}
if (!handled) {
System.out.println("Unknown option: " + arg);
System.out.println();
valid = false;
break;
}
}
if (!valid) {
showOptions();
completed();
}
} } | public class class_name {
protected void parseArguments(String[] arguments) {
LinkedList<String> args = new LinkedList<String>(Arrays.asList(arguments));
boolean valid = true;
while (!args.isEmpty()) {
String arg = args.removeFirst();
boolean handled = false;
for (Option option : options) {
if (option.processOption(arg, args)) {
handled = true; // depends on control dependency: [if], data = [none]
break;
}
}
if (!handled) {
System.out.println("Unknown option: " + arg); // depends on control dependency: [if], data = [none]
System.out.println(); // depends on control dependency: [if], data = [none]
valid = false; // depends on control dependency: [if], data = [none]
break;
}
}
if (!valid) {
showOptions(); // depends on control dependency: [if], data = [none]
completed(); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void parseAttributes(TypedArray a) {
// We transform the default values from DIP to pixels
DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
barWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, barWidth, metrics);
rimWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, rimWidth, metrics);
circleRadius =
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, circleRadius, metrics);
circleRadius =
(int) a.getDimension(R.styleable.ProgressWheel_matProg_circleRadius, circleRadius);
fillRadius = a.getBoolean(R.styleable.ProgressWheel_matProg_fillRadius, false);
barWidth = (int) a.getDimension(R.styleable.ProgressWheel_matProg_barWidth, barWidth);
rimWidth = (int) a.getDimension(R.styleable.ProgressWheel_matProg_rimWidth, rimWidth);
float baseSpinSpeed =
a.getFloat(R.styleable.ProgressWheel_matProg_spinSpeed, spinSpeed / 360.0f);
spinSpeed = baseSpinSpeed * 360;
barSpinCycleTime =
a.getInt(R.styleable.ProgressWheel_matProg_barSpinCycleTime, (int) barSpinCycleTime);
barColor = a.getColor(R.styleable.ProgressWheel_matProg_barColor, barColor);
rimColor = a.getColor(R.styleable.ProgressWheel_matProg_rimColor, rimColor);
linearProgress = a.getBoolean(R.styleable.ProgressWheel_matProg_linearProgress, false);
if (a.getBoolean(R.styleable.ProgressWheel_matProg_progressIndeterminate, false)) {
spin();
}
// Recycle
a.recycle();
} } | public class class_name {
private void parseAttributes(TypedArray a) {
// We transform the default values from DIP to pixels
DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
barWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, barWidth, metrics);
rimWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, rimWidth, metrics);
circleRadius =
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, circleRadius, metrics);
circleRadius =
(int) a.getDimension(R.styleable.ProgressWheel_matProg_circleRadius, circleRadius);
fillRadius = a.getBoolean(R.styleable.ProgressWheel_matProg_fillRadius, false);
barWidth = (int) a.getDimension(R.styleable.ProgressWheel_matProg_barWidth, barWidth);
rimWidth = (int) a.getDimension(R.styleable.ProgressWheel_matProg_rimWidth, rimWidth);
float baseSpinSpeed =
a.getFloat(R.styleable.ProgressWheel_matProg_spinSpeed, spinSpeed / 360.0f);
spinSpeed = baseSpinSpeed * 360;
barSpinCycleTime =
a.getInt(R.styleable.ProgressWheel_matProg_barSpinCycleTime, (int) barSpinCycleTime);
barColor = a.getColor(R.styleable.ProgressWheel_matProg_barColor, barColor);
rimColor = a.getColor(R.styleable.ProgressWheel_matProg_rimColor, rimColor);
linearProgress = a.getBoolean(R.styleable.ProgressWheel_matProg_linearProgress, false);
if (a.getBoolean(R.styleable.ProgressWheel_matProg_progressIndeterminate, false)) {
spin(); // depends on control dependency: [if], data = [none]
}
// Recycle
a.recycle();
} } |
public class class_name {
@Override
public IOpaqueCredentials getOpaqueCredentials() {
if (parentContext != null && parentContext.isAuthenticated()) {
NotSoOpaqueCredentials oc = new CacheOpaqueCredentials();
oc.setCredentials(this.cachedcredentials);
return oc;
} else return null;
} } | public class class_name {
@Override
public IOpaqueCredentials getOpaqueCredentials() {
if (parentContext != null && parentContext.isAuthenticated()) {
NotSoOpaqueCredentials oc = new CacheOpaqueCredentials();
oc.setCredentials(this.cachedcredentials); // depends on control dependency: [if], data = [none]
return oc; // depends on control dependency: [if], data = [none]
} else return null;
} } |
public class class_name {
@Override
protected MessageResource buildResource(final MessageItem messageItem, final MessageParams messageParams) {
MessageResource messageResource = null;
// Load overridden values first
if (messageParams.name() != null && this.overriddenMessageMap.containsKey(messageItem)) {
// Retrieve the customized parameter
messageResource = this.overriddenMessageMap.get(messageItem);
}
// No overridden value is defined
// Check if the message has a message key and
// check if the message has been loaded from any customized Messages file
if (messageResource == null && messageParams.name() != null /* && this.propertiesParametersMap.containsKey(op.name()) */) {
// Translation is always allowed for all Message
// It depends on LOG_RESOLUTION parameter for all LogMessage
final boolean translationAllowed = !(messageParams instanceof LogMessageParams) || CoreParameters.LOG_RESOLUTION.get();
// Translate the message code as required
String rawMessage = translationAllowed ? findMessage(messageParams.name()) : null;
// No translation found, the message will be the key with wrapped by <>
if (rawMessage == null) {
rawMessage = '<' + messageParams.name() + '>';
}
if (messageParams instanceof LogMessageParams) {
// Use default log marker and log level
messageResource = new MessageResourceBase(rawMessage, ((LogMessageParams) messageParams).marker(), ((LogMessageParams) messageParams).level());
} else {
// Just convert the code into message
messageResource = new MessageResourceBase(rawMessage);
}
}
return messageResource;
} } | public class class_name {
@Override
protected MessageResource buildResource(final MessageItem messageItem, final MessageParams messageParams) {
MessageResource messageResource = null;
// Load overridden values first
if (messageParams.name() != null && this.overriddenMessageMap.containsKey(messageItem)) {
// Retrieve the customized parameter
messageResource = this.overriddenMessageMap.get(messageItem);
// depends on control dependency: [if], data = [none]
}
// No overridden value is defined
// Check if the message has a message key and
// check if the message has been loaded from any customized Messages file
if (messageResource == null && messageParams.name() != null /* && this.propertiesParametersMap.containsKey(op.name()) */) {
// Translation is always allowed for all Message
// It depends on LOG_RESOLUTION parameter for all LogMessage
final boolean translationAllowed = !(messageParams instanceof LogMessageParams) || CoreParameters.LOG_RESOLUTION.get();
// Translate the message code as required
String rawMessage = translationAllowed ? findMessage(messageParams.name()) : null;
// No translation found, the message will be the key with wrapped by <>
if (rawMessage == null) {
rawMessage = '<' + messageParams.name() + '>';
// depends on control dependency: [if], data = [none]
}
if (messageParams instanceof LogMessageParams) {
// Use default log marker and log level
messageResource = new MessageResourceBase(rawMessage, ((LogMessageParams) messageParams).marker(), ((LogMessageParams) messageParams).level());
// depends on control dependency: [if], data = [none]
} else {
// Just convert the code into message
messageResource = new MessageResourceBase(rawMessage);
// depends on control dependency: [if], data = [none]
}
}
return messageResource;
} } |
public class class_name {
@Override
void setup() {
super.setup();
//set up job cache directory and associated permissions
String localDirs[] = this.mapredLocalDirs;
for(String localDir : localDirs) {
//Cache root
File cacheDirectory = new File(localDir,TaskTracker.getCacheSubdir());
File jobCacheDirectory = new File(localDir,TaskTracker.getJobCacheSubdir());
if(!cacheDirectory.exists()) {
if(!cacheDirectory.mkdirs()) {
LOG.warn("Unable to create cache directory : " +
cacheDirectory.getPath());
}
}
if(!jobCacheDirectory.exists()) {
if(!jobCacheDirectory.mkdirs()) {
LOG.warn("Unable to create job cache directory : " +
jobCacheDirectory.getPath());
}
}
//Give world writable permission for every directory under
//mapred-local-dir.
//Child tries to write files under it when executing.
changeDirectoryPermissions(localDir, FILE_PERMISSIONS, true);
}//end of local directory manipulations
//setting up perms for user logs
File taskLog = TaskLog.getUserLogDir();
changeDirectoryPermissions(taskLog.getPath(), FILE_PERMISSIONS,false);
} } | public class class_name {
@Override
void setup() {
super.setup();
//set up job cache directory and associated permissions
String localDirs[] = this.mapredLocalDirs;
for(String localDir : localDirs) {
//Cache root
File cacheDirectory = new File(localDir,TaskTracker.getCacheSubdir());
File jobCacheDirectory = new File(localDir,TaskTracker.getJobCacheSubdir());
if(!cacheDirectory.exists()) {
if(!cacheDirectory.mkdirs()) {
LOG.warn("Unable to create cache directory : " +
cacheDirectory.getPath()); // depends on control dependency: [if], data = [none]
}
}
if(!jobCacheDirectory.exists()) {
if(!jobCacheDirectory.mkdirs()) {
LOG.warn("Unable to create job cache directory : " +
jobCacheDirectory.getPath()); // depends on control dependency: [if], data = [none]
}
}
//Give world writable permission for every directory under
//mapred-local-dir.
//Child tries to write files under it when executing.
changeDirectoryPermissions(localDir, FILE_PERMISSIONS, true); // depends on control dependency: [for], data = [localDir]
}//end of local directory manipulations
//setting up perms for user logs
File taskLog = TaskLog.getUserLogDir();
changeDirectoryPermissions(taskLog.getPath(), FILE_PERMISSIONS,false);
} } |
public class class_name {
private void initGraphics() {
if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
Double.compare(getHeight(), 0.0) <= 0) {
if (getPrefWidth() > 0 && getPrefHeight() > 0) {
setPrefSize(getPrefWidth(), getPrefHeight());
} else {
setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
getStyleClass().add("switch");
shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 3, 0, 0, 0);
switchBorder = new Rectangle();
switchBorder.setFill(getForegroundColor());
switchBackground = new Rectangle();
switchBackground.setMouseTransparent(true);
switchBackground.setFill(isActive() ? getActiveColor() : getBackgroundColor());
thumb = new Circle();
thumb.setMouseTransparent(true);
thumb.setFill(getForegroundColor());
thumb.setEffect(shadow);
pane = new Pane(switchBorder, switchBackground, thumb);
getChildren().setAll(pane);
} } | public class class_name {
private void initGraphics() {
if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
Double.compare(getHeight(), 0.0) <= 0) {
if (getPrefWidth() > 0 && getPrefHeight() > 0) {
setPrefSize(getPrefWidth(), getPrefHeight()); // depends on control dependency: [if], data = [(getPrefWidth()]
} else {
setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); // depends on control dependency: [if], data = [none]
}
}
getStyleClass().add("switch");
shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 3, 0, 0, 0);
switchBorder = new Rectangle();
switchBorder.setFill(getForegroundColor());
switchBackground = new Rectangle();
switchBackground.setMouseTransparent(true);
switchBackground.setFill(isActive() ? getActiveColor() : getBackgroundColor());
thumb = new Circle();
thumb.setMouseTransparent(true);
thumb.setFill(getForegroundColor());
thumb.setEffect(shadow);
pane = new Pane(switchBorder, switchBackground, thumb);
getChildren().setAll(pane);
} } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.