code stringlengths 130 281k | code_dependency stringlengths 182 306k |
|---|---|
public class class_name {
public void setRAKey(String raKey)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
Tr.entry(tc, "MEF.setRAKey for enterprise class " + beanMetaData.enterpriseBeanName);
}
ivRAKey = raKey;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
Tr.exit(tc, "MEF.setRAKey for enterprise class " + beanMetaData.enterpriseBeanName);
}
} } | public class class_name {
public void setRAKey(String raKey)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
Tr.entry(tc, "MEF.setRAKey for enterprise class " + beanMetaData.enterpriseBeanName); // depends on control dependency: [if], data = [none]
}
ivRAKey = raKey;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
Tr.exit(tc, "MEF.setRAKey for enterprise class " + beanMetaData.enterpriseBeanName); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static String byteArrayToHexString(byte[] b) {
StringBuilder hs = new StringBuilder();
String stmp;
for (int n = 0; b != null && n < b.length; n++) {
stmp = Integer.toHexString(b[n] & 0XFF);
if (stmp.length() == 1)
hs.append('0');
hs.append(stmp);
}
return hs.toString().toLowerCase();
} } | public class class_name {
public static String byteArrayToHexString(byte[] b) {
StringBuilder hs = new StringBuilder();
String stmp;
for (int n = 0; b != null && n < b.length; n++) {
stmp = Integer.toHexString(b[n] & 0XFF); // depends on control dependency: [for], data = [n]
if (stmp.length() == 1)
hs.append('0');
hs.append(stmp); // depends on control dependency: [for], data = [none]
}
return hs.toString().toLowerCase();
} } |
public class class_name {
public void setItems(java.util.Collection<Stage> items) {
if (items == null) {
this.items = null;
return;
}
this.items = new java.util.ArrayList<Stage>(items);
} } | public class class_name {
public void setItems(java.util.Collection<Stage> items) {
if (items == null) {
this.items = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.items = new java.util.ArrayList<Stage>(items);
} } |
public class class_name {
public static boolean isXhr(){
String xhr = header("X-Requested-With");
if(xhr == null) {
xhr = header("x-requested-with");
}
return xhr != null && xhr.toLowerCase().equals("xmlhttprequest");
} } | public class class_name {
public static boolean isXhr(){
String xhr = header("X-Requested-With");
if(xhr == null) {
xhr = header("x-requested-with"); // depends on control dependency: [if], data = [none]
}
return xhr != null && xhr.toLowerCase().equals("xmlhttprequest");
} } |
public class class_name {
public final void mINSERT_HADOOP() throws RecognitionException {
try {
int _type = INSERT_HADOOP;
int _channel = DEFAULT_TOKEN_CHANNEL;
// druidG.g:582:15: ( ( 'INSERT_HADOOP' | 'insert_hadoop' ) )
// druidG.g:582:16: ( 'INSERT_HADOOP' | 'insert_hadoop' )
{
// druidG.g:582:16: ( 'INSERT_HADOOP' | 'insert_hadoop' )
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0=='I') ) {
alt2=1;
}
else if ( (LA2_0=='i') ) {
alt2=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 2, 0, input);
throw nvae;
}
switch (alt2) {
case 1 :
// druidG.g:582:17: 'INSERT_HADOOP'
{
match("INSERT_HADOOP");
}
break;
case 2 :
// druidG.g:582:33: 'insert_hadoop'
{
match("insert_hadoop");
}
break;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} } | public class class_name {
public final void mINSERT_HADOOP() throws RecognitionException {
try {
int _type = INSERT_HADOOP;
int _channel = DEFAULT_TOKEN_CHANNEL;
// druidG.g:582:15: ( ( 'INSERT_HADOOP' | 'insert_hadoop' ) )
// druidG.g:582:16: ( 'INSERT_HADOOP' | 'insert_hadoop' )
{
// druidG.g:582:16: ( 'INSERT_HADOOP' | 'insert_hadoop' )
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0=='I') ) {
alt2=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA2_0=='i') ) {
alt2=2; // depends on control dependency: [if], data = [none]
}
else {
NoViableAltException nvae =
new NoViableAltException("", 2, 0, input);
throw nvae;
}
switch (alt2) {
case 1 :
// druidG.g:582:17: 'INSERT_HADOOP'
{
match("INSERT_HADOOP");
}
break;
case 2 :
// druidG.g:582:33: 'insert_hadoop'
{
match("insert_hadoop");
}
break;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} } |
public class class_name {
public void addHttpSession(final HttpSession session) {
if (View.isInitialised() && !EventQueue.isDispatchThread()) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
addHttpSession(session);
}
});
return;
}
if (sessions.contains(session))
return;
sessions.add(session);
final int affectedRow = sessions.size() - 1;
fireTableRowsInserted(affectedRow, affectedRow);
} } | public class class_name {
public void addHttpSession(final HttpSession session) {
if (View.isInitialised() && !EventQueue.isDispatchThread()) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
addHttpSession(session);
}
}); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
if (sessions.contains(session))
return;
sessions.add(session);
final int affectedRow = sessions.size() - 1;
fireTableRowsInserted(affectedRow, affectedRow);
} } |
public class class_name {
private static InetAddress[] getByCommand() {
try {
Process process = Runtime.getRuntime().exec("getprop");
InputStream inputStream = process.getInputStream();
LineNumberReader lnr = new LineNumberReader(
new InputStreamReader(inputStream));
String line = null;
ArrayList<InetAddress> servers = new ArrayList<InetAddress>(5);
while ((line = lnr.readLine()) != null) {
int split = line.indexOf("]: [");
if (split == -1) {
continue;
}
String property = line.substring(1, split);
String value = line.substring(split + 4, line.length() - 1);
if (property.endsWith(".dns") || property.endsWith(".dns1") ||
property.endsWith(".dns2") || property.endsWith(".dns3") ||
property.endsWith(".dns4")) {
// normalize the address
InetAddress ip = InetAddress.getByName(value);
if (ip == null) continue;
value = ip.getHostAddress();
if (value == null) continue;
if (value.length() == 0) continue;
servers.add(ip);
}
}
if (servers.size() > 0) {
return servers.toArray(new InetAddress[servers.size()]);
}
} catch (IOException e) {
Logger.getLogger("AndroidDnsServer").log(Level.WARNING, "Exception in findDNSByExec", e);
}
return null;
} } | public class class_name {
private static InetAddress[] getByCommand() {
try {
Process process = Runtime.getRuntime().exec("getprop");
InputStream inputStream = process.getInputStream();
LineNumberReader lnr = new LineNumberReader(
new InputStreamReader(inputStream));
String line = null;
ArrayList<InetAddress> servers = new ArrayList<InetAddress>(5);
while ((line = lnr.readLine()) != null) {
int split = line.indexOf("]: [");
if (split == -1) {
continue;
}
String property = line.substring(1, split);
String value = line.substring(split + 4, line.length() - 1);
if (property.endsWith(".dns") || property.endsWith(".dns1") ||
property.endsWith(".dns2") || property.endsWith(".dns3") ||
property.endsWith(".dns4")) {
// normalize the address
InetAddress ip = InetAddress.getByName(value);
if (ip == null) continue;
value = ip.getHostAddress(); // depends on control dependency: [while], data = [none]
if (value == null) continue;
if (value.length() == 0) continue;
servers.add(ip); // depends on control dependency: [while], data = [none]
}
}
if (servers.size() > 0) {
return servers.toArray(new InetAddress[servers.size()]); // depends on control dependency: [if], data = [none]
}
} catch (IOException e) {
Logger.getLogger("AndroidDnsServer").log(Level.WARNING, "Exception in findDNSByExec", e);
}
return null;
} } |
public class class_name {
static void register(final Object value) {
synchronized (HashCodeBuilder.class) {
if (getRegistry() == null) {
REGISTRY.set(new HashSet<IDKey>());
}
}
getRegistry().add(new IDKey(value));
} } | public class class_name {
static void register(final Object value) {
synchronized (HashCodeBuilder.class) {
if (getRegistry() == null) {
REGISTRY.set(new HashSet<IDKey>()); // depends on control dependency: [if], data = [none]
}
}
getRegistry().add(new IDKey(value));
} } |
public class class_name {
public void encode(AsnOutputStream aos) throws EncodeException {
if (this.nationalOperationCode == null && this.privateOperationCode == null)
throw new EncodeException("Operation code: No Operation code set!");
try {
if (this.type == OperationCodeType.National && this.nationalOperationCode != null) {
aos.writeInteger(Tag.CLASS_PRIVATE, OperationCode._TAG_NATIONAL, this.nationalOperationCode);
} else if (this.type == OperationCodeType.Private && this.privateOperationCode != null) {
aos.writeInteger(Tag.CLASS_PRIVATE, OperationCode._TAG_PRIVATE, this.privateOperationCode);
} else {
throw new EncodeException("Operation code: No Operation code set!");
}
} catch (IOException e) {
throw new EncodeException("IOException while encoding OperationCode: " + e.getMessage(), e);
} catch (AsnException e) {
throw new EncodeException("AsnException while encoding OperationCode: " + e.getMessage(), e);
}
} } | public class class_name {
public void encode(AsnOutputStream aos) throws EncodeException {
if (this.nationalOperationCode == null && this.privateOperationCode == null)
throw new EncodeException("Operation code: No Operation code set!");
try {
if (this.type == OperationCodeType.National && this.nationalOperationCode != null) {
aos.writeInteger(Tag.CLASS_PRIVATE, OperationCode._TAG_NATIONAL, this.nationalOperationCode); // depends on control dependency: [if], data = [none]
} else if (this.type == OperationCodeType.Private && this.privateOperationCode != null) {
aos.writeInteger(Tag.CLASS_PRIVATE, OperationCode._TAG_PRIVATE, this.privateOperationCode); // depends on control dependency: [if], data = [none]
} else {
throw new EncodeException("Operation code: No Operation code set!");
}
} catch (IOException e) {
throw new EncodeException("IOException while encoding OperationCode: " + e.getMessage(), e);
} catch (AsnException e) {
throw new EncodeException("AsnException while encoding OperationCode: " + e.getMessage(), e);
}
} } |
public class class_name {
protected void paintComponent(final RenderContext renderContext) {
Renderer renderer = UIManager.getRenderer(this, renderContext);
if (getTemplate() != null || getTemplateMarkUp() != null) {
Renderer templateRenderer = UIManager.getTemplateRenderer(renderContext);
templateRenderer.render(this, renderContext);
} else if (renderer == null) {
// Default is juxtaposition
List<WComponent> children = getComponentModel().getChildren();
if (children != null) {
final int size = children.size();
for (int i = 0; i < size; i++) {
children.get(i).paint(renderContext);
}
}
} else {
renderer.render(this, renderContext);
}
} } | public class class_name {
protected void paintComponent(final RenderContext renderContext) {
Renderer renderer = UIManager.getRenderer(this, renderContext);
if (getTemplate() != null || getTemplateMarkUp() != null) {
Renderer templateRenderer = UIManager.getTemplateRenderer(renderContext);
templateRenderer.render(this, renderContext); // depends on control dependency: [if], data = [none]
} else if (renderer == null) {
// Default is juxtaposition
List<WComponent> children = getComponentModel().getChildren();
if (children != null) {
final int size = children.size();
for (int i = 0; i < size; i++) {
children.get(i).paint(renderContext); // depends on control dependency: [for], data = [i]
}
}
} else {
renderer.render(this, renderContext); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void setParentGroupNames(java.util.Collection<String> parentGroupNames) {
if (parentGroupNames == null) {
this.parentGroupNames = null;
return;
}
this.parentGroupNames = new java.util.ArrayList<String>(parentGroupNames);
} } | public class class_name {
public void setParentGroupNames(java.util.Collection<String> parentGroupNames) {
if (parentGroupNames == null) {
this.parentGroupNames = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.parentGroupNames = new java.util.ArrayList<String>(parentGroupNames);
} } |
public class class_name {
public V get(K[] key) {
Node child = root.get(key[0]);
if (child != null) {
return child.getChild(key, 1);
}
return null;
} } | public class class_name {
public V get(K[] key) {
Node child = root.get(key[0]);
if (child != null) {
return child.getChild(key, 1);
// depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
public static <T> T fromJsonFile(Class<T> type, File f) {
BufferedReader br = null;
try {
br = buffr(fileInr(f));
return Json.fromJson(type, br);
}
finally {
Streams.safeClose(br);
}
} } | public class class_name {
public static <T> T fromJsonFile(Class<T> type, File f) {
BufferedReader br = null;
try {
br = buffr(fileInr(f));
// depends on control dependency: [try], data = [none]
return Json.fromJson(type, br);
// depends on control dependency: [try], data = [none]
}
finally {
Streams.safeClose(br);
}
} } |
public class class_name {
@Override
protected T doRequestSync() {
T data = RequestCacheManager.getInstance().requestCacheSync(this);
if (data == null) {
data = RequestManager.getInstance().getRequestProxy(this).requestSync(this);
}
return data;
} } | public class class_name {
@Override
protected T doRequestSync() {
T data = RequestCacheManager.getInstance().requestCacheSync(this);
if (data == null) {
data = RequestManager.getInstance().getRequestProxy(this).requestSync(this); // depends on control dependency: [if], data = [none]
}
return data;
} } |
public class class_name {
private void checkForHashCodeChange(Entry<K, V> e) {
K key = extractKeyObj(e);
if (extractIntKeyValue(key, modifiedHash(key.hashCode())) != e.hashCode) {
if (keyMutationCnt == 0) {
getLog().warn("Key mismatch! Key hashcode changed! keyClass=" + e.getKey().getClass().getName());
String s;
try {
s = e.getKey().toString();
if (s != null) {
getLog().warn("Key mismatch! key.toString(): " + s);
}
} catch (Throwable t) {
getLog().warn("Key mismatch! key.toString() threw exception", t);
}
}
keyMutationCnt++;
}
} } | public class class_name {
private void checkForHashCodeChange(Entry<K, V> e) {
K key = extractKeyObj(e);
if (extractIntKeyValue(key, modifiedHash(key.hashCode())) != e.hashCode) {
if (keyMutationCnt == 0) {
getLog().warn("Key mismatch! Key hashcode changed! keyClass=" + e.getKey().getClass().getName()); // depends on control dependency: [if], data = [none]
String s;
try {
s = e.getKey().toString(); // depends on control dependency: [try], data = [none]
if (s != null) {
getLog().warn("Key mismatch! key.toString(): " + s); // depends on control dependency: [if], data = [none]
}
} catch (Throwable t) {
getLog().warn("Key mismatch! key.toString() threw exception", t);
} // depends on control dependency: [catch], data = [none]
}
keyMutationCnt++; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
static <T> List<T> filter(List<T> list, Predicate<T> predicate) {
List<T> results = new ArrayList<>();
for (T current : list) {
if (predicate.apply(current)) {
results.add(current);
}
}
return results;
} } | public class class_name {
static <T> List<T> filter(List<T> list, Predicate<T> predicate) {
List<T> results = new ArrayList<>();
for (T current : list) {
if (predicate.apply(current)) {
results.add(current); // depends on control dependency: [if], data = [none]
}
}
return results;
} } |
public class class_name {
public void render(float x, float y) {
if ((sprite == null) && (defaultImageName != null)) {
loadSystemParticleImage();
}
if (!visible) {
return;
}
GL.glTranslatef(x,y,0);
if (blendingMode == BLEND_ADDITIVE) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
}
if (usePoints()) {
GL.glEnable( SGL.GL_POINT_SMOOTH );
TextureImpl.bindNone();
}
// iterate over all emitters
for( int emitterIdx=0; emitterIdx<emitters.size(); emitterIdx++ )
{
// get emitter
ParticleEmitter emitter = (ParticleEmitter) emitters.get(emitterIdx);
if (!emitter.isEnabled()) {
continue;
}
// check for additive override and enable when set
if (emitter.useAdditive()) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
}
// now get the particle pool for this emitter and render all particles that are in use
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
Image image = emitter.getImage();
if (image == null) {
image = this.sprite;
}
if (!emitter.isOriented() && !emitter.usePoints(this)) {
image.startUse();
}
for (int i = 0; i < pool.particles.length; i++)
{
if (pool.particles[i].inUse())
pool.particles[i].render();
}
if (!emitter.isOriented() && !emitter.usePoints(this)) {
image.endUse();
}
// reset additive blend mode
if (emitter.useAdditive()) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA);
}
}
if (usePoints()) {
GL.glDisable( SGL.GL_POINT_SMOOTH );
}
if (blendingMode == BLEND_ADDITIVE) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA);
}
Color.white.bind();
GL.glTranslatef(-x,-y,0);
} } | public class class_name {
public void render(float x, float y) {
if ((sprite == null) && (defaultImageName != null)) {
loadSystemParticleImage();
// depends on control dependency: [if], data = [none]
}
if (!visible) {
return;
// depends on control dependency: [if], data = [none]
}
GL.glTranslatef(x,y,0);
if (blendingMode == BLEND_ADDITIVE) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
// depends on control dependency: [if], data = [none]
}
if (usePoints()) {
GL.glEnable( SGL.GL_POINT_SMOOTH );
// depends on control dependency: [if], data = [none]
TextureImpl.bindNone();
// depends on control dependency: [if], data = [none]
}
// iterate over all emitters
for( int emitterIdx=0; emitterIdx<emitters.size(); emitterIdx++ )
{
// get emitter
ParticleEmitter emitter = (ParticleEmitter) emitters.get(emitterIdx);
if (!emitter.isEnabled()) {
continue;
}
// check for additive override and enable when set
if (emitter.useAdditive()) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
// depends on control dependency: [if], data = [none]
}
// now get the particle pool for this emitter and render all particles that are in use
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
Image image = emitter.getImage();
if (image == null) {
image = this.sprite;
// depends on control dependency: [if], data = [none]
}
if (!emitter.isOriented() && !emitter.usePoints(this)) {
image.startUse();
// depends on control dependency: [if], data = [none]
}
for (int i = 0; i < pool.particles.length; i++)
{
if (pool.particles[i].inUse())
pool.particles[i].render();
}
if (!emitter.isOriented() && !emitter.usePoints(this)) {
image.endUse();
// depends on control dependency: [if], data = [none]
}
// reset additive blend mode
if (emitter.useAdditive()) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA);
// depends on control dependency: [if], data = [none]
}
}
if (usePoints()) {
GL.glDisable( SGL.GL_POINT_SMOOTH );
// depends on control dependency: [if], data = [none]
}
if (blendingMode == BLEND_ADDITIVE) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA);
// depends on control dependency: [if], data = [none]
}
Color.white.bind();
GL.glTranslatef(-x,-y,0);
} } |
public class class_name {
private void rebalanceStore(String storeName,
final AdminClient adminClient,
RebalanceTaskInfo stealInfo,
boolean isReadOnlyStore) {
// Move partitions
if (stealInfo.getPartitionIds(storeName) != null && stealInfo.getPartitionIds(storeName).size() > 0) {
logger.info(getHeader(stealInfo) + "Starting partitions migration for store "
+ storeName + " from donor node " + stealInfo.getDonorId());
int asyncId = adminClient.storeMntOps.migratePartitions(stealInfo.getDonorId(),
metadataStore.getNodeId(),
storeName,
stealInfo.getPartitionIds(storeName),
null,
stealInfo.getInitialCluster());
rebalanceStatusList.add(asyncId);
if(logger.isDebugEnabled()) {
logger.debug(getHeader(stealInfo) + "Waiting for completion for " + storeName
+ " with async id " + asyncId);
}
adminClient.rpcOps.waitForCompletion(metadataStore.getNodeId(),
asyncId,
voldemortConfig.getRebalancingTimeoutSec(),
TimeUnit.SECONDS,
getStatus());
rebalanceStatusList.remove((Object) asyncId);
logger.info(getHeader(stealInfo) + "Completed partition migration for store "
+ storeName + " from donor node " + stealInfo.getDonorId());
}
logger.info(getHeader(stealInfo) + "Finished all migration for store " + storeName);
} } | public class class_name {
private void rebalanceStore(String storeName,
final AdminClient adminClient,
RebalanceTaskInfo stealInfo,
boolean isReadOnlyStore) {
// Move partitions
if (stealInfo.getPartitionIds(storeName) != null && stealInfo.getPartitionIds(storeName).size() > 0) {
logger.info(getHeader(stealInfo) + "Starting partitions migration for store "
+ storeName + " from donor node " + stealInfo.getDonorId()); // depends on control dependency: [if], data = [none]
int asyncId = adminClient.storeMntOps.migratePartitions(stealInfo.getDonorId(),
metadataStore.getNodeId(),
storeName,
stealInfo.getPartitionIds(storeName),
null,
stealInfo.getInitialCluster());
rebalanceStatusList.add(asyncId); // depends on control dependency: [if], data = [none]
if(logger.isDebugEnabled()) {
logger.debug(getHeader(stealInfo) + "Waiting for completion for " + storeName
+ " with async id " + asyncId); // depends on control dependency: [if], data = [none]
}
adminClient.rpcOps.waitForCompletion(metadataStore.getNodeId(),
asyncId,
voldemortConfig.getRebalancingTimeoutSec(),
TimeUnit.SECONDS,
getStatus()); // depends on control dependency: [if], data = [none]
rebalanceStatusList.remove((Object) asyncId); // depends on control dependency: [if], data = [none]
logger.info(getHeader(stealInfo) + "Completed partition migration for store "
+ storeName + " from donor node " + stealInfo.getDonorId()); // depends on control dependency: [if], data = [none]
}
logger.info(getHeader(stealInfo) + "Finished all migration for store " + storeName);
} } |
public class class_name {
public void mTokens() throws RecognitionException {
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:8: ( NOT | ID | TEXT | TARGET | SOURCE | FUNCT | PRED | COMMA | COLON | SEMI | UNDERSCORE | DASH | STRING | STRING_WITH_QUOTE | STRING_WITH_QUOTE_DOUBLE | WS )
int alt6=16;
switch ( input.LA(1) ) {
case 'N':
case 'n':
{
int LA6_1 = input.LA(2);
if ( (LA6_1=='O'||LA6_1=='o') ) {
int LA6_16 = input.LA(3);
if ( (LA6_16=='T'||LA6_16=='t') ) {
int LA6_23 = input.LA(4);
if ( (LA6_23=='-'||(LA6_23 >= '0' && LA6_23 <= '9')||(LA6_23 >= 'A' && LA6_23 <= 'Z')||LA6_23=='_'||(LA6_23 >= 'a' && LA6_23 <= 'z')) ) {
alt6=13;
}
else {
alt6=1;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'I':
case 'i':
{
int LA6_2 = input.LA(2);
if ( (LA6_2=='D'||LA6_2=='d') ) {
int LA6_17 = input.LA(3);
if ( (LA6_17=='-'||(LA6_17 >= '0' && LA6_17 <= '9')||(LA6_17 >= 'A' && LA6_17 <= 'Z')||LA6_17=='_'||(LA6_17 >= 'a' && LA6_17 <= 'z')) ) {
alt6=13;
}
else {
alt6=2;
}
}
else {
alt6=13;
}
}
break;
case 'T':
case 't':
{
switch ( input.LA(2) ) {
case 'E':
case 'e':
{
int LA6_18 = input.LA(3);
if ( (LA6_18=='X'||LA6_18=='x') ) {
int LA6_25 = input.LA(4);
if ( (LA6_25=='T'||LA6_25=='t') ) {
int LA6_31 = input.LA(5);
if ( (LA6_31=='-'||(LA6_31 >= '0' && LA6_31 <= '9')||(LA6_31 >= 'A' && LA6_31 <= 'Z')||LA6_31=='_'||(LA6_31 >= 'a' && LA6_31 <= 'z')) ) {
alt6=13;
}
else {
alt6=3;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'A':
case 'a':
{
int LA6_19 = input.LA(3);
if ( (LA6_19=='R'||LA6_19=='r') ) {
int LA6_26 = input.LA(4);
if ( (LA6_26=='G'||LA6_26=='g') ) {
int LA6_32 = input.LA(5);
if ( (LA6_32=='E'||LA6_32=='e') ) {
int LA6_37 = input.LA(6);
if ( (LA6_37=='T'||LA6_37=='t') ) {
int LA6_41 = input.LA(7);
if ( (LA6_41=='-'||(LA6_41 >= '0' && LA6_41 <= '9')||(LA6_41 >= 'A' && LA6_41 <= 'Z')||LA6_41=='_'||(LA6_41 >= 'a' && LA6_41 <= 'z')) ) {
alt6=13;
}
else {
alt6=4;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
default:
alt6=13;
}
}
break;
case 'S':
case 's':
{
int LA6_4 = input.LA(2);
if ( (LA6_4=='O'||LA6_4=='o') ) {
int LA6_20 = input.LA(3);
if ( (LA6_20=='U'||LA6_20=='u') ) {
int LA6_27 = input.LA(4);
if ( (LA6_27=='R'||LA6_27=='r') ) {
int LA6_33 = input.LA(5);
if ( (LA6_33=='C'||LA6_33=='c') ) {
int LA6_38 = input.LA(6);
if ( (LA6_38=='E'||LA6_38=='e') ) {
int LA6_42 = input.LA(7);
if ( (LA6_42=='-'||(LA6_42 >= '0' && LA6_42 <= '9')||(LA6_42 >= 'A' && LA6_42 <= 'Z')||LA6_42=='_'||(LA6_42 >= 'a' && LA6_42 <= 'z')) ) {
alt6=13;
}
else {
alt6=5;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'F':
case 'f':
{
int LA6_5 = input.LA(2);
if ( (LA6_5=='U'||LA6_5=='u') ) {
int LA6_21 = input.LA(3);
if ( (LA6_21=='N'||LA6_21=='n') ) {
int LA6_28 = input.LA(4);
if ( (LA6_28=='C'||LA6_28=='c') ) {
int LA6_34 = input.LA(5);
if ( (LA6_34=='T'||LA6_34=='t') ) {
int LA6_39 = input.LA(6);
if ( (LA6_39=='-'||(LA6_39 >= '0' && LA6_39 <= '9')||(LA6_39 >= 'A' && LA6_39 <= 'Z')||LA6_39=='_'||(LA6_39 >= 'a' && LA6_39 <= 'z')) ) {
alt6=13;
}
else {
alt6=6;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'P':
case 'p':
{
int LA6_6 = input.LA(2);
if ( (LA6_6=='R'||LA6_6=='r') ) {
int LA6_22 = input.LA(3);
if ( (LA6_22=='E'||LA6_22=='e') ) {
int LA6_29 = input.LA(4);
if ( (LA6_29=='D'||LA6_29=='d') ) {
int LA6_35 = input.LA(5);
if ( (LA6_35=='-'||(LA6_35 >= '0' && LA6_35 <= '9')||(LA6_35 >= 'A' && LA6_35 <= 'Z')||LA6_35=='_'||(LA6_35 >= 'a' && LA6_35 <= 'z')) ) {
alt6=13;
}
else {
alt6=7;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case ',':
{
alt6=8;
}
break;
case ':':
{
alt6=9;
}
break;
case ';':
{
alt6=10;
}
break;
case '_':
{
alt6=11;
}
break;
case '-':
{
alt6=12;
}
break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'G':
case 'H':
case 'J':
case 'K':
case 'L':
case 'M':
case 'O':
case 'Q':
case 'R':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'g':
case 'h':
case 'j':
case 'k':
case 'l':
case 'm':
case 'o':
case 'q':
case 'r':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
{
alt6=13;
}
break;
case '\'':
{
alt6=14;
}
break;
case '\"':
{
alt6=15;
}
break;
case '\t':
case '\n':
case '\r':
case ' ':
{
alt6=16;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:10: NOT
{
mNOT();
}
break;
case 2 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:14: ID
{
mID();
}
break;
case 3 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:17: TEXT
{
mTEXT();
}
break;
case 4 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:22: TARGET
{
mTARGET();
}
break;
case 5 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:29: SOURCE
{
mSOURCE();
}
break;
case 6 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:36: FUNCT
{
mFUNCT();
}
break;
case 7 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:42: PRED
{
mPRED();
}
break;
case 8 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:47: COMMA
{
mCOMMA();
}
break;
case 9 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:53: COLON
{
mCOLON();
}
break;
case 10 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:59: SEMI
{
mSEMI();
}
break;
case 11 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:64: UNDERSCORE
{
mUNDERSCORE();
}
break;
case 12 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:75: DASH
{
mDASH();
}
break;
case 13 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:80: STRING
{
mSTRING();
}
break;
case 14 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:87: STRING_WITH_QUOTE
{
mSTRING_WITH_QUOTE();
}
break;
case 15 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:105: STRING_WITH_QUOTE_DOUBLE
{
mSTRING_WITH_QUOTE_DOUBLE();
}
break;
case 16 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:130: WS
{
mWS();
}
break;
}
} } | public class class_name {
public void mTokens() throws RecognitionException {
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:8: ( NOT | ID | TEXT | TARGET | SOURCE | FUNCT | PRED | COMMA | COLON | SEMI | UNDERSCORE | DASH | STRING | STRING_WITH_QUOTE | STRING_WITH_QUOTE_DOUBLE | WS )
int alt6=16;
switch ( input.LA(1) ) {
case 'N':
case 'n':
{
int LA6_1 = input.LA(2);
if ( (LA6_1=='O'||LA6_1=='o') ) {
int LA6_16 = input.LA(3);
if ( (LA6_16=='T'||LA6_16=='t') ) {
int LA6_23 = input.LA(4);
if ( (LA6_23=='-'||(LA6_23 >= '0' && LA6_23 <= '9')||(LA6_23 >= 'A' && LA6_23 <= 'Z')||LA6_23=='_'||(LA6_23 >= 'a' && LA6_23 <= 'z')) ) {
alt6=13; // depends on control dependency: [if], data = [none]
}
else {
alt6=1; // depends on control dependency: [if], data = [none]
}
}
else {
alt6=13; // depends on control dependency: [if], data = [none]
}
}
else {
alt6=13;
}
}
break;
case 'I':
case 'i':
{
int LA6_2 = input.LA(2);
if ( (LA6_2=='D'||LA6_2=='d') ) {
int LA6_17 = input.LA(3);
if ( (LA6_17=='-'||(LA6_17 >= '0' && LA6_17 <= '9')||(LA6_17 >= 'A' && LA6_17 <= 'Z')||LA6_17=='_'||(LA6_17 >= 'a' && LA6_17 <= 'z')) ) {
alt6=13;
}
else {
alt6=2;
}
}
else {
alt6=13;
}
}
break;
case 'T':
case 't':
{
switch ( input.LA(2) ) {
case 'E':
case 'e':
{
int LA6_18 = input.LA(3);
if ( (LA6_18=='X'||LA6_18=='x') ) {
int LA6_25 = input.LA(4);
if ( (LA6_25=='T'||LA6_25=='t') ) {
int LA6_31 = input.LA(5);
if ( (LA6_31=='-'||(LA6_31 >= '0' && LA6_31 <= '9')||(LA6_31 >= 'A' && LA6_31 <= 'Z')||LA6_31=='_'||(LA6_31 >= 'a' && LA6_31 <= 'z')) ) {
alt6=13;
}
else {
alt6=3;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'A':
case 'a':
{
int LA6_19 = input.LA(3);
if ( (LA6_19=='R'||LA6_19=='r') ) {
int LA6_26 = input.LA(4);
if ( (LA6_26=='G'||LA6_26=='g') ) {
int LA6_32 = input.LA(5);
if ( (LA6_32=='E'||LA6_32=='e') ) {
int LA6_37 = input.LA(6);
if ( (LA6_37=='T'||LA6_37=='t') ) {
int LA6_41 = input.LA(7);
if ( (LA6_41=='-'||(LA6_41 >= '0' && LA6_41 <= '9')||(LA6_41 >= 'A' && LA6_41 <= 'Z')||LA6_41=='_'||(LA6_41 >= 'a' && LA6_41 <= 'z')) ) {
alt6=13;
}
else {
alt6=4;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
default:
alt6=13;
}
}
break;
case 'S':
case 's':
{
int LA6_4 = input.LA(2);
if ( (LA6_4=='O'||LA6_4=='o') ) {
int LA6_20 = input.LA(3);
if ( (LA6_20=='U'||LA6_20=='u') ) {
int LA6_27 = input.LA(4);
if ( (LA6_27=='R'||LA6_27=='r') ) {
int LA6_33 = input.LA(5);
if ( (LA6_33=='C'||LA6_33=='c') ) {
int LA6_38 = input.LA(6);
if ( (LA6_38=='E'||LA6_38=='e') ) {
int LA6_42 = input.LA(7);
if ( (LA6_42=='-'||(LA6_42 >= '0' && LA6_42 <= '9')||(LA6_42 >= 'A' && LA6_42 <= 'Z')||LA6_42=='_'||(LA6_42 >= 'a' && LA6_42 <= 'z')) ) {
alt6=13;
}
else {
alt6=5;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'F':
case 'f':
{
int LA6_5 = input.LA(2);
if ( (LA6_5=='U'||LA6_5=='u') ) {
int LA6_21 = input.LA(3);
if ( (LA6_21=='N'||LA6_21=='n') ) {
int LA6_28 = input.LA(4);
if ( (LA6_28=='C'||LA6_28=='c') ) {
int LA6_34 = input.LA(5);
if ( (LA6_34=='T'||LA6_34=='t') ) {
int LA6_39 = input.LA(6);
if ( (LA6_39=='-'||(LA6_39 >= '0' && LA6_39 <= '9')||(LA6_39 >= 'A' && LA6_39 <= 'Z')||LA6_39=='_'||(LA6_39 >= 'a' && LA6_39 <= 'z')) ) {
alt6=13;
}
else {
alt6=6;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case 'P':
case 'p':
{
int LA6_6 = input.LA(2);
if ( (LA6_6=='R'||LA6_6=='r') ) {
int LA6_22 = input.LA(3);
if ( (LA6_22=='E'||LA6_22=='e') ) {
int LA6_29 = input.LA(4);
if ( (LA6_29=='D'||LA6_29=='d') ) {
int LA6_35 = input.LA(5);
if ( (LA6_35=='-'||(LA6_35 >= '0' && LA6_35 <= '9')||(LA6_35 >= 'A' && LA6_35 <= 'Z')||LA6_35=='_'||(LA6_35 >= 'a' && LA6_35 <= 'z')) ) {
alt6=13;
}
else {
alt6=7;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
else {
alt6=13;
}
}
break;
case ',':
{
alt6=8;
}
break;
case ':':
{
alt6=9;
}
break;
case ';':
{
alt6=10;
}
break;
case '_':
{
alt6=11;
}
break;
case '-':
{
alt6=12;
}
break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'G':
case 'H':
case 'J':
case 'K':
case 'L':
case 'M':
case 'O':
case 'Q':
case 'R':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'g':
case 'h':
case 'j':
case 'k':
case 'l':
case 'm':
case 'o':
case 'q':
case 'r':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
{
alt6=13;
}
break;
case '\'':
{
alt6=14;
}
break;
case '\"':
{
alt6=15;
}
break;
case '\t':
case '\n':
case '\r':
case ' ':
{
alt6=16;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:10: NOT
{
mNOT();
}
break;
case 2 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:14: ID
{
mID();
}
break;
case 3 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:17: TEXT
{
mTEXT();
}
break;
case 4 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:22: TARGET
{
mTARGET();
}
break;
case 5 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:29: SOURCE
{
mSOURCE();
}
break;
case 6 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:36: FUNCT
{
mFUNCT();
}
break;
case 7 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:42: PRED
{
mPRED();
}
break;
case 8 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:47: COMMA
{
mCOMMA();
}
break;
case 9 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:53: COLON
{
mCOLON();
}
break;
case 10 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:59: SEMI
{
mSEMI();
}
break;
case 11 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:64: UNDERSCORE
{
mUNDERSCORE();
}
break;
case 12 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:75: DASH
{
mDASH();
}
break;
case 13 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:80: STRING
{
mSTRING();
}
break;
case 14 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:87: STRING_WITH_QUOTE
{
mSTRING_WITH_QUOTE();
}
break;
case 15 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:105: STRING_WITH_QUOTE_DOUBLE
{
mSTRING_WITH_QUOTE_DOUBLE();
}
break;
case 16 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:1:130: WS
{
mWS();
}
break;
}
} } |
public class class_name {
public void marshall(FleetUtilization fleetUtilization, ProtocolMarshaller protocolMarshaller) {
if (fleetUtilization == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(fleetUtilization.getFleetId(), FLEETID_BINDING);
protocolMarshaller.marshall(fleetUtilization.getActiveServerProcessCount(), ACTIVESERVERPROCESSCOUNT_BINDING);
protocolMarshaller.marshall(fleetUtilization.getActiveGameSessionCount(), ACTIVEGAMESESSIONCOUNT_BINDING);
protocolMarshaller.marshall(fleetUtilization.getCurrentPlayerSessionCount(), CURRENTPLAYERSESSIONCOUNT_BINDING);
protocolMarshaller.marshall(fleetUtilization.getMaximumPlayerSessionCount(), MAXIMUMPLAYERSESSIONCOUNT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(FleetUtilization fleetUtilization, ProtocolMarshaller protocolMarshaller) {
if (fleetUtilization == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(fleetUtilization.getFleetId(), FLEETID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(fleetUtilization.getActiveServerProcessCount(), ACTIVESERVERPROCESSCOUNT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(fleetUtilization.getActiveGameSessionCount(), ACTIVEGAMESESSIONCOUNT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(fleetUtilization.getCurrentPlayerSessionCount(), CURRENTPLAYERSESSIONCOUNT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(fleetUtilization.getMaximumPlayerSessionCount(), MAXIMUMPLAYERSESSIONCOUNT_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 {
@Override
public EntityEnum getEntityType(IGroupMember entity) {
if (entity == null) {
throw new IllegalArgumentException("Parameter must not be null");
}
if (IEntityGroup.class.isAssignableFrom(entity.getClass())) {
return EntityEnum.getEntityEnum(entity.getLeafType(), true);
} else {
return EntityEnum.getEntityEnum(entity.getLeafType(), false);
}
} } | public class class_name {
@Override
public EntityEnum getEntityType(IGroupMember entity) {
if (entity == null) {
throw new IllegalArgumentException("Parameter must not be null");
}
if (IEntityGroup.class.isAssignableFrom(entity.getClass())) {
return EntityEnum.getEntityEnum(entity.getLeafType(), true); // depends on control dependency: [if], data = [none]
} else {
return EntityEnum.getEntityEnum(entity.getLeafType(), false); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static Node searchNodeById(Node rootNode, int nodeId) {
if (rootNode.getNodeId() == nodeId) {
return rootNode;
}
Node foundNode = null;
for (Node n : rootNode.getChilds()) {
foundNode = searchNodeById(n, nodeId);
if (foundNode != null) {
break;
}
}
return foundNode;
} } | public class class_name {
public static Node searchNodeById(Node rootNode, int nodeId) {
if (rootNode.getNodeId() == nodeId) {
return rootNode; // depends on control dependency: [if], data = [none]
}
Node foundNode = null;
for (Node n : rootNode.getChilds()) {
foundNode = searchNodeById(n, nodeId); // depends on control dependency: [for], data = [n]
if (foundNode != null) {
break;
}
}
return foundNode;
} } |
public class class_name {
public void changeAnimation(ViewHolder oldHolder, ViewHolder newHolder, int fromX, int fromY, int toX, int toY) {
final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView);
final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView);
final float prevValue = ViewCompat.getAlpha(oldHolder.itemView);
resetAnimation(oldHolder);
int deltaX = (int) (toX - fromX - prevTranslationX);
int deltaY = (int) (toY - fromY - prevTranslationY);
// recover prev translation state after ending animation
ViewCompat.setTranslationX(oldHolder.itemView, prevTranslationX);
ViewCompat.setTranslationY(oldHolder.itemView, prevTranslationY);
ViewCompat.setAlpha(oldHolder.itemView, prevValue);
if (newHolder != null) {
// carry over translation values
resetAnimation(newHolder);
ViewCompat.setTranslationX(newHolder.itemView, -deltaX);
ViewCompat.setTranslationY(newHolder.itemView, -deltaY);
ViewCompat.setAlpha(newHolder.itemView, 0);
}
} } | public class class_name {
public void changeAnimation(ViewHolder oldHolder, ViewHolder newHolder, int fromX, int fromY, int toX, int toY) {
final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView);
final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView);
final float prevValue = ViewCompat.getAlpha(oldHolder.itemView);
resetAnimation(oldHolder);
int deltaX = (int) (toX - fromX - prevTranslationX);
int deltaY = (int) (toY - fromY - prevTranslationY);
// recover prev translation state after ending animation
ViewCompat.setTranslationX(oldHolder.itemView, prevTranslationX);
ViewCompat.setTranslationY(oldHolder.itemView, prevTranslationY);
ViewCompat.setAlpha(oldHolder.itemView, prevValue);
if (newHolder != null) {
// carry over translation values
resetAnimation(newHolder); // depends on control dependency: [if], data = [(newHolder]
ViewCompat.setTranslationX(newHolder.itemView, -deltaX); // depends on control dependency: [if], data = [(newHolder]
ViewCompat.setTranslationY(newHolder.itemView, -deltaY); // depends on control dependency: [if], data = [(newHolder]
ViewCompat.setAlpha(newHolder.itemView, 0); // depends on control dependency: [if], data = [(newHolder]
}
} } |
public class class_name {
public List<Cursor> getInactiveCursors()
{
List<Cursor> returnList = new ArrayList<Cursor>();
synchronized (mCursors)
{
for (Cursor cursor : mCursors)
{
if (!cursor.isActive())
{
returnList.add(cursor);
}
}
}
return returnList;
} } | public class class_name {
public List<Cursor> getInactiveCursors()
{
List<Cursor> returnList = new ArrayList<Cursor>();
synchronized (mCursors)
{
for (Cursor cursor : mCursors)
{
if (!cursor.isActive())
{
returnList.add(cursor); // depends on control dependency: [if], data = [none]
}
}
}
return returnList;
} } |
public class class_name {
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) {
double[] offset = null;
String vstr = ((Element) cur).getAttribute(ATTR_VECTOR);
if(vstr != null && vstr.length() > 0) {
offset = parseVector(vstr);
}
if(offset == null) {
throw new AbortException("No translation vector given.");
}
// *** add new translation
cluster.addTranslation(offset);
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while(iter.hasNext()) {
Node child = iter.next();
if(child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
}
}
} } | public class class_name {
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) {
double[] offset = null;
String vstr = ((Element) cur).getAttribute(ATTR_VECTOR);
if(vstr != null && vstr.length() > 0) {
offset = parseVector(vstr); // depends on control dependency: [if], data = [(vstr]
}
if(offset == null) {
throw new AbortException("No translation vector given.");
}
// *** add new translation
cluster.addTranslation(offset);
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while(iter.hasNext()) {
Node child = iter.next();
if(child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName()); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public static DMatrixRMaj[] columnsToVector(DMatrixRMaj A, DMatrixRMaj[] v)
{
DMatrixRMaj[]ret;
if( v == null || v.length < A.numCols ) {
ret = new DMatrixRMaj[ A.numCols ];
} else {
ret = v;
}
for( int i = 0; i < ret.length; i++ ) {
if( ret[i] == null ) {
ret[i] = new DMatrixRMaj(A.numRows,1);
} else {
ret[i].reshape(A.numRows,1, false);
}
DMatrixRMaj u = ret[i];
for( int j = 0; j < A.numRows; j++ ) {
u.set(j,0, A.get(j,i));
}
}
return ret;
} } | public class class_name {
public static DMatrixRMaj[] columnsToVector(DMatrixRMaj A, DMatrixRMaj[] v)
{
DMatrixRMaj[]ret;
if( v == null || v.length < A.numCols ) {
ret = new DMatrixRMaj[ A.numCols ]; // depends on control dependency: [if], data = [none]
} else {
ret = v; // depends on control dependency: [if], data = [none]
}
for( int i = 0; i < ret.length; i++ ) {
if( ret[i] == null ) {
ret[i] = new DMatrixRMaj(A.numRows,1); // depends on control dependency: [if], data = [none]
} else {
ret[i].reshape(A.numRows,1, false); // depends on control dependency: [if], data = [none]
}
DMatrixRMaj u = ret[i];
for( int j = 0; j < A.numRows; j++ ) {
u.set(j,0, A.get(j,i)); // depends on control dependency: [for], data = [j]
}
}
return ret;
} } |
public class class_name {
public int disconnect(int v) {
Set<T> types = edges.remove(v);
if (types != null) {
int edges = types.size();
size -= edges;
return edges;
}
return 0;
} } | public class class_name {
public int disconnect(int v) {
Set<T> types = edges.remove(v);
if (types != null) {
int edges = types.size();
size -= edges; // depends on control dependency: [if], data = [none]
return edges; // depends on control dependency: [if], data = [none]
}
return 0;
} } |
public class class_name {
public boolean addLocalizationPoint(LWMConfig lp, DestinationDefinition dd) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, "addLocalizationPoint", lp);
}
boolean valid = false;
LocalizationDefinition ld = ((JsAdminFactoryImpl) jsaf).createLocalizationDefinition(lp);
if (!isInZOSServentRegion()) {
_mpAdmin = ((SIMPAdmin) _me.getMessageProcessor()).getAdministrator();
}
try {
_mpAdmin.createDestinationLocalization(dd, ld);
updatedDestDefList.add(dd);
updatedLocDefList.add(ld);
LocalizationEntry lEntry = new LocalizationEntry(ld);
lpMap.put(ld.getName(), lEntry);
MasterEntry newMasterEntry = new MasterEntry();
newMasterEntry.setDestinationLocalization(ld);
masterMap.put(dd.getName(), newMasterEntry);
valid = true;
} catch (Exception e) {
SibTr.error(tc, "LOCALIZATION_EXCEPTION_SIAS0113", e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, "addLocalizationPoint", Boolean.valueOf(valid));
}
return valid;
} } | public class class_name {
public boolean addLocalizationPoint(LWMConfig lp, DestinationDefinition dd) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, "addLocalizationPoint", lp); // depends on control dependency: [if], data = [none]
}
boolean valid = false;
LocalizationDefinition ld = ((JsAdminFactoryImpl) jsaf).createLocalizationDefinition(lp);
if (!isInZOSServentRegion()) {
_mpAdmin = ((SIMPAdmin) _me.getMessageProcessor()).getAdministrator(); // depends on control dependency: [if], data = [none]
}
try {
_mpAdmin.createDestinationLocalization(dd, ld); // depends on control dependency: [try], data = [none]
updatedDestDefList.add(dd); // depends on control dependency: [try], data = [none]
updatedLocDefList.add(ld); // depends on control dependency: [try], data = [none]
LocalizationEntry lEntry = new LocalizationEntry(ld);
lpMap.put(ld.getName(), lEntry); // depends on control dependency: [try], data = [none]
MasterEntry newMasterEntry = new MasterEntry();
newMasterEntry.setDestinationLocalization(ld); // depends on control dependency: [try], data = [none]
masterMap.put(dd.getName(), newMasterEntry); // depends on control dependency: [try], data = [none]
valid = true; // depends on control dependency: [try], data = [none]
} catch (Exception e) {
SibTr.error(tc, "LOCALIZATION_EXCEPTION_SIAS0113", e);
} // depends on control dependency: [catch], data = [none]
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, "addLocalizationPoint", Boolean.valueOf(valid)); // depends on control dependency: [if], data = [none]
}
return valid;
} } |
public class class_name {
public static boolean checkServerConnection(String serverURL) {
boolean value = false;
try {
value = new RetrieveCheckServerConnectionString().execute(serverURL).get();
} catch (InterruptedException e) {
QuickUtils.log.e("InterruptedException", e);
} catch (ExecutionException e) {
QuickUtils.log.e("ExecutionException", e);
}
return value;
} } | public class class_name {
public static boolean checkServerConnection(String serverURL) {
boolean value = false;
try {
value = new RetrieveCheckServerConnectionString().execute(serverURL).get(); // depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
QuickUtils.log.e("InterruptedException", e);
} catch (ExecutionException e) { // depends on control dependency: [catch], data = [none]
QuickUtils.log.e("ExecutionException", e);
} // depends on control dependency: [catch], data = [none]
return value;
} } |
public class class_name {
public boolean isServerStopping() {
String thisMethodName = CLASS_NAME + ".isServerStopping()";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, thisMethodName, new Boolean(_serverStopping));
}
return _serverStopping;
} } | public class class_name {
public boolean isServerStopping() {
String thisMethodName = CLASS_NAME + ".isServerStopping()";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, this); // depends on control dependency: [if], data = [none]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, thisMethodName, new Boolean(_serverStopping)); // depends on control dependency: [if], data = [none]
}
return _serverStopping;
} } |
public class class_name {
public void marshall(DeleteModelRequest deleteModelRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteModelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteModelRequest.getApiId(), APIID_BINDING);
protocolMarshaller.marshall(deleteModelRequest.getModelId(), MODELID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(DeleteModelRequest deleteModelRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteModelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteModelRequest.getApiId(), APIID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(deleteModelRequest.getModelId(), MODELID_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 Observable<ServiceResponse<Page<RecommendationInner>>> listRecommendedRulesForWebAppNextWithServiceResponseAsync(final String nextPageLink) {
return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<RecommendationInner>>, Observable<ServiceResponse<Page<RecommendationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<RecommendationInner>>> call(ServiceResponse<Page<RecommendationInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listRecommendedRulesForWebAppNextWithServiceResponseAsync(nextPageLink));
}
});
} } | public class class_name {
public Observable<ServiceResponse<Page<RecommendationInner>>> listRecommendedRulesForWebAppNextWithServiceResponseAsync(final String nextPageLink) {
return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<RecommendationInner>>, Observable<ServiceResponse<Page<RecommendationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<RecommendationInner>>> call(ServiceResponse<Page<RecommendationInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page); // depends on control dependency: [if], data = [none]
}
return Observable.just(page).concatWith(listRecommendedRulesForWebAppNextWithServiceResponseAsync(nextPageLink));
}
});
} } |
public class class_name {
public BasicAuthAuthenticator getBasicAuthAuthenticator() {
try {
return createBasicAuthenticator();
} catch (RegistryException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "RegistryException while trying to create BasicAuthAuthenticator", e);
}
}
return null;
} } | public class class_name {
public BasicAuthAuthenticator getBasicAuthAuthenticator() {
try {
return createBasicAuthenticator(); // depends on control dependency: [try], data = [none]
} catch (RegistryException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "RegistryException while trying to create BasicAuthAuthenticator", e); // depends on control dependency: [if], data = [none]
}
} // depends on control dependency: [catch], data = [none]
return null;
} } |
public class class_name {
public final String getSetting (final String targetName, final int connectionID, final OperationalTextKey textKey) throws OperationalTextKeyException {
try {
final SessionConfiguration sc;
synchronized (sessionConfigs) {
sc = sessionConfigs.get(targetName);
synchronized (sc) {
if (sc != null) {
String value = sc.getSetting(connectionID, textKey);
if (value != null) { return value; }
}
}
}
} catch (OperationalTextKeyException e) {
// we had not find a session/connection entry, so we have to search
// in the
// global settings
}
final SettingEntry se;
synchronized (globalConfig) {
se = globalConfig.get(textKey);
synchronized (se) {
if (se != null) { return se.getValue(); }
}
}
throw new OperationalTextKeyException("No OperationalTextKey entry found for key: " + textKey.value());
} } | public class class_name {
public final String getSetting (final String targetName, final int connectionID, final OperationalTextKey textKey) throws OperationalTextKeyException {
try {
final SessionConfiguration sc;
synchronized (sessionConfigs) {
sc = sessionConfigs.get(targetName);
synchronized (sc) {
if (sc != null) {
String value = sc.getSetting(connectionID, textKey);
if (value != null) { return value; } // depends on control dependency: [if], data = [none]
}
}
}
} catch (OperationalTextKeyException e) {
// we had not find a session/connection entry, so we have to search
// in the
// global settings
}
final SettingEntry se;
synchronized (globalConfig) {
se = globalConfig.get(textKey);
synchronized (se) {
if (se != null) { return se.getValue(); }
}
}
throw new OperationalTextKeyException("No OperationalTextKey entry found for key: " + textKey.value());
} } |
public class class_name {
void seekMatchingRead() {
while (!isAtEnd()) {
if (iterator == null || !iterator.hasNext()) {
LOG.info("Getting " +
(iterator == null ? "first" : "next") +
" interval from the API");
// We have hit an end (or this is first time) so we need to go fish
// to the API.
ReadIteratorResource<Read, ReadGroupSet, Reference> resource = queryNextInterval();
if (resource != null) {
LOG.info("Got next interval from the API");
header = resource.getSAMFileHeader();
iterator = resource.getSAMRecordIterable().iterator();
} else {
LOG.info("Failed to get next interval from the API");
header = null;
iterator = null;
}
} else {
nextRead = iterator.next();
if (currentInterval().matches(nextRead)) {
return; // Happy case, otherwise we keep spinning in the loop.
} else {
LOG.info("Skipping non matching read");
}
}
}
} } | public class class_name {
void seekMatchingRead() {
while (!isAtEnd()) {
if (iterator == null || !iterator.hasNext()) {
LOG.info("Getting " +
(iterator == null ? "first" : "next") +
" interval from the API"); // depends on control dependency: [if], data = [none]
// We have hit an end (or this is first time) so we need to go fish
// to the API.
ReadIteratorResource<Read, ReadGroupSet, Reference> resource = queryNextInterval();
if (resource != null) {
LOG.info("Got next interval from the API"); // depends on control dependency: [if], data = [none]
header = resource.getSAMFileHeader(); // depends on control dependency: [if], data = [none]
iterator = resource.getSAMRecordIterable().iterator(); // depends on control dependency: [if], data = [none]
} else {
LOG.info("Failed to get next interval from the API"); // depends on control dependency: [if], data = [none]
header = null; // depends on control dependency: [if], data = [none]
iterator = null; // depends on control dependency: [if], data = [none]
}
} else {
nextRead = iterator.next(); // depends on control dependency: [if], data = [none]
if (currentInterval().matches(nextRead)) {
return; // Happy case, otherwise we keep spinning in the loop. // depends on control dependency: [if], data = [none]
} else {
LOG.info("Skipping non matching read"); // depends on control dependency: [if], data = [none]
}
}
}
} } |
public class class_name {
protected boolean prePrepare() {
if (tc.isEntryEnabled())
Tr.entry(tc, "prePrepare");
//
// Cancel timeout prior to completion phase
//
cancelAlarms();
//
// Inform the Synchronisations we are about to complete
//
if (!_rollbackOnly) {
if (_syncs != null) {
_syncs.distributeBefore();
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "prePrepare", !_rollbackOnly);
return !_rollbackOnly;
} } | public class class_name {
protected boolean prePrepare() {
if (tc.isEntryEnabled())
Tr.entry(tc, "prePrepare");
//
// Cancel timeout prior to completion phase
//
cancelAlarms();
//
// Inform the Synchronisations we are about to complete
//
if (!_rollbackOnly) {
if (_syncs != null) {
_syncs.distributeBefore(); // depends on control dependency: [if], data = [none]
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "prePrepare", !_rollbackOnly);
return !_rollbackOnly;
} } |
public class class_name {
public List<String> getMultiSelect(String path) {
List<String> values = new ArrayList<String>();
for (JsonValue val : this.getValue(path).asArray()) {
values.add(val.asString());
}
return values;
} } | public class class_name {
public List<String> getMultiSelect(String path) {
List<String> values = new ArrayList<String>();
for (JsonValue val : this.getValue(path).asArray()) {
values.add(val.asString()); // depends on control dependency: [for], data = [val]
}
return values;
} } |
public class class_name {
@Override
public MonetaryAmount apply(MonetaryAmount value) {
Objects.requireNonNull(value, "Amount required.");
// 1 extract BD value, round according the default fraction units
int scale = this.context.getInt(SCALE_KEY);
RoundingMode roundingMode = this.context.get(RoundingMode.class);
BigDecimal num = value.getNumber().numberValue(BigDecimal.class).setScale(scale, roundingMode);
// 2 evaluate minor units and remainder
long minors = num.movePointRight(num.scale()).longValueExact();
int minimalMinors = this.context.getInt(MINMINORS_KEY);
long factor = minors / minimalMinors;
long low = minimalMinors * factor;
long high = minimalMinors * (factor + 1);
if (minors - low > high - minors) {
minors = high;
} else if (minors - low < high - minors) {
minors = low;
} else {
switch (roundingMode) {
case HALF_UP:
case UP:
case HALF_EVEN:
minors = high;
break;
default:
minors = low;
}
}
return value.getFactory().setCurrency(value.getCurrency())
.setNumber(BigDecimal.valueOf(minors).movePointLeft(scale)).create();
} } | public class class_name {
@Override
public MonetaryAmount apply(MonetaryAmount value) {
Objects.requireNonNull(value, "Amount required.");
// 1 extract BD value, round according the default fraction units
int scale = this.context.getInt(SCALE_KEY);
RoundingMode roundingMode = this.context.get(RoundingMode.class);
BigDecimal num = value.getNumber().numberValue(BigDecimal.class).setScale(scale, roundingMode);
// 2 evaluate minor units and remainder
long minors = num.movePointRight(num.scale()).longValueExact();
int minimalMinors = this.context.getInt(MINMINORS_KEY);
long factor = minors / minimalMinors;
long low = minimalMinors * factor;
long high = minimalMinors * (factor + 1);
if (minors - low > high - minors) {
minors = high; // depends on control dependency: [if], data = [none]
} else if (minors - low < high - minors) {
minors = low; // depends on control dependency: [if], data = [none]
} else {
switch (roundingMode) {
case HALF_UP:
case UP:
case HALF_EVEN:
minors = high;
break;
default:
minors = low;
}
}
return value.getFactory().setCurrency(value.getCurrency())
.setNumber(BigDecimal.valueOf(minors).movePointLeft(scale)).create();
} } |
public class class_name {
public PointerHierarchyRepresentationResult complete() {
if(csize != null) {
csize.destroy();
csize = null;
}
if(mergecount != ids.size() - 1) {
LOG.warning(mergecount + " merges were added to the hierarchy, expected " + (ids.size() - 1));
}
if(prototypes != null) {
return new PointerPrototypeHierarchyRepresentationResult(ids, parent, parentDistance, isSquared, order, prototypes);
}
return new PointerHierarchyRepresentationResult(ids, parent, parentDistance, isSquared, order);
} } | public class class_name {
public PointerHierarchyRepresentationResult complete() {
if(csize != null) {
csize.destroy(); // depends on control dependency: [if], data = [none]
csize = null; // depends on control dependency: [if], data = [none]
}
if(mergecount != ids.size() - 1) {
LOG.warning(mergecount + " merges were added to the hierarchy, expected " + (ids.size() - 1)); // depends on control dependency: [if], data = [(mergecount]
}
if(prototypes != null) {
return new PointerPrototypeHierarchyRepresentationResult(ids, parent, parentDistance, isSquared, order, prototypes); // depends on control dependency: [if], data = [none]
}
return new PointerHierarchyRepresentationResult(ids, parent, parentDistance, isSquared, order);
} } |
public class class_name {
@Override
public void finish(IQueueMessage<ID, DATA> msg) {
if (!isEphemeralDisabled()) {
String key = msg.getId().toString();
rocksDbWrapper.delete(cfNameEphemeral, writeOptions, key);
}
} } | public class class_name {
@Override
public void finish(IQueueMessage<ID, DATA> msg) {
if (!isEphemeralDisabled()) {
String key = msg.getId().toString();
rocksDbWrapper.delete(cfNameEphemeral, writeOptions, key); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void revert() {
for (Iterator i = children.iterator(); i.hasNext();) {
((FormModel) i.next()).revert();
}
// this will cause all buffered value models to revert
commitTrigger.revert();
// this will then go back and revert all unbuffered value models
for (Iterator i = mediatingValueModels.values().iterator(); i.hasNext();) {
((DirtyTrackingValueModel) i.next()).revertToOriginal();
}
} } | public class class_name {
public void revert() {
for (Iterator i = children.iterator(); i.hasNext();) {
((FormModel) i.next()).revert(); // depends on control dependency: [for], data = [i]
}
// this will cause all buffered value models to revert
commitTrigger.revert();
// this will then go back and revert all unbuffered value models
for (Iterator i = mediatingValueModels.values().iterator(); i.hasNext();) {
((DirtyTrackingValueModel) i.next()).revertToOriginal(); // depends on control dependency: [for], data = [i]
}
} } |
public class class_name {
public static long toLong(String str, long defaultValue) {
if (str == null) {
return defaultValue;
}
try {
return Long.parseLong(str);
} catch (NumberFormatException nfe) {
return defaultValue;
}
} } | public class class_name {
public static long toLong(String str, long defaultValue) {
if (str == null) {
return defaultValue; // depends on control dependency: [if], data = [none]
}
try {
return Long.parseLong(str); // depends on control dependency: [try], data = [none]
} catch (NumberFormatException nfe) {
return defaultValue;
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public int getNumDeliverable() {
NumDeliverable visitor=new NumDeliverable();
lock.lock();
try {
forEach(hd+1, hr, visitor);
return visitor.getResult();
}
finally {
lock.unlock();
}
} } | public class class_name {
public int getNumDeliverable() {
NumDeliverable visitor=new NumDeliverable();
lock.lock();
try {
forEach(hd+1, hr, visitor); // depends on control dependency: [try], data = [none]
return visitor.getResult(); // depends on control dependency: [try], data = [none]
}
finally {
lock.unlock();
}
} } |
public class class_name {
public void setCurrency(String currency) {
currency = StringUtils.upperCase(currency);
if (!CurrencyUtils.getInstance().isValidCurrency(currency)) {
currency = "EUR";
}
this.currency = currency;
} } | public class class_name {
public void setCurrency(String currency) {
currency = StringUtils.upperCase(currency);
if (!CurrencyUtils.getInstance().isValidCurrency(currency)) {
currency = "EUR"; // depends on control dependency: [if], data = [none]
}
this.currency = currency;
} } |
public class class_name {
public String getStringValue(String property) {
final List<JawrConfigManagerMBean> mBeans = getInitializedConfigurationManagers();
try {
if (mBeans.size() == 3) {
if (areEquals(getProperty(jsMBean, property), getProperty(cssMBean, property),
getProperty(binaryMBean, property))) {
return getProperty(jsMBean, property);
} else {
return NOT_IDENTICAL_VALUES;
}
}
if (mBeans.size() == 2) {
JawrConfigManagerMBean mBean1 = mBeans.get(0);
JawrConfigManagerMBean mBean2 = mBeans.get(1);
if (areEquals(getProperty(mBean1, property), getProperty(mBean2, property))) {
return getProperty(mBean1, property);
} else {
return NOT_IDENTICAL_VALUES;
}
}
JawrConfigManagerMBean mBean1 = mBeans.get(0);
return getProperty(mBean1, property);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
return ERROR_VALUE;
}
} } | public class class_name {
public String getStringValue(String property) {
final List<JawrConfigManagerMBean> mBeans = getInitializedConfigurationManagers();
try {
if (mBeans.size() == 3) {
if (areEquals(getProperty(jsMBean, property), getProperty(cssMBean, property),
getProperty(binaryMBean, property))) {
return getProperty(jsMBean, property); // depends on control dependency: [if], data = [none]
} else {
return NOT_IDENTICAL_VALUES; // depends on control dependency: [if], data = [none]
}
}
if (mBeans.size() == 2) {
JawrConfigManagerMBean mBean1 = mBeans.get(0);
JawrConfigManagerMBean mBean2 = mBeans.get(1);
if (areEquals(getProperty(mBean1, property), getProperty(mBean2, property))) {
return getProperty(mBean1, property); // depends on control dependency: [if], data = [none]
} else {
return NOT_IDENTICAL_VALUES; // depends on control dependency: [if], data = [none]
}
}
JawrConfigManagerMBean mBean1 = mBeans.get(0);
return getProperty(mBean1, property); // depends on control dependency: [try], data = [none]
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
return ERROR_VALUE;
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static List<Pair> toPairs(List<Double> xyValues) {
if (xyValues.size() % 2 != 0) {
throw new RuntimeException(String.format("[discrete error] "
+ "missing value in set of pairs (|xy|=%d)", xyValues.size()));
}
List<Pair> result = new ArrayList<Pair>((xyValues.size() + 1) / 2);
Iterator<Double> it = xyValues.iterator();
while (it.hasNext()) {
result.add(new Pair(it.next(), it.next()));
}
return result;
} } | public class class_name {
public static List<Pair> toPairs(List<Double> xyValues) {
if (xyValues.size() % 2 != 0) {
throw new RuntimeException(String.format("[discrete error] "
+ "missing value in set of pairs (|xy|=%d)", xyValues.size()));
}
List<Pair> result = new ArrayList<Pair>((xyValues.size() + 1) / 2);
Iterator<Double> it = xyValues.iterator();
while (it.hasNext()) {
result.add(new Pair(it.next(), it.next())); // depends on control dependency: [while], data = [none]
}
return result;
} } |
public class class_name {
private static boolean shouldFormatDFSCluster(String localDFSLocation,
boolean clean) {
boolean format = true;
File f = new File(localDFSLocation);
if (f.exists() && f.isDirectory() && !clean) {
format = false;
}
return format;
} } | public class class_name {
private static boolean shouldFormatDFSCluster(String localDFSLocation,
boolean clean) {
boolean format = true;
File f = new File(localDFSLocation);
if (f.exists() && f.isDirectory() && !clean) {
format = false; // depends on control dependency: [if], data = [none]
}
return format;
} } |
public class class_name {
public static BufferedImage grayMagnitude(ImageGray src, BufferedImage dst, double normalize) {
if (normalize < 0)
normalize = GImageStatistics.maxAbs(src);
dst = checkInputs(src, dst);
if (src.getDataType().isInteger()) {
return grayMagnitude((GrayI) src, dst, (int) normalize);
} else if( src instanceof GrayF32){
return grayMagnitude((GrayF32) src, dst, (float) normalize);
} else if( src instanceof GrayF64){
return grayMagnitude((GrayF64) src, dst, (float) normalize);
} else {
throw new RuntimeException("Unsupported type");
}
} } | public class class_name {
public static BufferedImage grayMagnitude(ImageGray src, BufferedImage dst, double normalize) {
if (normalize < 0)
normalize = GImageStatistics.maxAbs(src);
dst = checkInputs(src, dst);
if (src.getDataType().isInteger()) {
return grayMagnitude((GrayI) src, dst, (int) normalize); // depends on control dependency: [if], data = [none]
} else if( src instanceof GrayF32){
return grayMagnitude((GrayF32) src, dst, (float) normalize); // depends on control dependency: [if], data = [none]
} else if( src instanceof GrayF64){
return grayMagnitude((GrayF64) src, dst, (float) normalize); // depends on control dependency: [if], data = [none]
} else {
throw new RuntimeException("Unsupported type");
}
} } |
public class class_name {
public void createInitialPerformanceMonitors() {
if (packageScanBase != null) {
AnnotatedMethodScanner methodScanner = new AnnotatedMethodScanner();
for (Method m : methodScanner.findAnnotatedMethods(packageScanBase, org.fishwife.jrugged.aspects.PerformanceMonitor.class)) {
org.fishwife.jrugged.aspects.PerformanceMonitor performanceMonitorAnnotation = m.getAnnotation(org.fishwife.jrugged.aspects.PerformanceMonitor.class);
initialPerformanceMonitorList.add(performanceMonitorAnnotation.value());
}
}
for (String name: initialPerformanceMonitorList) {
createPerformanceMonitor(name);
}
} } | public class class_name {
public void createInitialPerformanceMonitors() {
if (packageScanBase != null) {
AnnotatedMethodScanner methodScanner = new AnnotatedMethodScanner();
for (Method m : methodScanner.findAnnotatedMethods(packageScanBase, org.fishwife.jrugged.aspects.PerformanceMonitor.class)) {
org.fishwife.jrugged.aspects.PerformanceMonitor performanceMonitorAnnotation = m.getAnnotation(org.fishwife.jrugged.aspects.PerformanceMonitor.class);
initialPerformanceMonitorList.add(performanceMonitorAnnotation.value()); // depends on control dependency: [for], data = [m]
}
}
for (String name: initialPerformanceMonitorList) {
createPerformanceMonitor(name); // depends on control dependency: [for], data = [name]
}
} } |
public class class_name {
@Action(name = "Create Virtual Machine",
outputs = {
@Output(Outputs.RETURN_CODE),
@Output(Outputs.RETURN_RESULT),
@Output(Outputs.EXCEPTION)
},
responses = {
@Response(text = Outputs.SUCCESS, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_SUCCESS,
matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED),
@Response(text = Outputs.FAILURE, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_FAILURE,
matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true)
})
public Map<String, String> createVM(@Param(value = HOST, required = true) String host,
@Param(value = PORT) String port,
@Param(value = PROTOCOL) String protocol,
@Param(value = USERNAME, required = true) String username,
@Param(value = PASSWORD, encrypted = true) String password,
@Param(value = TRUST_EVERYONE) String trustEveryone,
@Param(value = CLOSE_SESSION) String closeSession,
@Param(value = DATA_CENTER_NAME, required = true) String dataCenterName,
@Param(value = HOSTNAME, required = true) String hostname,
@Param(value = VM_NAME, required = true) String virtualMachineName,
@Param(value = DATA_STORE, required = true) String dataStore,
@Param(value = GUEST_OS_ID, required = true) String guestOsId,
@Param(value = FOLDER_NAME) String folderName,
@Param(value = RESOURCE_POOL) String resourcePool,
@Param(value = VM_DESCRIPTION) String description,
@Param(value = VM_CPU_COUNT) String numCPUs,
@Param(value = VM_DISK_SIZE) String vmDiskSize,
@Param(value = VM_MEMORY_SIZE) String vmMemorySize,
@Param(value = VMWARE_GLOBAL_SESSION_OBJECT) GlobalSessionObject<Map<String, Connection>> globalSessionObject) {
try {
final HttpInputs httpInputs = new HttpInputs.HttpInputsBuilder()
.withHost(host)
.withPort(port)
.withProtocol(protocol)
.withUsername(username)
.withPassword(password)
.withTrustEveryone(defaultIfEmpty(trustEveryone, FALSE))
.withCloseSession(defaultIfEmpty(closeSession, TRUE))
.withGlobalSessionObject(globalSessionObject)
.build();
final VmInputs vmInputs = new VmInputs.VmInputsBuilder()
.withDataCenterName(dataCenterName)
.withHostname(hostname)
.withVirtualMachineName(virtualMachineName)
.withDescription(description)
.withDataStore(dataStore)
.withGuestOsId(guestOsId)
.withFolderName(folderName)
.withResourcePool(resourcePool)
.withDescription(description)
.withGuestOsId(guestOsId)
.withDescription(description)
.withIntNumCPUs(numCPUs)
.withLongVmDiskSize(vmDiskSize)
.withLongVmMemorySize(vmMemorySize)
.build();
return new VmService().createVM(httpInputs, vmInputs);
} catch (Exception ex) {
return OutputUtilities.getFailureResultsMap(ex);
}
} } | public class class_name {
@Action(name = "Create Virtual Machine",
outputs = {
@Output(Outputs.RETURN_CODE),
@Output(Outputs.RETURN_RESULT),
@Output(Outputs.EXCEPTION)
},
responses = {
@Response(text = Outputs.SUCCESS, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_SUCCESS,
matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED),
@Response(text = Outputs.FAILURE, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_FAILURE,
matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true)
})
public Map<String, String> createVM(@Param(value = HOST, required = true) String host,
@Param(value = PORT) String port,
@Param(value = PROTOCOL) String protocol,
@Param(value = USERNAME, required = true) String username,
@Param(value = PASSWORD, encrypted = true) String password,
@Param(value = TRUST_EVERYONE) String trustEveryone,
@Param(value = CLOSE_SESSION) String closeSession,
@Param(value = DATA_CENTER_NAME, required = true) String dataCenterName,
@Param(value = HOSTNAME, required = true) String hostname,
@Param(value = VM_NAME, required = true) String virtualMachineName,
@Param(value = DATA_STORE, required = true) String dataStore,
@Param(value = GUEST_OS_ID, required = true) String guestOsId,
@Param(value = FOLDER_NAME) String folderName,
@Param(value = RESOURCE_POOL) String resourcePool,
@Param(value = VM_DESCRIPTION) String description,
@Param(value = VM_CPU_COUNT) String numCPUs,
@Param(value = VM_DISK_SIZE) String vmDiskSize,
@Param(value = VM_MEMORY_SIZE) String vmMemorySize,
@Param(value = VMWARE_GLOBAL_SESSION_OBJECT) GlobalSessionObject<Map<String, Connection>> globalSessionObject) {
try {
final HttpInputs httpInputs = new HttpInputs.HttpInputsBuilder()
.withHost(host)
.withPort(port)
.withProtocol(protocol)
.withUsername(username)
.withPassword(password)
.withTrustEveryone(defaultIfEmpty(trustEveryone, FALSE))
.withCloseSession(defaultIfEmpty(closeSession, TRUE))
.withGlobalSessionObject(globalSessionObject)
.build();
final VmInputs vmInputs = new VmInputs.VmInputsBuilder()
.withDataCenterName(dataCenterName)
.withHostname(hostname)
.withVirtualMachineName(virtualMachineName)
.withDescription(description)
.withDataStore(dataStore)
.withGuestOsId(guestOsId)
.withFolderName(folderName)
.withResourcePool(resourcePool)
.withDescription(description)
.withGuestOsId(guestOsId)
.withDescription(description)
.withIntNumCPUs(numCPUs)
.withLongVmDiskSize(vmDiskSize)
.withLongVmMemorySize(vmMemorySize)
.build();
return new VmService().createVM(httpInputs, vmInputs); // depends on control dependency: [try], data = [none]
} catch (Exception ex) {
return OutputUtilities.getFailureResultsMap(ex);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
void rollbackApplicationLocalTransaction() throws ResourceException {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "rollbackApplicationLocalTransaction");
}
if (_applicationLocalTransaction != null) {
SIUncoordinatedTransaction uncoordinatedTransaction = _applicationLocalTransaction
.getUncoordinatedTransaction();
try {
uncoordinatedTransaction.rollback();
} catch (SIException exception) {
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exception(this, TRACE, exception);
}
throw new ResourceException(NLS.getFormattedMessage(
"CONTAINER_ROLLBACK_FAILED_CWSIV0163",
new Object[] { exception }, null), exception);
} catch (SIErrorException exception) {
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exception(this, TRACE, exception);
}
throw new ResourceException(NLS.getFormattedMessage(
"CONTAINER_ROLLBACK_FAILED_CWSIV0163",
new Object[] { exception }, null), exception);
}
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "rollbackApplicationLocalTransaction");
}
} } | public class class_name {
void rollbackApplicationLocalTransaction() throws ResourceException {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "rollbackApplicationLocalTransaction");
}
if (_applicationLocalTransaction != null) {
SIUncoordinatedTransaction uncoordinatedTransaction = _applicationLocalTransaction
.getUncoordinatedTransaction();
try {
uncoordinatedTransaction.rollback();
} catch (SIException exception) {
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exception(this, TRACE, exception); // depends on control dependency: [if], data = [none]
}
throw new ResourceException(NLS.getFormattedMessage(
"CONTAINER_ROLLBACK_FAILED_CWSIV0163",
new Object[] { exception }, null), exception);
} catch (SIErrorException exception) {
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exception(this, TRACE, exception); // depends on control dependency: [if], data = [none]
}
throw new ResourceException(NLS.getFormattedMessage(
"CONTAINER_ROLLBACK_FAILED_CWSIV0163",
new Object[] { exception }, null), exception);
}
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "rollbackApplicationLocalTransaction");
}
} } |
public class class_name {
void unregisterJob(final ExecutionGraph eg) {
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, true);
while (it.hasNext()) {
this.splitMap.remove(it.next().getID());
}
} } | public class class_name {
void unregisterJob(final ExecutionGraph eg) {
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, true);
while (it.hasNext()) {
this.splitMap.remove(it.next().getID()); // depends on control dependency: [while], data = [none]
}
} } |
public class class_name {
public ChangeBatch withChanges(Change... changes) {
if (this.changes == null) {
setChanges(new com.amazonaws.internal.SdkInternalList<Change>(changes.length));
}
for (Change ele : changes) {
this.changes.add(ele);
}
return this;
} } | public class class_name {
public ChangeBatch withChanges(Change... changes) {
if (this.changes == null) {
setChanges(new com.amazonaws.internal.SdkInternalList<Change>(changes.length)); // depends on control dependency: [if], data = [none]
}
for (Change ele : changes) {
this.changes.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
public final EObject rulePredicatedKeyword() throws RecognitionException {
EObject current = null;
Token lv_predicated_0_0=null;
Token lv_firstSetPredicated_1_0=null;
Token lv_value_2_0=null;
enterRule();
try {
// InternalXtext.g:2176:2: ( ( ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) ) ) )
// InternalXtext.g:2177:2: ( ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) ) )
{
// InternalXtext.g:2177:2: ( ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) ) )
// InternalXtext.g:2178:3: ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) )
{
// InternalXtext.g:2178:3: ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) )
int alt50=2;
int LA50_0 = input.LA(1);
if ( (LA50_0==42) ) {
alt50=1;
}
else if ( (LA50_0==43) ) {
alt50=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 50, 0, input);
throw nvae;
}
switch (alt50) {
case 1 :
// InternalXtext.g:2179:4: ( (lv_predicated_0_0= '=>' ) )
{
// InternalXtext.g:2179:4: ( (lv_predicated_0_0= '=>' ) )
// InternalXtext.g:2180:5: (lv_predicated_0_0= '=>' )
{
// InternalXtext.g:2180:5: (lv_predicated_0_0= '=>' )
// InternalXtext.g:2181:6: lv_predicated_0_0= '=>'
{
lv_predicated_0_0=(Token)match(input,42,FollowSets000.FOLLOW_11);
newLeafNode(lv_predicated_0_0, grammarAccess.getPredicatedKeywordAccess().getPredicatedEqualsSignGreaterThanSignKeyword_0_0_0());
if (current==null) {
current = createModelElement(grammarAccess.getPredicatedKeywordRule());
}
setWithLastConsumed(current, "predicated", true, "=>");
}
}
}
break;
case 2 :
// InternalXtext.g:2194:4: ( (lv_firstSetPredicated_1_0= '->' ) )
{
// InternalXtext.g:2194:4: ( (lv_firstSetPredicated_1_0= '->' ) )
// InternalXtext.g:2195:5: (lv_firstSetPredicated_1_0= '->' )
{
// InternalXtext.g:2195:5: (lv_firstSetPredicated_1_0= '->' )
// InternalXtext.g:2196:6: lv_firstSetPredicated_1_0= '->'
{
lv_firstSetPredicated_1_0=(Token)match(input,43,FollowSets000.FOLLOW_11);
newLeafNode(lv_firstSetPredicated_1_0, grammarAccess.getPredicatedKeywordAccess().getFirstSetPredicatedHyphenMinusGreaterThanSignKeyword_0_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getPredicatedKeywordRule());
}
setWithLastConsumed(current, "firstSetPredicated", true, "->");
}
}
}
break;
}
// InternalXtext.g:2209:3: ( (lv_value_2_0= RULE_STRING ) )
// InternalXtext.g:2210:4: (lv_value_2_0= RULE_STRING )
{
// InternalXtext.g:2210:4: (lv_value_2_0= RULE_STRING )
// InternalXtext.g:2211:5: lv_value_2_0= RULE_STRING
{
lv_value_2_0=(Token)match(input,RULE_STRING,FollowSets000.FOLLOW_2);
newLeafNode(lv_value_2_0, grammarAccess.getPredicatedKeywordAccess().getValueSTRINGTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getPredicatedKeywordRule());
}
setWithLastConsumed(
current,
"value",
lv_value_2_0,
"org.eclipse.xtext.common.Terminals.STRING");
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} } | public class class_name {
public final EObject rulePredicatedKeyword() throws RecognitionException {
EObject current = null;
Token lv_predicated_0_0=null;
Token lv_firstSetPredicated_1_0=null;
Token lv_value_2_0=null;
enterRule();
try {
// InternalXtext.g:2176:2: ( ( ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) ) ) )
// InternalXtext.g:2177:2: ( ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) ) )
{
// InternalXtext.g:2177:2: ( ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) ) )
// InternalXtext.g:2178:3: ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) ) ( (lv_value_2_0= RULE_STRING ) )
{
// InternalXtext.g:2178:3: ( ( (lv_predicated_0_0= '=>' ) ) | ( (lv_firstSetPredicated_1_0= '->' ) ) )
int alt50=2;
int LA50_0 = input.LA(1);
if ( (LA50_0==42) ) {
alt50=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA50_0==43) ) {
alt50=2; // depends on control dependency: [if], data = [none]
}
else {
NoViableAltException nvae =
new NoViableAltException("", 50, 0, input);
throw nvae;
}
switch (alt50) {
case 1 :
// InternalXtext.g:2179:4: ( (lv_predicated_0_0= '=>' ) )
{
// InternalXtext.g:2179:4: ( (lv_predicated_0_0= '=>' ) )
// InternalXtext.g:2180:5: (lv_predicated_0_0= '=>' )
{
// InternalXtext.g:2180:5: (lv_predicated_0_0= '=>' )
// InternalXtext.g:2181:6: lv_predicated_0_0= '=>'
{
lv_predicated_0_0=(Token)match(input,42,FollowSets000.FOLLOW_11);
newLeafNode(lv_predicated_0_0, grammarAccess.getPredicatedKeywordAccess().getPredicatedEqualsSignGreaterThanSignKeyword_0_0_0());
if (current==null) {
current = createModelElement(grammarAccess.getPredicatedKeywordRule()); // depends on control dependency: [if], data = [none]
}
setWithLastConsumed(current, "predicated", true, "=>");
}
}
}
break;
case 2 :
// InternalXtext.g:2194:4: ( (lv_firstSetPredicated_1_0= '->' ) )
{
// InternalXtext.g:2194:4: ( (lv_firstSetPredicated_1_0= '->' ) )
// InternalXtext.g:2195:5: (lv_firstSetPredicated_1_0= '->' )
{
// InternalXtext.g:2195:5: (lv_firstSetPredicated_1_0= '->' )
// InternalXtext.g:2196:6: lv_firstSetPredicated_1_0= '->'
{
lv_firstSetPredicated_1_0=(Token)match(input,43,FollowSets000.FOLLOW_11);
newLeafNode(lv_firstSetPredicated_1_0, grammarAccess.getPredicatedKeywordAccess().getFirstSetPredicatedHyphenMinusGreaterThanSignKeyword_0_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getPredicatedKeywordRule()); // depends on control dependency: [if], data = [none]
}
setWithLastConsumed(current, "firstSetPredicated", true, "->");
}
}
}
break;
}
// InternalXtext.g:2209:3: ( (lv_value_2_0= RULE_STRING ) )
// InternalXtext.g:2210:4: (lv_value_2_0= RULE_STRING )
{
// InternalXtext.g:2210:4: (lv_value_2_0= RULE_STRING )
// InternalXtext.g:2211:5: lv_value_2_0= RULE_STRING
{
lv_value_2_0=(Token)match(input,RULE_STRING,FollowSets000.FOLLOW_2);
newLeafNode(lv_value_2_0, grammarAccess.getPredicatedKeywordAccess().getValueSTRINGTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getPredicatedKeywordRule()); // depends on control dependency: [if], data = [none]
}
setWithLastConsumed(
current,
"value",
lv_value_2_0,
"org.eclipse.xtext.common.Terminals.STRING");
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} } |
public class class_name {
public static Type[] getGenerics(final Type type, final Map<String, Type> generics) {
Type[] res = NO_TYPES;
Type analyzingType = type;
if (type instanceof TypeVariable) {
// if type is pure generic recovering parametrization
analyzingType = declaredGeneric((TypeVariable) type, generics);
}
if ((analyzingType instanceof ParameterizedType)
&& ((ParameterizedType) analyzingType).getActualTypeArguments().length > 0) {
res = ((ParameterizedType) analyzingType).getActualTypeArguments();
} else if (type instanceof Class) {
// if type is class return raw declaration
final Class<?> actual = (Class<?>) analyzingType;
if (actual.getTypeParameters().length > 0) {
res = GenericsResolutionUtils.resolveDirectRawGenerics(actual)
.values().toArray(new Type[0]);
}
}
return res;
} } | public class class_name {
public static Type[] getGenerics(final Type type, final Map<String, Type> generics) {
Type[] res = NO_TYPES;
Type analyzingType = type;
if (type instanceof TypeVariable) {
// if type is pure generic recovering parametrization
analyzingType = declaredGeneric((TypeVariable) type, generics); // depends on control dependency: [if], data = [none]
}
if ((analyzingType instanceof ParameterizedType)
&& ((ParameterizedType) analyzingType).getActualTypeArguments().length > 0) {
res = ((ParameterizedType) analyzingType).getActualTypeArguments(); // depends on control dependency: [if], data = [none]
} else if (type instanceof Class) {
// if type is class return raw declaration
final Class<?> actual = (Class<?>) analyzingType;
if (actual.getTypeParameters().length > 0) {
res = GenericsResolutionUtils.resolveDirectRawGenerics(actual)
.values().toArray(new Type[0]);
}
}
return res;
} } |
public class class_name {
@Nullable
private static <T> T resolveAttribute(String attributeName, Class<T> type) {
String getter = readProperty(attributeName);
if (getter == null) {
return null;
}
int idx = getter.indexOf('#');
if (idx <= 0 || idx == getter.length() - 1) {
error("invalid getter (expected <class>#<method>): %s\n", getter);
return null;
}
return callStaticMethod(getter.substring(0, idx), getter.substring(idx + 1), type);
} } | public class class_name {
@Nullable
private static <T> T resolveAttribute(String attributeName, Class<T> type) {
String getter = readProperty(attributeName);
if (getter == null) {
return null; // depends on control dependency: [if], data = [none]
}
int idx = getter.indexOf('#');
if (idx <= 0 || idx == getter.length() - 1) {
error("invalid getter (expected <class>#<method>): %s\n", getter); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
return callStaticMethod(getter.substring(0, idx), getter.substring(idx + 1), type);
} } |
public class class_name {
private static boolean overflowInParse(final long current, final int digit, final int radix) {
if (current >= 0) {
if (current < MAX_VALUE_DIVS[radix]) {
return false;
}
if (current > MAX_VALUE_DIVS[radix]) {
return true;
}
// current == maxValueDivs[radix]
return (digit > MAX_VALUE_MODS[radix]);
}
// current < 0: high bit is set
return true;
} } | public class class_name {
private static boolean overflowInParse(final long current, final int digit, final int radix) {
if (current >= 0) {
if (current < MAX_VALUE_DIVS[radix]) {
return false; // depends on control dependency: [if], data = [none]
}
if (current > MAX_VALUE_DIVS[radix]) {
return true; // depends on control dependency: [if], data = [none]
}
// current == maxValueDivs[radix]
return (digit > MAX_VALUE_MODS[radix]); // depends on control dependency: [if], data = [none]
}
// current < 0: high bit is set
return true;
} } |
public class class_name {
public final void onSaveInstanceState(@Nullable final Bundle outState) {
if (outState != null) {
outState.putInt(KEY_CHRONOS_LISTENER_ID, mChronosListener.getId());
}
} } | public class class_name {
public final void onSaveInstanceState(@Nullable final Bundle outState) {
if (outState != null) {
outState.putInt(KEY_CHRONOS_LISTENER_ID, mChronosListener.getId()); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
protected HashMap<String, PropertyDescriptor> inspectProperties() {
boolean scanAccessible = classDescriptor.isScanAccessible();
Class type = classDescriptor.getType();
HashMap<String, PropertyDescriptor> map = new HashMap<>();
Method[] methods = scanAccessible ? ClassUtil.getAccessibleMethods(type) : ClassUtil.getSupportedMethods(type);
for (int iteration = 0; iteration < 2; iteration++) {
// first find the getters, and then the setters!
for (Method method : methods) {
if (Modifier.isStatic(method.getModifiers())) {
continue; // ignore static methods
}
boolean add = false;
boolean issetter = false;
String propertyName;
if (iteration == 0) {
propertyName = ClassUtil.getBeanPropertyGetterName(method);
if (propertyName != null) {
add = true;
issetter = false;
}
} else {
propertyName = ClassUtil.getBeanPropertySetterName(method);
if (propertyName != null) {
add = true;
issetter = true;
}
}
if (add) {
MethodDescriptor methodDescriptor = classDescriptor.getMethodDescriptor(method.getName(), method.getParameterTypes(), true);
addProperty(map, propertyName, methodDescriptor, issetter);
}
}
}
if (classDescriptor.isIncludeFieldsAsProperties()) {
FieldDescriptor[] fieldDescriptors = classDescriptor.getAllFieldDescriptors();
String[] prefix = classDescriptor.getPropertyFieldPrefix();
for (FieldDescriptor fieldDescriptor : fieldDescriptors) {
Field field = fieldDescriptor.getField();
if (Modifier.isStatic(field.getModifiers())) {
continue; // ignore static fields
}
String name = field.getName();
if (prefix != null) {
for (String p : prefix) {
if (!name.startsWith(p)) {
continue;
}
name = name.substring(p.length());
break;
}
}
if (!map.containsKey(name)) {
// add missing field as a potential property
map.put(name, createPropertyDescriptor(name, fieldDescriptor));
}
}
}
return map;
} } | public class class_name {
protected HashMap<String, PropertyDescriptor> inspectProperties() {
boolean scanAccessible = classDescriptor.isScanAccessible();
Class type = classDescriptor.getType();
HashMap<String, PropertyDescriptor> map = new HashMap<>();
Method[] methods = scanAccessible ? ClassUtil.getAccessibleMethods(type) : ClassUtil.getSupportedMethods(type);
for (int iteration = 0; iteration < 2; iteration++) {
// first find the getters, and then the setters!
for (Method method : methods) {
if (Modifier.isStatic(method.getModifiers())) {
continue; // ignore static methods
}
boolean add = false;
boolean issetter = false;
String propertyName;
if (iteration == 0) {
propertyName = ClassUtil.getBeanPropertyGetterName(method); // depends on control dependency: [if], data = [none]
if (propertyName != null) {
add = true; // depends on control dependency: [if], data = [none]
issetter = false; // depends on control dependency: [if], data = [none]
}
} else {
propertyName = ClassUtil.getBeanPropertySetterName(method); // depends on control dependency: [if], data = [none]
if (propertyName != null) {
add = true; // depends on control dependency: [if], data = [none]
issetter = true; // depends on control dependency: [if], data = [none]
}
}
if (add) {
MethodDescriptor methodDescriptor = classDescriptor.getMethodDescriptor(method.getName(), method.getParameterTypes(), true);
addProperty(map, propertyName, methodDescriptor, issetter); // depends on control dependency: [if], data = [none]
}
}
}
if (classDescriptor.isIncludeFieldsAsProperties()) {
FieldDescriptor[] fieldDescriptors = classDescriptor.getAllFieldDescriptors();
String[] prefix = classDescriptor.getPropertyFieldPrefix();
for (FieldDescriptor fieldDescriptor : fieldDescriptors) {
Field field = fieldDescriptor.getField();
if (Modifier.isStatic(field.getModifiers())) {
continue; // ignore static fields
}
String name = field.getName();
if (prefix != null) {
for (String p : prefix) {
if (!name.startsWith(p)) {
continue;
}
name = name.substring(p.length()); // depends on control dependency: [for], data = [p]
break;
}
}
if (!map.containsKey(name)) {
// add missing field as a potential property
map.put(name, createPropertyDescriptor(name, fieldDescriptor)); // depends on control dependency: [if], data = [none]
}
}
}
return map;
} } |
public class class_name {
public TextColumn set(Selection rowSelection, String newValue) {
for (int row : rowSelection) {
set(row, newValue);
}
return this;
} } | public class class_name {
public TextColumn set(Selection rowSelection, String newValue) {
for (int row : rowSelection) {
set(row, newValue); // depends on control dependency: [for], data = [row]
}
return this;
} } |
public class class_name {
@Override
public void removeByG_P(long groupId, boolean primary) {
for (CommerceCurrency commerceCurrency : findByG_P(groupId, primary,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceCurrency);
}
} } | public class class_name {
@Override
public void removeByG_P(long groupId, boolean primary) {
for (CommerceCurrency commerceCurrency : findByG_P(groupId, primary,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceCurrency); // depends on control dependency: [for], data = [commerceCurrency]
}
} } |
public class class_name {
@Override
protected void computeStatistics(T input, int innerWidth, int innerHeight) {
final int statPixelStride = stats.getImageType().getNumBands();
final int statStride = stats.stride;
int vblocks = innerHeight/blockHeight;
if( vblocks*blockHeight < innerHeight )
vblocks++;
// for (int y = 0; y < innerHeight; y += blockHeight) {
BoofConcurrency.loopFor(0, vblocks, vblock -> {
BlockProcessor<T,S> processor = processors.pop();
processor.init(blockWidth,blockHeight,thresholdFromLocalBlocks);
int y = vblock*blockHeight;
int indexStats = (y/blockHeight)*statStride;
for (int x = 0; x < innerWidth; x += blockWidth, indexStats += statPixelStride) {
processor.computeBlockStatistics(x,y,blockWidth,blockHeight,indexStats,input,stats);
}
// handle the case where the image's width isn't evenly divisible by the block's width
if( innerWidth != input.width ) {
processor.computeBlockStatistics(innerWidth,y,input.width-innerWidth,blockHeight,indexStats,input,stats);
}
processors.recycle(processor);
});
// NOTE: below could be thrown into its own thread before the code above. Not easy with current thread design
// handle the case where the image's height isn't evenly divisible by the block's height
if( innerHeight != input.height ) {
BlockProcessor<T,S> processor = processors.pop();
processor.init(blockWidth,blockHeight,thresholdFromLocalBlocks);
int indexStats = (innerHeight/blockHeight)*statStride;
int y = innerHeight;
int blockHeight = input.height-innerHeight;
for (int x = 0; x < innerWidth; x += blockWidth, indexStats += statPixelStride) {
processor.computeBlockStatistics(x,y,blockWidth,blockHeight,indexStats,input,stats);
}
if( innerWidth != input.width ) {
processor.computeBlockStatistics(innerWidth,y,input.width-innerWidth,blockHeight,indexStats,input,stats);
}
}
} } | public class class_name {
@Override
protected void computeStatistics(T input, int innerWidth, int innerHeight) {
final int statPixelStride = stats.getImageType().getNumBands();
final int statStride = stats.stride;
int vblocks = innerHeight/blockHeight;
if( vblocks*blockHeight < innerHeight )
vblocks++;
// for (int y = 0; y < innerHeight; y += blockHeight) {
BoofConcurrency.loopFor(0, vblocks, vblock -> {
BlockProcessor<T,S> processor = processors.pop();
processor.init(blockWidth,blockHeight,thresholdFromLocalBlocks);
int y = vblock*blockHeight;
int indexStats = (y/blockHeight)*statStride;
for (int x = 0; x < innerWidth; x += blockWidth, indexStats += statPixelStride) {
processor.computeBlockStatistics(x,y,blockWidth,blockHeight,indexStats,input,stats); // depends on control dependency: [for], data = [x]
}
// handle the case where the image's width isn't evenly divisible by the block's width
if( innerWidth != input.width ) {
processor.computeBlockStatistics(innerWidth,y,input.width-innerWidth,blockHeight,indexStats,input,stats); // depends on control dependency: [if], data = [none]
}
processors.recycle(processor);
});
// NOTE: below could be thrown into its own thread before the code above. Not easy with current thread design
// handle the case where the image's height isn't evenly divisible by the block's height
if( innerHeight != input.height ) {
BlockProcessor<T,S> processor = processors.pop();
processor.init(blockWidth,blockHeight,thresholdFromLocalBlocks);
int indexStats = (innerHeight/blockHeight)*statStride;
int y = innerHeight;
int blockHeight = input.height-innerHeight;
for (int x = 0; x < innerWidth; x += blockWidth, indexStats += statPixelStride) {
processor.computeBlockStatistics(x,y,blockWidth,blockHeight,indexStats,input,stats); // depends on control dependency: [for], data = [x]
}
if( innerWidth != input.width ) {
processor.computeBlockStatistics(innerWidth,y,input.width-innerWidth,blockHeight,indexStats,input,stats); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
private void doMutation(double probability, DoubleSolution solution) {
double rnd, deltaq, tempDelta;
double y, yl, yu;
for (int i = 0; i < solution.getNumberOfVariables(); i++) {
if (randomGenerator.nextDouble() <= probability) {
y = solution.getVariableValue(i);
yl = solution.getLowerBound(i) ;
yu = solution.getUpperBound(i) ;
rnd = randomGenerator.nextDouble();
tempDelta = Math.pow(rnd, -delta);
deltaq = 0.5 * (rnd - 0.5) * (1 - tempDelta);
y = y + deltaq * (yu - yl);
y = solutionRepair.repairSolutionVariableValue(y, yl, yu);
solution.setVariableValue(i, y);
}
}
} } | public class class_name {
private void doMutation(double probability, DoubleSolution solution) {
double rnd, deltaq, tempDelta;
double y, yl, yu;
for (int i = 0; i < solution.getNumberOfVariables(); i++) {
if (randomGenerator.nextDouble() <= probability) {
y = solution.getVariableValue(i); // depends on control dependency: [if], data = [none]
yl = solution.getLowerBound(i) ; // depends on control dependency: [if], data = [none]
yu = solution.getUpperBound(i) ; // depends on control dependency: [if], data = [none]
rnd = randomGenerator.nextDouble(); // depends on control dependency: [if], data = [none]
tempDelta = Math.pow(rnd, -delta); // depends on control dependency: [if], data = [none]
deltaq = 0.5 * (rnd - 0.5) * (1 - tempDelta); // depends on control dependency: [if], data = [none]
y = y + deltaq * (yu - yl); // depends on control dependency: [if], data = [none]
y = solutionRepair.repairSolutionVariableValue(y, yl, yu); // depends on control dependency: [if], data = [none]
solution.setVariableValue(i, y); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public List<Pattern> getDisjointPatterns() {
Map<PatternNode, String> reverseMap = new IdentityHashMap<>();
reverseMap.putAll(this.aliasToNode.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())));
List<Pattern> result = new ArrayList<>();
while (!reverseMap.isEmpty()) {
Pattern pattern = new Pattern();
result.add(pattern);
Map.Entry<PatternNode, String> nextNode = reverseMap.entrySet().iterator().next();
Set<PatternNode> toVisit = new HashSet<>();
toVisit.add(nextNode.getKey());
while (toVisit.size() > 0) {
PatternNode currentNode = toVisit.iterator().next();
toVisit.remove(currentNode);
if (reverseMap.containsKey(currentNode)) {
pattern.aliasToNode.put(reverseMap.get(currentNode), currentNode);
reverseMap.remove(currentNode);
for (PatternEdge x : currentNode.out) {
toVisit.add(x.in);
}
for (PatternEdge x : currentNode.in) {
toVisit.add(x.out);
}
}
}
pattern.recalculateNumOfEdges();
}
return result;
} } | public class class_name {
public List<Pattern> getDisjointPatterns() {
Map<PatternNode, String> reverseMap = new IdentityHashMap<>();
reverseMap.putAll(this.aliasToNode.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())));
List<Pattern> result = new ArrayList<>();
while (!reverseMap.isEmpty()) {
Pattern pattern = new Pattern();
result.add(pattern); // depends on control dependency: [while], data = [none]
Map.Entry<PatternNode, String> nextNode = reverseMap.entrySet().iterator().next();
Set<PatternNode> toVisit = new HashSet<>();
toVisit.add(nextNode.getKey()); // depends on control dependency: [while], data = [none]
while (toVisit.size() > 0) {
PatternNode currentNode = toVisit.iterator().next();
toVisit.remove(currentNode); // depends on control dependency: [while], data = [none]
if (reverseMap.containsKey(currentNode)) {
pattern.aliasToNode.put(reverseMap.get(currentNode), currentNode); // depends on control dependency: [if], data = [none]
reverseMap.remove(currentNode); // depends on control dependency: [if], data = [none]
for (PatternEdge x : currentNode.out) {
toVisit.add(x.in); // depends on control dependency: [for], data = [x]
}
for (PatternEdge x : currentNode.in) {
toVisit.add(x.out); // depends on control dependency: [for], data = [x]
}
}
}
pattern.recalculateNumOfEdges(); // depends on control dependency: [while], data = [none]
}
return result;
} } |
public class class_name {
@Override
public int getObjectSizeInByteBuffer(ByteBuffer buffer) {
final int offset = buffer.position();
buffer.position();
if (buffer.get(offset + EMBEDDED_OFFSET) > 0) {
return embeddedObjectSerializedSize(buffer.getInt(offset + EMBEDDED_SIZE_OFFSET));
} else {
return SBTREE_CONTAINER_SIZE;
}
} } | public class class_name {
@Override
public int getObjectSizeInByteBuffer(ByteBuffer buffer) {
final int offset = buffer.position();
buffer.position();
if (buffer.get(offset + EMBEDDED_OFFSET) > 0) {
return embeddedObjectSerializedSize(buffer.getInt(offset + EMBEDDED_SIZE_OFFSET)); // depends on control dependency: [if], data = [none]
} else {
return SBTREE_CONTAINER_SIZE; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
protected MtasDataItemLongBasic getItem(int i) {
if (i >= 0 && i < size) {
return new MtasDataItemLongBasic(basicValueSumList[i], basicValueNList[i],
hasSub() ? subCollectorListNextLevel[i] : null, getStatsItems(),
sortType, sortDirection, errorNumber[i], errorList[i],
sourceNumberList[i]);
} else {
return null;
}
} } | public class class_name {
@Override
protected MtasDataItemLongBasic getItem(int i) {
if (i >= 0 && i < size) {
return new MtasDataItemLongBasic(basicValueSumList[i], basicValueNList[i],
hasSub() ? subCollectorListNextLevel[i] : null, getStatsItems(),
sortType, sortDirection, errorNumber[i], errorList[i],
sourceNumberList[i]); // depends on control dependency: [if], data = [none]
} else {
return null; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
protected String getProducerDestName() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getProducerDestName");
String pDestName = null;
// Get the forward routing path.
StringArrayWrapper frp = (StringArrayWrapper) properties.get(FORWARD_ROUTING_PATH);
if (frp == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "No forward routing path to examine");
// If the frp is null then we have the simple case of returning the
// 'big' destination.
pDestName = getDestName();
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "There is a forward routing path to examine.");
// There is an FRP to examine, and we want to return the name of the
// first destination in the FRP.
SIDestinationAddress producerAddr = frp.getProducerSIDestAddress();
if (producerAddr != null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Using first element of FRP as producer dest name");
pDestName = producerAddr.getDestinationName();
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "FRP is empty - use original dest name");
pDestName = getDestName();
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getProducerDestName", pDestName);
return pDestName;
} } | public class class_name {
protected String getProducerDestName() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getProducerDestName");
String pDestName = null;
// Get the forward routing path.
StringArrayWrapper frp = (StringArrayWrapper) properties.get(FORWARD_ROUTING_PATH);
if (frp == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "No forward routing path to examine");
// If the frp is null then we have the simple case of returning the
// 'big' destination.
pDestName = getDestName(); // depends on control dependency: [if], data = [none]
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "There is a forward routing path to examine.");
// There is an FRP to examine, and we want to return the name of the
// first destination in the FRP.
SIDestinationAddress producerAddr = frp.getProducerSIDestAddress();
if (producerAddr != null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Using first element of FRP as producer dest name");
pDestName = producerAddr.getDestinationName(); // depends on control dependency: [if], data = [none]
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "FRP is empty - use original dest name");
pDestName = getDestName(); // depends on control dependency: [if], data = [none]
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getProducerDestName", pDestName);
return pDestName;
} } |
public class class_name {
public float nextFloat() {
// Check cached result
if ((typeCache != null) && (typeCache instanceof Float)) {
float val = ((Float)typeCache).floatValue();
useTypeCache();
return val;
}
setRadix(10);
clearCaches();
try {
return Float.parseFloat(processFloatToken(next(floatPattern())));
} catch (NumberFormatException nfe) {
position = matcher.start(); // don't skip bad token
throw new InputMismatchException(nfe.getMessage());
}
} } | public class class_name {
public float nextFloat() {
// Check cached result
if ((typeCache != null) && (typeCache instanceof Float)) {
float val = ((Float)typeCache).floatValue();
useTypeCache(); // depends on control dependency: [if], data = [none]
return val; // depends on control dependency: [if], data = [none]
}
setRadix(10);
clearCaches();
try {
return Float.parseFloat(processFloatToken(next(floatPattern()))); // depends on control dependency: [try], data = [none]
} catch (NumberFormatException nfe) {
position = matcher.start(); // don't skip bad token
throw new InputMismatchException(nfe.getMessage());
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public Date createDateWithValidation(String dateString, String inputFormat) {
try { return createDate(dateString, inputFormat); }
catch (Exception exception) {
Syslog.debug("DateContextImpl.createDateWithValidation: Error " +
"creating date with " + dateString + "/" +
inputFormat + "; Exception: " + exception.getMessage());
}
return null;
} } | public class class_name {
public Date createDateWithValidation(String dateString, String inputFormat) {
try { return createDate(dateString, inputFormat); } // depends on control dependency: [try], data = [none]
catch (Exception exception) {
Syslog.debug("DateContextImpl.createDateWithValidation: Error " +
"creating date with " + dateString + "/" +
inputFormat + "; Exception: " + exception.getMessage());
} // depends on control dependency: [catch], data = [none]
return null;
} } |
public class class_name {
public boolean killTopology() {
// Setup Connection
String topologyURI = String.format("%s/v2/groups/%s?force=true",
this.marathonURI, this.topologyName);
HttpURLConnection conn = NetworkUtils.getHttpConnection(topologyURI);
// Attach a token if there is one specified
if (this.marathonAuthToken != null) {
conn.setRequestProperty("Authorization", String.format("token=%s", this.marathonAuthToken));
}
if (conn == null) {
LOG.log(Level.SEVERE, "Failed to find marathon scheduler");
return false;
}
try {
// Send kill topology request
if (!NetworkUtils.sendHttpDeleteRequest(conn)) {
LOG.log(Level.SEVERE, "Failed to send delete request");
return false;
}
// Check response
boolean success = NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_OK);
if (success) {
LOG.log(Level.INFO, "Successfully killed topology");
return true;
} else if (NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_UNAUTHORIZED)) {
LOG.log(Level.SEVERE, "Marathon requires authentication");
return false;
} else {
LOG.log(Level.SEVERE, "Failed to kill topology");
return false;
}
} finally {
// Disconnect to release resources
conn.disconnect();
}
} } | public class class_name {
public boolean killTopology() {
// Setup Connection
String topologyURI = String.format("%s/v2/groups/%s?force=true",
this.marathonURI, this.topologyName);
HttpURLConnection conn = NetworkUtils.getHttpConnection(topologyURI);
// Attach a token if there is one specified
if (this.marathonAuthToken != null) {
conn.setRequestProperty("Authorization", String.format("token=%s", this.marathonAuthToken)); // depends on control dependency: [if], data = [none]
}
if (conn == null) {
LOG.log(Level.SEVERE, "Failed to find marathon scheduler"); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
try {
// Send kill topology request
if (!NetworkUtils.sendHttpDeleteRequest(conn)) {
LOG.log(Level.SEVERE, "Failed to send delete request"); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
// Check response
boolean success = NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_OK);
if (success) {
LOG.log(Level.INFO, "Successfully killed topology"); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
} else if (NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_UNAUTHORIZED)) {
LOG.log(Level.SEVERE, "Marathon requires authentication"); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
} else {
LOG.log(Level.SEVERE, "Failed to kill topology"); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
} finally {
// Disconnect to release resources
conn.disconnect();
}
} } |
public class class_name {
public void marshall(ActionExecutionDetail actionExecutionDetail, ProtocolMarshaller protocolMarshaller) {
if (actionExecutionDetail == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(actionExecutionDetail.getPipelineExecutionId(), PIPELINEEXECUTIONID_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getActionExecutionId(), ACTIONEXECUTIONID_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getPipelineVersion(), PIPELINEVERSION_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getStageName(), STAGENAME_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getActionName(), ACTIONNAME_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getStartTime(), STARTTIME_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getLastUpdateTime(), LASTUPDATETIME_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getInput(), INPUT_BINDING);
protocolMarshaller.marshall(actionExecutionDetail.getOutput(), OUTPUT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(ActionExecutionDetail actionExecutionDetail, ProtocolMarshaller protocolMarshaller) {
if (actionExecutionDetail == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(actionExecutionDetail.getPipelineExecutionId(), PIPELINEEXECUTIONID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getActionExecutionId(), ACTIONEXECUTIONID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getPipelineVersion(), PIPELINEVERSION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getStageName(), STAGENAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getActionName(), ACTIONNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getStartTime(), STARTTIME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getLastUpdateTime(), LASTUPDATETIME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getInput(), INPUT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(actionExecutionDetail.getOutput(), OUTPUT_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 Paths getPaths(ObjectNode obj, String location, ParseResult result) {
final Paths paths = new PathsImpl();
if (obj == null) {
return null;
}
Set<String> pathKeys = getKeys(obj);
for (String pathName : pathKeys) {
JsonNode pathValue = obj.get(pathName);
if (pathName.startsWith("x-")) {
result.unsupported(location, pathName, pathValue);
} else {
if (!pathValue.getNodeType().equals(JsonNodeType.OBJECT)) {
result.invalidType(location, pathName, "object", pathValue);
} else {
ObjectNode path = (ObjectNode) pathValue;
PathItem pathObj = getPathItem(path, String.format("%s.%s'", location, pathName), result);
paths.put(pathName, pathObj);
}
}
}
return paths;
} } | public class class_name {
public Paths getPaths(ObjectNode obj, String location, ParseResult result) {
final Paths paths = new PathsImpl();
if (obj == null) {
return null; // depends on control dependency: [if], data = [none]
}
Set<String> pathKeys = getKeys(obj);
for (String pathName : pathKeys) {
JsonNode pathValue = obj.get(pathName);
if (pathName.startsWith("x-")) {
result.unsupported(location, pathName, pathValue); // depends on control dependency: [if], data = [none]
} else {
if (!pathValue.getNodeType().equals(JsonNodeType.OBJECT)) {
result.invalidType(location, pathName, "object", pathValue); // depends on control dependency: [if], data = [none]
} else {
ObjectNode path = (ObjectNode) pathValue;
PathItem pathObj = getPathItem(path, String.format("%s.%s'", location, pathName), result);
paths.put(pathName, pathObj); // depends on control dependency: [if], data = [none]
}
}
}
return paths;
} } |
public class class_name {
public void auditRetrieveDocumentSetEvent(RFC3881EventOutcomeCodes eventOutcome,
String repositoryEndpointUri,
String userName,
String[] documentUniqueIds, String[] repositoryUniqueIds, String homeCommunityIds[],
List<CodedValueType> purposesOfUse, List<CodedValueType> userRoles)
{
if (!isAuditorEnabled()) {
return;
}
XDSConsumerAuditor.getAuditor().auditRetrieveDocumentSetEvent(eventOutcome, repositoryEndpointUri,
userName,
documentUniqueIds, repositoryUniqueIds, homeCommunityIds, null, purposesOfUse, userRoles);
} } | public class class_name {
public void auditRetrieveDocumentSetEvent(RFC3881EventOutcomeCodes eventOutcome,
String repositoryEndpointUri,
String userName,
String[] documentUniqueIds, String[] repositoryUniqueIds, String homeCommunityIds[],
List<CodedValueType> purposesOfUse, List<CodedValueType> userRoles)
{
if (!isAuditorEnabled()) {
return; // depends on control dependency: [if], data = [none]
}
XDSConsumerAuditor.getAuditor().auditRetrieveDocumentSetEvent(eventOutcome, repositoryEndpointUri,
userName,
documentUniqueIds, repositoryUniqueIds, homeCommunityIds, null, purposesOfUse, userRoles);
} } |
public class class_name {
public static void or(byte[] map, int pos, byte source, int count) {
int shift = pos & 0x07;
int mask = (source & 0xff) >>> shift;
int index = pos / 8;
if (index >= map.length) {
return;
}
byte b = (byte) (map[index] | mask);
map[index] = b;
if (shift == 0) {
return;
}
shift = 8 - shift;
if (count > shift) {
mask = ((source & 0xff) << 8) >>> shift;
b = (byte) (map[index + 1] | mask);
map[index + 1] = b;
}
} } | public class class_name {
public static void or(byte[] map, int pos, byte source, int count) {
int shift = pos & 0x07;
int mask = (source & 0xff) >>> shift;
int index = pos / 8;
if (index >= map.length) {
return; // depends on control dependency: [if], data = [none]
}
byte b = (byte) (map[index] | mask);
map[index] = b;
if (shift == 0) {
return; // depends on control dependency: [if], data = [none]
}
shift = 8 - shift;
if (count > shift) {
mask = ((source & 0xff) << 8) >>> shift; // depends on control dependency: [if], data = [none]
b = (byte) (map[index + 1] | mask); // depends on control dependency: [if], data = [none]
map[index + 1] = b; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Subscribe
public void slowHeartBeat(LowLevelHeartBeatEvent e) {
Description current = null;
if (tests != null && !tests.isEmpty()) {
current = tests.peek().getDescription();
} else {
current = lastSuite; // may be null.
}
target.post(new HeartBeatEvent(
slave,
current,
e.lastActivity,
e.currentTime
));
} } | public class class_name {
@Subscribe
public void slowHeartBeat(LowLevelHeartBeatEvent e) {
Description current = null;
if (tests != null && !tests.isEmpty()) {
current = tests.peek().getDescription(); // depends on control dependency: [if], data = [none]
} else {
current = lastSuite; // may be null. // depends on control dependency: [if], data = [none]
}
target.post(new HeartBeatEvent(
slave,
current,
e.lastActivity,
e.currentTime
));
} } |
public class class_name {
public String getExplanation() {
if (getCause() instanceof javax.naming.NamingException) {
return ((javax.naming.NamingException) getCause()).getExplanation();
}
return null;
} } | public class class_name {
public String getExplanation() {
if (getCause() instanceof javax.naming.NamingException) {
return ((javax.naming.NamingException) getCause()).getExplanation();
// depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
public void
printNode(DapNode node)
throws IOException
{
if(node == null)
return;
DapSort sort = node.getSort();
String dmrname = sort.getName();
switch (sort) {
case DATASET:// treat like group
case GROUP:
if(!this.ce.references(node)) break;
DapGroup group = (DapGroup) node;
printer.marginPrint("<" + dmrname);
int flags = (sort == DapSort.DATASET ? PERLINE : NILFLAGS);
printXMLAttributes(node, ce, flags);
printer.println(">");
printer.indent();
// Make the output order conform to the spec
if(group.getDimensions().size() > 0) {
for(DapNode subnode : group.getDimensions()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode);
printer.eol();
}
}
if(group.getEnums().size() > 0) {
for(DapNode subnode : group.getEnums()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode);
printer.eol();
}
}
if(group.getVariables().size() > 0)
for(DapNode subnode : group.getVariables()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode);
printer.eol();
}
printMetadata(node);
if(group.getGroups().size() > 0)
for(DapNode subnode : group.getGroups()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode);
printer.eol();
}
printer.outdent();
printer.marginPrint("</" + dmrname + ">");
break;
case DIMENSION:
if(!this.ce.references(node)) break;
DapDimension dim = (DapDimension) node;
if(!dim.isShared()) break; // ignore, here, anonymous dimensions
printer.marginPrint("<" + dmrname);
printXMLAttributes(node, ce, NILFLAGS);
if(dim.isUnlimited())
printXMLAttribute(AbstractDSP.UCARTAGUNLIMITED, "1", NILFLAGS);
if(hasMetadata(node)) {
printer.println(">");
printMetadata(node);
printer.marginPrint("</" + dmrname + ">");
} else {
printer.print("/>");
}
break;
case ENUMERATION:
if(!this.ce.references(node)) break;
DapEnumeration en = (DapEnumeration) node;
printer.marginPrint("<" + dmrname);
printXMLAttributes(en, ce, NILFLAGS);
printer.println(">");
printer.indent();
List<String> econstnames = en.getNames();
for(String econst : econstnames) {
DapEnumConst value = en.lookup(econst);
assert (value != null);
printer.marginPrintln(
String.format("<EnumConst name=\"%s\" value=\"%d\"/>",
Escape.entityEscape(econst, null), value.getValue()));
}
printMetadata(node);
printer.outdent();
printer.marginPrint("</" + dmrname + ">");
break;
case VARIABLE:
if(!this.ce.references(node)) break;
DapVariable var = (DapVariable) node;
DapType type = var.getBaseType();
printer.marginPrint("<" + type.getTypeSort().name());
printXMLAttributes(node, ce, NILFLAGS);
if(type.isAtomic()) {
if((hasMetadata(node) || hasDimensions(var) || hasMaps(var))) {
printer.println(">");
printer.indent();
if(hasDimensions(var))
printDimrefs(var);
if(hasMetadata(var))
printMetadata(var);
if(hasMaps(var))
printMaps(var);
printer.outdent();
printer.marginPrint("</" + type.getTypeSort().name() + ">");
} else
printer.print("/>");
} else if(type.getTypeSort().isCompound()) {
DapStructure struct = (DapStructure) type;
printer.println(">");
printer.indent();
for(DapVariable field : struct.getFields()) {
if(!this.ce.references(field)) continue;
printNode(field);
printer.eol();
}
printDimrefs(var);
printMetadata(var);
printMaps(var);
printer.outdent();
printer.marginPrint("</" + type.getTypeSort().name() + ">");
} else
assert false : "Illegal variable base type";
break;
default:
assert (false) : "Unexpected sort: " + sort.name();
break;
}
} } | public class class_name {
public void
printNode(DapNode node)
throws IOException
{
if(node == null)
return;
DapSort sort = node.getSort();
String dmrname = sort.getName();
switch (sort) {
case DATASET:// treat like group
case GROUP:
if(!this.ce.references(node)) break;
DapGroup group = (DapGroup) node;
printer.marginPrint("<" + dmrname);
int flags = (sort == DapSort.DATASET ? PERLINE : NILFLAGS);
printXMLAttributes(node, ce, flags);
printer.println(">");
printer.indent();
// Make the output order conform to the spec
if(group.getDimensions().size() > 0) {
for(DapNode subnode : group.getDimensions()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode); // depends on control dependency: [for], data = [subnode]
printer.eol(); // depends on control dependency: [for], data = [none]
}
}
if(group.getEnums().size() > 0) {
for(DapNode subnode : group.getEnums()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode); // depends on control dependency: [for], data = [subnode]
printer.eol(); // depends on control dependency: [for], data = [none]
}
}
if(group.getVariables().size() > 0)
for(DapNode subnode : group.getVariables()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode); // depends on control dependency: [for], data = [subnode]
printer.eol(); // depends on control dependency: [for], data = [none]
}
printMetadata(node);
if(group.getGroups().size() > 0)
for(DapNode subnode : group.getGroups()) {
if(!this.ce.references(subnode)) continue;
printNode(subnode); // depends on control dependency: [for], data = [subnode]
printer.eol(); // depends on control dependency: [for], data = [none]
}
printer.outdent();
printer.marginPrint("</" + dmrname + ">");
break;
case DIMENSION:
if(!this.ce.references(node)) break;
DapDimension dim = (DapDimension) node;
if(!dim.isShared()) break; // ignore, here, anonymous dimensions
printer.marginPrint("<" + dmrname);
printXMLAttributes(node, ce, NILFLAGS);
if(dim.isUnlimited())
printXMLAttribute(AbstractDSP.UCARTAGUNLIMITED, "1", NILFLAGS);
if(hasMetadata(node)) {
printer.println(">"); // depends on control dependency: [if], data = [none]
printMetadata(node); // depends on control dependency: [if], data = [none]
printer.marginPrint("</" + dmrname + ">"); // depends on control dependency: [if], data = [none]
} else {
printer.print("/>"); // depends on control dependency: [if], data = [none]
}
break;
case ENUMERATION:
if(!this.ce.references(node)) break;
DapEnumeration en = (DapEnumeration) node;
printer.marginPrint("<" + dmrname);
printXMLAttributes(en, ce, NILFLAGS);
printer.println(">");
printer.indent();
List<String> econstnames = en.getNames();
for(String econst : econstnames) {
DapEnumConst value = en.lookup(econst);
assert (value != null); // depends on control dependency: [for], data = [none]
printer.marginPrintln(
String.format("<EnumConst name=\"%s\" value=\"%d\"/>",
Escape.entityEscape(econst, null), value.getValue())); // depends on control dependency: [for], data = [none]
}
printMetadata(node);
printer.outdent();
printer.marginPrint("</" + dmrname + ">");
break;
case VARIABLE:
if(!this.ce.references(node)) break;
DapVariable var = (DapVariable) node;
DapType type = var.getBaseType();
printer.marginPrint("<" + type.getTypeSort().name());
printXMLAttributes(node, ce, NILFLAGS);
if(type.isAtomic()) {
if((hasMetadata(node) || hasDimensions(var) || hasMaps(var))) {
printer.println(">"); // depends on control dependency: [if], data = [none]
printer.indent(); // depends on control dependency: [if], data = [none]
if(hasDimensions(var))
printDimrefs(var);
if(hasMetadata(var))
printMetadata(var);
if(hasMaps(var))
printMaps(var);
printer.outdent(); // depends on control dependency: [if], data = [none]
printer.marginPrint("</" + type.getTypeSort().name() + ">"); // depends on control dependency: [if], data = [none]
} else
printer.print("/>");
} else if(type.getTypeSort().isCompound()) {
DapStructure struct = (DapStructure) type;
printer.println(">"); // depends on control dependency: [if], data = [none]
printer.indent(); // depends on control dependency: [if], data = [none]
for(DapVariable field : struct.getFields()) {
if(!this.ce.references(field)) continue;
printNode(field); // depends on control dependency: [for], data = [field]
printer.eol(); // depends on control dependency: [for], data = [none]
}
printDimrefs(var); // depends on control dependency: [if], data = [none]
printMetadata(var); // depends on control dependency: [if], data = [none]
printMaps(var); // depends on control dependency: [if], data = [none]
printer.outdent(); // depends on control dependency: [if], data = [none]
printer.marginPrint("</" + type.getTypeSort().name() + ">"); // depends on control dependency: [if], data = [none]
} else
assert false : "Illegal variable base type";
break;
default:
assert (false) : "Unexpected sort: " + sort.name();
break;
}
} } |
public class class_name {
public SnackbarWrapper buildWrapper() {
Snackbar snackbar = Snackbar.make(parentView, message, duration);
SnackbarWrapper wrapper = new SnackbarWrapper(snackbar)
.setAction(actionText, sanitisedActionClickListener())
.setActionTextAllCaps(actionAllCaps)
.addCallbacks(callbacks)
.setIconMargin(iconMargin);
if (actionTextColor != 0) {
wrapper.setActionTextColor(actionTextColor);
}
if (messageTextColor != 0) {
wrapper.setTextColor(messageTextColor);
}
if (appendMessages != null) {
wrapper.appendMessage(appendMessages);
}
if (backgroundColor != 0) {
wrapper.setBackgroundColor(backgroundColor);
}
if (icon != null) {
wrapper.setIcon(icon);
}
return wrapper;
} } | public class class_name {
public SnackbarWrapper buildWrapper() {
Snackbar snackbar = Snackbar.make(parentView, message, duration);
SnackbarWrapper wrapper = new SnackbarWrapper(snackbar)
.setAction(actionText, sanitisedActionClickListener())
.setActionTextAllCaps(actionAllCaps)
.addCallbacks(callbacks)
.setIconMargin(iconMargin);
if (actionTextColor != 0) {
wrapper.setActionTextColor(actionTextColor); // depends on control dependency: [if], data = [(actionTextColor]
}
if (messageTextColor != 0) {
wrapper.setTextColor(messageTextColor); // depends on control dependency: [if], data = [(messageTextColor]
}
if (appendMessages != null) {
wrapper.appendMessage(appendMessages); // depends on control dependency: [if], data = [(appendMessages]
}
if (backgroundColor != 0) {
wrapper.setBackgroundColor(backgroundColor); // depends on control dependency: [if], data = [(backgroundColor]
}
if (icon != null) {
wrapper.setIcon(icon); // depends on control dependency: [if], data = [(icon]
}
return wrapper;
} } |
public class class_name {
protected void handleViewChange(View v) {
List<Address> mbrs=v.getMembers();
if(mbrs.isEmpty()) return;
if(view == null || view.compareTo(v) < 0)
view=v;
else
return;
Address existing_coord=coord, new_coord=mbrs.get(0);
boolean coord_changed=!Objects.equals(existing_coord, new_coord);
if(coord_changed && new_coord != null) {
coord=new_coord;
// todo: if I'm the new coord, get the highest seqno from all members. If not, re-send my pending seqno reqs
}
if(new_coord != null)
is_coord=new_coord.equals(local_addr);
} } | public class class_name {
protected void handleViewChange(View v) {
List<Address> mbrs=v.getMembers();
if(mbrs.isEmpty()) return;
if(view == null || view.compareTo(v) < 0)
view=v;
else
return;
Address existing_coord=coord, new_coord=mbrs.get(0);
boolean coord_changed=!Objects.equals(existing_coord, new_coord);
if(coord_changed && new_coord != null) {
coord=new_coord; // depends on control dependency: [if], data = [none]
// todo: if I'm the new coord, get the highest seqno from all members. If not, re-send my pending seqno reqs
}
if(new_coord != null)
is_coord=new_coord.equals(local_addr);
} } |
public class class_name {
public DescribeContinuousExportsResult withDescriptions(ContinuousExportDescription... descriptions) {
if (this.descriptions == null) {
setDescriptions(new java.util.ArrayList<ContinuousExportDescription>(descriptions.length));
}
for (ContinuousExportDescription ele : descriptions) {
this.descriptions.add(ele);
}
return this;
} } | public class class_name {
public DescribeContinuousExportsResult withDescriptions(ContinuousExportDescription... descriptions) {
if (this.descriptions == null) {
setDescriptions(new java.util.ArrayList<ContinuousExportDescription>(descriptions.length)); // depends on control dependency: [if], data = [none]
}
for (ContinuousExportDescription ele : descriptions) {
this.descriptions.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
protected void setupRoadBorders(ZoomableGraphicsContext gc, RoadPolyline element) {
final Color color = gc.rgb(getDrawingColor(element));
gc.setStroke(color);
final double width;
if (element.isWidePolyline()) {
width = 2 + gc.doc2fxSize(element.getWidth());
} else {
width = 3;
}
gc.setLineWidthInPixels(width);
} } | public class class_name {
protected void setupRoadBorders(ZoomableGraphicsContext gc, RoadPolyline element) {
final Color color = gc.rgb(getDrawingColor(element));
gc.setStroke(color);
final double width;
if (element.isWidePolyline()) {
width = 2 + gc.doc2fxSize(element.getWidth()); // depends on control dependency: [if], data = [none]
} else {
width = 3; // depends on control dependency: [if], data = [none]
}
gc.setLineWidthInPixels(width);
} } |
public class class_name {
private void setViewsVisibility() {
if (mSeekBar != null) {
mSeekBar.setVisibility(View.VISIBLE);
}
if (mPlaybackTime != null) {
mPlaybackTime.setVisibility(View.VISIBLE);
}
if (mRunTime != null) {
mRunTime.setVisibility(View.VISIBLE);
}
if (mTotalTime != null) {
mTotalTime.setVisibility(View.VISIBLE);
}
if (mPlayButton != null) {
mPlayButton.setVisibility(View.VISIBLE);
}
if (mPauseButton != null) {
mPauseButton.setVisibility(View.VISIBLE);
}
} } | public class class_name {
private void setViewsVisibility() {
if (mSeekBar != null) {
mSeekBar.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none]
}
if (mPlaybackTime != null) {
mPlaybackTime.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none]
}
if (mRunTime != null) {
mRunTime.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none]
}
if (mTotalTime != null) {
mTotalTime.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none]
}
if (mPlayButton != null) {
mPlayButton.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none]
}
if (mPauseButton != null) {
mPauseButton.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
void findLargestAnglesForAllNodes() {
for (int i = 0; i < listInfo.size(); i++) {
NodeInfo info = listInfo.get(i);
if( info.edges.size < 2 )
continue;
for (int k = 0, j = info.edges.size-1; k < info.edges.size; j=k,k++) {
double angleA = info.edges.get(j).angle;
double angleB = info.edges.get(k).angle;
double distance = UtilAngle.distanceCCW(angleA,angleB);
if( distance > info.angleBetween ) {
info.angleBetween = distance;
info.left = info.edges.get(j).target;
info.right = info.edges.get(k).target;
}
}
}
} } | public class class_name {
void findLargestAnglesForAllNodes() {
for (int i = 0; i < listInfo.size(); i++) {
NodeInfo info = listInfo.get(i);
if( info.edges.size < 2 )
continue;
for (int k = 0, j = info.edges.size-1; k < info.edges.size; j=k,k++) {
double angleA = info.edges.get(j).angle;
double angleB = info.edges.get(k).angle;
double distance = UtilAngle.distanceCCW(angleA,angleB);
if( distance > info.angleBetween ) {
info.angleBetween = distance; // depends on control dependency: [if], data = [none]
info.left = info.edges.get(j).target; // depends on control dependency: [if], data = [none]
info.right = info.edges.get(k).target; // depends on control dependency: [if], data = [none]
}
}
}
} } |
public class class_name {
public List<ManagementGroupVertex> getSuccessors() {
final List<ManagementGroupVertex> successors = new ArrayList<ManagementGroupVertex>();
for (ManagementGroupEdge edge : this.forwardEdges) {
successors.add(edge.getTarget());
}
return successors;
} } | public class class_name {
public List<ManagementGroupVertex> getSuccessors() {
final List<ManagementGroupVertex> successors = new ArrayList<ManagementGroupVertex>();
for (ManagementGroupEdge edge : this.forwardEdges) {
successors.add(edge.getTarget()); // depends on control dependency: [for], data = [edge]
}
return successors;
} } |
public class class_name {
private void ensureJdbcType(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
{
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE))
{
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_JDBC_TYPE))
{
throw new ConstraintException("No jdbc-type specified for the field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName());
}
fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_JDBC_TYPE));
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_CONVERSION) && fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_CONVERSION))
{
fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_CONVERSION, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_CONVERSION));
}
}
else
{
// we could let XDoclet check the type for field declarations but not for modifications (as we could
// not specify the empty string anymore)
String jdbcType = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE);
if (!_jdbcTypes.containsKey(jdbcType))
{
throw new ConstraintException("The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" specifies the invalid jdbc type "+jdbcType);
}
}
} } | public class class_name {
private void ensureJdbcType(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
{
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE))
{
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_JDBC_TYPE))
{
throw new ConstraintException("No jdbc-type specified for the field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName());
}
fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_JDBC_TYPE));
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_CONVERSION) && fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_CONVERSION))
{
fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_CONVERSION, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_DEFAULT_CONVERSION));
// depends on control dependency: [if], data = [none]
}
}
else
{
// we could let XDoclet check the type for field declarations but not for modifications (as we could
// not specify the empty string anymore)
String jdbcType = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE);
if (!_jdbcTypes.containsKey(jdbcType))
{
throw new ConstraintException("The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" specifies the invalid jdbc type "+jdbcType);
}
}
} } |
public class class_name {
protected void addFiles(List<CmsFileInfo> fileInfos) {
if (fileInfos != null) {
for (CmsFileInfo file : fileInfos) {
// store all files
m_allFiles.put(file.getFileName(), file);
// add those files to the list of files to upload that potential candidates
if (!isTooLarge(file) && (file.getFileSize() != 0)) {
m_filesToUpload.put(file.getFileName(), file);
}
// remove those files from the list to upload that were previously unchecked by the user
if ((m_listItems.get(file.getFileName()) != null)
&& (m_listItems.get(file.getFileName()).getCheckBox() != null)
&& !m_listItems.get(file.getFileName()).getCheckBox().isChecked()) {
m_filesToUpload.remove(file.getFileName());
}
}
// now rebuild the list: handle all files
m_fileList.clearList();
List<String> sortedFileNames = new ArrayList<String>(m_allFiles.keySet());
Collections.sort(sortedFileNames, String.CASE_INSENSITIVE_ORDER);
for (String filename : sortedFileNames) {
CmsFileInfo file = m_allFiles.get(filename);
addFileToList(file, false, false, isTooLarge(file));
}
doResize();
}
loadAndShow();
} } | public class class_name {
protected void addFiles(List<CmsFileInfo> fileInfos) {
if (fileInfos != null) {
for (CmsFileInfo file : fileInfos) {
// store all files
m_allFiles.put(file.getFileName(), file); // depends on control dependency: [for], data = [file]
// add those files to the list of files to upload that potential candidates
if (!isTooLarge(file) && (file.getFileSize() != 0)) {
m_filesToUpload.put(file.getFileName(), file); // depends on control dependency: [if], data = [none]
}
// remove those files from the list to upload that were previously unchecked by the user
if ((m_listItems.get(file.getFileName()) != null)
&& (m_listItems.get(file.getFileName()).getCheckBox() != null)
&& !m_listItems.get(file.getFileName()).getCheckBox().isChecked()) {
m_filesToUpload.remove(file.getFileName()); // depends on control dependency: [if], data = [none]
}
}
// now rebuild the list: handle all files
m_fileList.clearList(); // depends on control dependency: [if], data = [none]
List<String> sortedFileNames = new ArrayList<String>(m_allFiles.keySet());
Collections.sort(sortedFileNames, String.CASE_INSENSITIVE_ORDER); // depends on control dependency: [if], data = [none]
for (String filename : sortedFileNames) {
CmsFileInfo file = m_allFiles.get(filename);
addFileToList(file, false, false, isTooLarge(file)); // depends on control dependency: [for], data = [none]
}
doResize(); // depends on control dependency: [if], data = [none]
}
loadAndShow();
} } |
public class class_name {
public static void getDeclaredFields(Class c, Collection<Field> fields) {
try
{
Field[] local = c.getDeclaredFields();
for (Field field : local)
{
if (!field.isAccessible())
{
try
{
field.setAccessible(true);
}
catch (Exception ignored) { }
}
int modifiers = field.getModifiers();
if (!Modifier.isStatic(modifiers) &&
!field.getName().startsWith("this$") &&
!Modifier.isTransient(modifiers))
{ // speed up: do not count static fields, do not go back up to enclosing object in nested case, do not consider transients
fields.add(field);
}
}
}
catch (Throwable ignored)
{
ExceptionUtilities.safelyIgnoreException(ignored);
}
} } | public class class_name {
public static void getDeclaredFields(Class c, Collection<Field> fields) {
try
{
Field[] local = c.getDeclaredFields();
for (Field field : local)
{
if (!field.isAccessible())
{
try
{
field.setAccessible(true); // depends on control dependency: [try], data = [none]
}
catch (Exception ignored) { } // depends on control dependency: [catch], data = [none]
}
int modifiers = field.getModifiers();
if (!Modifier.isStatic(modifiers) &&
!field.getName().startsWith("this$") &&
!Modifier.isTransient(modifiers))
{ // speed up: do not count static fields, do not go back up to enclosing object in nested case, do not consider transients
fields.add(field); // depends on control dependency: [if], data = [none]
}
}
}
catch (Throwable ignored)
{
ExceptionUtilities.safelyIgnoreException(ignored);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
protected void readFolder(CmsUUID folderId, boolean clearFilter) throws CmsException {
CmsObject cms = A_CmsUI.getCmsObject();
if (clearFilter) {
m_searchField.clear();
}
CmsResource folder = cms.readResource(folderId, FOLDERS);
m_currentFolder = folderId;
String folderPath = cms.getSitePath(folder);
if (OpenCms.getSiteManager().isSharedFolder(cms.getRequestContext().getSiteRoot())) {
folderPath = folderPath.substring(cms.getRequestContext().getSiteRoot().length());
}
setPathInfo(folderPath);
List<CmsResource> childResources = cms.readResources(folder, FILES_N_FOLDERS, false);
m_fileTable.fillTable(cms, childResources, clearFilter);
boolean hasFolderChild = false;
for (CmsResource child : childResources) {
if (child.isFolder()) {
hasFolderChild = true;
break;
}
}
m_treeContainer.setChildrenAllowed(folderId, hasFolderChild);
String sitePath = folder.getRootPath().equals(cms.getRequestContext().getSiteRoot() + "/") ? "" : folderPath;
String state = new StateBean(
cms.getRequestContext().getSiteRoot(),
sitePath,
cms.getRequestContext().getCurrentProject().getUuid().toString()).asString();
if (LOG.isDebugEnabled()) {
String p = RandomStringUtils.randomAlphanumeric(5) + " readFolder ";
LOG.debug(p + "siteRoot = " + cms.getRequestContext().getSiteRoot());
LOG.debug(p + "folder = " + folder.getRootPath());
LOG.debug(p + "folderPath = " + folderPath);
LOG.debug(p + "sitePath = " + sitePath);
LOG.debug(p + "state = " + state);
LOG.debug(p + "m_currentState = " + m_currentState);
LOG.debug(p + "m_currentState.asString = " + StateBean.parse(m_currentState).asString());
}
if ((m_currentState == null) || !(state).equals(StateBean.parse(m_currentState).asString())) {
m_currentState = state;
CmsAppWorkplaceUi.get().changeCurrentAppState(m_currentState);
}
m_locationCache.setFileExplorerLocation(cms.getRequestContext().getSiteRoot(), sitePath);
m_uploadButton.setTargetFolder(folder.getRootPath());
m_uploadArea.setTargetFolder(folder.getRootPath());
if (!m_fileTree.isExpanded(folderId)) {
expandCurrentFolder();
}
if (!m_fileTree.isSelected(folderId)) {
m_fileTree.select(folderId);
}
} } | public class class_name {
protected void readFolder(CmsUUID folderId, boolean clearFilter) throws CmsException {
CmsObject cms = A_CmsUI.getCmsObject();
if (clearFilter) {
m_searchField.clear();
}
CmsResource folder = cms.readResource(folderId, FOLDERS);
m_currentFolder = folderId;
String folderPath = cms.getSitePath(folder);
if (OpenCms.getSiteManager().isSharedFolder(cms.getRequestContext().getSiteRoot())) {
folderPath = folderPath.substring(cms.getRequestContext().getSiteRoot().length());
}
setPathInfo(folderPath);
List<CmsResource> childResources = cms.readResources(folder, FILES_N_FOLDERS, false);
m_fileTable.fillTable(cms, childResources, clearFilter);
boolean hasFolderChild = false;
for (CmsResource child : childResources) {
if (child.isFolder()) {
hasFolderChild = true; // depends on control dependency: [if], data = [none]
break;
}
}
m_treeContainer.setChildrenAllowed(folderId, hasFolderChild);
String sitePath = folder.getRootPath().equals(cms.getRequestContext().getSiteRoot() + "/") ? "" : folderPath;
String state = new StateBean(
cms.getRequestContext().getSiteRoot(),
sitePath,
cms.getRequestContext().getCurrentProject().getUuid().toString()).asString();
if (LOG.isDebugEnabled()) {
String p = RandomStringUtils.randomAlphanumeric(5) + " readFolder ";
LOG.debug(p + "siteRoot = " + cms.getRequestContext().getSiteRoot());
LOG.debug(p + "folder = " + folder.getRootPath());
LOG.debug(p + "folderPath = " + folderPath);
LOG.debug(p + "sitePath = " + sitePath);
LOG.debug(p + "state = " + state);
LOG.debug(p + "m_currentState = " + m_currentState);
LOG.debug(p + "m_currentState.asString = " + StateBean.parse(m_currentState).asString());
}
if ((m_currentState == null) || !(state).equals(StateBean.parse(m_currentState).asString())) {
m_currentState = state;
CmsAppWorkplaceUi.get().changeCurrentAppState(m_currentState);
}
m_locationCache.setFileExplorerLocation(cms.getRequestContext().getSiteRoot(), sitePath);
m_uploadButton.setTargetFolder(folder.getRootPath());
m_uploadArea.setTargetFolder(folder.getRootPath());
if (!m_fileTree.isExpanded(folderId)) {
expandCurrentFolder();
}
if (!m_fileTree.isSelected(folderId)) {
m_fileTree.select(folderId);
}
} } |
public class class_name {
@Override
public synchronized void stop(StopContext context) {
try {
sipService.stop();
// FIXME: kakonyii
// server.stop();
} catch (Exception e) {
}
// FIXME: kakonyii
// engine = null;
// service = null;
// server = null;
// sipEngine = null;
sipService = null;
} } | public class class_name {
@Override
public synchronized void stop(StopContext context) {
try {
sipService.stop(); // depends on control dependency: [try], data = [none]
// FIXME: kakonyii
// server.stop();
} catch (Exception e) {
} // depends on control dependency: [catch], data = [none]
// FIXME: kakonyii
// engine = null;
// service = null;
// server = null;
// sipEngine = null;
sipService = null;
} } |
public class class_name {
@Nullable
private static Symbol tryGetSymbol(Tree tree) {
if (tree instanceof JCIdent) {
return ((JCIdent) tree).sym;
}
if (tree instanceof JCFieldAccess) {
return ((JCFieldAccess) tree).sym;
}
if (tree instanceof JCVariableDecl) {
return ((JCVariableDecl) tree).sym;
}
return null;
} } | public class class_name {
@Nullable
private static Symbol tryGetSymbol(Tree tree) {
if (tree instanceof JCIdent) {
return ((JCIdent) tree).sym; // depends on control dependency: [if], data = [none]
}
if (tree instanceof JCFieldAccess) {
return ((JCFieldAccess) tree).sym; // depends on control dependency: [if], data = [none]
}
if (tree instanceof JCVariableDecl) {
return ((JCVariableDecl) tree).sym; // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
@Override
public void run(T configuration, Environment environment) {
try {
if (configuration.getGuice() == null) {
LOGGER.error("GuiceBundle can not work without and configuration!");
}
GuiceBundle.configuration = configuration.getGuice();
createReflections(configuration.getGuice().getScanPackages());
JerseyUtil.registerGuiceBound(injector, environment.jersey());
JerseyUtil.registerGuiceFilter(environment);
deModule.setEnvironmentData(configuration, environment);
findAndRunScanners(environment, injector);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
} } | public class class_name {
@Override
public void run(T configuration, Environment environment) {
try {
if (configuration.getGuice() == null) {
LOGGER.error("GuiceBundle can not work without and configuration!"); // depends on control dependency: [if], data = [none]
}
GuiceBundle.configuration = configuration.getGuice(); // depends on control dependency: [try], data = [none]
createReflections(configuration.getGuice().getScanPackages()); // depends on control dependency: [try], data = [none]
JerseyUtil.registerGuiceBound(injector, environment.jersey()); // depends on control dependency: [try], data = [none]
JerseyUtil.registerGuiceFilter(environment); // depends on control dependency: [try], data = [none]
deModule.setEnvironmentData(configuration, environment); // depends on control dependency: [try], data = [none]
findAndRunScanners(environment, injector); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
@Override
public void execute(final Tuple tuple) {
if (TupleUtils.isTick(tuple)) {
onTickTuple(tuple);
} else {
process(tuple);
}
} } | public class class_name {
@Override
public void execute(final Tuple tuple) {
if (TupleUtils.isTick(tuple)) {
onTickTuple(tuple); // depends on control dependency: [if], data = [none]
} else {
process(tuple); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public void removeByCommerceCountryId(long commerceCountryId) {
for (CommerceAddress commerceAddress : findByCommerceCountryId(
commerceCountryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceAddress);
}
} } | public class class_name {
@Override
public void removeByCommerceCountryId(long commerceCountryId) {
for (CommerceAddress commerceAddress : findByCommerceCountryId(
commerceCountryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceAddress); // depends on control dependency: [for], data = [commerceAddress]
}
} } |
public class class_name {
public static boolean isH2Connection(Settings configuration) {
final String connStr;
try {
connStr = configuration.getConnectionString(
Settings.KEYS.DB_CONNECTION_STRING,
Settings.KEYS.DB_FILE_NAME);
} catch (IOException ex) {
LOGGER.debug("Unable to get connectionn string", ex);
return false;
}
return connStr.startsWith("jdbc:h2:file:");
} } | public class class_name {
public static boolean isH2Connection(Settings configuration) {
final String connStr;
try {
connStr = configuration.getConnectionString(
Settings.KEYS.DB_CONNECTION_STRING,
Settings.KEYS.DB_FILE_NAME); // depends on control dependency: [try], data = [none]
} catch (IOException ex) {
LOGGER.debug("Unable to get connectionn string", ex);
return false;
} // depends on control dependency: [catch], data = [none]
return connStr.startsWith("jdbc:h2:file:");
} } |
public class class_name {
public <ObjectType extends Identifiable> Map<String, ObjectType>
asMap(List<LDAPEntry> entries, Function<LDAPEntry, ObjectType> mapper) {
// Convert each entry to the corresponding Guacamole API object
Map<String, ObjectType> objects = new HashMap<>(entries.size());
for (LDAPEntry entry : entries) {
ObjectType object = mapper.apply(entry);
if (object == null) {
logger.debug("Ignoring object \"{}\".", entry.getDN());
continue;
}
// Attempt to add object to map, warning if the object appears
// to be a duplicate
String identifier = object.getIdentifier();
if (objects.putIfAbsent(identifier, object) != null)
logger.warn("Multiple objects ambiguously map to the "
+ "same identifier (\"{}\"). Ignoring \"{}\" as "
+ "a duplicate.", identifier, entry.getDN());
}
return objects;
} } | public class class_name {
public <ObjectType extends Identifiable> Map<String, ObjectType>
asMap(List<LDAPEntry> entries, Function<LDAPEntry, ObjectType> mapper) {
// Convert each entry to the corresponding Guacamole API object
Map<String, ObjectType> objects = new HashMap<>(entries.size());
for (LDAPEntry entry : entries) {
ObjectType object = mapper.apply(entry);
if (object == null) {
logger.debug("Ignoring object \"{}\".", entry.getDN()); // depends on control dependency: [if], data = [none]
continue;
}
// Attempt to add object to map, warning if the object appears
// to be a duplicate
String identifier = object.getIdentifier();
if (objects.putIfAbsent(identifier, object) != null)
logger.warn("Multiple objects ambiguously map to the "
+ "same identifier (\"{}\"). Ignoring \"{}\" as "
+ "a duplicate.", identifier, entry.getDN());
}
return objects;
} } |
public class class_name {
public void printStackTrace(java.io.PrintStream s)
{
if (s == null)
s = System.err;
try
{
super.printStackTrace(s);
}
catch (Exception e){}
Throwable exception = m_exception;
for (int i = 0; (i < 10) && (null != exception); i++)
{
s.println("---------");
exception.printStackTrace(s);
if (exception instanceof TransformerException)
{
TransformerException se = (TransformerException) exception;
Throwable prev = exception;
exception = se.getException();
if (prev == exception)
break;
}
else
{
exception = null;
}
}
} } | public class class_name {
public void printStackTrace(java.io.PrintStream s)
{
if (s == null)
s = System.err;
try
{
super.printStackTrace(s); // depends on control dependency: [try], data = [none]
}
catch (Exception e){} // depends on control dependency: [catch], data = [none]
Throwable exception = m_exception;
for (int i = 0; (i < 10) && (null != exception); i++)
{
s.println("---------"); // depends on control dependency: [for], data = [none]
exception.printStackTrace(s); // depends on control dependency: [for], data = [none]
if (exception instanceof TransformerException)
{
TransformerException se = (TransformerException) exception;
Throwable prev = exception;
exception = se.getException(); // depends on control dependency: [if], data = [none]
if (prev == exception)
break;
}
else
{
exception = null; // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public JobScheduleDeleteOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) {
if (ifUnmodifiedSince == null) {
this.ifUnmodifiedSince = null;
} else {
this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince);
}
return this;
} } | public class class_name {
public JobScheduleDeleteOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) {
if (ifUnmodifiedSince == null) {
this.ifUnmodifiedSince = null; // depends on control dependency: [if], data = [none]
} else {
this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); // depends on control dependency: [if], data = [(ifUnmodifiedSince]
}
return this;
} } |
public class class_name {
private int randomValue(IntVar x) {
int i = rnd.nextInt(x.getDomainSize());
DisposableValueIterator ite = x.getValueIterator(true);
int pos = -1;
try {
while (i >= 0) {
pos = ite.next();
i--;
}
} finally {
ite.dispose();
}
return pos;
} } | public class class_name {
private int randomValue(IntVar x) {
int i = rnd.nextInt(x.getDomainSize());
DisposableValueIterator ite = x.getValueIterator(true);
int pos = -1;
try {
while (i >= 0) {
pos = ite.next(); // depends on control dependency: [while], data = [none]
i--; // depends on control dependency: [while], data = [none]
}
} finally {
ite.dispose();
}
return pos;
} } |
public class class_name {
public void setOwners(java.util.Collection<String> owners) {
if (owners == null) {
this.owners = null;
return;
}
this.owners = new com.amazonaws.internal.SdkInternalList<String>(owners);
} } | public class class_name {
public void setOwners(java.util.Collection<String> owners) {
if (owners == null) {
this.owners = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.owners = new com.amazonaws.internal.SdkInternalList<String>(owners);
} } |
public class class_name {
public static double[] addArray(double[] array1, double[] array2)
{
if (array1.length != array2.length)
{
throw new IllegalArgumentException("The dimensions have to be equal!");
}
double[] result = new double[array1.length];
assert array1.length == array2.length;
for (int i = 0; i < array1.length; i++)
{
result[i] = array1[i] + array2[i];
}
return result;
} } | public class class_name {
public static double[] addArray(double[] array1, double[] array2)
{
if (array1.length != array2.length)
{
throw new IllegalArgumentException("The dimensions have to be equal!");
}
double[] result = new double[array1.length];
assert array1.length == array2.length;
for (int i = 0; i < array1.length; i++)
{
result[i] = array1[i] + array2[i]; // depends on control dependency: [for], data = [i]
}
return result;
} } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.