code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public DERObject toASN1Object() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(objectId); if (parametersDefined) { v.add(parameters); } return new DERSequence(v); } }
public class class_name { public DERObject toASN1Object() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(objectId); if (parametersDefined) { v.add(parameters); // depends on control dependency: [if], data = [none] } return new DERSequence(v); } }
public class class_name { public void updateMailServer(int id, String hostName, String username, String password, int port, boolean tls, boolean ssl, long lifeTimeSpan, long idleTimeSpan, boolean reuseConnections) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); if (port < 1) port = 21; if (hostName == null || hostName.trim().length() == 0) throw new ExpressionException("Host (SMTP) can be a empty value"); hostName = hostName.trim(); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); boolean checkId = id > 0; // Update Element server = null; String _hostName, _username; for (int i = 0; i < children.length; i++) { Element el = children[i]; if (checkId) { if (i + 1 == id) { server = el; break; } } else { _hostName = StringUtil.emptyIfNull(el.getAttribute("smtp")); _username = StringUtil.emptyIfNull(el.getAttribute("username")); if (_hostName.equalsIgnoreCase(hostName) && _username.equals(StringUtil.emptyIfNull(username))) { server = el; break; } } } // Insert if (server == null) { server = doc.createElement("server"); mail.appendChild(XMLCaster.toRawNode(server)); } server.setAttribute("smtp", hostName); server.setAttribute("username", username); server.setAttribute("password", ConfigWebUtil.encrypt(password)); server.setAttribute("port", Caster.toString(port)); server.setAttribute("tls", Caster.toString(tls)); server.setAttribute("ssl", Caster.toString(ssl)); server.setAttribute("life", Caster.toString(lifeTimeSpan)); server.setAttribute("idle", Caster.toString(idleTimeSpan)); server.setAttribute("reuse-connection", Caster.toString(reuseConnections)); } }
public class class_name { public void updateMailServer(int id, String hostName, String username, String password, int port, boolean tls, boolean ssl, long lifeTimeSpan, long idleTimeSpan, boolean reuseConnections) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); if (port < 1) port = 21; if (hostName == null || hostName.trim().length() == 0) throw new ExpressionException("Host (SMTP) can be a empty value"); hostName = hostName.trim(); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); boolean checkId = id > 0; // Update Element server = null; String _hostName, _username; for (int i = 0; i < children.length; i++) { Element el = children[i]; if (checkId) { if (i + 1 == id) { server = el; // depends on control dependency: [if], data = [none] break; } } else { _hostName = StringUtil.emptyIfNull(el.getAttribute("smtp")); // depends on control dependency: [if], data = [none] _username = StringUtil.emptyIfNull(el.getAttribute("username")); // depends on control dependency: [if], data = [none] if (_hostName.equalsIgnoreCase(hostName) && _username.equals(StringUtil.emptyIfNull(username))) { server = el; // depends on control dependency: [if], data = [none] break; } } } // Insert if (server == null) { server = doc.createElement("server"); mail.appendChild(XMLCaster.toRawNode(server)); } server.setAttribute("smtp", hostName); server.setAttribute("username", username); server.setAttribute("password", ConfigWebUtil.encrypt(password)); server.setAttribute("port", Caster.toString(port)); server.setAttribute("tls", Caster.toString(tls)); server.setAttribute("ssl", Caster.toString(ssl)); server.setAttribute("life", Caster.toString(lifeTimeSpan)); server.setAttribute("idle", Caster.toString(idleTimeSpan)); server.setAttribute("reuse-connection", Caster.toString(reuseConnections)); } }
public class class_name { public void marshall(DevEndpoint devEndpoint, ProtocolMarshaller protocolMarshaller) { if (devEndpoint == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(devEndpoint.getEndpointName(), ENDPOINTNAME_BINDING); protocolMarshaller.marshall(devEndpoint.getRoleArn(), ROLEARN_BINDING); protocolMarshaller.marshall(devEndpoint.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING); protocolMarshaller.marshall(devEndpoint.getSubnetId(), SUBNETID_BINDING); protocolMarshaller.marshall(devEndpoint.getYarnEndpointAddress(), YARNENDPOINTADDRESS_BINDING); protocolMarshaller.marshall(devEndpoint.getPrivateAddress(), PRIVATEADDRESS_BINDING); protocolMarshaller.marshall(devEndpoint.getZeppelinRemoteSparkInterpreterPort(), ZEPPELINREMOTESPARKINTERPRETERPORT_BINDING); protocolMarshaller.marshall(devEndpoint.getPublicAddress(), PUBLICADDRESS_BINDING); protocolMarshaller.marshall(devEndpoint.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(devEndpoint.getNumberOfNodes(), NUMBEROFNODES_BINDING); protocolMarshaller.marshall(devEndpoint.getAvailabilityZone(), AVAILABILITYZONE_BINDING); protocolMarshaller.marshall(devEndpoint.getVpcId(), VPCID_BINDING); protocolMarshaller.marshall(devEndpoint.getExtraPythonLibsS3Path(), EXTRAPYTHONLIBSS3PATH_BINDING); protocolMarshaller.marshall(devEndpoint.getExtraJarsS3Path(), EXTRAJARSS3PATH_BINDING); protocolMarshaller.marshall(devEndpoint.getFailureReason(), FAILUREREASON_BINDING); protocolMarshaller.marshall(devEndpoint.getLastUpdateStatus(), LASTUPDATESTATUS_BINDING); protocolMarshaller.marshall(devEndpoint.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING); protocolMarshaller.marshall(devEndpoint.getLastModifiedTimestamp(), LASTMODIFIEDTIMESTAMP_BINDING); protocolMarshaller.marshall(devEndpoint.getPublicKey(), PUBLICKEY_BINDING); protocolMarshaller.marshall(devEndpoint.getPublicKeys(), PUBLICKEYS_BINDING); protocolMarshaller.marshall(devEndpoint.getSecurityConfiguration(), SECURITYCONFIGURATION_BINDING); protocolMarshaller.marshall(devEndpoint.getArguments(), ARGUMENTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DevEndpoint devEndpoint, ProtocolMarshaller protocolMarshaller) { if (devEndpoint == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(devEndpoint.getEndpointName(), ENDPOINTNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getRoleArn(), ROLEARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getSubnetId(), SUBNETID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getYarnEndpointAddress(), YARNENDPOINTADDRESS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getPrivateAddress(), PRIVATEADDRESS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getZeppelinRemoteSparkInterpreterPort(), ZEPPELINREMOTESPARKINTERPRETERPORT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getPublicAddress(), PUBLICADDRESS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getNumberOfNodes(), NUMBEROFNODES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getAvailabilityZone(), AVAILABILITYZONE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getVpcId(), VPCID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getExtraPythonLibsS3Path(), EXTRAPYTHONLIBSS3PATH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getExtraJarsS3Path(), EXTRAJARSS3PATH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getFailureReason(), FAILUREREASON_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getLastUpdateStatus(), LASTUPDATESTATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getLastModifiedTimestamp(), LASTMODIFIEDTIMESTAMP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getPublicKey(), PUBLICKEY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getPublicKeys(), PUBLICKEYS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getSecurityConfiguration(), SECURITYCONFIGURATION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(devEndpoint.getArguments(), ARGUMENTS_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 int startNewSession() { if (txSessEncKey != null) return SESSION_ERROR_ALREADY_ACTIVE; if ((txMasterSalt == null) || (rxMasterSalt == null)) return SESSION_ERROR_MASTER_SALT_UDNEFINED; if ((txMasterKey == null) || (rxMasterKey == null)) return SESSION_ERROR_MASTER_SALT_UDNEFINED; if (!txSessionKeyDerivation()) { log("startNewSession txSessionKeyDerivation failed"); return SESSION_ERROR_KEY_DERIVATION_FAILED; } // Create encryptor components for tx session try { // and the HMAC components txEncryptorSuite = platform.getCrypto().createEncryptorSuite( txSessEncKey, initVector); txHMAC = platform.getCrypto().createHMACSHA1(txSessAuthKey); } catch (Throwable e) { log("startNewSession failed to create Tx encryptor"); return SESSION_ERROR_RESOURCE_CREATION_PROBLEM; } replayWindow = platform.getUtils().createSortedVector(); receivedFirst = false; rollOverCounter = 0; rxRoc = 0; txIV = new byte[16]; // Always uses a 128 bit IV rxIV = new byte[16]; txEncOut = new byte[16]; rxEncOut = new byte[16]; return SESSION_OK; } }
public class class_name { public int startNewSession() { if (txSessEncKey != null) return SESSION_ERROR_ALREADY_ACTIVE; if ((txMasterSalt == null) || (rxMasterSalt == null)) return SESSION_ERROR_MASTER_SALT_UDNEFINED; if ((txMasterKey == null) || (rxMasterKey == null)) return SESSION_ERROR_MASTER_SALT_UDNEFINED; if (!txSessionKeyDerivation()) { log("startNewSession txSessionKeyDerivation failed"); // depends on control dependency: [if], data = [none] return SESSION_ERROR_KEY_DERIVATION_FAILED; // depends on control dependency: [if], data = [none] } // Create encryptor components for tx session try { // and the HMAC components txEncryptorSuite = platform.getCrypto().createEncryptorSuite( txSessEncKey, initVector); // depends on control dependency: [try], data = [none] txHMAC = platform.getCrypto().createHMACSHA1(txSessAuthKey); // depends on control dependency: [try], data = [none] } catch (Throwable e) { log("startNewSession failed to create Tx encryptor"); return SESSION_ERROR_RESOURCE_CREATION_PROBLEM; } // depends on control dependency: [catch], data = [none] replayWindow = platform.getUtils().createSortedVector(); receivedFirst = false; rollOverCounter = 0; rxRoc = 0; txIV = new byte[16]; // Always uses a 128 bit IV rxIV = new byte[16]; txEncOut = new byte[16]; rxEncOut = new byte[16]; return SESSION_OK; } }
public class class_name { public QueryResult objectQuery(String tableName, String queryText, String fieldNames, int pageSize, String afterObjID, String sortOrder) { Map<String, String> params = new HashMap<>(); if (!Utils.isEmpty(queryText)) { params.put("q", queryText); } if (!Utils.isEmpty(fieldNames)) { params.put("f", fieldNames); } if (pageSize >= 0) { params.put("s", Integer.toString(pageSize)); } if (!Utils.isEmpty(afterObjID)) { params.put("g", afterObjID); } if (!Utils.isEmpty(sortOrder)) { params.put("o", sortOrder); } return objectQuery(tableName, params); } }
public class class_name { public QueryResult objectQuery(String tableName, String queryText, String fieldNames, int pageSize, String afterObjID, String sortOrder) { Map<String, String> params = new HashMap<>(); if (!Utils.isEmpty(queryText)) { params.put("q", queryText); // depends on control dependency: [if], data = [none] } if (!Utils.isEmpty(fieldNames)) { params.put("f", fieldNames); // depends on control dependency: [if], data = [none] } if (pageSize >= 0) { params.put("s", Integer.toString(pageSize)); // depends on control dependency: [if], data = [(pageSize] } if (!Utils.isEmpty(afterObjID)) { params.put("g", afterObjID); // depends on control dependency: [if], data = [none] } if (!Utils.isEmpty(sortOrder)) { params.put("o", sortOrder); // depends on control dependency: [if], data = [none] } return objectQuery(tableName, params); } }
public class class_name { private static int unsignedToSigned(int unsigned, int size) { if ((unsigned & (1 << size - 1)) != 0) { unsigned = -1 * ((1 << size - 1) - (unsigned & ((1 << size - 1) - 1))); } return unsigned; } }
public class class_name { private static int unsignedToSigned(int unsigned, int size) { if ((unsigned & (1 << size - 1)) != 0) { unsigned = -1 * ((1 << size - 1) - (unsigned & ((1 << size - 1) - 1))); // depends on control dependency: [if], data = [none] } return unsigned; } }
public class class_name { public static LuisRuntimeAPI authenticate(String baseUrl, ServiceClientCredentials credentials) { String endpointAPI = null; try { URI uri = new URI(baseUrl); endpointAPI = uri.getHost(); } catch (Exception e) { endpointAPI = EndpointAPI.US_WEST.toString(); } return new LuisRuntimeAPIImpl(baseUrl, credentials) .withEndpoint(endpointAPI); } }
public class class_name { public static LuisRuntimeAPI authenticate(String baseUrl, ServiceClientCredentials credentials) { String endpointAPI = null; try { URI uri = new URI(baseUrl); endpointAPI = uri.getHost(); // depends on control dependency: [try], data = [none] } catch (Exception e) { endpointAPI = EndpointAPI.US_WEST.toString(); } // depends on control dependency: [catch], data = [none] return new LuisRuntimeAPIImpl(baseUrl, credentials) .withEndpoint(endpointAPI); } }
public class class_name { @SuppressWarnings("unchecked") public <T> TypeAdapter<T> getAdapter(TypeToken<T> type) { TypeAdapter<?> cached = typeTokenCache.get(type); if (cached != null) { return (TypeAdapter<T>) cached; } Map<TypeToken<?>, FutureTypeAdapter<?>> threadCalls = calls.get(); // the key and value type parameters always agree FutureTypeAdapter<T> ongoingCall = (FutureTypeAdapter<T>) threadCalls.get(type); if (ongoingCall != null) { return ongoingCall; } FutureTypeAdapter<T> call = new FutureTypeAdapter<T>(); threadCalls.put(type, call); try { for (TypeAdapterFactory factory : factories) { TypeAdapter<T> candidate = factory.create(this, type); if (candidate != null) { call.setDelegate(candidate); typeTokenCache.put(type, candidate); return candidate; } } throw new IllegalArgumentException("GSON cannot handle " + type); } finally { threadCalls.remove(type); } } }
public class class_name { @SuppressWarnings("unchecked") public <T> TypeAdapter<T> getAdapter(TypeToken<T> type) { TypeAdapter<?> cached = typeTokenCache.get(type); if (cached != null) { return (TypeAdapter<T>) cached; // depends on control dependency: [if], data = [none] } Map<TypeToken<?>, FutureTypeAdapter<?>> threadCalls = calls.get(); // the key and value type parameters always agree FutureTypeAdapter<T> ongoingCall = (FutureTypeAdapter<T>) threadCalls.get(type); if (ongoingCall != null) { return ongoingCall; // depends on control dependency: [if], data = [none] } FutureTypeAdapter<T> call = new FutureTypeAdapter<T>(); threadCalls.put(type, call); try { for (TypeAdapterFactory factory : factories) { TypeAdapter<T> candidate = factory.create(this, type); if (candidate != null) { call.setDelegate(candidate); // depends on control dependency: [if], data = [(candidate] typeTokenCache.put(type, candidate); // depends on control dependency: [if], data = [none] return candidate; // depends on control dependency: [if], data = [none] } } throw new IllegalArgumentException("GSON cannot handle " + type); } finally { threadCalls.remove(type); } } }
public class class_name { public static String encodeAsString(Object obj,NamingStyle namingStyle,boolean useUnicode){ SerializeConfig config = SerializeConfig.getGlobalInstance(); config.propertyNamingStrategy = getNamingStrategy(namingStyle); if(useUnicode){ return JSON.toJSONString(obj,config, SerializerFeature.BrowserCompatible, SerializerFeature.WriteNullListAsEmpty, SerializerFeature.NotWriteDefaultValue ); } return JSON.toJSONString(obj,config); } }
public class class_name { public static String encodeAsString(Object obj,NamingStyle namingStyle,boolean useUnicode){ SerializeConfig config = SerializeConfig.getGlobalInstance(); config.propertyNamingStrategy = getNamingStrategy(namingStyle); if(useUnicode){ return JSON.toJSONString(obj,config, SerializerFeature.BrowserCompatible, SerializerFeature.WriteNullListAsEmpty, SerializerFeature.NotWriteDefaultValue ); // depends on control dependency: [if], data = [none] } return JSON.toJSONString(obj,config); } }
public class class_name { public Icon getIcon() { if (severity == null) { return null; } try { IconSource iconSource = ValkyrieRepository.getInstance().getApplicationConfig().iconSource(); return iconSource.getIcon("severity." + severity.getLabel()); } catch (NoSuchImageResourceException e) { return null; } } }
public class class_name { public Icon getIcon() { if (severity == null) { return null; // depends on control dependency: [if], data = [none] } try { IconSource iconSource = ValkyrieRepository.getInstance().getApplicationConfig().iconSource(); return iconSource.getIcon("severity." + severity.getLabel()); // depends on control dependency: [try], data = [none] } catch (NoSuchImageResourceException e) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static char toCharValue(Object o, char defaultValue) { if (o instanceof Character) return ((Character) o).charValue(); else if (o instanceof Boolean) return (char) ((((Boolean) o).booleanValue()) ? 1 : 0); else if (o instanceof Double) return (char) (((Double) o).doubleValue()); else if (o instanceof Number) return (char) (((Number) o).doubleValue()); else if (o instanceof String) { String str = o.toString(); if (str.length() > 0) return str.charAt(0); return defaultValue; } else if (o instanceof ObjectWrap) { return toCharValue(((ObjectWrap) o).getEmbededObject(toCharacter(defaultValue)), defaultValue); } else if (o == null) return toCharValue("", defaultValue); return defaultValue; } }
public class class_name { public static char toCharValue(Object o, char defaultValue) { if (o instanceof Character) return ((Character) o).charValue(); else if (o instanceof Boolean) return (char) ((((Boolean) o).booleanValue()) ? 1 : 0); else if (o instanceof Double) return (char) (((Double) o).doubleValue()); else if (o instanceof Number) return (char) (((Number) o).doubleValue()); else if (o instanceof String) { String str = o.toString(); if (str.length() > 0) return str.charAt(0); return defaultValue; // depends on control dependency: [if], data = [none] } else if (o instanceof ObjectWrap) { return toCharValue(((ObjectWrap) o).getEmbededObject(toCharacter(defaultValue)), defaultValue); // depends on control dependency: [if], data = [none] } else if (o == null) return toCharValue("", defaultValue); return defaultValue; } }
public class class_name { public void deleteReference() { if (decreaseRefCount() == 0) { T deleted; synchronized (this) { deleted = mValue; mValue = null; } mResourceReleaser.release(deleted); removeLiveReference(deleted); } } }
public class class_name { public void deleteReference() { if (decreaseRefCount() == 0) { T deleted; synchronized (this) { // depends on control dependency: [if], data = [none] deleted = mValue; mValue = null; } mResourceReleaser.release(deleted); // depends on control dependency: [if], data = [none] removeLiveReference(deleted); // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean usesStandardModel(XLog log) { String model = extractModel(log); if (model == null) { return false; } else if (model.trim().equals(VALUE_MODEL_STANDARD)) { return true; } else { return false; } } }
public class class_name { public boolean usesStandardModel(XLog log) { String model = extractModel(log); if (model == null) { return false; // depends on control dependency: [if], data = [none] } else if (model.trim().equals(VALUE_MODEL_STANDARD)) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(RejectSkillRequest rejectSkillRequest, ProtocolMarshaller protocolMarshaller) { if (rejectSkillRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rejectSkillRequest.getSkillId(), SKILLID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(RejectSkillRequest rejectSkillRequest, ProtocolMarshaller protocolMarshaller) { if (rejectSkillRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rejectSkillRequest.getSkillId(), SKILLID_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void copyFile(String source, String target) { try { CmsFileUtil.copy(m_configRfsPath + source, m_configRfsPath + target); } catch (IOException e) { m_errors.add("Could not copy " + source + " to " + target + " \n"); m_errors.add(e.toString() + "\n"); } } }
public class class_name { public void copyFile(String source, String target) { try { CmsFileUtil.copy(m_configRfsPath + source, m_configRfsPath + target); // depends on control dependency: [try], data = [none] } catch (IOException e) { m_errors.add("Could not copy " + source + " to " + target + " \n"); m_errors.add(e.toString() + "\n"); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void onDialogRequestEricsson(MAPDialog mapDialog, AddressString destReference, AddressString origReference, AddressString arg3, AddressString arg4) { if (logger.isDebugEnabled()) { logger.debug(String.format("onDialogRequest for DialogId=%d DestinationReference=%s OriginReference=%s ", mapDialog.getLocalDialogId(), destReference, origReference)); } } }
public class class_name { @Override public void onDialogRequestEricsson(MAPDialog mapDialog, AddressString destReference, AddressString origReference, AddressString arg3, AddressString arg4) { if (logger.isDebugEnabled()) { logger.debug(String.format("onDialogRequest for DialogId=%d DestinationReference=%s OriginReference=%s ", mapDialog.getLocalDialogId(), destReference, origReference)); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Nullable public IJSExpression getInitParams () { final JSAssocArray ret = new JSAssocArray (); if (ret.isEmpty ()) { // No properties present return JSExpr.TRUE; } return ret; } }
public class class_name { @Nullable public IJSExpression getInitParams () { final JSAssocArray ret = new JSAssocArray (); if (ret.isEmpty ()) { // No properties present return JSExpr.TRUE; // depends on control dependency: [if], data = [none] } return ret; } }
public class class_name { public static boolean isSbeJavaName(final String value) { for (final String token : PATTERN.split(value, -1)) { if (isJavaIdentifier(token)) { if (isJavaKeyword(token)) { return false; } } else { return false; } } return true; } }
public class class_name { public static boolean isSbeJavaName(final String value) { for (final String token : PATTERN.split(value, -1)) { if (isJavaIdentifier(token)) { if (isJavaKeyword(token)) { return false; // depends on control dependency: [if], data = [none] } } else { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public void openDrawer() { if (drawerLayout != null && sliderLayout != null) { if (drawerGravity != 0) { drawerLayout.openDrawer(drawerGravity); } else { drawerLayout.openDrawer(sliderLayout); } } } }
public class class_name { public void openDrawer() { if (drawerLayout != null && sliderLayout != null) { if (drawerGravity != 0) { drawerLayout.openDrawer(drawerGravity); // depends on control dependency: [if], data = [(drawerGravity] } else { drawerLayout.openDrawer(sliderLayout); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private void visitFrameAfterOnMethodEntry() { if (!visitFramesAfterCallbacks) return; // The frame that is required after the trace guard must be // fully specified as 'this' is no longer an 'uninitialized this' if (isConstructor()) { List<Object> stackLocals = new ArrayList<Object>(argTypes.length + 1); stackLocals.add(classAdapter.getClassType().getInternalName()); for (Type type : argTypes) { switch (type.getSort()) { case Type.ARRAY: case Type.OBJECT: stackLocals.add(type.getInternalName()); break; case Type.BOOLEAN: case Type.CHAR: case Type.BYTE: case Type.SHORT: case Type.INT: stackLocals.add(INTEGER); break; case Type.LONG: stackLocals.add(LONG); break; case Type.FLOAT: stackLocals.add(FLOAT); break; case Type.DOUBLE: stackLocals.add(DOUBLE); break; } } visitFrame(F_FULL, stackLocals.size(), stackLocals.toArray(), 0, new Object[] {}); visitInsn(NOP); } else { visitFrame(F_SAME, 0, null, 0, null); visitInsn(NOP); } } }
public class class_name { private void visitFrameAfterOnMethodEntry() { if (!visitFramesAfterCallbacks) return; // The frame that is required after the trace guard must be // fully specified as 'this' is no longer an 'uninitialized this' if (isConstructor()) { List<Object> stackLocals = new ArrayList<Object>(argTypes.length + 1); stackLocals.add(classAdapter.getClassType().getInternalName()); // depends on control dependency: [if], data = [none] for (Type type : argTypes) { switch (type.getSort()) { case Type.ARRAY: case Type.OBJECT: stackLocals.add(type.getInternalName()); break; case Type.BOOLEAN: case Type.CHAR: case Type.BYTE: case Type.SHORT: case Type.INT: stackLocals.add(INTEGER); break; case Type.LONG: stackLocals.add(LONG); break; case Type.FLOAT: stackLocals.add(FLOAT); break; case Type.DOUBLE: stackLocals.add(DOUBLE); break; } } visitFrame(F_FULL, stackLocals.size(), stackLocals.toArray(), 0, new Object[] {}); // depends on control dependency: [if], data = [none] visitInsn(NOP); // depends on control dependency: [if], data = [none] } else { visitFrame(F_SAME, 0, null, 0, null); // depends on control dependency: [if], data = [none] visitInsn(NOP); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String unquote(String s) { if (s==null) return null; if (s.length()<2) return s; char first=s.charAt(0); char last=s.charAt(s.length()-1); if (first!=last || (first!='"' && first!='\'')) return s; StringBuilder b=new StringBuilder(s.length()-2); boolean escape=false; for (int i=1;i<s.length()-1;i++) { char c = s.charAt(i); if (escape) { escape=false; switch (c) { case 'n': b.append('\n'); break; case 'r': b.append('\r'); break; case 't': b.append('\t'); break; case 'f': b.append('\f'); break; case 'b': b.append('\b'); break; case 'u': b.append((char)( (convertHexDigit((byte)s.charAt(i++))<<24)+ (convertHexDigit((byte)s.charAt(i++))<<16)+ (convertHexDigit((byte)s.charAt(i++))<<8)+ (convertHexDigit((byte)s.charAt(i++))) ) ); break; default: b.append(c); } } else if (c=='\\') { escape=true; continue; } else b.append(c); } return b.toString(); } }
public class class_name { public static String unquote(String s) { if (s==null) return null; if (s.length()<2) return s; char first=s.charAt(0); char last=s.charAt(s.length()-1); if (first!=last || (first!='"' && first!='\'')) return s; StringBuilder b=new StringBuilder(s.length()-2); boolean escape=false; for (int i=1;i<s.length()-1;i++) { char c = s.charAt(i); if (escape) { escape=false; // depends on control dependency: [if], data = [none] switch (c) { case 'n': b.append('\n'); break; case 'r': b.append('\r'); break; case 't': b.append('\t'); break; case 'f': b.append('\f'); break; case 'b': b.append('\b'); break; case 'u': b.append((char)( (convertHexDigit((byte)s.charAt(i++))<<24)+ (convertHexDigit((byte)s.charAt(i++))<<16)+ (convertHexDigit((byte)s.charAt(i++))<<8)+ (convertHexDigit((byte)s.charAt(i++))) ) ); break; default: b.append(c); } } else if (c=='\\') { escape=true; // depends on control dependency: [if], data = [none] continue; } else b.append(c); } return b.toString(); } }
public class class_name { private static String breakExtractor(String formula) { boolean finalBreak = false; int innerMostBracket = formula.lastIndexOf("("); if (innerMostBracket<0) return formula; String finalformula = formula.substring(0, innerMostBracket); String multipliedformula = ""; String formulaEnd = ""; String multiple = ""; for (int f = innerMostBracket + 1; f < formula.length(); f++) { char thisChar = formula.charAt(f); if ( finalBreak ) { if ( isDigit(thisChar) ){ multiple += thisChar; } else { formulaEnd = formula.substring(f, formula.length()); break; } }else { if ( thisChar == ')' ) { finalBreak = true; }else multipliedformula += thisChar; } } finalformula += muliplier(multipliedformula, multiple.isEmpty() ? 1:Integer.valueOf(multiple)) + formulaEnd; if (finalformula.contains("(")) return breakExtractor(finalformula); else return finalformula; } }
public class class_name { private static String breakExtractor(String formula) { boolean finalBreak = false; int innerMostBracket = formula.lastIndexOf("("); if (innerMostBracket<0) return formula; String finalformula = formula.substring(0, innerMostBracket); String multipliedformula = ""; String formulaEnd = ""; String multiple = ""; for (int f = innerMostBracket + 1; f < formula.length(); f++) { char thisChar = formula.charAt(f); if ( finalBreak ) { if ( isDigit(thisChar) ){ multiple += thisChar; // depends on control dependency: [if], data = [none] } else { formulaEnd = formula.substring(f, formula.length()); // depends on control dependency: [if], data = [none] break; } }else { if ( thisChar == ')' ) { finalBreak = true; // depends on control dependency: [if], data = [none] }else multipliedformula += thisChar; } } finalformula += muliplier(multipliedformula, multiple.isEmpty() ? 1:Integer.valueOf(multiple)) + formulaEnd; if (finalformula.contains("(")) return breakExtractor(finalformula); else return finalformula; } }
public class class_name { public boolean moveTo(Vector3f location) { if (autonomousMovementControl != null) { ((AbstractControl) autonomousMovementControl).setEnabled(true); return autonomousMovementControl.moveTo(location); } return false; } }
public class class_name { public boolean moveTo(Vector3f location) { if (autonomousMovementControl != null) { ((AbstractControl) autonomousMovementControl).setEnabled(true); // depends on control dependency: [if], data = [none] return autonomousMovementControl.moveTo(location); // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public void setUserGroups(CmsObject cms) { if (getUser() != null) { try { m_groups = cms.getGroupsOfUser(getUser().getName(), false); } catch (CmsException e) { // failed to set user groups } } } }
public class class_name { public void setUserGroups(CmsObject cms) { if (getUser() != null) { try { m_groups = cms.getGroupsOfUser(getUser().getName(), false); // depends on control dependency: [try], data = [none] } catch (CmsException e) { // failed to set user groups } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public Annotation asAnnotation() { if (this instanceof Annotation) { return Cast.as(this); } else if (document() != null) { return document() .annotationBuilder() .type(AnnotationType.ROOT) .bounds(this) .attributes(this) .createDetached(); } return Fragments.detachedAnnotation(AnnotationType.ROOT, start(), end()); } }
public class class_name { public Annotation asAnnotation() { if (this instanceof Annotation) { return Cast.as(this); // depends on control dependency: [if], data = [none] } else if (document() != null) { return document() .annotationBuilder() .type(AnnotationType.ROOT) .bounds(this) .attributes(this) .createDetached(); // depends on control dependency: [if], data = [none] } return Fragments.detachedAnnotation(AnnotationType.ROOT, start(), end()); } }
public class class_name { @Override public void subscribe(Class<? extends RootApplicationEvent> event, EventListener listener) { synchronized (subscriptions) { Set<EventListener> listeners = subscriptions.get(event); if (listeners == null) { listeners = new HashSet<>(1); listeners.add(listener); } else { listeners.add(listener); subscriptions.put(event, listeners); } } } }
public class class_name { @Override public void subscribe(Class<? extends RootApplicationEvent> event, EventListener listener) { synchronized (subscriptions) { Set<EventListener> listeners = subscriptions.get(event); if (listeners == null) { listeners = new HashSet<>(1); // depends on control dependency: [if], data = [none] listeners.add(listener); // depends on control dependency: [if], data = [none] } else { listeners.add(listener); // depends on control dependency: [if], data = [none] subscriptions.put(event, listeners); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void processSpace(Properties properties) { try { Transform transform = null; // Load any optionally specifie transform class String transformClass = properties.getProperty(MATRIX_TRANSFORM_PROPERTY); if (transformClass != null) transform = ReflectionUtil.getObjectInstance( transformClass); MatrixFile processedSpace = super.processSpace(transform); System.out.printf("Matrix saved in %s as %s%n", processedSpace.getFile(), processedSpace.getFormat()); wordSpace = MatrixIO.readMatrix(processedSpace.getFile(), processedSpace.getFormat()); System.out.printf("loaded word space of %d x %d%n", wordSpace.rows(), wordSpace.columns()); } catch (IOException ioe) { throw new IOError(ioe); } } }
public class class_name { public void processSpace(Properties properties) { try { Transform transform = null; // Load any optionally specifie transform class String transformClass = properties.getProperty(MATRIX_TRANSFORM_PROPERTY); if (transformClass != null) transform = ReflectionUtil.getObjectInstance( transformClass); MatrixFile processedSpace = super.processSpace(transform); System.out.printf("Matrix saved in %s as %s%n", processedSpace.getFile(), processedSpace.getFormat()); // depends on control dependency: [try], data = [none] wordSpace = MatrixIO.readMatrix(processedSpace.getFile(), processedSpace.getFormat()); // depends on control dependency: [try], data = [none] System.out.printf("loaded word space of %d x %d%n", wordSpace.rows(), wordSpace.columns()); // depends on control dependency: [try], data = [none] } catch (IOException ioe) { throw new IOError(ioe); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static void setAtomProperties(IAtomContainer container, Object propKey, Object propVal) { if (container != null) { for (IAtom atom : container.atoms()) { atom.setProperty(propKey, propVal); } } } }
public class class_name { public static void setAtomProperties(IAtomContainer container, Object propKey, Object propVal) { if (container != null) { for (IAtom atom : container.atoms()) { atom.setProperty(propKey, propVal); // depends on control dependency: [for], data = [atom] } } } }
public class class_name { void initializeFromRect(Envelope2D src, Envelope2D dest) { if (src.isEmpty() || dest.isEmpty() || 0 == src.getWidth() || 0 == src.getHeight()) setZero(); else { xy = yx = 0; xx = dest.getWidth() / src.getWidth(); yy = dest.getHeight() / src.getHeight(); xd = dest.xmin - src.xmin * xx; yd = dest.ymin - src.ymin * yy; } } }
public class class_name { void initializeFromRect(Envelope2D src, Envelope2D dest) { if (src.isEmpty() || dest.isEmpty() || 0 == src.getWidth() || 0 == src.getHeight()) setZero(); else { xy = yx = 0; // depends on control dependency: [if], data = [none] xx = dest.getWidth() / src.getWidth(); // depends on control dependency: [if], data = [dest.] yy = dest.getHeight() / src.getHeight(); // depends on control dependency: [if], data = [dest.] xd = dest.xmin - src.xmin * xx; // depends on control dependency: [if], data = [dest.] yd = dest.ymin - src.ymin * yy; // depends on control dependency: [if], data = [dest.] } } }
public class class_name { private R connectOne(T first, R acc, T last) { synchronized (root) { Connector<T, R> l = left; if (l == null) { return pushRight(acc, last); } if (l.acc == NONE) { l.acc = acc; l.left = first; l.right = last; return connectEmpty(); } T laright = l.right; if (mergeable.test(laright, first)) { l.acc = combiner.apply(l.acc, acc); l.right = last; return connectEmpty(); } left = null; l.rhs = null; l.right = none(); if (l.left != NONE) { return pushRight(acc, last); } acc = pushRight(acc, last); if (acc != NONE) left = new Connector<>(null, acc, this); return l.drain(); } } }
public class class_name { private R connectOne(T first, R acc, T last) { synchronized (root) { Connector<T, R> l = left; if (l == null) { return pushRight(acc, last); // depends on control dependency: [if], data = [none] } if (l.acc == NONE) { l.acc = acc; // depends on control dependency: [if], data = [none] l.left = first; // depends on control dependency: [if], data = [none] l.right = last; // depends on control dependency: [if], data = [none] return connectEmpty(); // depends on control dependency: [if], data = [none] } T laright = l.right; if (mergeable.test(laright, first)) { l.acc = combiner.apply(l.acc, acc); // depends on control dependency: [if], data = [none] l.right = last; // depends on control dependency: [if], data = [none] return connectEmpty(); // depends on control dependency: [if], data = [none] } left = null; l.rhs = null; l.right = none(); if (l.left != NONE) { return pushRight(acc, last); // depends on control dependency: [if], data = [none] } acc = pushRight(acc, last); if (acc != NONE) left = new Connector<>(null, acc, this); return l.drain(); } } }
public class class_name { @Throws(IllegalPositiveArgumentException.class) public static void notPositive(final boolean condition, final int value, @Nullable final String name) { if (condition) { Check.notPositive(value, name); } } }
public class class_name { @Throws(IllegalPositiveArgumentException.class) public static void notPositive(final boolean condition, final int value, @Nullable final String name) { if (condition) { Check.notPositive(value, name); // depends on control dependency: [if], data = [none] } } }
public class class_name { public DMatrixRMaj getQ(DMatrixRMaj Q ) { Q = UtilDecompositons_DDRM.checkIdentity(Q,N,N); for( int i = 0; i < N; i++ ) w[i] = 0; for( int j = N-2; j >= 0; j-- ) { w[j+1] = 1; for( int i = j+2; i < N; i++ ) { w[i] = QT.get(j,i); } QrHelperFunctions_DDRM.rank1UpdateMultR(Q, w, gammas[j + 1], j + 1, j + 1, N, b); // Q.print(); } return Q; } }
public class class_name { public DMatrixRMaj getQ(DMatrixRMaj Q ) { Q = UtilDecompositons_DDRM.checkIdentity(Q,N,N); for( int i = 0; i < N; i++ ) w[i] = 0; for( int j = N-2; j >= 0; j-- ) { w[j+1] = 1; // depends on control dependency: [for], data = [j] for( int i = j+2; i < N; i++ ) { w[i] = QT.get(j,i); // depends on control dependency: [for], data = [i] } QrHelperFunctions_DDRM.rank1UpdateMultR(Q, w, gammas[j + 1], j + 1, j + 1, N, b); // depends on control dependency: [for], data = [j] // Q.print(); } return Q; } }
public class class_name { public void marshall(ListDatasetsRequest listDatasetsRequest, ProtocolMarshaller protocolMarshaller) { if (listDatasetsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listDatasetsRequest.getIdentityPoolId(), IDENTITYPOOLID_BINDING); protocolMarshaller.marshall(listDatasetsRequest.getIdentityId(), IDENTITYID_BINDING); protocolMarshaller.marshall(listDatasetsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listDatasetsRequest.getMaxResults(), MAXRESULTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListDatasetsRequest listDatasetsRequest, ProtocolMarshaller protocolMarshaller) { if (listDatasetsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listDatasetsRequest.getIdentityPoolId(), IDENTITYPOOLID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listDatasetsRequest.getIdentityId(), IDENTITYID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listDatasetsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listDatasetsRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @SuppressWarnings("unchecked") public <T extends JCTree> T translate(T tree) { if (tree == null) { return null; } else { tree.accept(this); JCTree tmpResult = this.result; this.result = null; return (T)tmpResult; // XXX cast } } }
public class class_name { @SuppressWarnings("unchecked") public <T extends JCTree> T translate(T tree) { if (tree == null) { return null; // depends on control dependency: [if], data = [none] } else { tree.accept(this); // depends on control dependency: [if], data = [none] JCTree tmpResult = this.result; this.result = null; // depends on control dependency: [if], data = [none] return (T)tmpResult; // XXX cast // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void setTraceRouter(WsTraceRouter traceRouter) { internalTraceRouter.set(traceRouter); // Pass the earlierMessages queue to the router. // Now that the internalMessageRouter is non-null, this class will // NOT add any more messages to the earlierMessages queue. // The MessageRouter basically owns the earlierMessages queue // from now on. if (earlierTraces != null) { synchronized (this) { if (earlierTraces != null) { traceRouter.setEarlierTraces(earlierTraces); } } } else { traceRouter.setEarlierTraces(null); } } }
public class class_name { @Override public void setTraceRouter(WsTraceRouter traceRouter) { internalTraceRouter.set(traceRouter); // Pass the earlierMessages queue to the router. // Now that the internalMessageRouter is non-null, this class will // NOT add any more messages to the earlierMessages queue. // The MessageRouter basically owns the earlierMessages queue // from now on. if (earlierTraces != null) { synchronized (this) { // depends on control dependency: [if], data = [none] if (earlierTraces != null) { traceRouter.setEarlierTraces(earlierTraces); // depends on control dependency: [if], data = [(earlierTraces] } } } else { traceRouter.setEarlierTraces(null); // depends on control dependency: [if], data = [null)] } } }
public class class_name { public ASN1Primitive toASN1Primitive() { ASN1EncodableVector vec = new ASN1EncodableVector(); if (this.pathLenConstraint != null) { vec.add(this.pathLenConstraint); } vec.add(this.proxyPolicy.toASN1Primitive()); return new DERSequence(vec); } }
public class class_name { public ASN1Primitive toASN1Primitive() { ASN1EncodableVector vec = new ASN1EncodableVector(); if (this.pathLenConstraint != null) { vec.add(this.pathLenConstraint); // depends on control dependency: [if], data = [(this.pathLenConstraint] } vec.add(this.proxyPolicy.toASN1Primitive()); return new DERSequence(vec); } }
public class class_name { public void copyFromDirectBuffer(int bytesRead) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "copyFromDirectBuffer: " + bytesRead); } int newPosition = this.oWsBBDirect.position(); int cachePosition = this.oByteBuffer.position(); if (this.quickBufferAction == NOT_ACTIVATED) { // copy the bytes read from the old position this.oWsBBDirect.position(cachePosition); if (bytesRead == -1) { // copy all the bytes up to the limit this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), oByteBuffer.remaining()); } else if (bytesRead > 0) { // copy just the bytes that were read this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), bytesRead); } // set to the position this.oByteBuffer.position(newPosition); } else { synchronized (wsBBRoot.actionAccess) { if (wsBBRoot.actionState == PooledWsByteBufferImpl.COPY_WHEN_NEEDED_STATE1) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "actionState: STATE1 - nothing will be copied"); } // don't do the copy now, just update the position pointer this.oByteBuffer.position(newPosition); int min = cachePosition; int max = newPosition - 1; // in STATE1 readMin and readMax keep track of the data that will // need to be moved up to the nonDirect buffer upon entering STATE2. // This area can be expanded to contain some bytes which were not // read into, since nothing has been put into the NonDirect buffer, // so any gaps in the read data will be uninitialized data anyway. if ((wsBBRoot.readMin == -1) || (min < wsBBRoot.readMin)) { wsBBRoot.readMin = min; } if ((wsBBRoot.readMax == -1) || (max > wsBBRoot.readMax)) { wsBBRoot.readMax = max; } // if getMin and getMax are not outside of the new read, then reset them, // so that the next get(...) will pull up the new data. if ((wsBBRoot.getMax >= wsBBRoot.readMin) && (wsBBRoot.getMin <= wsBBRoot.readMax)) { wsBBRoot.getMax = -1; wsBBRoot.getMin = -1; } } else { // actionState must equal COPY_WHEN_NEEDED_STATE2 or // BUFFER_MGMT_COPY_ALL_FINAL (if another thread just changed it). // if (wsBBRoot.actionState == PooledWsByteBufferImpl.COPY_WHEN_NEEDED_STATE2) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "actionState: STATE2, first copy up any previously read data"); } // first copy up to the nonDirect buffer any data that was read before // entering STATE 2 if ((wsBBRoot.readMin != -1) && (wsBBRoot.readMax != -1)) { moveUpUsingGetMinMax(wsBBRoot.readMin, wsBBRoot.readMax, 0); } } this.wsBBRoot.actionState = PooledWsByteBufferImpl.COPY_ALL_FINAL; this.quickBufferAction = NOT_ACTIVATED; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "actionState: COPY_ALL_FINAL, copy currently read data to NonDirect buffer "); } // copy the bytes read from the old position this.oWsBBDirect.position(cachePosition); if (bytesRead == -1) { // copy all the bytes up to the limit this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), oByteBuffer.remaining()); } else if (bytesRead > 0) { // copy just the bytes that were read this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), bytesRead); } // set to the position this.oByteBuffer.position(newPosition); } } // end-sync } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "copyFromDirectBuffer"); } } }
public class class_name { public void copyFromDirectBuffer(int bytesRead) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "copyFromDirectBuffer: " + bytesRead); // depends on control dependency: [if], data = [none] } int newPosition = this.oWsBBDirect.position(); int cachePosition = this.oByteBuffer.position(); if (this.quickBufferAction == NOT_ACTIVATED) { // copy the bytes read from the old position this.oWsBBDirect.position(cachePosition); // depends on control dependency: [if], data = [none] if (bytesRead == -1) { // copy all the bytes up to the limit this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), oByteBuffer.remaining()); // depends on control dependency: [if], data = [none] } else if (bytesRead > 0) { // copy just the bytes that were read this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), bytesRead); // depends on control dependency: [if], data = [none] } // set to the position this.oByteBuffer.position(newPosition); // depends on control dependency: [if], data = [none] } else { synchronized (wsBBRoot.actionAccess) { // depends on control dependency: [if], data = [none] if (wsBBRoot.actionState == PooledWsByteBufferImpl.COPY_WHEN_NEEDED_STATE1) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "actionState: STATE1 - nothing will be copied"); // depends on control dependency: [if], data = [none] } // don't do the copy now, just update the position pointer this.oByteBuffer.position(newPosition); // depends on control dependency: [if], data = [none] int min = cachePosition; int max = newPosition - 1; // in STATE1 readMin and readMax keep track of the data that will // need to be moved up to the nonDirect buffer upon entering STATE2. // This area can be expanded to contain some bytes which were not // read into, since nothing has been put into the NonDirect buffer, // so any gaps in the read data will be uninitialized data anyway. if ((wsBBRoot.readMin == -1) || (min < wsBBRoot.readMin)) { wsBBRoot.readMin = min; // depends on control dependency: [if], data = [none] } if ((wsBBRoot.readMax == -1) || (max > wsBBRoot.readMax)) { wsBBRoot.readMax = max; // depends on control dependency: [if], data = [none] } // if getMin and getMax are not outside of the new read, then reset them, // so that the next get(...) will pull up the new data. if ((wsBBRoot.getMax >= wsBBRoot.readMin) && (wsBBRoot.getMin <= wsBBRoot.readMax)) { wsBBRoot.getMax = -1; // depends on control dependency: [if], data = [none] wsBBRoot.getMin = -1; // depends on control dependency: [if], data = [none] } } else { // actionState must equal COPY_WHEN_NEEDED_STATE2 or // BUFFER_MGMT_COPY_ALL_FINAL (if another thread just changed it). // if (wsBBRoot.actionState == PooledWsByteBufferImpl.COPY_WHEN_NEEDED_STATE2) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "actionState: STATE2, first copy up any previously read data"); // depends on control dependency: [if], data = [none] } // first copy up to the nonDirect buffer any data that was read before // entering STATE 2 if ((wsBBRoot.readMin != -1) && (wsBBRoot.readMax != -1)) { moveUpUsingGetMinMax(wsBBRoot.readMin, wsBBRoot.readMax, 0); // depends on control dependency: [if], data = [none] } } this.wsBBRoot.actionState = PooledWsByteBufferImpl.COPY_ALL_FINAL; // depends on control dependency: [if], data = [none] this.quickBufferAction = NOT_ACTIVATED; // depends on control dependency: [if], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "actionState: COPY_ALL_FINAL, copy currently read data to NonDirect buffer "); // depends on control dependency: [if], data = [none] } // copy the bytes read from the old position this.oWsBBDirect.position(cachePosition); // depends on control dependency: [if], data = [none] if (bytesRead == -1) { // copy all the bytes up to the limit this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), oByteBuffer.remaining()); // depends on control dependency: [if], data = [none] } else if (bytesRead > 0) { // copy just the bytes that were read this.oWsBBDirect.get(oByteBuffer.array(), cachePosition + oByteBuffer.arrayOffset(), bytesRead); // depends on control dependency: [if], data = [none] } // set to the position this.oByteBuffer.position(newPosition); // depends on control dependency: [if], data = [none] } } // end-sync } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "copyFromDirectBuffer"); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setIdentifierResolver(final Object identifierResolver) { if (identifierResolver instanceof IdentifierResolver) { this.identifierResolver = (IdentifierResolver) identifierResolver; } else if (identifierResolver instanceof String) { this.identifierResolver = new IdentifierResolver() { public String getIdentifierFor(String nodeName) { return (String) identifierResolver; } }; } else if (identifierResolver instanceof Closure) { final ObjectGraphBuilder self = this; this.identifierResolver = new IdentifierResolver() { public String getIdentifierFor(String nodeName) { Closure cls = (Closure) identifierResolver; cls.setDelegate(self); return (String) cls.call(new Object[]{nodeName}); } }; } else { this.identifierResolver = new DefaultIdentifierResolver(); } } }
public class class_name { public void setIdentifierResolver(final Object identifierResolver) { if (identifierResolver instanceof IdentifierResolver) { this.identifierResolver = (IdentifierResolver) identifierResolver; // depends on control dependency: [if], data = [none] } else if (identifierResolver instanceof String) { this.identifierResolver = new IdentifierResolver() { public String getIdentifierFor(String nodeName) { return (String) identifierResolver; } }; // depends on control dependency: [if], data = [none] } else if (identifierResolver instanceof Closure) { final ObjectGraphBuilder self = this; this.identifierResolver = new IdentifierResolver() { public String getIdentifierFor(String nodeName) { Closure cls = (Closure) identifierResolver; cls.setDelegate(self); return (String) cls.call(new Object[]{nodeName}); } }; // depends on control dependency: [if], data = [none] } else { this.identifierResolver = new DefaultIdentifierResolver(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void addIfAbsent(CharSequence variant, String template) { int idx = StandardPlural.indexFromString(variant); if (templates[idx] != null) { return; } templates[idx] = SimpleFormatter.compileMinMaxArguments(template, 0, 1); } }
public class class_name { public void addIfAbsent(CharSequence variant, String template) { int idx = StandardPlural.indexFromString(variant); if (templates[idx] != null) { return; // depends on control dependency: [if], data = [none] } templates[idx] = SimpleFormatter.compileMinMaxArguments(template, 0, 1); } }
public class class_name { void toStringRep(String indent, XAppender out) { out.append(indent).append("<"); out.append(name); if (attributes.size() > 0) { for (String an : attributes.keySet()) { out.append(" ").append(an).append("='").append(sanitize(attributes.get(an))).append("'"); } } if (children.size() == 0) { if (content == null) { out.append("/>"); } else { out.append(">"); out.append(sanitize(content)); out.append("</"); out.append(name); out.append(">"); } } else { if (content == null) { out.append(String.format(">%n")); } else { out.append(">"); out.append(sanitize(content)); out.append(String.format("%n")); } for (XElement e : children) { e.toStringRep(indent + " ", out); } out.append(indent).append("</"); out.append(name); out.append(">"); } out.append(String.format("%n")); } }
public class class_name { void toStringRep(String indent, XAppender out) { out.append(indent).append("<"); out.append(name); if (attributes.size() > 0) { for (String an : attributes.keySet()) { out.append(" ").append(an).append("='").append(sanitize(attributes.get(an))).append("'"); // depends on control dependency: [for], data = [an] } } if (children.size() == 0) { if (content == null) { out.append("/>"); // depends on control dependency: [if], data = [none] } else { out.append(">"); // depends on control dependency: [if], data = [none] out.append(sanitize(content)); // depends on control dependency: [if], data = [(content] out.append("</"); // depends on control dependency: [if], data = [none] out.append(name); // depends on control dependency: [if], data = [none] out.append(">"); // depends on control dependency: [if], data = [none] } } else { if (content == null) { out.append(String.format(">%n")); // depends on control dependency: [if], data = [none] } else { out.append(">"); // depends on control dependency: [if], data = [none] out.append(sanitize(content)); // depends on control dependency: [if], data = [(content] out.append(String.format("%n")); // depends on control dependency: [if], data = [none] } for (XElement e : children) { e.toStringRep(indent + " ", out); // depends on control dependency: [for], data = [e] } out.append(indent).append("</"); // depends on control dependency: [if], data = [none] out.append(name); // depends on control dependency: [if], data = [none] out.append(">"); // depends on control dependency: [if], data = [none] } out.append(String.format("%n")); } }
public class class_name { @Override public Client accept(MediaType... types) { for (MediaType mt : types) { possiblyAddHeader(HttpHeaders.ACCEPT, JAXRSUtils.mediaTypeToString(mt)); } return this; } }
public class class_name { @Override public Client accept(MediaType... types) { for (MediaType mt : types) { possiblyAddHeader(HttpHeaders.ACCEPT, JAXRSUtils.mediaTypeToString(mt)); // depends on control dependency: [for], data = [mt] } return this; } }
public class class_name { protected void upgradeSonstigeElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:sonstige[@sonstige_typ]", doc).selectNodes(doc); for (Object item : nodes) { Element node = (Element) item; String value = StringUtils.trimToNull(node.getAttribute("sonstige_typ")); if ("GARAGEN".equalsIgnoreCase(value) || "PARKFLACHE".equalsIgnoreCase(value)) { Element parentNode = (Element) node.getParentNode(); parentNode.removeChild(node); Element newNode = doc.createElementNS(StringUtils.EMPTY, "parken"); newNode.setAttribute("parken_typ", "STELLPLATZ"); parentNode.appendChild(newNode); } } } }
public class class_name { protected void upgradeSonstigeElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:sonstige[@sonstige_typ]", doc).selectNodes(doc); for (Object item : nodes) { Element node = (Element) item; String value = StringUtils.trimToNull(node.getAttribute("sonstige_typ")); if ("GARAGEN".equalsIgnoreCase(value) || "PARKFLACHE".equalsIgnoreCase(value)) { Element parentNode = (Element) node.getParentNode(); parentNode.removeChild(node); // depends on control dependency: [if], data = [none] Element newNode = doc.createElementNS(StringUtils.EMPTY, "parken"); newNode.setAttribute("parken_typ", "STELLPLATZ"); // depends on control dependency: [if], data = [none] parentNode.appendChild(newNode); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void complete(NetworkConnection vc, IOWriteRequestContext wctx) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "complete", new Object[] {vc, wctx}); if (connection.isLoggingIOEvents()) connection.getConnectionEventRecorder().logDebug("complete method invoked on write context "+System.identityHashCode(wctx)); try { doWork(true); } catch(SIConnectionDroppedException connectionDroppedException) { // No FFDC code needed // This has been thrown because the priority queue was purged (most likely on another thread). // The exception is thrown to prevent threads in this method looping forever or hanging if the // conneciton is invalidate on another thread. Therefore we simply swallow this exception and // allow the thread to exit this method. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Caught SIConnectionDroppedException, Priority Queue has been purged"); } catch(Error error) { FFDCFilter.processException (error, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_03, connection.getDiagnostics(true)); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, error); // It might appear slightly odd for this code to catch Error (especially since the JDK docs say // that Error means that something has gone so badly wrong that you should abandon all hope). // This code makes one final stab at putting out some diagnostics about what happened (if we // propagate the Error up to the TCP Channel, it is sometimes lost) and closing down the // connection. I figured that we might as well try to do something - as we can hardly make // things worse... (famous last words) connection.invalidate(false, error, "Error caught in ConnectionWriteCompletedCallback.complete()"); // Re-throw the error to ensure that it causes the maximum devastation. // The JVM is probably very ill if an Error is thrown so attempt no recovery. throw error; } catch(RuntimeException runtimeException) { FFDCFilter.processException (runtimeException, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_04, connection.getDiagnostics(true)); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, runtimeException); // We can reasonably try to recover from a runtime exception by invalidating the associated // connection. This should drive the underlying TCP/IP socket to be closed. connection.invalidate(false, runtimeException, "RuntimeException caught in ConnectionWriteCompletedCallback.complete()"); // Don't throw the RuntimeException on as we risk blowing away part of the TCP channel. } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "complete"); } }
public class class_name { public void complete(NetworkConnection vc, IOWriteRequestContext wctx) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "complete", new Object[] {vc, wctx}); if (connection.isLoggingIOEvents()) connection.getConnectionEventRecorder().logDebug("complete method invoked on write context "+System.identityHashCode(wctx)); try { doWork(true); // depends on control dependency: [try], data = [none] } catch(SIConnectionDroppedException connectionDroppedException) { // No FFDC code needed // This has been thrown because the priority queue was purged (most likely on another thread). // The exception is thrown to prevent threads in this method looping forever or hanging if the // conneciton is invalidate on another thread. Therefore we simply swallow this exception and // allow the thread to exit this method. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Caught SIConnectionDroppedException, Priority Queue has been purged"); } catch(Error error) { // depends on control dependency: [catch], data = [none] FFDCFilter.processException (error, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_03, connection.getDiagnostics(true)); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, error); // It might appear slightly odd for this code to catch Error (especially since the JDK docs say // that Error means that something has gone so badly wrong that you should abandon all hope). // This code makes one final stab at putting out some diagnostics about what happened (if we // propagate the Error up to the TCP Channel, it is sometimes lost) and closing down the // connection. I figured that we might as well try to do something - as we can hardly make // things worse... (famous last words) connection.invalidate(false, error, "Error caught in ConnectionWriteCompletedCallback.complete()"); // Re-throw the error to ensure that it causes the maximum devastation. // The JVM is probably very ill if an Error is thrown so attempt no recovery. throw error; } catch(RuntimeException runtimeException) { // depends on control dependency: [catch], data = [none] FFDCFilter.processException (runtimeException, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_04, connection.getDiagnostics(true)); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, runtimeException); // We can reasonably try to recover from a runtime exception by invalidating the associated // connection. This should drive the underlying TCP/IP socket to be closed. connection.invalidate(false, runtimeException, "RuntimeException caught in ConnectionWriteCompletedCallback.complete()"); // Don't throw the RuntimeException on as we risk blowing away part of the TCP channel. } // depends on control dependency: [catch], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "complete"); } }
public class class_name { public void marshall(MeshSpec meshSpec, ProtocolMarshaller protocolMarshaller) { if (meshSpec == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(meshSpec.getEgressFilter(), EGRESSFILTER_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(MeshSpec meshSpec, ProtocolMarshaller protocolMarshaller) { if (meshSpec == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(meshSpec.getEgressFilter(), EGRESSFILTER_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 Iterable<UNode> getMemberList() { assert m_type == NodeType.MAP || m_type == NodeType.ARRAY; if (m_children == null) { m_children = new ArrayList<UNode>(); } return m_children; } }
public class class_name { public Iterable<UNode> getMemberList() { assert m_type == NodeType.MAP || m_type == NodeType.ARRAY; if (m_children == null) { m_children = new ArrayList<UNode>(); // depends on control dependency: [if], data = [none] } return m_children; } }
public class class_name { Stream<String> writeMeter(Meter m) { List<Field> fields = new ArrayList<>(); for (Measurement measurement : m.measure()) { double value = measurement.getValue(); if (!Double.isFinite(value)) { continue; } String fieldKey = measurement.getStatistic().getTagValueRepresentation() .replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase(); fields.add(new Field(fieldKey, value)); } if (fields.isEmpty()) { return Stream.empty(); } return Stream.of(influxLineProtocol(m.getId(), "unknown", fields.stream())); } }
public class class_name { Stream<String> writeMeter(Meter m) { List<Field> fields = new ArrayList<>(); for (Measurement measurement : m.measure()) { double value = measurement.getValue(); if (!Double.isFinite(value)) { continue; } String fieldKey = measurement.getStatistic().getTagValueRepresentation() .replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase(); fields.add(new Field(fieldKey, value)); // depends on control dependency: [for], data = [none] } if (fields.isEmpty()) { return Stream.empty(); // depends on control dependency: [if], data = [none] } return Stream.of(influxLineProtocol(m.getId(), "unknown", fields.stream())); } }
public class class_name { @Override protected boolean internalEquals(ValueData another) { if (another instanceof StreamPersistedValueData) { StreamPersistedValueData streamValue = (StreamPersistedValueData)another; if (file != null && file.equals(streamValue.file)) { return true; } else if (tempFile != null && tempFile.equals(streamValue.tempFile)) { return true; } else if (stream != null && stream == streamValue.stream) { return true; } else if (url != null && streamValue.url != null && url.getFile().equals(streamValue.url.getFile())) { return true; } } return false; } }
public class class_name { @Override protected boolean internalEquals(ValueData another) { if (another instanceof StreamPersistedValueData) { StreamPersistedValueData streamValue = (StreamPersistedValueData)another; if (file != null && file.equals(streamValue.file)) { return true; // depends on control dependency: [if], data = [none] } else if (tempFile != null && tempFile.equals(streamValue.tempFile)) { return true; // depends on control dependency: [if], data = [none] } else if (stream != null && stream == streamValue.stream) { return true; // depends on control dependency: [if], data = [none] } else if (url != null && streamValue.url != null && url.getFile().equals(streamValue.url.getFile())) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public void unloadQueue(Response response) { for (Cookie cookie : this.queue) { response.addCookieHeader(cookie.getHTTPHeader()); } } }
public class class_name { public void unloadQueue(Response response) { for (Cookie cookie : this.queue) { response.addCookieHeader(cookie.getHTTPHeader()); // depends on control dependency: [for], data = [cookie] } } }
public class class_name { synchronized protected void commit() { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.entering(CLASS_NAME,"commit","["+this+"] ,_headersWritten -->" + _headersWritten ); } // begin 134537: part 2 // (!isCommitted()) if (!_headersWritten && !isCommitted()) // add check if headersWritten { // end 134537: part 2 addLocaleHeader(); // PQ59244 - disallow content length header if content is encoded // LIBERTY if (containsHeader(HEADER_CONTENT_ENCODING) && containsHeader(HEADER_CONTENT_LENGTH)) { if (keepContentLength){ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME,"commit", "WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header"); } } else{ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"commit", "Content-Length header disallowed w/presence of Content-Encoding header"); } removeHeader(HEADER_CONTENT_LENGTH); } } WebContainer.notifyHttpServletResponseListenersPreHeaderCommit((HttpServletRequest) _connContext.getRequest(), this); String scheme = this.getRequest().getScheme(); if(scheme!=null && scheme.equalsIgnoreCase("https")){ addSTSHeader(); } _response.prepareHeadersForWrite(); // begin 134537: part 3 _headersWritten = true; // end 134537: part 3 if(this._bufferedOut!= null && this._bufferedOut instanceof WCOutputStream){ HttpOutputStreamConnectWeb output = ((WCOutputStream) this._bufferedOut).getOutput(); output.setWebC_headersWritten(true); String remoteUser = _connContext.getRequest().getRemoteUser(); if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME, "commit", "Setting remote user : " + remoteUser); } //Set the remote user to the channel. This will first try to get the security remote user and then fall back on the channel output.setWC_remoteUser(remoteUser); (((WCOutputStream) this._bufferedOut).getOutput()).setWebC_headersWritten(true); } } if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.exiting(CLASS_NAME,"commit"); } } }
public class class_name { synchronized protected void commit() { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.entering(CLASS_NAME,"commit","["+this+"] ,_headersWritten -->" + _headersWritten ); // depends on control dependency: [if], data = [none] } // begin 134537: part 2 // (!isCommitted()) if (!_headersWritten && !isCommitted()) // add check if headersWritten { // end 134537: part 2 addLocaleHeader(); // PQ59244 - disallow content length header if content is encoded // LIBERTY if (containsHeader(HEADER_CONTENT_ENCODING) && containsHeader(HEADER_CONTENT_LENGTH)) { if (keepContentLength){ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME,"commit", "WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header"); // depends on control dependency: [if], data = [none] } } else{ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"commit", "Content-Length header disallowed w/presence of Content-Encoding header"); // depends on control dependency: [if], data = [none] } removeHeader(HEADER_CONTENT_LENGTH); // depends on control dependency: [if], data = [none] } } WebContainer.notifyHttpServletResponseListenersPreHeaderCommit((HttpServletRequest) _connContext.getRequest(), this); String scheme = this.getRequest().getScheme(); if(scheme!=null && scheme.equalsIgnoreCase("https")){ addSTSHeader(); // depends on control dependency: [if], data = [none] } _response.prepareHeadersForWrite(); // begin 134537: part 3 _headersWritten = true; // end 134537: part 3 if(this._bufferedOut!= null && this._bufferedOut instanceof WCOutputStream){ HttpOutputStreamConnectWeb output = ((WCOutputStream) this._bufferedOut).getOutput(); output.setWebC_headersWritten(true); String remoteUser = _connContext.getRequest().getRemoteUser(); if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME, "commit", "Setting remote user : " + remoteUser); } //Set the remote user to the channel. This will first try to get the security remote user and then fall back on the channel output.setWC_remoteUser(remoteUser); (((WCOutputStream) this._bufferedOut).getOutput()).setWebC_headersWritten(true); } } if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.exiting(CLASS_NAME,"commit"); } } }
public class class_name { public String getContainerAuthDataID() { String authDataID = null; lock.readLock().lock(); try { if (containerAuthDataRef != null) { authDataID = (String) containerAuthDataRef.getProperty(ID); if (authDataID == null || DEFAULT_PATTERN.matcher(authDataID).matches() || DEFAULT_NESTED_PATTERN.matcher(authDataID).matches()) { authDataID = (String) containerAuthDataRef.getProperty("config.displayId"); } } } finally { lock.readLock().unlock(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "default container auth data", authDataID); return authDataID; } }
public class class_name { public String getContainerAuthDataID() { String authDataID = null; lock.readLock().lock(); try { if (containerAuthDataRef != null) { authDataID = (String) containerAuthDataRef.getProperty(ID); // depends on control dependency: [if], data = [none] if (authDataID == null || DEFAULT_PATTERN.matcher(authDataID).matches() || DEFAULT_NESTED_PATTERN.matcher(authDataID).matches()) { authDataID = (String) containerAuthDataRef.getProperty("config.displayId"); // depends on control dependency: [if], data = [none] } } } finally { lock.readLock().unlock(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "default container auth data", authDataID); return authDataID; } }
public class class_name { private boolean loginMissingToken(NextFilter nextFilter, IoSession session, HttpRequestMessage httpRequest, AuthenticationToken authToken, TypedCallbackHandlerMap additionalCallbacks, HttpRealmInfo[] realms, int realmIndex, LoginContext[] loginContexts) { HttpRealmInfo realm = realms[realmIndex]; // We build a LoginContext here and call login() so that login // modules have a chance to any challenge parameters to the initial // challenge (KG-2191). ResultAwareLoginContext loginContext = null; try { LoginContextFactory loginContextFactory = realm.getLoginContextFactory(); TypedCallbackHandlerMap callbackHandlerMap = new TypedCallbackHandlerMap(); registerCallbacks(session, httpRequest, authToken, callbackHandlerMap); callbackHandlerMap.putAll(additionalCallbacks); loginContext = (ResultAwareLoginContext) loginContextFactory.createLoginContext(callbackHandlerMap); if (loginContext == null) { throw new LoginException("Login failed; cannot create a login context for authentication token '" + authToken + "\'."); } if (loggerEnabled()) { log("Login module login required; [%s].", authToken); } loginContext.login(); } catch (LoginException le) { // Depending on the login modules configured, this could be // a very normal condition. if (loggerEnabled()) { // Ignore the common "all modules ignored case", it just gums // up the logs whilst adding no value. if (le.getMessage() != null && !le.getMessage().contains("all modules ignored")) { log("Login failed: " + le.getMessage(), le); } } if (loginContext == null) { // This can happen if the given authentication token is // not one that we support. And if that is the case, then // we will never able to handle the token, so return // 403 now. writeResponse(HttpStatus.CLIENT_FORBIDDEN, nextFilter, session, httpRequest); return false; } } catch (Exception e) { if (loggerEnabled()) { log("Login failed.", e); } writeResponse(HttpStatus.CLIENT_FORBIDDEN, nextFilter, session, httpRequest); return false; } DefaultLoginResult loginResult = loginContext.getLoginResult(); String challenge = sendChallengeResponse(nextFilter, session, httpRequest, loginResult, realms, realmIndex, loginContexts); if (loggerEnabled()) { log(String.format("No authentication token was provided. Issuing an authentication challenge '%s'.", challenge)); } // No matter what happens, we know that the roles currently present // are not sufficient for logging in, so return false. ResourceAddress localAddress = LOCAL_ADDRESS.get(session); String nextProtocol = localAddress.getOption(NEXT_PROTOCOL); if ("http/1.1".equals(nextProtocol)) { HttpMergeRequestFilter.INITIAL_HTTP_REQUEST_KEY.remove(session); } return false; } }
public class class_name { private boolean loginMissingToken(NextFilter nextFilter, IoSession session, HttpRequestMessage httpRequest, AuthenticationToken authToken, TypedCallbackHandlerMap additionalCallbacks, HttpRealmInfo[] realms, int realmIndex, LoginContext[] loginContexts) { HttpRealmInfo realm = realms[realmIndex]; // We build a LoginContext here and call login() so that login // modules have a chance to any challenge parameters to the initial // challenge (KG-2191). ResultAwareLoginContext loginContext = null; try { LoginContextFactory loginContextFactory = realm.getLoginContextFactory(); TypedCallbackHandlerMap callbackHandlerMap = new TypedCallbackHandlerMap(); registerCallbacks(session, httpRequest, authToken, callbackHandlerMap); // depends on control dependency: [try], data = [none] callbackHandlerMap.putAll(additionalCallbacks); // depends on control dependency: [try], data = [none] loginContext = (ResultAwareLoginContext) loginContextFactory.createLoginContext(callbackHandlerMap); // depends on control dependency: [try], data = [none] if (loginContext == null) { throw new LoginException("Login failed; cannot create a login context for authentication token '" + authToken + "\'."); } if (loggerEnabled()) { log("Login module login required; [%s].", authToken); // depends on control dependency: [if], data = [none] } loginContext.login(); // depends on control dependency: [try], data = [none] } catch (LoginException le) { // Depending on the login modules configured, this could be // a very normal condition. if (loggerEnabled()) { // Ignore the common "all modules ignored case", it just gums // up the logs whilst adding no value. if (le.getMessage() != null && !le.getMessage().contains("all modules ignored")) { log("Login failed: " + le.getMessage(), le); // depends on control dependency: [if], data = [none] } } if (loginContext == null) { // This can happen if the given authentication token is // not one that we support. And if that is the case, then // we will never able to handle the token, so return // 403 now. writeResponse(HttpStatus.CLIENT_FORBIDDEN, nextFilter, session, httpRequest); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } catch (Exception e) { // depends on control dependency: [catch], data = [none] if (loggerEnabled()) { log("Login failed.", e); // depends on control dependency: [if], data = [none] } writeResponse(HttpStatus.CLIENT_FORBIDDEN, nextFilter, session, httpRequest); return false; } // depends on control dependency: [catch], data = [none] DefaultLoginResult loginResult = loginContext.getLoginResult(); String challenge = sendChallengeResponse(nextFilter, session, httpRequest, loginResult, realms, realmIndex, loginContexts); if (loggerEnabled()) { log(String.format("No authentication token was provided. Issuing an authentication challenge '%s'.", challenge)); // depends on control dependency: [if], data = [none] } // No matter what happens, we know that the roles currently present // are not sufficient for logging in, so return false. ResourceAddress localAddress = LOCAL_ADDRESS.get(session); String nextProtocol = localAddress.getOption(NEXT_PROTOCOL); if ("http/1.1".equals(nextProtocol)) { HttpMergeRequestFilter.INITIAL_HTTP_REQUEST_KEY.remove(session); // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public static String messageAliasImportLine(CmsAliasImportResult result) { if ((result.getAliasPath() == null) || (result.getTargetPath() == null)) { return result.getLine(); } else { return Messages.get().key( Messages.GUI_ALIASES_IMPORT_LINE_2, result.getAliasPath(), result.getTargetPath()); } } }
public class class_name { public static String messageAliasImportLine(CmsAliasImportResult result) { if ((result.getAliasPath() == null) || (result.getTargetPath() == null)) { return result.getLine(); // depends on control dependency: [if], data = [none] } else { return Messages.get().key( Messages.GUI_ALIASES_IMPORT_LINE_2, result.getAliasPath(), result.getTargetPath()); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public T deserialize(byte[] message) { if (dis != null) { dis.setBuffer(message); } else { dis = new DataInputDeserializer(message); } try { return serializer.deserialize(dis); } catch (IOException e) { throw new RuntimeException("Unable to deserialize message", e); } } }
public class class_name { @Override public T deserialize(byte[] message) { if (dis != null) { dis.setBuffer(message); // depends on control dependency: [if], data = [none] } else { dis = new DataInputDeserializer(message); // depends on control dependency: [if], data = [none] } try { return serializer.deserialize(dis); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new RuntimeException("Unable to deserialize message", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private synchronized long nextId(boolean isPadding, long busId) { long timestamp = timeGen(); long paddingnum = regionId; if (isPadding) { paddingnum = busId; } if (timestamp < lastTimestamp) { try { throw new Exception("Clock moved backwards. Refusing to generate id for " + (lastTimestamp - timestamp) + " milliseconds"); } catch (Exception e) { e.printStackTrace(); } } //如果上次生成时间和当前时间相同,在同一毫秒内 if (lastTimestamp == timestamp) { //sequence自增,因为sequence只有10bit,所以和sequenceMask相与一下,去掉高位 sequence = (sequence + 1) & sequenceMask; //判断是否溢出,也就是每毫秒内超过1024,当为1024时,与sequenceMask相与,sequence就等于0 if (sequence == 0) { //自旋等待到下一毫秒 timestamp = tailNextMillis(lastTimestamp); } } else { // 如果和上次生成时间不同,重置sequence,就是下一毫秒开始,sequence计数重新从0开始累加, // 为了保证尾数随机性更大一些,最后一位设置一个随机数 sequence = new SecureRandom().nextInt(10); } lastTimestamp = timestamp; return ((timestamp - twepoch) << timestampLeftShift) | (paddingnum << regionIdShift) | (workerId << workerIdShift) | sequence; } }
public class class_name { private synchronized long nextId(boolean isPadding, long busId) { long timestamp = timeGen(); long paddingnum = regionId; if (isPadding) { paddingnum = busId; // depends on control dependency: [if], data = [none] } if (timestamp < lastTimestamp) { try { throw new Exception("Clock moved backwards. Refusing to generate id for " + (lastTimestamp - timestamp) + " milliseconds"); } catch (Exception e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } //如果上次生成时间和当前时间相同,在同一毫秒内 if (lastTimestamp == timestamp) { //sequence自增,因为sequence只有10bit,所以和sequenceMask相与一下,去掉高位 sequence = (sequence + 1) & sequenceMask; // depends on control dependency: [if], data = [none] //判断是否溢出,也就是每毫秒内超过1024,当为1024时,与sequenceMask相与,sequence就等于0 if (sequence == 0) { //自旋等待到下一毫秒 timestamp = tailNextMillis(lastTimestamp); // depends on control dependency: [if], data = [none] } } else { // 如果和上次生成时间不同,重置sequence,就是下一毫秒开始,sequence计数重新从0开始累加, // 为了保证尾数随机性更大一些,最后一位设置一个随机数 sequence = new SecureRandom().nextInt(10); // depends on control dependency: [if], data = [none] } lastTimestamp = timestamp; return ((timestamp - twepoch) << timestampLeftShift) | (paddingnum << regionIdShift) | (workerId << workerIdShift) | sequence; } }
public class class_name { private void addParent(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) { MavenProject parent = project.getParent(); if (parent != null) { MavenProjectDescriptor parentDescriptor = resolveProject(parent, MavenProjectDescriptor.class, scannerContext); projectDescriptor.setParent(parentDescriptor); } } }
public class class_name { private void addParent(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) { MavenProject parent = project.getParent(); if (parent != null) { MavenProjectDescriptor parentDescriptor = resolveProject(parent, MavenProjectDescriptor.class, scannerContext); projectDescriptor.setParent(parentDescriptor); // depends on control dependency: [if], data = [(parent] } } }
public class class_name { public static boolean isValidCSS (@Nonnull final IReadableResource aRes, @Nonnull final Charset aFallbackCharset, @Nonnull final ECSSVersion eVersion) { ValueEnforcer.notNull (aRes, "Resource"); ValueEnforcer.notNull (aFallbackCharset, "FallbackCharset"); ValueEnforcer.notNull (eVersion, "Version"); final Reader aReader = aRes.getReader (aFallbackCharset); if (aReader == null) { LOGGER.warn ("Failed to open CSS reader " + aRes); return false; } return isValidCSS (aReader, eVersion); } }
public class class_name { public static boolean isValidCSS (@Nonnull final IReadableResource aRes, @Nonnull final Charset aFallbackCharset, @Nonnull final ECSSVersion eVersion) { ValueEnforcer.notNull (aRes, "Resource"); ValueEnforcer.notNull (aFallbackCharset, "FallbackCharset"); ValueEnforcer.notNull (eVersion, "Version"); final Reader aReader = aRes.getReader (aFallbackCharset); if (aReader == null) { LOGGER.warn ("Failed to open CSS reader " + aRes); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } return isValidCSS (aReader, eVersion); } }
public class class_name { @Override public EClass getIfcTransportElementType() { if (ifcTransportElementTypeEClass == null) { ifcTransportElementTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(731); } return ifcTransportElementTypeEClass; } }
public class class_name { @Override public EClass getIfcTransportElementType() { if (ifcTransportElementTypeEClass == null) { ifcTransportElementTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(731); // depends on control dependency: [if], data = [none] } return ifcTransportElementTypeEClass; } }
public class class_name { public void copyToClipboard(final int rowIndex, final int colIndex, final int width, final int height) { final StringBuilder sb = new StringBuilder(); if (rowIndex == 0 && colIndex == 0 && width == getColumnCount() && height == getRowCount()) { for (int i = 0; i < width; i++) { sb.append(getColumnName(i)); if (i < height - 1) { sb.append("\t"); } } sb.append("\n"); } for (int row = rowIndex; row < rowIndex + height; row++) { for (int col = colIndex; col < colIndex + width; col++) { Object value = getValueAt(row, col); if (value == null) { value = ""; } else if (value instanceof JComponent) { value = WidgetUtils.extractText((JComponent) value); } sb.append(value); sb.append("\t"); } sb.deleteCharAt(sb.length() - 1); sb.append("\n"); } final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); final StringSelection stsel = new StringSelection(sb.toString()); clipboard.setContents(stsel, stsel); } }
public class class_name { public void copyToClipboard(final int rowIndex, final int colIndex, final int width, final int height) { final StringBuilder sb = new StringBuilder(); if (rowIndex == 0 && colIndex == 0 && width == getColumnCount() && height == getRowCount()) { for (int i = 0; i < width; i++) { sb.append(getColumnName(i)); // depends on control dependency: [for], data = [i] if (i < height - 1) { sb.append("\t"); // depends on control dependency: [if], data = [none] } } sb.append("\n"); // depends on control dependency: [if], data = [none] } for (int row = rowIndex; row < rowIndex + height; row++) { for (int col = colIndex; col < colIndex + width; col++) { Object value = getValueAt(row, col); if (value == null) { value = ""; // depends on control dependency: [if], data = [none] } else if (value instanceof JComponent) { value = WidgetUtils.extractText((JComponent) value); // depends on control dependency: [if], data = [none] } sb.append(value); // depends on control dependency: [for], data = [none] sb.append("\t"); // depends on control dependency: [for], data = [none] } sb.deleteCharAt(sb.length() - 1); // depends on control dependency: [for], data = [none] sb.append("\n"); // depends on control dependency: [for], data = [none] } final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); final StringSelection stsel = new StringSelection(sb.toString()); clipboard.setContents(stsel, stsel); } }
public class class_name { public static void stringify(Node root, byte[] expression, StringBuilder out) { if (root.type == NodeType.TERM) { out.append(new String(expression, root.start, root.end - root.start, Constants.UTF8)); } else { String sep = ""; for (Node c : root.children) { out.append(sep); boolean parens = (c.type != NodeType.TERM && root.type != c.type); if (parens) out.append("("); stringify(c, expression, out); if (parens) out.append(")"); sep = root.type == NodeType.AND ? "&" : "|"; } } } }
public class class_name { public static void stringify(Node root, byte[] expression, StringBuilder out) { if (root.type == NodeType.TERM) { out.append(new String(expression, root.start, root.end - root.start, Constants.UTF8)); // depends on control dependency: [if], data = [none] } else { String sep = ""; for (Node c : root.children) { out.append(sep); // depends on control dependency: [for], data = [none] boolean parens = (c.type != NodeType.TERM && root.type != c.type); if (parens) out.append("("); stringify(c, expression, out); // depends on control dependency: [for], data = [c] if (parens) out.append(")"); sep = root.type == NodeType.AND ? "&" : "|"; // depends on control dependency: [for], data = [none] } } } }
public class class_name { @Override public void getMentions() { getDispatcher().invokeLater(new AsyncTask(MENTIONS_TIMELINE, listeners) { @Override public void invoke(List<TwitterListener> listeners) throws TwitterException { ResponseList<Status> statuses = twitter.getMentionsTimeline(); for (TwitterListener listener : listeners) { try { listener.gotMentions(statuses); } catch (Exception e) { logger.warn("Exception at getMentions", e); } } } }); } }
public class class_name { @Override public void getMentions() { getDispatcher().invokeLater(new AsyncTask(MENTIONS_TIMELINE, listeners) { @Override public void invoke(List<TwitterListener> listeners) throws TwitterException { ResponseList<Status> statuses = twitter.getMentionsTimeline(); for (TwitterListener listener : listeners) { try { listener.gotMentions(statuses); // depends on control dependency: [try], data = [none] } catch (Exception e) { logger.warn("Exception at getMentions", e); } // depends on control dependency: [catch], data = [none] } } }); } }
public class class_name { private static Object matchOrReplace(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, RegExpImpl reImpl, GlobData data, NativeRegExp re) { String str = data.str; data.global = (re.getFlags() & NativeRegExp.JSREG_GLOB) != 0; int[] indexp = { 0 }; Object result = null; if (data.mode == RA_SEARCH) { result = re.executeRegExp(cx, scope, reImpl, str, indexp, NativeRegExp.TEST); if (result != null && result.equals(Boolean.TRUE)) result = Integer.valueOf(reImpl.leftContext.length); else result = Integer.valueOf(-1); } else if (data.global) { re.lastIndex = 0d; for (int count = 0; indexp[0] <= str.length(); count++) { result = re.executeRegExp(cx, scope, reImpl, str, indexp, NativeRegExp.TEST); if (result == null || !result.equals(Boolean.TRUE)) break; if (data.mode == RA_MATCH) { match_glob(data, cx, scope, count, reImpl); } else { if (data.mode != RA_REPLACE) Kit.codeBug(); SubString lastMatch = reImpl.lastMatch; int leftIndex = data.leftIndex; int leftlen = lastMatch.index - leftIndex; data.leftIndex = lastMatch.index + lastMatch.length; replace_glob(data, cx, scope, reImpl, leftIndex, leftlen); } if (reImpl.lastMatch.length == 0) { if (indexp[0] == str.length()) break; indexp[0]++; } } } else { result = re.executeRegExp(cx, scope, reImpl, str, indexp, ((data.mode == RA_REPLACE) ? NativeRegExp.TEST : NativeRegExp.MATCH)); } return result; } }
public class class_name { private static Object matchOrReplace(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, RegExpImpl reImpl, GlobData data, NativeRegExp re) { String str = data.str; data.global = (re.getFlags() & NativeRegExp.JSREG_GLOB) != 0; int[] indexp = { 0 }; Object result = null; if (data.mode == RA_SEARCH) { result = re.executeRegExp(cx, scope, reImpl, str, indexp, NativeRegExp.TEST); // depends on control dependency: [if], data = [none] if (result != null && result.equals(Boolean.TRUE)) result = Integer.valueOf(reImpl.leftContext.length); else result = Integer.valueOf(-1); } else if (data.global) { re.lastIndex = 0d; // depends on control dependency: [if], data = [none] for (int count = 0; indexp[0] <= str.length(); count++) { result = re.executeRegExp(cx, scope, reImpl, str, indexp, NativeRegExp.TEST); // depends on control dependency: [for], data = [none] if (result == null || !result.equals(Boolean.TRUE)) break; if (data.mode == RA_MATCH) { match_glob(data, cx, scope, count, reImpl); // depends on control dependency: [if], data = [none] } else { if (data.mode != RA_REPLACE) Kit.codeBug(); SubString lastMatch = reImpl.lastMatch; int leftIndex = data.leftIndex; int leftlen = lastMatch.index - leftIndex; data.leftIndex = lastMatch.index + lastMatch.length; // depends on control dependency: [if], data = [none] replace_glob(data, cx, scope, reImpl, leftIndex, leftlen); // depends on control dependency: [if], data = [none] } if (reImpl.lastMatch.length == 0) { if (indexp[0] == str.length()) break; indexp[0]++; // depends on control dependency: [if], data = [none] } } } else { result = re.executeRegExp(cx, scope, reImpl, str, indexp, ((data.mode == RA_REPLACE) ? NativeRegExp.TEST : NativeRegExp.MATCH)); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { public final synchronized void insertLinkBefore(Link insertLink, Link followingLink) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry( this, tc, "insertLinkBefore", new long[] { insertLink.getSequence(), followingLink.getSequence()}); } Link prev = followingLink._getPreviousLink(); insertLink._link(prev, followingLink, this); prev._setNextLink(insertLink); followingLink._setPreviousLink(insertLink); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(this, tc, "insertLinkBefore", _debugString()); } } }
public class class_name { public final synchronized void insertLinkBefore(Link insertLink, Link followingLink) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry( this, tc, "insertLinkBefore", new long[] { insertLink.getSequence(), followingLink.getSequence()}); // depends on control dependency: [if], data = [none] } Link prev = followingLink._getPreviousLink(); insertLink._link(prev, followingLink, this); prev._setNextLink(insertLink); followingLink._setPreviousLink(insertLink); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(this, tc, "insertLinkBefore", _debugString()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(Permission permission, ProtocolMarshaller protocolMarshaller) { if (permission == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(permission.getStackId(), STACKID_BINDING); protocolMarshaller.marshall(permission.getIamUserArn(), IAMUSERARN_BINDING); protocolMarshaller.marshall(permission.getAllowSsh(), ALLOWSSH_BINDING); protocolMarshaller.marshall(permission.getAllowSudo(), ALLOWSUDO_BINDING); protocolMarshaller.marshall(permission.getLevel(), LEVEL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(Permission permission, ProtocolMarshaller protocolMarshaller) { if (permission == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(permission.getStackId(), STACKID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(permission.getIamUserArn(), IAMUSERARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(permission.getAllowSsh(), ALLOWSSH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(permission.getAllowSudo(), ALLOWSUDO_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(permission.getLevel(), LEVEL_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static JRDesignGroup getJRDesignGroup(DynamicJasperDesign jd, LayoutManager layoutManager, DJGroup group) { Map references = layoutManager.getReferencesMap(); for (Object o : references.keySet()) { String groupName = (String) o; DJGroup djGroup = (DJGroup) references.get(groupName); if (group == djGroup) { return (JRDesignGroup) jd.getGroupsMap().get(groupName); } } return null; } }
public class class_name { public static JRDesignGroup getJRDesignGroup(DynamicJasperDesign jd, LayoutManager layoutManager, DJGroup group) { Map references = layoutManager.getReferencesMap(); for (Object o : references.keySet()) { String groupName = (String) o; DJGroup djGroup = (DJGroup) references.get(groupName); if (group == djGroup) { return (JRDesignGroup) jd.getGroupsMap().get(groupName); // depends on control dependency: [if], data = [(group] } } return null; } }
public class class_name { @SuppressWarnings("unchecked") public static <T> NFAFactory<T> compileFactory( final Pattern<T, ?> pattern, boolean timeoutHandling) { if (pattern == null) { // return a factory for empty NFAs return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling); } else { final NFAFactoryCompiler<T> nfaFactoryCompiler = new NFAFactoryCompiler<>(pattern); nfaFactoryCompiler.compileFactory(); return new NFAFactoryImpl<>(nfaFactoryCompiler.getWindowTime(), nfaFactoryCompiler.getStates(), timeoutHandling); } } }
public class class_name { @SuppressWarnings("unchecked") public static <T> NFAFactory<T> compileFactory( final Pattern<T, ?> pattern, boolean timeoutHandling) { if (pattern == null) { // return a factory for empty NFAs return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling); // depends on control dependency: [if], data = [none] } else { final NFAFactoryCompiler<T> nfaFactoryCompiler = new NFAFactoryCompiler<>(pattern); nfaFactoryCompiler.compileFactory(); // depends on control dependency: [if], data = [none] return new NFAFactoryImpl<>(nfaFactoryCompiler.getWindowTime(), nfaFactoryCompiler.getStates(), timeoutHandling); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void groovyExpression(Reader reader, StringWriter sw) throws IOException { sw.write("${"); int c; while ((c = reader.read()) != -1) { if (c == '%') { c = reader.read(); if (c != '>') { sw.write('%'); } else { break; } } if (c != '\n' && c != '\r') { sw.write(c); } } sw.write("}"); } }
public class class_name { private void groovyExpression(Reader reader, StringWriter sw) throws IOException { sw.write("${"); int c; while ((c = reader.read()) != -1) { if (c == '%') { c = reader.read(); // depends on control dependency: [if], data = [none] if (c != '>') { sw.write('%'); // depends on control dependency: [if], data = [none] } else { break; } } if (c != '\n' && c != '\r') { sw.write(c); // depends on control dependency: [if], data = [(c] } } sw.write("}"); } }
public class class_name { @Override public EClass getIfcCShapeProfileDef() { if (ifcCShapeProfileDefEClass == null) { ifcCShapeProfileDefEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(68); } return ifcCShapeProfileDefEClass; } }
public class class_name { @Override public EClass getIfcCShapeProfileDef() { if (ifcCShapeProfileDefEClass == null) { ifcCShapeProfileDefEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(68); // depends on control dependency: [if], data = [none] } return ifcCShapeProfileDefEClass; } }
public class class_name { public void openCustomTab( final Context context, final CustomTabsIntent customTabsIntent, final Uri uri, CustomTabFallback fallback) { final String packageName = getPackageNameToUse(context); if (packageName != null) { final CustomTabsServiceConnection connection = new CustomTabsServiceConnection() { @Override public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient client) { client.warmup(0L); // This prevents backgrounding after redirection customTabsIntent.intent.setPackage(packageName); customTabsIntent.intent.setData(uri); customTabsIntent.launchUrl(context, uri); } @Override public void onServiceDisconnected(ComponentName name) {} }; CustomTabsClient.bindCustomTabsService(context, packageName, connection); } else if (fallback != null) { fallback.openUri(context, uri); } else { Log.e(UberSdk.UBER_SDK_LOG_TAG, "Use of openCustomTab without Customtab support or a fallback set"); } } }
public class class_name { public void openCustomTab( final Context context, final CustomTabsIntent customTabsIntent, final Uri uri, CustomTabFallback fallback) { final String packageName = getPackageNameToUse(context); if (packageName != null) { final CustomTabsServiceConnection connection = new CustomTabsServiceConnection() { @Override public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient client) { client.warmup(0L); // This prevents backgrounding after redirection customTabsIntent.intent.setPackage(packageName); customTabsIntent.intent.setData(uri); customTabsIntent.launchUrl(context, uri); } @Override public void onServiceDisconnected(ComponentName name) {} }; CustomTabsClient.bindCustomTabsService(context, packageName, connection); // depends on control dependency: [if], data = [none] } else if (fallback != null) { fallback.openUri(context, uri); // depends on control dependency: [if], data = [none] } else { Log.e(UberSdk.UBER_SDK_LOG_TAG, "Use of openCustomTab without Customtab support or a fallback set"); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Map<String, SavedAttachment> findExistingAttachments( Map<String, ? extends Attachment> attachments) { Map<String, SavedAttachment> existingAttachments = new HashMap<String, SavedAttachment>(); for (Map.Entry<String, ? extends Attachment> a : attachments.entrySet()) { if (a instanceof SavedAttachment) { existingAttachments.put(a.getKey(), (SavedAttachment)a.getValue()); } } return existingAttachments; } }
public class class_name { public static Map<String, SavedAttachment> findExistingAttachments( Map<String, ? extends Attachment> attachments) { Map<String, SavedAttachment> existingAttachments = new HashMap<String, SavedAttachment>(); for (Map.Entry<String, ? extends Attachment> a : attachments.entrySet()) { if (a instanceof SavedAttachment) { existingAttachments.put(a.getKey(), (SavedAttachment)a.getValue()); // depends on control dependency: [if], data = [none] } } return existingAttachments; } }
public class class_name { protected boolean isVeraEnabled( boolean quiet ) { if ( vera.getSkip() ) { if ( ! quiet ) { getLog().info( VeraConfiguration.SKIP_MESSAGE + ", 'skip' set to true in the " + VeraConfiguration.TOOL_NAME + " configuration" ); } return false; } if ( vera.getVeraHome() == null ) { if ( ! quiet ) { getLog().info( VeraConfiguration.SKIP_MESSAGE + ", path to " + VeraConfiguration.TOOL_NAME + " home directory not set" ); } return false; } return true; } }
public class class_name { protected boolean isVeraEnabled( boolean quiet ) { if ( vera.getSkip() ) { if ( ! quiet ) { getLog().info( VeraConfiguration.SKIP_MESSAGE + ", 'skip' set to true in the " + VeraConfiguration.TOOL_NAME + " configuration" ); // depends on control dependency: [if], data = [none] } return false; // depends on control dependency: [if], data = [none] } if ( vera.getVeraHome() == null ) { if ( ! quiet ) { getLog().info( VeraConfiguration.SKIP_MESSAGE + ", path to " + VeraConfiguration.TOOL_NAME + " home directory not set" ); // depends on control dependency: [if], data = [none] } return false; // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { public static KeePassDatabase getInstance(File keePassDatabaseFile) { if (keePassDatabaseFile == null) { throw new IllegalArgumentException("You must provide a valid KeePass database file."); } InputStream keePassDatabaseStream = null; try { keePassDatabaseStream = new FileInputStream(keePassDatabaseFile); return getInstance(keePassDatabaseStream); } catch (FileNotFoundException e) { throw new IllegalArgumentException("The KeePass database file could not be found. You must provide a valid KeePass database file.", e); } finally { if (keePassDatabaseStream != null) { try { keePassDatabaseStream.close(); } catch (IOException e) { // Ignore } } } } }
public class class_name { public static KeePassDatabase getInstance(File keePassDatabaseFile) { if (keePassDatabaseFile == null) { throw new IllegalArgumentException("You must provide a valid KeePass database file."); } InputStream keePassDatabaseStream = null; try { keePassDatabaseStream = new FileInputStream(keePassDatabaseFile); // depends on control dependency: [try], data = [none] return getInstance(keePassDatabaseStream); // depends on control dependency: [try], data = [none] } catch (FileNotFoundException e) { throw new IllegalArgumentException("The KeePass database file could not be found. You must provide a valid KeePass database file.", e); } finally { // depends on control dependency: [catch], data = [none] if (keePassDatabaseStream != null) { try { keePassDatabaseStream.close(); // depends on control dependency: [try], data = [none] } catch (IOException e) { // Ignore } // depends on control dependency: [catch], data = [none] } } } }
public class class_name { @Pure public static boolean intersectsSolidSphereSolidAlignedBox( double x1, double y1, double z1, double radius, double bx, double by, double bz, double bsx, double bsy, double bsz) { double dx; if (x1<bx) { dx = bx - x1; } else if (x1>(bx+bsx)) { dx = x1 - (bx+bsx); } else { dx = 0f; } double dy; if (y1<by) { dy = by - y1; } else if (y1>(by+bsy)) { dy = y1 - (by+bsy); } else { dy = 0f; } double dz; if (z1<bz) { dz = bz - z1; } else if (z1>(bz+bsz)) { dz = z1 - (bz+bsz); } else { dz = 0f; } return (dx*dx+dy*dy+dz*dz) < (radius*radius*radius); } }
public class class_name { @Pure public static boolean intersectsSolidSphereSolidAlignedBox( double x1, double y1, double z1, double radius, double bx, double by, double bz, double bsx, double bsy, double bsz) { double dx; if (x1<bx) { dx = bx - x1; // depends on control dependency: [if], data = [none] } else if (x1>(bx+bsx)) { dx = x1 - (bx+bsx); // depends on control dependency: [if], data = [none] } else { dx = 0f; // depends on control dependency: [if], data = [none] } double dy; if (y1<by) { dy = by - y1; // depends on control dependency: [if], data = [none] } else if (y1>(by+bsy)) { dy = y1 - (by+bsy); // depends on control dependency: [if], data = [none] } else { dy = 0f; // depends on control dependency: [if], data = [none] } double dz; if (z1<bz) { dz = bz - z1; // depends on control dependency: [if], data = [none] } else if (z1>(bz+bsz)) { dz = z1 - (bz+bsz); // depends on control dependency: [if], data = [none] } else { dz = 0f; // depends on control dependency: [if], data = [none] } return (dx*dx+dy*dy+dz*dz) < (radius*radius*radius); } }
public class class_name { public static Object invokeNoArgMethod(Object obj, String methodName) { try { return obj.getClass().getMethod(methodName).invoke(obj); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException e) { throw new RateLimiterReflectionException( "Failed to reflect method \"" + methodName + "\" on object: " + obj, e); } catch (InvocationTargetException e) { throw new RateLimiterException( "Failed to invoke method \"" + methodName + "\" on object: " + obj, e); } } }
public class class_name { public static Object invokeNoArgMethod(Object obj, String methodName) { try { return obj.getClass().getMethod(methodName).invoke(obj); // depends on control dependency: [try], data = [none] } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException e) { throw new RateLimiterReflectionException( "Failed to reflect method \"" + methodName + "\" on object: " + obj, e); } catch (InvocationTargetException e) { // depends on control dependency: [catch], data = [none] throw new RateLimiterException( "Failed to invoke method \"" + methodName + "\" on object: " + obj, e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @NotNull public OptionalLong mapToLong(@NotNull DoubleToLongFunction mapper) { if (!isPresent()) { return OptionalLong.empty(); } Objects.requireNonNull(mapper); return OptionalLong.of(mapper.applyAsLong(value)); } }
public class class_name { @NotNull public OptionalLong mapToLong(@NotNull DoubleToLongFunction mapper) { if (!isPresent()) { return OptionalLong.empty(); // depends on control dependency: [if], data = [none] } Objects.requireNonNull(mapper); return OptionalLong.of(mapper.applyAsLong(value)); } }
public class class_name { @Override public void onSuccess(final DMRResponse response) { ModelNode result = response.get(); if (!result.hasDefined(OUTCOME) || result.isFailure()) { onFailedOutcome(result); abort(); } else { onSuccess(result); proceed(); } } }
public class class_name { @Override public void onSuccess(final DMRResponse response) { ModelNode result = response.get(); if (!result.hasDefined(OUTCOME) || result.isFailure()) { onFailedOutcome(result); // depends on control dependency: [if], data = [none] abort(); // depends on control dependency: [if], data = [none] } else { onSuccess(result); // depends on control dependency: [if], data = [none] proceed(); // depends on control dependency: [if], data = [none] } } }
public class class_name { @edu.umd.cs.findbugs.annotations.SuppressWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING") private UserRecord getUserRecord(final String domain, final String userName) throws LoginException { String userId; String credential; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getDatabaseConnection(); statement = connection.prepareStatement(dbProps.get().getSqlUserQuery()); statement.setString(1, domain); statement.setString(2, userName); resultSet = statement.executeQuery(); if (resultSet.next()) { userId = resultSet.getString(1); credential = resultSet.getString(2); } else { final String error = "Username '" + userName + "' does not exist (query returned zero results)"; LOG.warn(error); throw new LoginException(error); } resultSet.close(); statement.close(); } catch (SQLException e) { final String error = "Error executing SQL query"; LOG.warn(error, e); throw Util.newLoginException(error, e); } finally { DbUtil.close(resultSet); DbUtil.close(statement); DbUtil.close(connection); } return new UserRecord(domain, userName, userId, credential); } }
public class class_name { @edu.umd.cs.findbugs.annotations.SuppressWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING") private UserRecord getUserRecord(final String domain, final String userName) throws LoginException { String userId; String credential; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getDatabaseConnection(); statement = connection.prepareStatement(dbProps.get().getSqlUserQuery()); statement.setString(1, domain); statement.setString(2, userName); resultSet = statement.executeQuery(); if (resultSet.next()) { userId = resultSet.getString(1); // depends on control dependency: [if], data = [none] credential = resultSet.getString(2); // depends on control dependency: [if], data = [none] } else { final String error = "Username '" + userName + "' does not exist (query returned zero results)"; // depends on control dependency: [if], data = [none] LOG.warn(error); // depends on control dependency: [if], data = [none] throw new LoginException(error); } resultSet.close(); statement.close(); } catch (SQLException e) { final String error = "Error executing SQL query"; LOG.warn(error, e); throw Util.newLoginException(error, e); } finally { DbUtil.close(resultSet); DbUtil.close(statement); DbUtil.close(connection); } return new UserRecord(domain, userName, userId, credential); } }
public class class_name { public void countItems() { itemCounts = new ItemCounts(); itemCounts.startTime = System.currentTimeMillis(); itemCounts.numDirectories = 1; // count the current directory itemCounts.numFiles = 0; itemCounts.numBlocks = 0; if (children != null) { for (INode child : children) { countItemsRecursively(child); } } itemCounts.finishTime = System.currentTimeMillis(); } }
public class class_name { public void countItems() { itemCounts = new ItemCounts(); itemCounts.startTime = System.currentTimeMillis(); itemCounts.numDirectories = 1; // count the current directory itemCounts.numFiles = 0; itemCounts.numBlocks = 0; if (children != null) { for (INode child : children) { countItemsRecursively(child); // depends on control dependency: [for], data = [child] } } itemCounts.finishTime = System.currentTimeMillis(); } }
public class class_name { private static List<String> buildSegmentedSentences(final BufferedReader breader) { String line; List<String> sentences = new ArrayList<>(); try { while ((line = breader.readLine()) != null) { sentences.add(line); } } catch (final IOException e) { LOG.error("IOException", e); } return sentences; } }
public class class_name { private static List<String> buildSegmentedSentences(final BufferedReader breader) { String line; List<String> sentences = new ArrayList<>(); try { while ((line = breader.readLine()) != null) { sentences.add(line); // depends on control dependency: [while], data = [none] } } catch (final IOException e) { LOG.error("IOException", e); } // depends on control dependency: [catch], data = [none] return sentences; } }
public class class_name { public static boolean isConvergenced(List<KmeansPoint> basePoints, List<KmeansPoint> newPoints, double convergenceThres) { boolean result = true; for (int pointIndex = 0; pointIndex < basePoints.size(); pointIndex++) { double distance = MathUtils.distance(basePoints.get(pointIndex).getDataPoint(), newPoints.get(pointIndex).getDataPoint()); if (distance > convergenceThres) { result = false; break; } } return result; } }
public class class_name { public static boolean isConvergenced(List<KmeansPoint> basePoints, List<KmeansPoint> newPoints, double convergenceThres) { boolean result = true; for (int pointIndex = 0; pointIndex < basePoints.size(); pointIndex++) { double distance = MathUtils.distance(basePoints.get(pointIndex).getDataPoint(), newPoints.get(pointIndex).getDataPoint()); if (distance > convergenceThres) { result = false; // depends on control dependency: [if], data = [none] break; } } return result; } }
public class class_name { private static void compareSets(Delta delta, Collection deltas, LinkedList stack, ID idFetcher) { Set srcSet = (Set) delta.srcValue; Set targetSet = (Set) delta.targetValue; // Create ID to Object map for target Set Map targetIdToValue = new HashMap(); for (Object targetValue : targetSet) { if (targetValue != null && isIdObject(targetValue, idFetcher)) { // Only map non-null target array elements targetIdToValue.put(idFetcher.getId(targetValue), targetValue); } } Map srcIdToValue = new HashMap(); String sysId = "(" + System.identityHashCode(srcSet) + ").remove("; for (Object srcValue : srcSet) { String srcPtr = sysId + System.identityHashCode(srcValue) + ')'; if (isIdObject(srcValue, idFetcher)) { // Only map non-null source array elements Object srcId = idFetcher.getId(srcValue); srcIdToValue.put(srcId, srcValue); if (targetIdToValue.containsKey(srcId)) { // Queue item for deep, field level check as the object is still there (it's fields could have changed). stack.push(new Delta(delta.id, delta.fieldName, srcPtr, srcValue, targetIdToValue.get(srcId), null)); } else { Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, null); removeDelta.setCmd(SET_REMOVE); deltas.add(removeDelta); } } else { if (!targetSet.contains(srcValue)) { Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, null); removeDelta.setCmd(SET_REMOVE); deltas.add(removeDelta); } } } sysId = "(" + System.identityHashCode(targetSet) + ").add("; for (Object targetValue : targetSet) { String srcPtr = sysId + System.identityHashCode(targetValue) + ')'; if (isIdObject(targetValue, idFetcher)) { Object targetId = idFetcher.getId(targetValue); if (!srcIdToValue.containsKey(targetId)) { Delta addDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, targetValue, null); addDelta.setCmd(SET_ADD); deltas.add(addDelta); } } else { if (!srcSet.contains(targetValue)) { Delta addDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, targetValue, null); addDelta.setCmd(SET_ADD); deltas.add(addDelta); } } } // TODO: If LinkedHashSet, may need to issue commands to reorder... } }
public class class_name { private static void compareSets(Delta delta, Collection deltas, LinkedList stack, ID idFetcher) { Set srcSet = (Set) delta.srcValue; Set targetSet = (Set) delta.targetValue; // Create ID to Object map for target Set Map targetIdToValue = new HashMap(); for (Object targetValue : targetSet) { if (targetValue != null && isIdObject(targetValue, idFetcher)) { // Only map non-null target array elements targetIdToValue.put(idFetcher.getId(targetValue), targetValue); // depends on control dependency: [if], data = [(targetValue] } } Map srcIdToValue = new HashMap(); String sysId = "(" + System.identityHashCode(srcSet) + ").remove("; for (Object srcValue : srcSet) { String srcPtr = sysId + System.identityHashCode(srcValue) + ')'; if (isIdObject(srcValue, idFetcher)) { // Only map non-null source array elements Object srcId = idFetcher.getId(srcValue); srcIdToValue.put(srcId, srcValue); // depends on control dependency: [if], data = [none] if (targetIdToValue.containsKey(srcId)) { // Queue item for deep, field level check as the object is still there (it's fields could have changed). stack.push(new Delta(delta.id, delta.fieldName, srcPtr, srcValue, targetIdToValue.get(srcId), null)); // depends on control dependency: [if], data = [none] } else { Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, null); removeDelta.setCmd(SET_REMOVE); // depends on control dependency: [if], data = [none] deltas.add(removeDelta); // depends on control dependency: [if], data = [none] } } else { if (!targetSet.contains(srcValue)) { Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, null); removeDelta.setCmd(SET_REMOVE); // depends on control dependency: [if], data = [none] deltas.add(removeDelta); // depends on control dependency: [if], data = [none] } } } sysId = "(" + System.identityHashCode(targetSet) + ").add("; for (Object targetValue : targetSet) { String srcPtr = sysId + System.identityHashCode(targetValue) + ')'; if (isIdObject(targetValue, idFetcher)) { Object targetId = idFetcher.getId(targetValue); if (!srcIdToValue.containsKey(targetId)) { Delta addDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, targetValue, null); addDelta.setCmd(SET_ADD); // depends on control dependency: [if], data = [none] deltas.add(addDelta); // depends on control dependency: [if], data = [none] } } else { if (!srcSet.contains(targetValue)) { Delta addDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, targetValue, null); addDelta.setCmd(SET_ADD); // depends on control dependency: [if], data = [none] deltas.add(addDelta); // depends on control dependency: [if], data = [none] } } } // TODO: If LinkedHashSet, may need to issue commands to reorder... } }
public class class_name { public boolean processErrors(MessageEmit err) { if (valErrors.size() == 0) { return false; } for (ValError ve: valErrors) { processError(err, ve); } valErrors.clear(); return true; } }
public class class_name { public boolean processErrors(MessageEmit err) { if (valErrors.size() == 0) { return false; // depends on control dependency: [if], data = [none] } for (ValError ve: valErrors) { processError(err, ve); // depends on control dependency: [for], data = [ve] } valErrors.clear(); return true; } }
public class class_name { @Override public T getQueue(QueueSpec spec) { try { T queue = queueInstances.get(spec, new Callable<T>() { @Override public T call() throws Exception { return createAndInitQueue(spec); } }); return queue; } catch (ExecutionException e) { throw new RuntimeException(e); } } }
public class class_name { @Override public T getQueue(QueueSpec spec) { try { T queue = queueInstances.get(spec, new Callable<T>() { @Override public T call() throws Exception { return createAndInitQueue(spec); } }); return queue; // depends on control dependency: [try], data = [none] } catch (ExecutionException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void cleanup() { if (operation instanceof Command && log.isOpen()) { try { log.release(index); } catch (IllegalStateException e) { } } session.release(); index = 0; session = null; instant = null; operation = null; pool.release(this); } }
public class class_name { private void cleanup() { if (operation instanceof Command && log.isOpen()) { try { log.release(index); // depends on control dependency: [try], data = [none] } catch (IllegalStateException e) { } // depends on control dependency: [catch], data = [none] } session.release(); index = 0; session = null; instant = null; operation = null; pool.release(this); } }
public class class_name { public int handleUpdateFunctions(BasicDBObject query, BasicDBObject update, String collName) { DBCollection collection = mongoDb.getCollection(collName); KunderaCoreUtils.printQuery("Update collection:" + query, showQuery); WriteResult result = null; try { result = collection.update(query, update); } catch (MongoException ex) { return -1; } if (result.getN() <= 0) return -1; return result.getN(); } }
public class class_name { public int handleUpdateFunctions(BasicDBObject query, BasicDBObject update, String collName) { DBCollection collection = mongoDb.getCollection(collName); KunderaCoreUtils.printQuery("Update collection:" + query, showQuery); WriteResult result = null; try { result = collection.update(query, update); // depends on control dependency: [try], data = [none] } catch (MongoException ex) { return -1; } // depends on control dependency: [catch], data = [none] if (result.getN() <= 0) return -1; return result.getN(); } }
public class class_name { public static String getDigAlgFromSigAlg(String signatureAlgorithm) { signatureAlgorithm = signatureAlgorithm.toUpperCase(Locale.ENGLISH); int with = signatureAlgorithm.indexOf("WITH"); if (with > 0) { return signatureAlgorithm.substring(0, with); } return null; } }
public class class_name { public static String getDigAlgFromSigAlg(String signatureAlgorithm) { signatureAlgorithm = signatureAlgorithm.toUpperCase(Locale.ENGLISH); int with = signatureAlgorithm.indexOf("WITH"); if (with > 0) { return signatureAlgorithm.substring(0, with); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public JBBPOut Skip(int numberOfBytes) throws IOException { assertNotEnded(); if (this.processCommands) { if (numberOfBytes < 0) { throw new IllegalArgumentException("Value is negative"); } this.Align(); while (numberOfBytes > 0) { this.outStream.write(0); numberOfBytes--; } } return this; } }
public class class_name { public JBBPOut Skip(int numberOfBytes) throws IOException { assertNotEnded(); if (this.processCommands) { if (numberOfBytes < 0) { throw new IllegalArgumentException("Value is negative"); } this.Align(); while (numberOfBytes > 0) { this.outStream.write(0); // depends on control dependency: [while], data = [0)] numberOfBytes--; // depends on control dependency: [while], data = [none] } } return this; } }
public class class_name { public ContainerDefinition withCommand(String... command) { if (this.command == null) { setCommand(new com.amazonaws.internal.SdkInternalList<String>(command.length)); } for (String ele : command) { this.command.add(ele); } return this; } }
public class class_name { public ContainerDefinition withCommand(String... command) { if (this.command == null) { setCommand(new com.amazonaws.internal.SdkInternalList<String>(command.length)); // depends on control dependency: [if], data = [none] } for (String ele : command) { this.command.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private String escapeValue(String str, boolean escapeSpace) { int len = str.length(); int bufLen = len * 2; if (bufLen < 0) { bufLen = Integer.MAX_VALUE; } StringBuilder outBuffer = new StringBuilder(bufLen); for(int x=0; x<len; x++) { char aChar = str.charAt(x); // Handle common case first, selecting largest block that // avoids the specials below if ((aChar > 61) && (aChar < 127)) { if (aChar == '\\') { outBuffer.append('\\'); outBuffer.append('\\'); continue; } outBuffer.append(aChar); continue; } switch(aChar) { case ' ': if (x == 0 || escapeSpace) outBuffer.append('\\'); outBuffer.append(' '); break; case '\t':outBuffer.append('\\'); outBuffer.append('t'); break; case '\n':outBuffer.append('\\'); outBuffer.append('n'); break; case '\r':outBuffer.append('\\'); outBuffer.append('r'); break; case '\f':outBuffer.append('\\'); outBuffer.append('f'); break; case '=': // Fall through case ':': // Fall through case '#': // Fall through case '!': outBuffer.append('\\'); outBuffer.append(aChar); break; default: outBuffer.append(aChar); } } return outBuffer.toString(); } }
public class class_name { private String escapeValue(String str, boolean escapeSpace) { int len = str.length(); int bufLen = len * 2; if (bufLen < 0) { bufLen = Integer.MAX_VALUE; // depends on control dependency: [if], data = [none] } StringBuilder outBuffer = new StringBuilder(bufLen); for(int x=0; x<len; x++) { char aChar = str.charAt(x); // Handle common case first, selecting largest block that // avoids the specials below if ((aChar > 61) && (aChar < 127)) { if (aChar == '\\') { outBuffer.append('\\'); outBuffer.append('\\'); // depends on control dependency: [if], data = ['\\')] // depends on control dependency: [if], data = ['\\')] continue; } outBuffer.append(aChar); // depends on control dependency: [if], data = [none] continue; } switch(aChar) { case ' ': if (x == 0 || escapeSpace) outBuffer.append('\\'); outBuffer.append(' '); break; case '\t':outBuffer.append('\\'); outBuffer.append('t'); break; case '\n':outBuffer.append('\\'); outBuffer.append('n'); break; case '\r':outBuffer.append('\\'); outBuffer.append('r'); break; case '\f':outBuffer.append('\\'); outBuffer.append('f'); break; case '=': // Fall through case ':': // Fall through case '#': // Fall through case '!': outBuffer.append('\\'); outBuffer.append(aChar); break; default: outBuffer.append(aChar); } } return outBuffer.toString(); } }
public class class_name { private void performCheckpoint(boolean persistentTransactions) throws ObjectManagerException { final String methodName = "performCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Boolean(persistentTransactions)); if (gatherStatistics) { long now = System.currentTimeMillis(); waitingBetweenCheckpointsMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). // Recover and complete Orphan transactions. completeOrphanTransactions(); long logSequenceNumber = 0; if (persistentTransactions) { // Mark the point in the log that we can truncate to once checkpoint is complete, // then write start of checkpoint to the log. This makes sure that the CheckpointStart is recovered first, // which ensures that all of the ObjectStores are known at startup. CheckpointStartLogRecord checkpointStartLogRecord = new CheckpointStartLogRecord(this); // We don't release the reserved space for the Checkpoint log records as // we will need to re-reserve it after the checkpoint has completed. Instead we just // suppress the check on the log space because we reserved the space for the // checkpoint start and end records earlier. // Updates to QueueManagerState must be recorded in the log before we // flush the ObjectStores, otherwise we risk having named objects in the stores // which are not known in the ObjectManager. logSequenceNumber = logOutput.markAndWriteNext(checkpointStartLogRecord, 0, false, // Do not check the log space, we reserved it earlier. true); if (gatherStatistics) { long now = System.currentTimeMillis(); flushingCheckpointStartMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). checkpointStarting = CHECKPOINT_STARTING_PERSISTENT; // Mark all active transactions as requiring a checkpoint. for (java.util.Iterator registeredTransactionIterator = registeredInternalTransactions.values().iterator(); registeredTransactionIterator.hasNext();) { InternalTransaction registeredTransaction = (InternalTransaction) (registeredTransactionIterator.next()); // The registered transaction might be null if it was removed from the map after // we built the iterator. See ConcurrentHashMap and java.util.Map.Entry.getValue(). if (registeredTransaction != null) registeredTransaction.setRequiresCheckpoint(); } // for registeredInternalTransactions. } else { checkpointStarting = CHECKPOINT_STARTING_NONPERSISTENT; } // if (persistentTransactions). // From now on, new transactions write to the following checkpoint in the file store. checkpointStarting = CHECKPOINT_STARTING_NO; // -------------------------------------------------------------------------------------------- // Pause so that: // 1) In flight persistent transactions might complete, avoiding the need to write a checkpoint // record for them. // 2) Objects in the checkpoint set which will be written to the Object Store might get deleted // avoiding the need to write them. // -------------------------------------------------------------------------------------------- Object lock = new Object(); synchronized (lock) { try { if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, methodName, new Object[] { "wait:867", new Integer(checkpointDelay) }); lock.wait(checkpointDelay); // Let some transactions complete. } catch (InterruptedException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:877:1.62"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw new UnexpectedExceptionException(this, exception); } // catch (InterruptedException exception). } // synchronized (lock). if (gatherStatistics) { long now = System.currentTimeMillis(); pausedDuringCheckpointMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). // Now that the log is forced tell the active transactions they can safely update the ObjectStores // on the assumption that their logRecords prior to logSequenceNumber have been forced to disk. // The Transactions take their checkpoint on the assumption that the ObjectStores contain their // ManagedObjects. The Object Stores have not been forced yet but the log has, // so this is a safe assumption. long transactionsRequiringCheckpoint = 0; for (java.util.Iterator registeredTransactionIterator = registeredInternalTransactions.values() .iterator(); registeredTransactionIterator.hasNext();) { InternalTransaction registeredTransaction = (InternalTransaction) (registeredTransactionIterator.next()); // The registered transaction might be null if it was removed from the map after // we built the iterator. See ConcurrentHashMap and java.util.Map.Entry.getValue(). // Checkpoint only transactions that have not cleared their reqiuirement for a checkpoint. if (registeredTransaction != null && registeredTransaction.requiresPersistentCheckpoint) { registeredTransaction.checkpoint(logSequenceNumber); transactionsRequiringCheckpoint++; } // if ... registeredTransaction.requiresCheckpoint. } // for registeredInternalTransactions. if (gatherStatistics) { totalTransactionsRequiringCheckpoint = totalTransactionsRequiringCheckpoint + transactionsRequiringCheckpoint; maximumTransactionsInAnyCheckpoint = Math.max(transactionsRequiringCheckpoint, maximumTransactionsInAnyCheckpoint); } // if (gatherStatistics). // Flush ObjectStores to disk. // Loop over a copy of the store collection, in case a new one is registered while we we do this. ObjectStore[] stores; synchronized (objectStores) { stores = (ObjectStore[]) objectStores.values().toArray(new ObjectStore[objectStores.size()]); } for (int i = 0; i < stores.length; i++) { // Let the store decide whether to flush according to its storage strategy. if (persistentTransactions) stores[i].flush(); else if (!stores[i].getPersistence()) stores[i].flush(); } // for. if (gatherStatistics) { long now = System.currentTimeMillis(); flushingObjectStoresForCheckpointMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; totalCheckpointsTaken++; } // if (gatherStatistics). if (persistentTransactions) { // Write end of checkpoint to the log. CheckpointEndLogRecord checkpointEndLogRecord = new CheckpointEndLogRecord(); logOutput.writeNext(checkpointEndLogRecord, 0, false, // Do not ckeck the log space, we reserved it earlier. false); // Force the log and truncate to the mark point set when we wrote checkpointStartLogRecord. logOutput.truncate(); if (gatherStatistics) { long now = System.currentTimeMillis(); flushingEndCheckpointMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). // -------------------------------------------------------------------------------------------- // If the log is still too full start backing out transactions. // -------------------------------------------------------------------------------------------- synchronized (registeredInternalTransactions) { if (logOutput.isOcupancyHigh()) { // Reduce other work in the ObjectManager so that checkpointing can catch up. currentMaximumActiveTransactions = Math.max(registeredInternalTransactions.size() / 2, 2); // Find the biggest transaction in terms of its reserved space in the log. InternalTransaction biggestTransaction = null; long biggestTransactionSize = 0; for (java.util.Iterator transactionIterator = registeredInternalTransactions.values() .iterator(); transactionIterator.hasNext();) { InternalTransaction internalTransaction = (InternalTransaction) transactionIterator.next(); long transactionSize = internalTransaction.getLogSpaceReserved(); if (transactionSize > biggestTransactionSize && internalTransaction.state == Transaction.stateActivePersistent) { biggestTransaction = internalTransaction; biggestTransactionSize = transactionSize; } // if (transactionSize... } // for... registeredInternalTransactions. if (biggestTransaction != null) { Transaction transaction = biggestTransaction.getExternalTransaction(); // We cannot synchronize on the internal transaction because we might deadlock an application thread. // Application threads may synchronize on their ManagedObjects and then invoke synchronized transaction // methods, so we must not hold a transaction lock when calling backout. For example LinkedLists // synchronize on the list when the preBackout callback is made then they invoke synchronized transaction // methods. If we hold the transaction lock first we would deadlock another thread making transaction // calls while synchronized on the list. // We just catch the state exception and discard it. try { if (biggestTransaction.state == Transaction.stateActivePersistent) { // It is possible that the biggest transaction has now moved on to some other work, // but we need to backout something so that will ahve to do. if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, methodName, new Object[] { "Log too full, backing out biggestTransaction:995", biggestTransaction }); trace.warning(this, cclass, methodName, "ObjectManagerState_LogTooFull", biggestTransaction); transaction.setTerminationReason(Transaction.terminatedLogTooFull); transaction.backout(false); } // if ( biggestTransaction.state... } catch (InvalidStateException exception) { // No FFDC Code Needed, condition expected when we race with the application thread. if (Tracing.isAnyTracingEnabled() && trace.isEventEnabled()) trace.event(this, cclass, methodName, exception); } // catch (StateErrorException exception). requestCheckpoint(true); // Trigger another checkpoint to see if things have got better. } } else { // log file not particularly full. // We had previously reduced the number of active transactions, // this will allw the number to recover. As new transactions come along they // will run and the backlog will be cleared as transactions finish. currentMaximumActiveTransactions = maximumActiveTransactions; } // if (((FileLogOutput)logOutput).getOcupancy()... // If we have more transactions than we need release some freeTrasactions. if (totalTransactions > currentMaximumActiveTransactions) totalTransactions = totalTransactions - freeTransactions.clear(totalTransactions - currentMaximumActiveTransactions); } // synchronized (registeredInternalTransactions). } // if (persistentTransactions). // finally reset transactions since last checkpoint if (persistentTransactions) persistentTransactionsSinceLastCheckpoint = 0; nonPersistentTransactionsSinceLastCheckpoint = 0; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); } }
public class class_name { private void performCheckpoint(boolean persistentTransactions) throws ObjectManagerException { final String methodName = "performCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Boolean(persistentTransactions)); if (gatherStatistics) { long now = System.currentTimeMillis(); waitingBetweenCheckpointsMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). // Recover and complete Orphan transactions. completeOrphanTransactions(); long logSequenceNumber = 0; if (persistentTransactions) { // Mark the point in the log that we can truncate to once checkpoint is complete, // then write start of checkpoint to the log. This makes sure that the CheckpointStart is recovered first, // which ensures that all of the ObjectStores are known at startup. CheckpointStartLogRecord checkpointStartLogRecord = new CheckpointStartLogRecord(this); // We don't release the reserved space for the Checkpoint log records as // we will need to re-reserve it after the checkpoint has completed. Instead we just // suppress the check on the log space because we reserved the space for the // checkpoint start and end records earlier. // Updates to QueueManagerState must be recorded in the log before we // flush the ObjectStores, otherwise we risk having named objects in the stores // which are not known in the ObjectManager. logSequenceNumber = logOutput.markAndWriteNext(checkpointStartLogRecord, 0, false, // Do not check the log space, we reserved it earlier. true); if (gatherStatistics) { long now = System.currentTimeMillis(); flushingCheckpointStartMilliseconds += now - lastCheckpointMilliseconds; // depends on control dependency: [if], data = [none] lastCheckpointMilliseconds = now; // depends on control dependency: [if], data = [none] } // if (gatherStatistics). checkpointStarting = CHECKPOINT_STARTING_PERSISTENT; // Mark all active transactions as requiring a checkpoint. for (java.util.Iterator registeredTransactionIterator = registeredInternalTransactions.values().iterator(); registeredTransactionIterator.hasNext();) { InternalTransaction registeredTransaction = (InternalTransaction) (registeredTransactionIterator.next()); // The registered transaction might be null if it was removed from the map after // we built the iterator. See ConcurrentHashMap and java.util.Map.Entry.getValue(). if (registeredTransaction != null) registeredTransaction.setRequiresCheckpoint(); } // for registeredInternalTransactions. } else { checkpointStarting = CHECKPOINT_STARTING_NONPERSISTENT; } // if (persistentTransactions). // From now on, new transactions write to the following checkpoint in the file store. checkpointStarting = CHECKPOINT_STARTING_NO; // -------------------------------------------------------------------------------------------- // Pause so that: // 1) In flight persistent transactions might complete, avoiding the need to write a checkpoint // record for them. // 2) Objects in the checkpoint set which will be written to the Object Store might get deleted // avoiding the need to write them. // -------------------------------------------------------------------------------------------- Object lock = new Object(); synchronized (lock) { try { if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, methodName, new Object[] { "wait:867", new Integer(checkpointDelay) }); lock.wait(checkpointDelay); // Let some transactions complete. // depends on control dependency: [try], data = [none] } catch (InterruptedException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:877:1.62"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw new UnexpectedExceptionException(this, exception); } // catch (InterruptedException exception). // depends on control dependency: [catch], data = [none] } // synchronized (lock). if (gatherStatistics) { long now = System.currentTimeMillis(); pausedDuringCheckpointMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). // Now that the log is forced tell the active transactions they can safely update the ObjectStores // on the assumption that their logRecords prior to logSequenceNumber have been forced to disk. // The Transactions take their checkpoint on the assumption that the ObjectStores contain their // ManagedObjects. The Object Stores have not been forced yet but the log has, // so this is a safe assumption. long transactionsRequiringCheckpoint = 0; for (java.util.Iterator registeredTransactionIterator = registeredInternalTransactions.values() .iterator(); registeredTransactionIterator.hasNext();) { InternalTransaction registeredTransaction = (InternalTransaction) (registeredTransactionIterator.next()); // The registered transaction might be null if it was removed from the map after // we built the iterator. See ConcurrentHashMap and java.util.Map.Entry.getValue(). // Checkpoint only transactions that have not cleared their reqiuirement for a checkpoint. if (registeredTransaction != null && registeredTransaction.requiresPersistentCheckpoint) { registeredTransaction.checkpoint(logSequenceNumber); // depends on control dependency: [if], data = [none] transactionsRequiringCheckpoint++; // depends on control dependency: [if], data = [none] } // if ... registeredTransaction.requiresCheckpoint. } // for registeredInternalTransactions. if (gatherStatistics) { totalTransactionsRequiringCheckpoint = totalTransactionsRequiringCheckpoint + transactionsRequiringCheckpoint; maximumTransactionsInAnyCheckpoint = Math.max(transactionsRequiringCheckpoint, maximumTransactionsInAnyCheckpoint); } // if (gatherStatistics). // Flush ObjectStores to disk. // Loop over a copy of the store collection, in case a new one is registered while we we do this. ObjectStore[] stores; synchronized (objectStores) { stores = (ObjectStore[]) objectStores.values().toArray(new ObjectStore[objectStores.size()]); } for (int i = 0; i < stores.length; i++) { // Let the store decide whether to flush according to its storage strategy. if (persistentTransactions) stores[i].flush(); else if (!stores[i].getPersistence()) stores[i].flush(); } // for. if (gatherStatistics) { long now = System.currentTimeMillis(); flushingObjectStoresForCheckpointMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; totalCheckpointsTaken++; } // if (gatherStatistics). if (persistentTransactions) { // Write end of checkpoint to the log. CheckpointEndLogRecord checkpointEndLogRecord = new CheckpointEndLogRecord(); logOutput.writeNext(checkpointEndLogRecord, 0, false, // Do not ckeck the log space, we reserved it earlier. false); // Force the log and truncate to the mark point set when we wrote checkpointStartLogRecord. logOutput.truncate(); if (gatherStatistics) { long now = System.currentTimeMillis(); flushingEndCheckpointMilliseconds += now - lastCheckpointMilliseconds; lastCheckpointMilliseconds = now; } // if (gatherStatistics). // -------------------------------------------------------------------------------------------- // If the log is still too full start backing out transactions. // -------------------------------------------------------------------------------------------- synchronized (registeredInternalTransactions) { if (logOutput.isOcupancyHigh()) { // Reduce other work in the ObjectManager so that checkpointing can catch up. currentMaximumActiveTransactions = Math.max(registeredInternalTransactions.size() / 2, 2); // Find the biggest transaction in terms of its reserved space in the log. InternalTransaction biggestTransaction = null; long biggestTransactionSize = 0; for (java.util.Iterator transactionIterator = registeredInternalTransactions.values() .iterator(); transactionIterator.hasNext();) { InternalTransaction internalTransaction = (InternalTransaction) transactionIterator.next(); long transactionSize = internalTransaction.getLogSpaceReserved(); if (transactionSize > biggestTransactionSize && internalTransaction.state == Transaction.stateActivePersistent) { biggestTransaction = internalTransaction; biggestTransactionSize = transactionSize; } // if (transactionSize... } // for... registeredInternalTransactions. if (biggestTransaction != null) { Transaction transaction = biggestTransaction.getExternalTransaction(); // We cannot synchronize on the internal transaction because we might deadlock an application thread. // Application threads may synchronize on their ManagedObjects and then invoke synchronized transaction // methods, so we must not hold a transaction lock when calling backout. For example LinkedLists // synchronize on the list when the preBackout callback is made then they invoke synchronized transaction // methods. If we hold the transaction lock first we would deadlock another thread making transaction // calls while synchronized on the list. // We just catch the state exception and discard it. try { if (biggestTransaction.state == Transaction.stateActivePersistent) { // It is possible that the biggest transaction has now moved on to some other work, // but we need to backout something so that will ahve to do. if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, methodName, new Object[] { "Log too full, backing out biggestTransaction:995", biggestTransaction }); trace.warning(this, cclass, methodName, "ObjectManagerState_LogTooFull", biggestTransaction); transaction.setTerminationReason(Transaction.terminatedLogTooFull); transaction.backout(false); } // if ( biggestTransaction.state... } catch (InvalidStateException exception) { // No FFDC Code Needed, condition expected when we race with the application thread. if (Tracing.isAnyTracingEnabled() && trace.isEventEnabled()) trace.event(this, cclass, methodName, exception); } // catch (StateErrorException exception). requestCheckpoint(true); // Trigger another checkpoint to see if things have got better. } } else { // log file not particularly full. // We had previously reduced the number of active transactions, // this will allw the number to recover. As new transactions come along they // will run and the backlog will be cleared as transactions finish. currentMaximumActiveTransactions = maximumActiveTransactions; } // if (((FileLogOutput)logOutput).getOcupancy()... // If we have more transactions than we need release some freeTrasactions. if (totalTransactions > currentMaximumActiveTransactions) totalTransactions = totalTransactions - freeTransactions.clear(totalTransactions - currentMaximumActiveTransactions); } // synchronized (registeredInternalTransactions). } // if (persistentTransactions). // finally reset transactions since last checkpoint if (persistentTransactions) persistentTransactionsSinceLastCheckpoint = 0; nonPersistentTransactionsSinceLastCheckpoint = 0; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); } }
public class class_name { public void addAStarListener(AStarListener<ST, PT> listener) { if (this.listeners == null) { this.listeners = new ArrayList<>(); } this.listeners.add(listener); } }
public class class_name { public void addAStarListener(AStarListener<ST, PT> listener) { if (this.listeners == null) { this.listeners = new ArrayList<>(); // depends on control dependency: [if], data = [none] } this.listeners.add(listener); } }
public class class_name { protected void selectSegment(Segment segment) { if(segment.isUnpaired()) { // remember selected unpaired segment for(Segment other : segments.getPairedSegments(segment)) { indirectSelections.put(other, segment); selectSegment(other); } } else { if(!selectedSegments.contains(segment)) { selectedSegments.add(segment); if(segment.getDBIDs() != null) { unselectedObjects.removeDBIDs(segment.getDBIDs()); } } } } }
public class class_name { protected void selectSegment(Segment segment) { if(segment.isUnpaired()) { // remember selected unpaired segment for(Segment other : segments.getPairedSegments(segment)) { indirectSelections.put(other, segment); // depends on control dependency: [for], data = [other] selectSegment(other); // depends on control dependency: [for], data = [other] } } else { if(!selectedSegments.contains(segment)) { selectedSegments.add(segment); // depends on control dependency: [if], data = [none] if(segment.getDBIDs() != null) { unselectedObjects.removeDBIDs(segment.getDBIDs()); // depends on control dependency: [if], data = [(segment.getDBIDs()] } } } } }
public class class_name { private void startSliding(boolean highlight, boolean fireEvent) { if (highlight) { DOM.setElementProperty(lineElement, "className", SLIDER_LINE + " " + SLIDER_LINE_SLIDING); DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB + " " + SLIDER_KNOB_SLIDING); } } }
public class class_name { private void startSliding(boolean highlight, boolean fireEvent) { if (highlight) { DOM.setElementProperty(lineElement, "className", SLIDER_LINE + " " + SLIDER_LINE_SLIDING); // depends on control dependency: [if], data = [none] DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB + " " + SLIDER_KNOB_SLIDING); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setReadReplicaIdentifiers(java.util.Collection<String> readReplicaIdentifiers) { if (readReplicaIdentifiers == null) { this.readReplicaIdentifiers = null; return; } this.readReplicaIdentifiers = new com.amazonaws.internal.SdkInternalList<String>(readReplicaIdentifiers); } }
public class class_name { public void setReadReplicaIdentifiers(java.util.Collection<String> readReplicaIdentifiers) { if (readReplicaIdentifiers == null) { this.readReplicaIdentifiers = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.readReplicaIdentifiers = new com.amazonaws.internal.SdkInternalList<String>(readReplicaIdentifiers); } }
public class class_name { protected SpdDouble getSpdDouble() { myValue.reset(false); for (int i = 0; i < members.size(); i++) { Object member = members.get(i); if (member == null) continue; if (member instanceof SpdDouble) { myValue.combine((SpdDouble) member); } else { // SpdDoubleAggregate myValue.combine(((SpdDoubleAggregate) member).getSpdDouble()); } } return myValue; } }
public class class_name { protected SpdDouble getSpdDouble() { myValue.reset(false); for (int i = 0; i < members.size(); i++) { Object member = members.get(i); if (member == null) continue; if (member instanceof SpdDouble) { myValue.combine((SpdDouble) member); // depends on control dependency: [if], data = [none] } else { // SpdDoubleAggregate myValue.combine(((SpdDoubleAggregate) member).getSpdDouble()); // depends on control dependency: [if], data = [none] } } return myValue; } }
public class class_name { public EvacuateAction evacuate(String serverId, String host, String adminPassword, Boolean sharedStorage) { Evacuate entity = new Evacuate(); entity.setHost(host); if (adminPassword != null && adminPassword.length() > 0) { entity.setAdminPassword(adminPassword); } if (sharedStorage != null) { entity.setSharedStorage(sharedStorage.booleanValue()); } else { entity.setSharedStorage(false); } return new EvacuateAction(serverId, entity); } }
public class class_name { public EvacuateAction evacuate(String serverId, String host, String adminPassword, Boolean sharedStorage) { Evacuate entity = new Evacuate(); entity.setHost(host); if (adminPassword != null && adminPassword.length() > 0) { entity.setAdminPassword(adminPassword); // depends on control dependency: [if], data = [(adminPassword] } if (sharedStorage != null) { entity.setSharedStorage(sharedStorage.booleanValue()); // depends on control dependency: [if], data = [(sharedStorage] } else { entity.setSharedStorage(false); // depends on control dependency: [if], data = [none] } return new EvacuateAction(serverId, entity); } }
public class class_name { public ServiceCall<Void> deleteModel(DeleteModelOptions deleteModelOptions) { Validator.notNull(deleteModelOptions, "deleteModelOptions cannot be null"); String[] pathSegments = { "v1/models" }; String[] pathParameters = { deleteModelOptions.modelId() }; RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("natural-language-understanding", "v1", "deleteModel"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); return createServiceCall(builder.build(), ResponseConverterUtils.getVoid()); } }
public class class_name { public ServiceCall<Void> deleteModel(DeleteModelOptions deleteModelOptions) { Validator.notNull(deleteModelOptions, "deleteModelOptions cannot be null"); String[] pathSegments = { "v1/models" }; String[] pathParameters = { deleteModelOptions.modelId() }; RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("natural-language-understanding", "v1", "deleteModel"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); // depends on control dependency: [for], data = [header] } builder.header("Accept", "application/json"); return createServiceCall(builder.build(), ResponseConverterUtils.getVoid()); } }
public class class_name { @SuppressWarnings("unchecked") public <T> DomainObjectMatch<T> createMatchFrom(DomainObjectMatch<T> domainObjectMatch) { DomainObjectMatch<T> ret; FromPreviousQueryExpression pqe; DomainObjectMatch<?> match; DomainObjectMatch<?> delegate = APIAccess.getDelegate(domainObjectMatch); if (delegate != null) { // generic model DomainObjectMatch<?> newDelegate = APIAccess.createDomainObjectMatch(delegate, this.queryExecutor.getDomainObjectMatches().size(), this.queryExecutor.getMappingInfo()); this.queryExecutor.getDomainObjectMatches().add(newDelegate); pqe = new FromPreviousQueryExpression( newDelegate, delegate); ret = (DomainObjectMatch<T>) APIAccess.createDomainObjectMatch(DomainObject.class, newDelegate); match = newDelegate; } else { ret = APIAccess.createDomainObjectMatch(domainObjectMatch, this.queryExecutor.getDomainObjectMatches().size(), this.queryExecutor.getMappingInfo()); this.queryExecutor.getDomainObjectMatches().add(ret); pqe = new FromPreviousQueryExpression( ret, domainObjectMatch); match = ret; } this.queryExecutor.addAstObject(pqe); QueryRecorder.recordAssignment(this, "createMatchFrom", match, QueryRecorder.reference(domainObjectMatch)); return ret; } }
public class class_name { @SuppressWarnings("unchecked") public <T> DomainObjectMatch<T> createMatchFrom(DomainObjectMatch<T> domainObjectMatch) { DomainObjectMatch<T> ret; FromPreviousQueryExpression pqe; DomainObjectMatch<?> match; DomainObjectMatch<?> delegate = APIAccess.getDelegate(domainObjectMatch); if (delegate != null) { // generic model DomainObjectMatch<?> newDelegate = APIAccess.createDomainObjectMatch(delegate, this.queryExecutor.getDomainObjectMatches().size(), this.queryExecutor.getMappingInfo()); this.queryExecutor.getDomainObjectMatches().add(newDelegate); // depends on control dependency: [if], data = [none] pqe = new FromPreviousQueryExpression( newDelegate, delegate); // depends on control dependency: [if], data = [none] ret = (DomainObjectMatch<T>) APIAccess.createDomainObjectMatch(DomainObject.class, newDelegate); // depends on control dependency: [if], data = [none] match = newDelegate; // depends on control dependency: [if], data = [none] } else { ret = APIAccess.createDomainObjectMatch(domainObjectMatch, this.queryExecutor.getDomainObjectMatches().size(), this.queryExecutor.getMappingInfo()); // depends on control dependency: [if], data = [none] this.queryExecutor.getDomainObjectMatches().add(ret); // depends on control dependency: [if], data = [none] pqe = new FromPreviousQueryExpression( ret, domainObjectMatch); // depends on control dependency: [if], data = [none] match = ret; // depends on control dependency: [if], data = [none] } this.queryExecutor.addAstObject(pqe); QueryRecorder.recordAssignment(this, "createMatchFrom", match, QueryRecorder.reference(domainObjectMatch)); return ret; } }
public class class_name { public void setTableColumnNames(HashMappedList list) { if (resultTable != null) { ((TableDerived) resultTable).columnList = list; return; } leftQueryExpression.setTableColumnNames(list); } }
public class class_name { public void setTableColumnNames(HashMappedList list) { if (resultTable != null) { ((TableDerived) resultTable).columnList = list; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } leftQueryExpression.setTableColumnNames(list); } }
public class class_name { private void fireCandidatePairSelectedEvent() { // Stop the ICE Agent this.stop(); // Fire the event to all listener List<IceEventListener> listeners; synchronized (this.iceListeners) { listeners = new ArrayList<IceEventListener>(this.iceListeners); } SelectedCandidatesEvent event = new SelectedCandidatesEvent(this); for (IceEventListener listener : listeners) { listener.onSelectedCandidates(event); } } }
public class class_name { private void fireCandidatePairSelectedEvent() { // Stop the ICE Agent this.stop(); // Fire the event to all listener List<IceEventListener> listeners; synchronized (this.iceListeners) { listeners = new ArrayList<IceEventListener>(this.iceListeners); } SelectedCandidatesEvent event = new SelectedCandidatesEvent(this); for (IceEventListener listener : listeners) { listener.onSelectedCandidates(event); // depends on control dependency: [for], data = [listener] } } }
public class class_name { public List<String> getFilterPickList(final UITableHeader _uitableHeader) throws EFapsException { final List<String> ret = new ArrayList<>(); for (final UIRow rowmodel : this.values) { for (final IFilterable cell : rowmodel.getCells()) { if (cell.belongsTo(_uitableHeader.getFieldId())) { final String value = cell.getPickListValue(); if (!ret.contains(value)) { ret.add(value); } break; } } } Collections.sort(ret); return ret; } }
public class class_name { public List<String> getFilterPickList(final UITableHeader _uitableHeader) throws EFapsException { final List<String> ret = new ArrayList<>(); for (final UIRow rowmodel : this.values) { for (final IFilterable cell : rowmodel.getCells()) { if (cell.belongsTo(_uitableHeader.getFieldId())) { final String value = cell.getPickListValue(); if (!ret.contains(value)) { ret.add(value); // depends on control dependency: [if], data = [none] } break; } } } Collections.sort(ret); return ret; } }