code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public void printNavBlock() { StringBuilder buf = new StringBuilder("GRID NAVIGATION:"); if (navBlock != null) { buf.append(navBlock.toString()); } else { buf.append("\n\tUNKNOWN GRID NAVIGATION"); } System.out.println(buf.toString()); } }
public class class_name { public void printNavBlock() { StringBuilder buf = new StringBuilder("GRID NAVIGATION:"); if (navBlock != null) { buf.append(navBlock.toString()); // depends on control dependency: [if], data = [(navBlock] } else { buf.append("\n\tUNKNOWN GRID NAVIGATION"); // depends on control dependency: [if], data = [none] } System.out.println(buf.toString()); } }
public class class_name { public void exiting(Object object) { if (!getLogger().isLoggable(Level.FINER)) { return; } FrameInfo fi = getLoggingFrame(); getLogger().exiting(fi.className, fi.methodName, object); } }
public class class_name { public void exiting(Object object) { if (!getLogger().isLoggable(Level.FINER)) { return; // depends on control dependency: [if], data = [none] } FrameInfo fi = getLoggingFrame(); getLogger().exiting(fi.className, fi.methodName, object); } }
public class class_name { public EClass getTilePosition() { if (tilePositionEClass == null) { tilePositionEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(394); } return tilePositionEClass; } }
public class class_name { public EClass getTilePosition() { if (tilePositionEClass == null) { tilePositionEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(394); // depends on control dependency: [if], data = [none] } return tilePositionEClass; } }
public class class_name { public static Props getPropsFromYamlFile(final String path, final File flowFile) { final List<Props> propsList = new ArrayList<>(); final NodeBeanLoader loader = new NodeBeanLoader(); try { final NodeBean nodeBean = loader.load(flowFile); final String[] pathList = path.split(Constants.PATH_DELIMITER); if (findPropsFromNodeBean(nodeBean, pathList, 0, propsList)) { if (!propsList.isEmpty()) { return propsList.get(0); } else { logger.error("Error getting props for " + path); } } } catch (final Exception e) { logger.error("Failed to get props, error loading flow YAML file. ", e); } return null; } }
public class class_name { public static Props getPropsFromYamlFile(final String path, final File flowFile) { final List<Props> propsList = new ArrayList<>(); final NodeBeanLoader loader = new NodeBeanLoader(); try { final NodeBean nodeBean = loader.load(flowFile); final String[] pathList = path.split(Constants.PATH_DELIMITER); if (findPropsFromNodeBean(nodeBean, pathList, 0, propsList)) { if (!propsList.isEmpty()) { return propsList.get(0); // depends on control dependency: [if], data = [none] } else { logger.error("Error getting props for " + path); // depends on control dependency: [if], data = [none] } } } catch (final Exception e) { logger.error("Failed to get props, error loading flow YAML file. ", e); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public void init ( String nodeName, String sharedSecret, String hostName, String publicHostName, String region, int port, String nodeNamespace, boolean adHoc) { _nodeName = nodeName; _sharedSecret = sharedSecret; _nodeNamespace = nodeNamespace; _adHoc = adHoc; // wire ourselves into the server _conmgr.addChainedAuthenticator( new ServiceAuthenticator<PeerCreds>(PeerCreds.class, PeerAuthName.class) { @Override protected boolean areValid (PeerCreds creds) { return isAuthenticPeer(creds); } }); _clmgr.addSessionFactory( SessionFactory.newSessionFactory(PeerCreds.class, PeerSession.class, PeerAuthName.class, PeerClientResolver.class)); // create our node object _nodeobj = _omgr.registerObject(createNodeObject()); _nodeobj.setNodeName(nodeName); _nodeobj.setBootStamp(System.currentTimeMillis()); // register ourselves with the node table _self = new NodeRecord( _nodeName, hostName, (publicHostName == null) ? hostName : publicHostName, region, port); if (!adHoc) { _invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") { @Override public void invokePersist () throws Exception { _noderepo.updateNode(_self); } }); } // set the invocation service _nodeobj.setPeerService(_invmgr.registerProvider(this, PeerMarshaller.class)); // register ourselves as a client observer _clmgr.addClientObserver(this); // and start our peer refresh interval (this lives for the lifetime of the server) if (!adHoc) { _omgr.newInterval(new Runnable() { public void run () { refreshPeers(); } }).schedule(5000L, 60*1000L); } // give derived classes an easy way to get in on the init action didInit(); } }
public class class_name { public void init ( String nodeName, String sharedSecret, String hostName, String publicHostName, String region, int port, String nodeNamespace, boolean adHoc) { _nodeName = nodeName; _sharedSecret = sharedSecret; _nodeNamespace = nodeNamespace; _adHoc = adHoc; // wire ourselves into the server _conmgr.addChainedAuthenticator( new ServiceAuthenticator<PeerCreds>(PeerCreds.class, PeerAuthName.class) { @Override protected boolean areValid (PeerCreds creds) { return isAuthenticPeer(creds); } }); _clmgr.addSessionFactory( SessionFactory.newSessionFactory(PeerCreds.class, PeerSession.class, PeerAuthName.class, PeerClientResolver.class)); // create our node object _nodeobj = _omgr.registerObject(createNodeObject()); _nodeobj.setNodeName(nodeName); _nodeobj.setBootStamp(System.currentTimeMillis()); // register ourselves with the node table _self = new NodeRecord( _nodeName, hostName, (publicHostName == null) ? hostName : publicHostName, region, port); if (!adHoc) { _invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") { @Override public void invokePersist () throws Exception { _noderepo.updateNode(_self); } }); } // set the invocation service _nodeobj.setPeerService(_invmgr.registerProvider(this, PeerMarshaller.class)); // register ourselves as a client observer _clmgr.addClientObserver(this); // and start our peer refresh interval (this lives for the lifetime of the server) if (!adHoc) { _omgr.newInterval(new Runnable() { public void run () { refreshPeers(); } }).schedule(5000L, 60*1000L); } // give derived classes an easy way to get in on the init action didInit(); // depends on control dependency: [if], data = [none] } }
public class class_name { @Override public void close() { synchronized (this) { LOG.log(Level.FINER, "Close launcher: job {0} with status {1}", new Object[] {this.theJob, this.status}); if (this.status.isRunning()) { this.status = LauncherStatus.FORCE_CLOSED; } if (null != this.theJob) { this.theJob.close(); } this.notify(); } LOG.log(Level.FINEST, "Close launcher: shutdown REEF"); this.reef.close(); LOG.log(Level.FINEST, "Close launcher: done"); } }
public class class_name { @Override public void close() { synchronized (this) { LOG.log(Level.FINER, "Close launcher: job {0} with status {1}", new Object[] {this.theJob, this.status}); if (this.status.isRunning()) { this.status = LauncherStatus.FORCE_CLOSED; // depends on control dependency: [if], data = [none] } if (null != this.theJob) { this.theJob.close(); // depends on control dependency: [if], data = [none] } this.notify(); } LOG.log(Level.FINEST, "Close launcher: shutdown REEF"); this.reef.close(); LOG.log(Level.FINEST, "Close launcher: done"); } }
public class class_name { @UiThread public void notifyParentMoved(int fromParentPosition, int toParentPosition) { int fromFlatParentPosition = getFlatParentPosition(fromParentPosition); ExpandableWrapper<P, C> fromParentWrapper = mFlatItemList.get(fromFlatParentPosition); // If the parent is collapsed we can take advantage of notifyItemMoved otherwise // we are forced to do a "manual" move by removing and then adding the parent + children // (no notifyItemRangeMovedAvailable) boolean isCollapsed = !fromParentWrapper.isExpanded(); boolean isExpandedNoChildren = !isCollapsed && (fromParentWrapper.getWrappedChildList().size() == 0); if (isCollapsed || isExpandedNoChildren) { int toFlatParentPosition = getFlatParentPosition(toParentPosition); ExpandableWrapper<P, C> toParentWrapper = mFlatItemList.get(toFlatParentPosition); mFlatItemList.remove(fromFlatParentPosition); int childOffset = 0; if (toParentWrapper.isExpanded()) { childOffset = toParentWrapper.getWrappedChildList().size(); } mFlatItemList.add(toFlatParentPosition + childOffset, fromParentWrapper); notifyItemMoved(fromFlatParentPosition, toFlatParentPosition + childOffset); } else { // Remove the parent and children int sizeChanged = 0; int childListSize = fromParentWrapper.getWrappedChildList().size(); for (int i = 0; i < childListSize + 1; i++) { mFlatItemList.remove(fromFlatParentPosition); sizeChanged++; } notifyItemRangeRemoved(fromFlatParentPosition, sizeChanged); // Add the parent and children at new position int toFlatParentPosition = getFlatParentPosition(toParentPosition); int childOffset = 0; if (toFlatParentPosition != INVALID_FLAT_POSITION) { ExpandableWrapper<P, C> toParentWrapper = mFlatItemList.get(toFlatParentPosition); if (toParentWrapper.isExpanded()) { childOffset = toParentWrapper.getWrappedChildList().size(); } } else { toFlatParentPosition = mFlatItemList.size(); } mFlatItemList.add(toFlatParentPosition + childOffset, fromParentWrapper); List<ExpandableWrapper<P, C>> wrappedChildList = fromParentWrapper.getWrappedChildList(); sizeChanged = wrappedChildList.size() + 1; mFlatItemList.addAll(toFlatParentPosition + childOffset + 1, wrappedChildList); notifyItemRangeInserted(toFlatParentPosition + childOffset, sizeChanged); } } }
public class class_name { @UiThread public void notifyParentMoved(int fromParentPosition, int toParentPosition) { int fromFlatParentPosition = getFlatParentPosition(fromParentPosition); ExpandableWrapper<P, C> fromParentWrapper = mFlatItemList.get(fromFlatParentPosition); // If the parent is collapsed we can take advantage of notifyItemMoved otherwise // we are forced to do a "manual" move by removing and then adding the parent + children // (no notifyItemRangeMovedAvailable) boolean isCollapsed = !fromParentWrapper.isExpanded(); boolean isExpandedNoChildren = !isCollapsed && (fromParentWrapper.getWrappedChildList().size() == 0); if (isCollapsed || isExpandedNoChildren) { int toFlatParentPosition = getFlatParentPosition(toParentPosition); ExpandableWrapper<P, C> toParentWrapper = mFlatItemList.get(toFlatParentPosition); mFlatItemList.remove(fromFlatParentPosition); // depends on control dependency: [if], data = [none] int childOffset = 0; if (toParentWrapper.isExpanded()) { childOffset = toParentWrapper.getWrappedChildList().size(); // depends on control dependency: [if], data = [none] } mFlatItemList.add(toFlatParentPosition + childOffset, fromParentWrapper); // depends on control dependency: [if], data = [none] notifyItemMoved(fromFlatParentPosition, toFlatParentPosition + childOffset); // depends on control dependency: [if], data = [none] } else { // Remove the parent and children int sizeChanged = 0; int childListSize = fromParentWrapper.getWrappedChildList().size(); for (int i = 0; i < childListSize + 1; i++) { mFlatItemList.remove(fromFlatParentPosition); // depends on control dependency: [for], data = [none] sizeChanged++; // depends on control dependency: [for], data = [none] } notifyItemRangeRemoved(fromFlatParentPosition, sizeChanged); // depends on control dependency: [if], data = [none] // Add the parent and children at new position int toFlatParentPosition = getFlatParentPosition(toParentPosition); int childOffset = 0; if (toFlatParentPosition != INVALID_FLAT_POSITION) { ExpandableWrapper<P, C> toParentWrapper = mFlatItemList.get(toFlatParentPosition); if (toParentWrapper.isExpanded()) { childOffset = toParentWrapper.getWrappedChildList().size(); // depends on control dependency: [if], data = [none] } } else { toFlatParentPosition = mFlatItemList.size(); // depends on control dependency: [if], data = [none] } mFlatItemList.add(toFlatParentPosition + childOffset, fromParentWrapper); // depends on control dependency: [if], data = [none] List<ExpandableWrapper<P, C>> wrappedChildList = fromParentWrapper.getWrappedChildList(); sizeChanged = wrappedChildList.size() + 1; // depends on control dependency: [if], data = [none] mFlatItemList.addAll(toFlatParentPosition + childOffset + 1, wrappedChildList); // depends on control dependency: [if], data = [none] notifyItemRangeInserted(toFlatParentPosition + childOffset, sizeChanged); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(Nameserver nameserver, ProtocolMarshaller protocolMarshaller) { if (nameserver == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(nameserver.getName(), NAME_BINDING); protocolMarshaller.marshall(nameserver.getGlueIps(), GLUEIPS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(Nameserver nameserver, ProtocolMarshaller protocolMarshaller) { if (nameserver == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(nameserver.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(nameserver.getGlueIps(), GLUEIPS_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 marshall(FleetAttributes fleetAttributes, ProtocolMarshaller protocolMarshaller) { if (fleetAttributes == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(fleetAttributes.getFleetId(), FLEETID_BINDING); protocolMarshaller.marshall(fleetAttributes.getFleetArn(), FLEETARN_BINDING); protocolMarshaller.marshall(fleetAttributes.getFleetType(), FLEETTYPE_BINDING); protocolMarshaller.marshall(fleetAttributes.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(fleetAttributes.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(fleetAttributes.getName(), NAME_BINDING); protocolMarshaller.marshall(fleetAttributes.getCreationTime(), CREATIONTIME_BINDING); protocolMarshaller.marshall(fleetAttributes.getTerminationTime(), TERMINATIONTIME_BINDING); protocolMarshaller.marshall(fleetAttributes.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(fleetAttributes.getBuildId(), BUILDID_BINDING); protocolMarshaller.marshall(fleetAttributes.getScriptId(), SCRIPTID_BINDING); protocolMarshaller.marshall(fleetAttributes.getServerLaunchPath(), SERVERLAUNCHPATH_BINDING); protocolMarshaller.marshall(fleetAttributes.getServerLaunchParameters(), SERVERLAUNCHPARAMETERS_BINDING); protocolMarshaller.marshall(fleetAttributes.getLogPaths(), LOGPATHS_BINDING); protocolMarshaller.marshall(fleetAttributes.getNewGameSessionProtectionPolicy(), NEWGAMESESSIONPROTECTIONPOLICY_BINDING); protocolMarshaller.marshall(fleetAttributes.getOperatingSystem(), OPERATINGSYSTEM_BINDING); protocolMarshaller.marshall(fleetAttributes.getResourceCreationLimitPolicy(), RESOURCECREATIONLIMITPOLICY_BINDING); protocolMarshaller.marshall(fleetAttributes.getMetricGroups(), METRICGROUPS_BINDING); protocolMarshaller.marshall(fleetAttributes.getStoppedActions(), STOPPEDACTIONS_BINDING); protocolMarshaller.marshall(fleetAttributes.getInstanceRoleArn(), INSTANCEROLEARN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(FleetAttributes fleetAttributes, ProtocolMarshaller protocolMarshaller) { if (fleetAttributes == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(fleetAttributes.getFleetId(), FLEETID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getFleetArn(), FLEETARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getFleetType(), FLEETTYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getInstanceType(), INSTANCETYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getCreationTime(), CREATIONTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getTerminationTime(), TERMINATIONTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getBuildId(), BUILDID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getScriptId(), SCRIPTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getServerLaunchPath(), SERVERLAUNCHPATH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getServerLaunchParameters(), SERVERLAUNCHPARAMETERS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getLogPaths(), LOGPATHS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getNewGameSessionProtectionPolicy(), NEWGAMESESSIONPROTECTIONPOLICY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getOperatingSystem(), OPERATINGSYSTEM_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getResourceCreationLimitPolicy(), RESOURCECREATIONLIMITPOLICY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getMetricGroups(), METRICGROUPS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getStoppedActions(), STOPPEDACTIONS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fleetAttributes.getInstanceRoleArn(), INSTANCEROLEARN_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 int convertToJDBCCode(int op) { if (CRUD_MAP.containsKey(op)){ return CRUD_MAP.get(op); } throw new UnsupportedOperationException(Utils.format("Operation code {} is not supported", op)); } }
public class class_name { public static int convertToJDBCCode(int op) { if (CRUD_MAP.containsKey(op)){ return CRUD_MAP.get(op); // depends on control dependency: [if], data = [none] } throw new UnsupportedOperationException(Utils.format("Operation code {} is not supported", op)); } }
public class class_name { protected static void invalidateSwitchPoints() { if (LOG_ENABLED) { LOG.info("invalidating switch point"); } SwitchPoint old = switchPoint; switchPoint = new SwitchPoint(); synchronized(IndyInterface.class) { SwitchPoint.invalidateAll(new SwitchPoint[]{old}); } } }
public class class_name { protected static void invalidateSwitchPoints() { if (LOG_ENABLED) { LOG.info("invalidating switch point"); // depends on control dependency: [if], data = [none] } SwitchPoint old = switchPoint; switchPoint = new SwitchPoint(); synchronized(IndyInterface.class) { SwitchPoint.invalidateAll(new SwitchPoint[]{old}); } } }
public class class_name { private static void replaceWord(StringBuilder input, String word, String replace, boolean ignoreCase) { // The string where we look for (lower case if ignoreCase) StringBuilder workInput; // The string to find (lower case if ignoreCase) String workWord; if (input == null || word == null || input.length() == 0 || word.length() == 0) { return; } if (replace == null) { replace = ""; } // Use the lowercase versions to compare, but replace in the original input if (ignoreCase) { workInput = new StringBuilder(input.toString().toLowerCase(Locale.ENGLISH)); workWord = word.toLowerCase(Locale.ENGLISH); } else { // Creates a StringBuilder to work with based in the input, we don't touch the input, to do the // replaces there. So we use a new StringBuilder, not an assignment. workInput = new StringBuilder(input); workWord = word; } int pos = 0; do { // Search for the word but from the previous found index, to avoid infinite loop if the replace word // contains the word pos = workInput.indexOf(workWord, pos); // If word is not found if (pos == -1) { break; } // If the previous char is a word letter, don't replace, look for the next one. if (pos > 0) { char prevChar = workInput.charAt(pos - 1); if (Character.isLetterOrDigit(prevChar)) { pos = pos + workWord.length(); continue; } } // If the next char is a word letter, don't replace, look for the next int nextPos = pos + workWord.length(); if (nextPos < workInput.length()) { char nextChar = workInput.charAt(nextPos); if (Character.isLetterOrDigit(nextChar)) { pos = pos + workWord.length(); continue; } } if (pos >= 0 && pos < input.length()) { // replace this word but in the original input (without changing the case) input.replace(pos, pos + workWord.length(), replace); workInput.replace(pos, pos + workWord.length(), replace); } // move to the next character after the replace word pos = pos + replace.length(); } while (pos > -1 && pos < workInput.length()); } }
public class class_name { private static void replaceWord(StringBuilder input, String word, String replace, boolean ignoreCase) { // The string where we look for (lower case if ignoreCase) StringBuilder workInput; // The string to find (lower case if ignoreCase) String workWord; if (input == null || word == null || input.length() == 0 || word.length() == 0) { return; // depends on control dependency: [if], data = [none] } if (replace == null) { replace = ""; // depends on control dependency: [if], data = [none] } // Use the lowercase versions to compare, but replace in the original input if (ignoreCase) { workInput = new StringBuilder(input.toString().toLowerCase(Locale.ENGLISH)); // depends on control dependency: [if], data = [none] workWord = word.toLowerCase(Locale.ENGLISH); // depends on control dependency: [if], data = [none] } else { // Creates a StringBuilder to work with based in the input, we don't touch the input, to do the // replaces there. So we use a new StringBuilder, not an assignment. workInput = new StringBuilder(input); // depends on control dependency: [if], data = [none] workWord = word; // depends on control dependency: [if], data = [none] } int pos = 0; do { // Search for the word but from the previous found index, to avoid infinite loop if the replace word // contains the word pos = workInput.indexOf(workWord, pos); // If word is not found if (pos == -1) { break; } // If the previous char is a word letter, don't replace, look for the next one. if (pos > 0) { char prevChar = workInput.charAt(pos - 1); if (Character.isLetterOrDigit(prevChar)) { pos = pos + workWord.length(); // depends on control dependency: [if], data = [none] continue; } } // If the next char is a word letter, don't replace, look for the next int nextPos = pos + workWord.length(); if (nextPos < workInput.length()) { char nextChar = workInput.charAt(nextPos); if (Character.isLetterOrDigit(nextChar)) { pos = pos + workWord.length(); // depends on control dependency: [if], data = [none] continue; } } if (pos >= 0 && pos < input.length()) { // replace this word but in the original input (without changing the case) input.replace(pos, pos + workWord.length(), replace); // depends on control dependency: [if], data = [(pos] workInput.replace(pos, pos + workWord.length(), replace); // depends on control dependency: [if], data = [(pos] } // move to the next character after the replace word pos = pos + replace.length(); } while (pos > -1 && pos < workInput.length()); } }
public class class_name { public void createCheckpoint() { if (logger.isLoggable(Level.INFO)) logger.info("Start creating checkpoint"); if (MY_METHOD == METHOD_MONITOR) { if (VanillaDb.txMgr().getNextTxNum() - lastTxNum > TX_COUNT_TO_CHECKPOINT) { Transaction tx = VanillaDb.txMgr().newTransaction( Connection.TRANSACTION_SERIALIZABLE, false); VanillaDb.txMgr().createCheckpoint(tx); tx.commit(); lastTxNum = VanillaDb.txMgr().getNextTxNum(); } } else if (MY_METHOD == METHOD_PERIODIC) { Transaction tx = VanillaDb.txMgr().newTransaction( Connection.TRANSACTION_SERIALIZABLE, false); VanillaDb.txMgr().createCheckpoint(tx); tx.commit(); } if (logger.isLoggable(Level.INFO)) logger.info("A checkpoint created"); } }
public class class_name { public void createCheckpoint() { if (logger.isLoggable(Level.INFO)) logger.info("Start creating checkpoint"); if (MY_METHOD == METHOD_MONITOR) { if (VanillaDb.txMgr().getNextTxNum() - lastTxNum > TX_COUNT_TO_CHECKPOINT) { Transaction tx = VanillaDb.txMgr().newTransaction( Connection.TRANSACTION_SERIALIZABLE, false); VanillaDb.txMgr().createCheckpoint(tx); // depends on control dependency: [if], data = [none] tx.commit(); // depends on control dependency: [if], data = [none] lastTxNum = VanillaDb.txMgr().getNextTxNum(); // depends on control dependency: [if], data = [none] } } else if (MY_METHOD == METHOD_PERIODIC) { Transaction tx = VanillaDb.txMgr().newTransaction( Connection.TRANSACTION_SERIALIZABLE, false); VanillaDb.txMgr().createCheckpoint(tx); // depends on control dependency: [if], data = [none] tx.commit(); // depends on control dependency: [if], data = [none] } if (logger.isLoggable(Level.INFO)) logger.info("A checkpoint created"); } }
public class class_name { public static Iterator<Token[]> tokenIterator(ItemRule itemRule) { Iterator<Token[]> it = null; if (itemRule.isListableType()) { List<Token[]> list = itemRule.getTokensList(); if (list != null) { it = list.iterator(); } } else if (itemRule.isMappableType()) { Map<String, Token[]> map = itemRule.getTokensMap(); if (map != null) { it = map.values().iterator(); } } else { return new Iterator<Token[]>() { private int count = 0; @Override public boolean hasNext() { return (count++ < 1); } @Override public Token[] next() { return itemRule.getTokens(); } @Override public void remove() { throw new UnsupportedOperationException("Cannot remove an element of an array"); } }; } return it; } }
public class class_name { public static Iterator<Token[]> tokenIterator(ItemRule itemRule) { Iterator<Token[]> it = null; if (itemRule.isListableType()) { List<Token[]> list = itemRule.getTokensList(); if (list != null) { it = list.iterator(); // depends on control dependency: [if], data = [none] } } else if (itemRule.isMappableType()) { Map<String, Token[]> map = itemRule.getTokensMap(); if (map != null) { it = map.values().iterator(); // depends on control dependency: [if], data = [none] } } else { return new Iterator<Token[]>() { private int count = 0; @Override public boolean hasNext() { return (count++ < 1); } @Override public Token[] next() { return itemRule.getTokens(); } @Override public void remove() { throw new UnsupportedOperationException("Cannot remove an element of an array"); } }; // depends on control dependency: [if], data = [none] } return it; } }
public class class_name { public static String removePrefixPath(final String prefix, final String resource) { String normalizedResource = resource; if (normalizedResource.startsWith(prefix)) { normalizedResource = normalizedResource .substring(prefix.length() - 1); } return normalizedResource; } }
public class class_name { public static String removePrefixPath(final String prefix, final String resource) { String normalizedResource = resource; if (normalizedResource.startsWith(prefix)) { normalizedResource = normalizedResource .substring(prefix.length() - 1); // depends on control dependency: [if], data = [none] } return normalizedResource; } }
public class class_name { public static Map<String, Object> queryForMap(String sql, Object... args) { Map<String, Object> result = new HashMap<String, Object>(); List<Map<String, Object>> list = queryForList(sql, args); if (list.size() > 0) { result = list.get(0); } return result; } }
public class class_name { public static Map<String, Object> queryForMap(String sql, Object... args) { Map<String, Object> result = new HashMap<String, Object>(); List<Map<String, Object>> list = queryForList(sql, args); if (list.size() > 0) { result = list.get(0); // depends on control dependency: [if], data = [0)] } return result; } }
public class class_name { void formatHours(StringBuilder b, ZonedDateTime d, int width, boolean twelveHour) { int hours = d.getHour(); if (twelveHour && hours > 12) { hours = hours - 12; } if (twelveHour && hours == 0) { hours = 12; } zeroPad2(b, hours, width); } }
public class class_name { void formatHours(StringBuilder b, ZonedDateTime d, int width, boolean twelveHour) { int hours = d.getHour(); if (twelveHour && hours > 12) { hours = hours - 12; // depends on control dependency: [if], data = [none] } if (twelveHour && hours == 0) { hours = 12; // depends on control dependency: [if], data = [none] } zeroPad2(b, hours, width); } }
public class class_name { public static String getLabel(FacesContext context, UIComponent comp) { Object o = comp.getAttributes().get("label"); if (o == null || (o instanceof String && ((String) o).length() == 0)) { ValueExpression vex = comp.getValueExpression("label"); if (null != vex) return (String) vex.getValue(context.getELContext()); } if (o == null) { // Use the "clientId" if there was no label specified. o = comp.getClientId(context); } return (String) o; } }
public class class_name { public static String getLabel(FacesContext context, UIComponent comp) { Object o = comp.getAttributes().get("label"); if (o == null || (o instanceof String && ((String) o).length() == 0)) { ValueExpression vex = comp.getValueExpression("label"); if (null != vex) return (String) vex.getValue(context.getELContext()); } if (o == null) { // Use the "clientId" if there was no label specified. o = comp.getClientId(context); // depends on control dependency: [if], data = [none] } return (String) o; } }
public class class_name { private <IN1, IN2> TypeInformation<?>[] createSubTypesInfo(Type originalType, ParameterizedType definingType, ArrayList<Type> typeHierarchy, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, boolean lenient) { Type[] subtypes = new Type[definingType.getActualTypeArguments().length]; // materialize possible type variables for (int i = 0; i < subtypes.length; i++) { final Type actualTypeArg = definingType.getActualTypeArguments()[i]; // materialize immediate TypeVariables if (actualTypeArg instanceof TypeVariable<?>) { subtypes[i] = materializeTypeVariable(typeHierarchy, (TypeVariable<?>) actualTypeArg); } // class or parameterized type else { subtypes[i] = actualTypeArg; } } TypeInformation<?>[] subTypesInfo = new TypeInformation<?>[subtypes.length]; for (int i = 0; i < subtypes.length; i++) { final ArrayList<Type> subTypeHierarchy = new ArrayList<>(typeHierarchy); subTypeHierarchy.add(subtypes[i]); // sub type could not be determined with materializing // try to derive the type info of the TypeVariable from the immediate base child input as a last attempt if (subtypes[i] instanceof TypeVariable<?>) { subTypesInfo[i] = createTypeInfoFromInputs((TypeVariable<?>) subtypes[i], subTypeHierarchy, in1Type, in2Type); // variable could not be determined if (subTypesInfo[i] == null && !lenient) { throw new InvalidTypesException("Type of TypeVariable '" + ((TypeVariable<?>) subtypes[i]).getName() + "' in '" + ((TypeVariable<?>) subtypes[i]).getGenericDeclaration() + "' could not be determined. This is most likely a type erasure problem. " + "The type extraction currently supports types with generic variables only in cases where " + "all variables in the return type can be deduced from the input type(s). " + "Otherwise the type has to be specified explicitly using type information."); } } else { // create the type information of the subtype or null/exception try { subTypesInfo[i] = createTypeInfoWithTypeHierarchy(subTypeHierarchy, subtypes[i], in1Type, in2Type); } catch (InvalidTypesException e) { if (lenient) { subTypesInfo[i] = null; } else { throw e; } } } } // check that number of fields matches the number of subtypes if (!lenient) { Class<?> originalTypeAsClass = null; if (isClassType(originalType)) { originalTypeAsClass = typeToClass(originalType); } checkNotNull(originalTypeAsClass, "originalType has an unexpected type"); // check if the class we assumed to conform to the defining type so far is actually a pojo because the // original type contains additional fields. // check for additional fields. int fieldCount = countFieldsInClass(originalTypeAsClass); if(fieldCount > subTypesInfo.length) { return null; } } return subTypesInfo; } }
public class class_name { private <IN1, IN2> TypeInformation<?>[] createSubTypesInfo(Type originalType, ParameterizedType definingType, ArrayList<Type> typeHierarchy, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, boolean lenient) { Type[] subtypes = new Type[definingType.getActualTypeArguments().length]; // materialize possible type variables for (int i = 0; i < subtypes.length; i++) { final Type actualTypeArg = definingType.getActualTypeArguments()[i]; // materialize immediate TypeVariables if (actualTypeArg instanceof TypeVariable<?>) { subtypes[i] = materializeTypeVariable(typeHierarchy, (TypeVariable<?>) actualTypeArg); // depends on control dependency: [if], data = [)] } // class or parameterized type else { subtypes[i] = actualTypeArg; // depends on control dependency: [if], data = [none] } } TypeInformation<?>[] subTypesInfo = new TypeInformation<?>[subtypes.length]; for (int i = 0; i < subtypes.length; i++) { final ArrayList<Type> subTypeHierarchy = new ArrayList<>(typeHierarchy); subTypeHierarchy.add(subtypes[i]); // depends on control dependency: [for], data = [i] // sub type could not be determined with materializing // try to derive the type info of the TypeVariable from the immediate base child input as a last attempt if (subtypes[i] instanceof TypeVariable<?>) { subTypesInfo[i] = createTypeInfoFromInputs((TypeVariable<?>) subtypes[i], subTypeHierarchy, in1Type, in2Type); // depends on control dependency: [if], data = [)] // variable could not be determined if (subTypesInfo[i] == null && !lenient) { throw new InvalidTypesException("Type of TypeVariable '" + ((TypeVariable<?>) subtypes[i]).getName() + "' in '" + ((TypeVariable<?>) subtypes[i]).getGenericDeclaration() + "' could not be determined. This is most likely a type erasure problem. " + "The type extraction currently supports types with generic variables only in cases where " + "all variables in the return type can be deduced from the input type(s). " + "Otherwise the type has to be specified explicitly using type information."); } } else { // create the type information of the subtype or null/exception try { subTypesInfo[i] = createTypeInfoWithTypeHierarchy(subTypeHierarchy, subtypes[i], in1Type, in2Type); // depends on control dependency: [try], data = [none] } catch (InvalidTypesException e) { if (lenient) { subTypesInfo[i] = null; // depends on control dependency: [if], data = [none] } else { throw e; } } // depends on control dependency: [catch], data = [none] } } // check that number of fields matches the number of subtypes if (!lenient) { Class<?> originalTypeAsClass = null; // depends on control dependency: [if], data = [none] if (isClassType(originalType)) { originalTypeAsClass = typeToClass(originalType); // depends on control dependency: [if], data = [none] } checkNotNull(originalTypeAsClass, "originalType has an unexpected type"); // depends on control dependency: [if], data = [none] // check if the class we assumed to conform to the defining type so far is actually a pojo because the // original type contains additional fields. // check for additional fields. int fieldCount = countFieldsInClass(originalTypeAsClass); if(fieldCount > subTypesInfo.length) { return null; // depends on control dependency: [if], data = [none] } } return subTypesInfo; } }
public class class_name { public static void invertLower( double L[] , int m ) { for( int i = 0; i < m; i++ ) { double L_ii = L[ i*m + i ]; for( int j = 0; j < i; j++ ) { double val = 0; for( int k = j; k < i; k++ ) { val += L[ i*m + k] * L[ k*m + j ]; } L[ i*m + j ] = -val / L_ii; } L[ i*m + i ] = 1.0 / L_ii; } } }
public class class_name { public static void invertLower( double L[] , int m ) { for( int i = 0; i < m; i++ ) { double L_ii = L[ i*m + i ]; for( int j = 0; j < i; j++ ) { double val = 0; for( int k = j; k < i; k++ ) { val += L[ i*m + k] * L[ k*m + j ]; // depends on control dependency: [for], data = [k] } L[ i*m + j ] = -val / L_ii; // depends on control dependency: [for], data = [j] } L[ i*m + i ] = 1.0 / L_ii; // depends on control dependency: [for], data = [i] } } }
public class class_name { public static Font createFont(File fontFile) { try { return Font.createFont(Font.TRUETYPE_FONT, fontFile); } catch (FontFormatException e) { // True Type字体无效时使用Type1字体 try { return Font.createFont(Font.TYPE1_FONT, fontFile); } catch (Exception e1) { throw new UtilException(e); } } catch (IOException e) { throw new IORuntimeException(e); } } }
public class class_name { public static Font createFont(File fontFile) { try { return Font.createFont(Font.TRUETYPE_FONT, fontFile); // depends on control dependency: [try], data = [none] } catch (FontFormatException e) { // True Type字体无效时使用Type1字体 try { return Font.createFont(Font.TYPE1_FONT, fontFile); // depends on control dependency: [try], data = [none] } catch (Exception e1) { throw new UtilException(e); } // depends on control dependency: [catch], data = [none] } catch (IOException e) { // depends on control dependency: [catch], data = [none] throw new IORuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public byte[] compRequest(CommsConnection conn, int productVersion, int packetId, byte[] data) { //Venu liberty change // using CommsConstants instead of JfapChanelConstants if(packetId == CommsConstants.SEG_REQUEST_SCHEMA){ // get the requested schemata from the SchemaManager return SchemaManager.getEncodedSchemataByEncodedIDs(data); } else{ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Invalid packetId"); SIErrorException e = new SIErrorException(); FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.CompHandshakeImpl.compRequest", "123", this); throw e; } } }
public class class_name { public byte[] compRequest(CommsConnection conn, int productVersion, int packetId, byte[] data) { //Venu liberty change // using CommsConstants instead of JfapChanelConstants if(packetId == CommsConstants.SEG_REQUEST_SCHEMA){ // get the requested schemata from the SchemaManager return SchemaManager.getEncodedSchemataByEncodedIDs(data); // depends on control dependency: [if], data = [none] } else{ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Invalid packetId"); SIErrorException e = new SIErrorException(); FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.CompHandshakeImpl.compRequest", "123", this); // depends on control dependency: [if], data = [none] throw e; } } }
public class class_name { public static Object stringToSqlValue(String value, int sqlType, boolean isRequired, boolean isEmptyStringNulled) { // 设置变量 String sourceValue = value; if (SqlUtils.isTextType(sqlType)) { if ((sourceValue == null) || (true == StringUtils.isEmpty(sourceValue) && isEmptyStringNulled)) { return isRequired ? REQUIRED_FIELD_NULL_SUBSTITUTE : null; } else { return sourceValue; } } else { if (StringUtils.isEmpty(sourceValue)) { return isEmptyStringNulled ? null : sourceValue;// oracle的返回null,保持兼容 } else { Class<?> requiredType = sqlTypeToJavaTypeMap.get(sqlType); if (requiredType == null) { throw new IllegalArgumentException("unknow java.sql.Types - " + sqlType); } else if (requiredType.equals(String.class)) { return sourceValue; } else if (true == isNumeric(sqlType)) { return convertUtilsBean.convert(sourceValue.trim(), requiredType); } else { return convertUtilsBean.convert(sourceValue, requiredType); } } } } }
public class class_name { public static Object stringToSqlValue(String value, int sqlType, boolean isRequired, boolean isEmptyStringNulled) { // 设置变量 String sourceValue = value; if (SqlUtils.isTextType(sqlType)) { if ((sourceValue == null) || (true == StringUtils.isEmpty(sourceValue) && isEmptyStringNulled)) { return isRequired ? REQUIRED_FIELD_NULL_SUBSTITUTE : null; // depends on control dependency: [if], data = [none] } else { return sourceValue; // depends on control dependency: [if], data = [none] } } else { if (StringUtils.isEmpty(sourceValue)) { return isEmptyStringNulled ? null : sourceValue;// oracle的返回null,保持兼容 // depends on control dependency: [if], data = [none] } else { Class<?> requiredType = sqlTypeToJavaTypeMap.get(sqlType); if (requiredType == null) { throw new IllegalArgumentException("unknow java.sql.Types - " + sqlType); } else if (requiredType.equals(String.class)) { return sourceValue; // depends on control dependency: [if], data = [none] } else if (true == isNumeric(sqlType)) { return convertUtilsBean.convert(sourceValue.trim(), requiredType); // depends on control dependency: [if], data = [none] } else { return convertUtilsBean.convert(sourceValue, requiredType); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public static IUnitizingAnnotationUnit findNextUnit( final Iterator<IUnitizingAnnotationUnit> units, int raterIdx, final Object category) { while (units.hasNext()) { IUnitizingAnnotationUnit result = units.next(); if (category != null && !category.equals(result.getCategory())) { continue; } if (raterIdx < 0 || result.getRaterIdx() == raterIdx) { return result; } } return null; } }
public class class_name { public static IUnitizingAnnotationUnit findNextUnit( final Iterator<IUnitizingAnnotationUnit> units, int raterIdx, final Object category) { while (units.hasNext()) { IUnitizingAnnotationUnit result = units.next(); if (category != null && !category.equals(result.getCategory())) { continue; } if (raterIdx < 0 || result.getRaterIdx() == raterIdx) { return result; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public TypeSignature getTypeSignature(Type type) { FullTypeSignature typeSignature = getFullTypeSignature(type); if (typeSignature != null) { return typeSignature; } if (type instanceof WildcardType) { return getTypeArgSignature((WildcardType) type); } return null; } }
public class class_name { public TypeSignature getTypeSignature(Type type) { FullTypeSignature typeSignature = getFullTypeSignature(type); if (typeSignature != null) { return typeSignature; // depends on control dependency: [if], data = [none] } if (type instanceof WildcardType) { return getTypeArgSignature((WildcardType) type); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public static DateItem fromString(String code) { String[] items = code.split("\n"); if(items.length != 6) return null; int year, month, day, id; try { year = Integer.parseInt(items[2]); month = Integer.parseInt(items[3]); day = Integer.parseInt(items[4]); id = Integer.parseInt(items[5]); } catch (NumberFormatException e) { e.printStackTrace(); return null; } return new DateItem(emptyToNull(items[0]), emptyToNull(items[1]), year, month, day, id); } }
public class class_name { public static DateItem fromString(String code) { String[] items = code.split("\n"); if(items.length != 6) return null; int year, month, day, id; try { year = Integer.parseInt(items[2]); // depends on control dependency: [try], data = [none] month = Integer.parseInt(items[3]); // depends on control dependency: [try], data = [none] day = Integer.parseInt(items[4]); // depends on control dependency: [try], data = [none] id = Integer.parseInt(items[5]); // depends on control dependency: [try], data = [none] } catch (NumberFormatException e) { e.printStackTrace(); return null; } // depends on control dependency: [catch], data = [none] return new DateItem(emptyToNull(items[0]), emptyToNull(items[1]), year, month, day, id); } }
public class class_name { private LockedObject generateLockedObjects( String path ) { if (!locks.containsKey(path)) { LockedObject returnObject = new LockedObject(this, path, !temporary); String parentPath = getParentPath(path); if (parentPath != null) { LockedObject parentLockedObject = generateLockedObjects(parentPath); parentLockedObject.addChild(returnObject); returnObject.parent = parentLockedObject; } return returnObject; } // there is already a LockedObject on the specified path return this.locks.get(path); } }
public class class_name { private LockedObject generateLockedObjects( String path ) { if (!locks.containsKey(path)) { LockedObject returnObject = new LockedObject(this, path, !temporary); String parentPath = getParentPath(path); if (parentPath != null) { LockedObject parentLockedObject = generateLockedObjects(parentPath); parentLockedObject.addChild(returnObject); // depends on control dependency: [if], data = [none] returnObject.parent = parentLockedObject; // depends on control dependency: [if], data = [none] } return returnObject; // depends on control dependency: [if], data = [none] } // there is already a LockedObject on the specified path return this.locks.get(path); } }
public class class_name { public static DeploymentType parseDeployment(String deploymentURL) { // get the URL/path for the deployment and prep an InputStream InputStream deployIS = null; try { URL deployURL = new URL(deploymentURL); deployIS = deployURL.openStream(); } catch (MalformedURLException ex) { // Invalid URL. Try as a file. try { deployIS = new FileInputStream(deploymentURL); } catch (FileNotFoundException e) { deployIS = null; } } catch (IOException ioex) { deployIS = null; } // make sure the file exists if (deployIS == null) { hostLog.error("Could not locate deployment info at given URL: " + deploymentURL); return null; } else { hostLog.info("URL of deployment info: " + deploymentURL); } return getDeployment(deployIS); } }
public class class_name { public static DeploymentType parseDeployment(String deploymentURL) { // get the URL/path for the deployment and prep an InputStream InputStream deployIS = null; try { URL deployURL = new URL(deploymentURL); deployIS = deployURL.openStream(); // depends on control dependency: [try], data = [none] } catch (MalformedURLException ex) { // Invalid URL. Try as a file. try { deployIS = new FileInputStream(deploymentURL); // depends on control dependency: [try], data = [none] } catch (FileNotFoundException e) { deployIS = null; } // depends on control dependency: [catch], data = [none] } catch (IOException ioex) { // depends on control dependency: [catch], data = [none] deployIS = null; } // depends on control dependency: [catch], data = [none] // make sure the file exists if (deployIS == null) { hostLog.error("Could not locate deployment info at given URL: " + deploymentURL); // depends on control dependency: [if], data = [none] return null; // depends on control dependency: [if], data = [none] } else { hostLog.info("URL of deployment info: " + deploymentURL); // depends on control dependency: [if], data = [none] } return getDeployment(deployIS); } }
public class class_name { static private float[][] splitArray(final float[] array, final int blockSize) { int size = array.length / blockSize; float[][] split = new float[size][]; for (int i = 0; i < size; i++) { split[i] = subArray(array, i * blockSize, blockSize); } return split; } }
public class class_name { static private float[][] splitArray(final float[] array, final int blockSize) { int size = array.length / blockSize; float[][] split = new float[size][]; for (int i = 0; i < size; i++) { split[i] = subArray(array, i * blockSize, blockSize); // depends on control dependency: [for], data = [i] } return split; } }
public class class_name { private String getTextChunk(final String string, final int slength, final int marker) { final StringBuilder chunk = new StringBuilder(); for (int index = marker; index < slength; index++) { final char c = string.charAt(index); if (isDigit(c)) { break; } chunk.append(c); } return chunk.toString(); } }
public class class_name { private String getTextChunk(final String string, final int slength, final int marker) { final StringBuilder chunk = new StringBuilder(); for (int index = marker; index < slength; index++) { final char c = string.charAt(index); if (isDigit(c)) { break; } chunk.append(c); // depends on control dependency: [for], data = [none] } return chunk.toString(); } }
public class class_name { private void setAdminAttribute(Account account) { if (adminGroups != null) { for (String adminGroup : adminGroups) { if (adminGroup.startsWith("@") && account.getUsername().equalsIgnoreCase(adminGroup.substring(1))) { // admin user account.getAuthorizations().addPermission("*"); } else if (account.hasRole(adminGroup)) { // admin role account.getAuthorizations().addPermission("*"); } } } } }
public class class_name { private void setAdminAttribute(Account account) { if (adminGroups != null) { for (String adminGroup : adminGroups) { if (adminGroup.startsWith("@") && account.getUsername().equalsIgnoreCase(adminGroup.substring(1))) { // admin user account.getAuthorizations().addPermission("*"); // depends on control dependency: [if], data = [none] } else if (account.hasRole(adminGroup)) { // admin role account.getAuthorizations().addPermission("*"); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public ReleaseHostsResult withSuccessful(String... successful) { if (this.successful == null) { setSuccessful(new com.amazonaws.internal.SdkInternalList<String>(successful.length)); } for (String ele : successful) { this.successful.add(ele); } return this; } }
public class class_name { public ReleaseHostsResult withSuccessful(String... successful) { if (this.successful == null) { setSuccessful(new com.amazonaws.internal.SdkInternalList<String>(successful.length)); // depends on control dependency: [if], data = [none] } for (String ele : successful) { this.successful.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private Object readOrLoadItem(long sequence) { Object item; if (sequence < ringbuffer.headSequence() && store.isEnabled()) { item = store.load(sequence); } else { item = ringbuffer.read(sequence); } return item; } }
public class class_name { private Object readOrLoadItem(long sequence) { Object item; if (sequence < ringbuffer.headSequence() && store.isEnabled()) { item = store.load(sequence); // depends on control dependency: [if], data = [(sequence] } else { item = ringbuffer.read(sequence); // depends on control dependency: [if], data = [(sequence] } return item; } }
public class class_name { public void onLeafClick(LeafClickEvent event) { try { if (isIconTargetClicked()) { onIconClick(event.getLeaf()); } else { LayerTreeTreeNode layerTreeNode = (LayerTreeTreeNode) event.getLeaf(); mapModel.selectLayer(layerTreeNode.getLayer()); } } catch (Exception e) { // NOSONAR Log.logError(e.getMessage()); // some other unusable element } } }
public class class_name { public void onLeafClick(LeafClickEvent event) { try { if (isIconTargetClicked()) { onIconClick(event.getLeaf()); // depends on control dependency: [if], data = [none] } else { LayerTreeTreeNode layerTreeNode = (LayerTreeTreeNode) event.getLeaf(); mapModel.selectLayer(layerTreeNode.getLayer()); // depends on control dependency: [if], data = [none] } } catch (Exception e) { // NOSONAR Log.logError(e.getMessage()); // some other unusable element } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override protected void doHandle(CommandContext ctx) throws CommandLineException { final ModelControllerClient client = ctx.getModelControllerClient(); if(client == null) { throw new CommandLineException("Connection is not available."); } if (embeddedServerRef != null && embeddedServerRef.get() != null) { embeddedServerRef.get().stop(); return; } if (!(client instanceof AwaiterModelControllerClient)) { throw new CommandLineException("Unsupported ModelControllerClient implementation " + client.getClass().getName()); } final AwaiterModelControllerClient cliClient = (AwaiterModelControllerClient) client; final ModelNode op = this.buildRequestWithoutHeaders(ctx); boolean disconnect = true; final String restartValue = restart.getValue(ctx.getParsedCommandLine()); if (Util.TRUE.equals(restartValue) || ctx.isDomainMode() && !isLocalHost(ctx.getModelControllerClient(), host.getValue(ctx.getParsedCommandLine()))) { disconnect = false; } try { final ModelNode response = cliClient.execute(op, true); if(!Util.isSuccess(response)) { throw new CommandLineException(Util.getFailureDescription(response)); } } catch(IOException e) { // if it's not connected, it's assumed the connection has already been shutdown if(cliClient.isConnected()) { StreamUtils.safeClose(client); throw new CommandLineException("Failed to execute :shutdown", e); } } if (disconnect) { ctx.disconnectController(); } else { // if I try to reconnect immediately, it'll hang for 5 sec // which the default connection timeout for model controller client // waiting half a sec on my machine works perfectly try { Thread.sleep(2000); } catch (InterruptedException e) { throw new CommandLineException("Interrupted while pausing before reconnecting.", e); } try { cliClient.ensureConnected(ctx.getConfig().getConnectionTimeout() + 1000); } catch(CommandLineException e) { ctx.disconnectController(); throw e; } catch (IOException ex) { if (ex instanceof RedirectException) { if (!Util.reconnectContext((RedirectException) ex, ctx)) { throw new CommandLineException("Can't reconnect context.", ex); } } else { throw new CommandLineException(ex); } } } } }
public class class_name { @Override protected void doHandle(CommandContext ctx) throws CommandLineException { final ModelControllerClient client = ctx.getModelControllerClient(); if(client == null) { throw new CommandLineException("Connection is not available."); } if (embeddedServerRef != null && embeddedServerRef.get() != null) { embeddedServerRef.get().stop(); return; } if (!(client instanceof AwaiterModelControllerClient)) { throw new CommandLineException("Unsupported ModelControllerClient implementation " + client.getClass().getName()); } final AwaiterModelControllerClient cliClient = (AwaiterModelControllerClient) client; final ModelNode op = this.buildRequestWithoutHeaders(ctx); boolean disconnect = true; final String restartValue = restart.getValue(ctx.getParsedCommandLine()); if (Util.TRUE.equals(restartValue) || ctx.isDomainMode() && !isLocalHost(ctx.getModelControllerClient(), host.getValue(ctx.getParsedCommandLine()))) { disconnect = false; } try { final ModelNode response = cliClient.execute(op, true); if(!Util.isSuccess(response)) { throw new CommandLineException(Util.getFailureDescription(response)); } } catch(IOException e) { // if it's not connected, it's assumed the connection has already been shutdown if(cliClient.isConnected()) { StreamUtils.safeClose(client); // depends on control dependency: [if], data = [none] throw new CommandLineException("Failed to execute :shutdown", e); } } if (disconnect) { ctx.disconnectController(); } else { // if I try to reconnect immediately, it'll hang for 5 sec // which the default connection timeout for model controller client // waiting half a sec on my machine works perfectly try { Thread.sleep(2000); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { throw new CommandLineException("Interrupted while pausing before reconnecting.", e); } // depends on control dependency: [catch], data = [none] try { cliClient.ensureConnected(ctx.getConfig().getConnectionTimeout() + 1000); // depends on control dependency: [try], data = [none] } catch(CommandLineException e) { ctx.disconnectController(); throw e; } catch (IOException ex) { // depends on control dependency: [catch], data = [none] if (ex instanceof RedirectException) { if (!Util.reconnectContext((RedirectException) ex, ctx)) { throw new CommandLineException("Can't reconnect context.", ex); } } else { throw new CommandLineException(ex); } } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public void push(T val) { backChunk.values[backPos] = val; backChunk = endChunk; backPos = endPos; if (++endPos != size) { return; } Chunk<T> sc = spareChunk; if (sc != beginChunk) { spareChunk = spareChunk.next; endChunk.next = sc; sc.prev = endChunk; } else { endChunk.next = new Chunk<>(size, memoryPtr); memoryPtr += size; endChunk.next.prev = endChunk; } endChunk = endChunk.next; endPos = 0; } }
public class class_name { public void push(T val) { backChunk.values[backPos] = val; backChunk = endChunk; backPos = endPos; if (++endPos != size) { return; // depends on control dependency: [if], data = [none] } Chunk<T> sc = spareChunk; if (sc != beginChunk) { spareChunk = spareChunk.next; // depends on control dependency: [if], data = [none] endChunk.next = sc; // depends on control dependency: [if], data = [none] sc.prev = endChunk; // depends on control dependency: [if], data = [none] } else { endChunk.next = new Chunk<>(size, memoryPtr); // depends on control dependency: [if], data = [none] memoryPtr += size; // depends on control dependency: [if], data = [none] endChunk.next.prev = endChunk; // depends on control dependency: [if], data = [none] } endChunk = endChunk.next; endPos = 0; } }
public class class_name { @Column(header = Messages.GUI_HISTORY_DIALOG_BUTTON_RESTORE_0, order = 6) public Button getRestoreButton() { if (m_bean.getVersion().getVersionNumber() == null) { return null; } return m_restoreButton; } }
public class class_name { @Column(header = Messages.GUI_HISTORY_DIALOG_BUTTON_RESTORE_0, order = 6) public Button getRestoreButton() { if (m_bean.getVersion().getVersionNumber() == null) { return null; // depends on control dependency: [if], data = [none] } return m_restoreButton; } }
public class class_name { public void updateInNavigation(CmsClientSitemapEntry entry) { if (entry.isInNavigation()) { m_inNavigationStyle.setValue(null); getListItemWidget().setTitleEditable(true); } else { m_inNavigationStyle.setValue(CSS.notInNavigationEntry()); getListItemWidget().setTitleEditable(false); } } }
public class class_name { public void updateInNavigation(CmsClientSitemapEntry entry) { if (entry.isInNavigation()) { m_inNavigationStyle.setValue(null); // depends on control dependency: [if], data = [none] getListItemWidget().setTitleEditable(true); // depends on control dependency: [if], data = [none] } else { m_inNavigationStyle.setValue(CSS.notInNavigationEntry()); // depends on control dependency: [if], data = [none] getListItemWidget().setTitleEditable(false); // depends on control dependency: [if], data = [none] } } }
public class class_name { private String removeLocalParamPrefix(final String q) { int index = q.indexOf('}'); if (index >= 0) { return q.substring(index + 1); } return q; } }
public class class_name { private String removeLocalParamPrefix(final String q) { int index = q.indexOf('}'); if (index >= 0) { return q.substring(index + 1); // depends on control dependency: [if], data = [(index] } return q; } }
public class class_name { protected int getNumberOfSelectedMessages(HttpMessageContainer httpMessageContainer) { if (httpMessageContainer instanceof SelectableHttpMessagesContainer) { return ((SelectableHttpMessagesContainer) httpMessageContainer).getNumberOfSelectedMessages(); } else if (httpMessageContainer instanceof SingleHttpMessageContainer) { return ((SingleHttpMessageContainer) httpMessageContainer).isEmpty() ? 0 : 1; } return 0; } }
public class class_name { protected int getNumberOfSelectedMessages(HttpMessageContainer httpMessageContainer) { if (httpMessageContainer instanceof SelectableHttpMessagesContainer) { return ((SelectableHttpMessagesContainer) httpMessageContainer).getNumberOfSelectedMessages(); // depends on control dependency: [if], data = [none] } else if (httpMessageContainer instanceof SingleHttpMessageContainer) { return ((SingleHttpMessageContainer) httpMessageContainer).isEmpty() ? 0 : 1; // depends on control dependency: [if], data = [none] } return 0; } }
public class class_name { public static <K, V> void putAll(Map<K, V> to, Map<? extends K, ? extends V> from) { if (to != null && from != null) { to.putAll(from); } } }
public class class_name { public static <K, V> void putAll(Map<K, V> to, Map<? extends K, ? extends V> from) { if (to != null && from != null) { to.putAll(from); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void updateConfig(Map<String, Object> config) { Object value = config.get(PROPERTY_CHAIN_START_RETRY_ATTEMPTS); if (null != value) { setChainStartRetryAttempts(value); } value = config.get(PROPERTY_CHAIN_START_RETRY_INTERVAL); if (null != value) { setChainStartRetryInterval(value); } value = config.get(PROPERTY_CHAIN_QUIESCETIMEOUT); if (null != value) { setDefaultChainQuiesceTimeout(value); } value = config.get(PROPERTY_MISSING_CONFIG_WARNING); if (null != value) { setMissingConfigWarning(value); } } }
public class class_name { public void updateConfig(Map<String, Object> config) { Object value = config.get(PROPERTY_CHAIN_START_RETRY_ATTEMPTS); if (null != value) { setChainStartRetryAttempts(value); // depends on control dependency: [if], data = [value)] } value = config.get(PROPERTY_CHAIN_START_RETRY_INTERVAL); if (null != value) { setChainStartRetryInterval(value); // depends on control dependency: [if], data = [value)] } value = config.get(PROPERTY_CHAIN_QUIESCETIMEOUT); if (null != value) { setDefaultChainQuiesceTimeout(value); // depends on control dependency: [if], data = [value)] } value = config.get(PROPERTY_MISSING_CONFIG_WARNING); if (null != value) { setMissingConfigWarning(value); // depends on control dependency: [if], data = [value)] } } }
public class class_name { @Override public String path() { try { return new URI(request.uri()).getRawPath(); } catch (URISyntaxException e) { //NOSONAR // Should never be the case. return uri(); } } }
public class class_name { @Override public String path() { try { return new URI(request.uri()).getRawPath(); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { //NOSONAR // Should never be the case. return uri(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static List <NameValuePair> parse (final URI uri, final String encoding) { final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { List<NameValuePair> result = new ArrayList<NameValuePair>(); Scanner scanner = new Scanner(query); parse(result, scanner, encoding); return result; } else { return Collections.emptyList(); } } }
public class class_name { public static List <NameValuePair> parse (final URI uri, final String encoding) { final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { List<NameValuePair> result = new ArrayList<NameValuePair>(); Scanner scanner = new Scanner(query); parse(result, scanner, encoding); // depends on control dependency: [if], data = [none] return result; // depends on control dependency: [if], data = [none] } else { return Collections.emptyList(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Byte[] toObject(byte... a) { if (a != null) { Byte[] w = new Byte[a.length]; for (int i = 0; i < a.length; i++) { w[i] = a[i]; } return w; } return null; } }
public class class_name { public static Byte[] toObject(byte... a) { if (a != null) { Byte[] w = new Byte[a.length]; for (int i = 0; i < a.length; i++) { w[i] = a[i]; // depends on control dependency: [for], data = [i] } return w; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public void goToHour(double hour){ if (mAreDimensionsInvalid) { mScrollToHour = hour; return; } int verticalOffset = 0; if (hour > 24) verticalOffset = mHourHeight * 24; else if (hour > 0) verticalOffset = (int) (mHourHeight * hour); if (verticalOffset > mHourHeight * 24 - getHeight() + mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom) verticalOffset = (int)(mHourHeight * 24 - getHeight() + mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom); mCurrentOrigin.y = -verticalOffset; invalidate(); } }
public class class_name { public void goToHour(double hour){ if (mAreDimensionsInvalid) { mScrollToHour = hour; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } int verticalOffset = 0; if (hour > 24) verticalOffset = mHourHeight * 24; else if (hour > 0) verticalOffset = (int) (mHourHeight * hour); if (verticalOffset > mHourHeight * 24 - getHeight() + mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom) verticalOffset = (int)(mHourHeight * 24 - getHeight() + mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom); mCurrentOrigin.y = -verticalOffset; invalidate(); } }
public class class_name { protected void makeCoordinateAxes(NetcdfDataset ncDataset) { for (VarProcess vp : varList) { if (vp.isCoordinateAxis || vp.isCoordinateVariable) { if (vp.axisType == null) vp.axisType = getAxisType(ncDataset, (VariableEnhanced) vp.v); if (vp.axisType == null) { userAdvice.format("Coordinate Axis %s does not have an assigned AxisType%n", vp.v.getFullName()); } vp.makeIntoCoordinateAxis(); } } } }
public class class_name { protected void makeCoordinateAxes(NetcdfDataset ncDataset) { for (VarProcess vp : varList) { if (vp.isCoordinateAxis || vp.isCoordinateVariable) { if (vp.axisType == null) vp.axisType = getAxisType(ncDataset, (VariableEnhanced) vp.v); if (vp.axisType == null) { userAdvice.format("Coordinate Axis %s does not have an assigned AxisType%n", vp.v.getFullName()); // depends on control dependency: [if], data = [none] } vp.makeIntoCoordinateAxis(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void setPrincipals(java.util.Collection<PrincipalIdFormat> principals) { if (principals == null) { this.principals = null; return; } this.principals = new com.amazonaws.internal.SdkInternalList<PrincipalIdFormat>(principals); } }
public class class_name { public void setPrincipals(java.util.Collection<PrincipalIdFormat> principals) { if (principals == null) { this.principals = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.principals = new com.amazonaws.internal.SdkInternalList<PrincipalIdFormat>(principals); } }
public class class_name { private static <T, E extends Exception> T runWithOurClassLoader(final Callable<T> action, Class<E> allowed) throws E { PrivilegedExceptionAction<T> actionWithClassloader = new PrivilegedExceptionAction<T>() { public T run() throws Exception { ClassLoader original = Thread.currentThread().getContextClassLoader(); ClassLoader ours = XmlUtil.class.getClassLoader(); // Don't override the TCCL if it is not needed. if (original == ours) { return action.call(); } else { try { Thread.currentThread().setContextClassLoader(ours); return action.call(); } finally { Thread.currentThread().setContextClassLoader(original); } } } }; try { return AccessController.doPrivileged(actionWithClassloader); } catch (PrivilegedActionException e) { Throwable cause = e.getCause(); if (allowed.isInstance(cause)) { throw allowed.cast(cause); } else { throw (Error) new AssertionError().initCause(cause); } } } }
public class class_name { private static <T, E extends Exception> T runWithOurClassLoader(final Callable<T> action, Class<E> allowed) throws E { PrivilegedExceptionAction<T> actionWithClassloader = new PrivilegedExceptionAction<T>() { public T run() throws Exception { ClassLoader original = Thread.currentThread().getContextClassLoader(); ClassLoader ours = XmlUtil.class.getClassLoader(); // Don't override the TCCL if it is not needed. if (original == ours) { return action.call(); // depends on control dependency: [if], data = [none] } else { try { Thread.currentThread().setContextClassLoader(ours); // depends on control dependency: [try], data = [none] return action.call(); // depends on control dependency: [try], data = [none] } finally { Thread.currentThread().setContextClassLoader(original); } } } }; try { return AccessController.doPrivileged(actionWithClassloader); } catch (PrivilegedActionException e) { Throwable cause = e.getCause(); if (allowed.isInstance(cause)) { throw allowed.cast(cause); } else { throw (Error) new AssertionError().initCause(cause); } } } }
public class class_name { @Override public EClass getIfcRatioMeasure() { if (ifcRatioMeasureEClass == null) { ifcRatioMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(856); } return ifcRatioMeasureEClass; } }
public class class_name { @Override public EClass getIfcRatioMeasure() { if (ifcRatioMeasureEClass == null) { ifcRatioMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(856); // depends on control dependency: [if], data = [none] } return ifcRatioMeasureEClass; } }
public class class_name { @Nullable private String _parseToken (final char cTerminator1, final char cTerminator2) { char ch; m_nIndex1 = m_nPos; m_nIndex2 = m_nPos; while (_hasChar ()) { ch = m_aChars[m_nPos]; if (ch == cTerminator1 || ch == cTerminator2) break; m_nIndex2++; m_nPos++; } return _getToken (false); } }
public class class_name { @Nullable private String _parseToken (final char cTerminator1, final char cTerminator2) { char ch; m_nIndex1 = m_nPos; m_nIndex2 = m_nPos; while (_hasChar ()) { ch = m_aChars[m_nPos]; // depends on control dependency: [while], data = [none] if (ch == cTerminator1 || ch == cTerminator2) break; m_nIndex2++; // depends on control dependency: [while], data = [none] m_nPos++; // depends on control dependency: [while], data = [none] } return _getToken (false); } }
public class class_name { public NFNota notaParaObjeto(final File xml) { try { return this.persister.read(NFNota.class, xml); } catch (final Exception e) { throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage())); } } }
public class class_name { public NFNota notaParaObjeto(final File xml) { try { return this.persister.read(NFNota.class, xml); // depends on control dependency: [try], data = [none] } catch (final Exception e) { throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage())); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public String getPeerPublicHostName (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.publicHostName; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? null : peer.getPublicHostName(); } }
public class class_name { public String getPeerPublicHostName (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.publicHostName; // depends on control dependency: [if], data = [none] } PeerNode peer = _peers.get(nodeName); return (peer == null) ? null : peer.getPublicHostName(); } }
public class class_name { private void adjustApproximatedKNNDistances(MkCoPEntry entry, Map<DBID, KNNList> knnLists) { MkCoPTreeNode<O> node = getNode(entry); if(node.isLeaf()) { for(int i = 0; i < node.getNumEntries(); i++) { MkCoPLeafEntry leafEntry = (MkCoPLeafEntry) node.getEntry(i); approximateKnnDistances(leafEntry, knnLists.get(leafEntry.getRoutingObjectID())); } } else { for(int i = 0; i < node.getNumEntries(); i++) { MkCoPEntry dirEntry = node.getEntry(i); adjustApproximatedKNNDistances(dirEntry, knnLists); } } ApproximationLine approx = node.conservativeKnnDistanceApproximation(settings.kmax); entry.setConservativeKnnDistanceApproximation(approx); } }
public class class_name { private void adjustApproximatedKNNDistances(MkCoPEntry entry, Map<DBID, KNNList> knnLists) { MkCoPTreeNode<O> node = getNode(entry); if(node.isLeaf()) { for(int i = 0; i < node.getNumEntries(); i++) { MkCoPLeafEntry leafEntry = (MkCoPLeafEntry) node.getEntry(i); approximateKnnDistances(leafEntry, knnLists.get(leafEntry.getRoutingObjectID())); // depends on control dependency: [for], data = [none] } } else { for(int i = 0; i < node.getNumEntries(); i++) { MkCoPEntry dirEntry = node.getEntry(i); adjustApproximatedKNNDistances(dirEntry, knnLists); // depends on control dependency: [for], data = [none] } } ApproximationLine approx = node.conservativeKnnDistanceApproximation(settings.kmax); entry.setConservativeKnnDistanceApproximation(approx); } }
public class class_name { private static Observable<PingServiceHealth> pingQuery( final NetworkAddress hostname, final String bucket, final String password, final ClusterFacade core, final long timeout, final TimeUnit timeUnit) { final AtomicReference<CouchbaseRequest> request = new AtomicReference<CouchbaseRequest>(); Observable<com.couchbase.client.core.message.query.PingResponse> response = Observable.defer(new Func0<Observable<com.couchbase.client.core.message.query.PingResponse>>() { @Override public Observable<com.couchbase.client.core.message.query.PingResponse> call() { CouchbaseRequest r; try { r = new com.couchbase.client.core.message.query.PingRequest( InetAddress.getByName(hostname.address()), bucket, password ); } catch (Exception e) { return Observable.error(e); } request.set(r); return core.send(r); } }).timeout(timeout, timeUnit); return mapToServiceHealth(null, ServiceType.QUERY, response, request, timeout, timeUnit); } }
public class class_name { private static Observable<PingServiceHealth> pingQuery( final NetworkAddress hostname, final String bucket, final String password, final ClusterFacade core, final long timeout, final TimeUnit timeUnit) { final AtomicReference<CouchbaseRequest> request = new AtomicReference<CouchbaseRequest>(); Observable<com.couchbase.client.core.message.query.PingResponse> response = Observable.defer(new Func0<Observable<com.couchbase.client.core.message.query.PingResponse>>() { @Override public Observable<com.couchbase.client.core.message.query.PingResponse> call() { CouchbaseRequest r; try { r = new com.couchbase.client.core.message.query.PingRequest( InetAddress.getByName(hostname.address()), bucket, password ); // depends on control dependency: [try], data = [none] } catch (Exception e) { return Observable.error(e); } // depends on control dependency: [catch], data = [none] request.set(r); return core.send(r); } }).timeout(timeout, timeUnit); return mapToServiceHealth(null, ServiceType.QUERY, response, request, timeout, timeUnit); } }
public class class_name { public void dumpTo(OutputStream out) { PrintWriter writer; try { writer = new PrintWriter(new OutputStreamWriter(out, "utf-8")); } catch (UnsupportedEncodingException e) { writer = new PrintWriter(out); } recursiveDump(root, 0, writer); writer.close(); } }
public class class_name { public void dumpTo(OutputStream out) { PrintWriter writer; try { writer = new PrintWriter(new OutputStreamWriter(out, "utf-8")); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException e) { writer = new PrintWriter(out); } // depends on control dependency: [catch], data = [none] recursiveDump(root, 0, writer); writer.close(); } }
public class class_name { public static String escapeHtml(String source) { if (source == null) { return null; } source = escapeXml(source); source = substitute(source, "\r", ""); source = substitute(source, "\n", "<br/>\n"); return source; } }
public class class_name { public static String escapeHtml(String source) { if (source == null) { return null; // depends on control dependency: [if], data = [none] } source = escapeXml(source); source = substitute(source, "\r", ""); source = substitute(source, "\n", "<br/>\n"); return source; } }
public class class_name { public Observable<ServiceResponse<Page<StorageAccountInfoInner>>> listStorageAccountsNextWithServiceResponseAsync(final String nextPageLink) { return listStorageAccountsNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<StorageAccountInfoInner>>, Observable<ServiceResponse<Page<StorageAccountInfoInner>>>>() { @Override public Observable<ServiceResponse<Page<StorageAccountInfoInner>>> call(ServiceResponse<Page<StorageAccountInfoInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listStorageAccountsNextWithServiceResponseAsync(nextPageLink)); } }); } }
public class class_name { public Observable<ServiceResponse<Page<StorageAccountInfoInner>>> listStorageAccountsNextWithServiceResponseAsync(final String nextPageLink) { return listStorageAccountsNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<StorageAccountInfoInner>>, Observable<ServiceResponse<Page<StorageAccountInfoInner>>>>() { @Override public Observable<ServiceResponse<Page<StorageAccountInfoInner>>> call(ServiceResponse<Page<StorageAccountInfoInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); // depends on control dependency: [if], data = [none] } return Observable.just(page).concatWith(listStorageAccountsNextWithServiceResponseAsync(nextPageLink)); } }); } }
public class class_name { protected void closeConnection(final String meUuid) { final String methodName = "closeConnection"; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, meUuid); } closeConnection (meUuid, false); if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); } } }
public class class_name { protected void closeConnection(final String meUuid) { final String methodName = "closeConnection"; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, meUuid); // depends on control dependency: [if], data = [none] } closeConnection (meUuid, false); if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String joinP(String delimiter, char... chars) { StringBuilder builder = new StringBuilder(chars.length + (delimiter.length() * chars.length)); boolean first = true; for (char c : chars) { if (first) { first = false; } else { builder.append(delimiter); } builder.append(c); } return builder.toString(); } }
public class class_name { public static String joinP(String delimiter, char... chars) { StringBuilder builder = new StringBuilder(chars.length + (delimiter.length() * chars.length)); boolean first = true; for (char c : chars) { if (first) { first = false; // depends on control dependency: [if], data = [none] } else { builder.append(delimiter); // depends on control dependency: [if], data = [none] } builder.append(c); // depends on control dependency: [for], data = [c] } return builder.toString(); } }
public class class_name { @Override public LocalDate with(TemporalField field, long newValue) { if (field instanceof ChronoField) { ChronoField f = (ChronoField) field; f.checkValidValue(newValue); switch (f) { case DAY_OF_WEEK: return plusDays(newValue - getDayOfWeek().getValue()); case ALIGNED_DAY_OF_WEEK_IN_MONTH: return plusDays(newValue - getLong(ALIGNED_DAY_OF_WEEK_IN_MONTH)); case ALIGNED_DAY_OF_WEEK_IN_YEAR: return plusDays(newValue - getLong(ALIGNED_DAY_OF_WEEK_IN_YEAR)); case DAY_OF_MONTH: return withDayOfMonth((int) newValue); case DAY_OF_YEAR: return withDayOfYear((int) newValue); case EPOCH_DAY: return LocalDate.ofEpochDay(newValue); case ALIGNED_WEEK_OF_MONTH: return plusWeeks(newValue - getLong(ALIGNED_WEEK_OF_MONTH)); case ALIGNED_WEEK_OF_YEAR: return plusWeeks(newValue - getLong(ALIGNED_WEEK_OF_YEAR)); case MONTH_OF_YEAR: return withMonth((int) newValue); case PROLEPTIC_MONTH: return plusMonths(newValue - getProlepticMonth()); case YEAR_OF_ERA: return withYear((int) (year >= 1 ? newValue : 1 - newValue)); case YEAR: return withYear((int) newValue); case ERA: return (getLong(ERA) == newValue ? this : withYear(1 - year)); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.adjustInto(this, newValue); } }
public class class_name { @Override public LocalDate with(TemporalField field, long newValue) { if (field instanceof ChronoField) { ChronoField f = (ChronoField) field; f.checkValidValue(newValue); // depends on control dependency: [if], data = [none] switch (f) { case DAY_OF_WEEK: return plusDays(newValue - getDayOfWeek().getValue()); case ALIGNED_DAY_OF_WEEK_IN_MONTH: return plusDays(newValue - getLong(ALIGNED_DAY_OF_WEEK_IN_MONTH)); case ALIGNED_DAY_OF_WEEK_IN_YEAR: return plusDays(newValue - getLong(ALIGNED_DAY_OF_WEEK_IN_YEAR)); case DAY_OF_MONTH: return withDayOfMonth((int) newValue); case DAY_OF_YEAR: return withDayOfYear((int) newValue); case EPOCH_DAY: return LocalDate.ofEpochDay(newValue); case ALIGNED_WEEK_OF_MONTH: return plusWeeks(newValue - getLong(ALIGNED_WEEK_OF_MONTH)); case ALIGNED_WEEK_OF_YEAR: return plusWeeks(newValue - getLong(ALIGNED_WEEK_OF_YEAR)); case MONTH_OF_YEAR: return withMonth((int) newValue); case PROLEPTIC_MONTH: return plusMonths(newValue - getProlepticMonth()); case YEAR_OF_ERA: return withYear((int) (year >= 1 ? newValue : 1 - newValue)); case YEAR: return withYear((int) newValue); case ERA: return (getLong(ERA) == newValue ? this : withYear(1 - year)); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.adjustInto(this, newValue); } }
public class class_name { private static GeometricParity geometric2D(Map<IAtom, Integer> elevationMap, List<IBond> bonds, int i, int[] adjacent, IAtomContainer container) { IAtom atom = container.getAtom(i); // create map of the atoms and their elevation from the center, makeElevationMap(atom, bonds, elevationMap); Point2d[] coordinates = new Point2d[4]; int[] elevations = new int[4]; // set the forth ligand to centre as default (overwritten if // we have 4 neighbors) if (atom.getPoint2d() != null) coordinates[3] = atom.getPoint2d(); else return null; for (int j = 0; j < adjacent.length; j++) { IAtom neighbor = container.getAtom(adjacent[j]); elevations[j] = elevationMap.get(neighbor); if (neighbor.getPoint2d() != null) coordinates[j] = neighbor.getPoint2d(); else return null; // skip to next atom } return new Tetrahedral2DParity(coordinates, elevations); } }
public class class_name { private static GeometricParity geometric2D(Map<IAtom, Integer> elevationMap, List<IBond> bonds, int i, int[] adjacent, IAtomContainer container) { IAtom atom = container.getAtom(i); // create map of the atoms and their elevation from the center, makeElevationMap(atom, bonds, elevationMap); Point2d[] coordinates = new Point2d[4]; int[] elevations = new int[4]; // set the forth ligand to centre as default (overwritten if // we have 4 neighbors) if (atom.getPoint2d() != null) coordinates[3] = atom.getPoint2d(); else return null; for (int j = 0; j < adjacent.length; j++) { IAtom neighbor = container.getAtom(adjacent[j]); elevations[j] = elevationMap.get(neighbor); // depends on control dependency: [for], data = [j] if (neighbor.getPoint2d() != null) coordinates[j] = neighbor.getPoint2d(); else return null; // skip to next atom } return new Tetrahedral2DParity(coordinates, elevations); } }
public class class_name { public com.groupon.odo.proxylib.models.Method getMethodForEnabledId(int enabledId) { com.groupon.odo.proxylib.models.Method method = null; int override_id = 0; PreparedStatement queryStatement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { queryStatement = sqlConnection.prepareStatement( "SELECT * FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE + " WHERE " + Constants.ENABLED_OVERRIDES_OVERRIDE_ID + " = ?" ); queryStatement.setInt(1, enabledId); results = queryStatement.executeQuery(); if (results.next()) { override_id = results.getInt(Constants.ENABLED_OVERRIDES_OVERRIDE_ID); queryStatement = sqlConnection.prepareStatement( "SELECT * FROM " + Constants.DB_TABLE_OVERRIDE + " WHERE " + Constants.GENERIC_ID + " = ?" ); queryStatement.setInt(1, override_id); results = queryStatement.executeQuery(); if (results.next()) { method = new com.groupon.odo.proxylib.models.Method(); method.setId(override_id); method.setClassName(results.getString(Constants.OVERRIDE_CLASS_NAME)); method.setMethodName(results.getString(Constants.OVERRIDE_METHOD_NAME)); } } } catch (SQLException e) { e.printStackTrace(); } finally { try { if (results != null) { results.close(); } } catch (Exception e) { } try { if (queryStatement != null) { queryStatement.close(); } } catch (Exception e) { } } // now get the rest of the data from the plugin manager // this gets all of the actual data try { method = PluginManager.getInstance().getMethod(method.getClassName(), method.getMethodName()); method.setId(override_id); } catch (Exception e) { e.printStackTrace(); } return method; } }
public class class_name { public com.groupon.odo.proxylib.models.Method getMethodForEnabledId(int enabledId) { com.groupon.odo.proxylib.models.Method method = null; int override_id = 0; PreparedStatement queryStatement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { queryStatement = sqlConnection.prepareStatement( "SELECT * FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE + " WHERE " + Constants.ENABLED_OVERRIDES_OVERRIDE_ID + " = ?" ); queryStatement.setInt(1, enabledId); results = queryStatement.executeQuery(); if (results.next()) { override_id = results.getInt(Constants.ENABLED_OVERRIDES_OVERRIDE_ID); // depends on control dependency: [if], data = [none] queryStatement = sqlConnection.prepareStatement( "SELECT * FROM " + Constants.DB_TABLE_OVERRIDE + " WHERE " + Constants.GENERIC_ID + " = ?" ); // depends on control dependency: [if], data = [none] queryStatement.setInt(1, override_id); // depends on control dependency: [if], data = [none] results = queryStatement.executeQuery(); // depends on control dependency: [if], data = [none] if (results.next()) { method = new com.groupon.odo.proxylib.models.Method(); // depends on control dependency: [if], data = [none] method.setId(override_id); // depends on control dependency: [if], data = [none] method.setClassName(results.getString(Constants.OVERRIDE_CLASS_NAME)); // depends on control dependency: [if], data = [none] method.setMethodName(results.getString(Constants.OVERRIDE_METHOD_NAME)); // depends on control dependency: [if], data = [none] } } } catch (SQLException e) { e.printStackTrace(); } finally { try { if (results != null) { results.close(); // depends on control dependency: [if], data = [none] } } catch (Exception e) { } // depends on control dependency: [catch], data = [none] try { if (queryStatement != null) { queryStatement.close(); // depends on control dependency: [if], data = [none] } } catch (Exception e) { } // depends on control dependency: [catch], data = [none] } // now get the rest of the data from the plugin manager // this gets all of the actual data try { method = PluginManager.getInstance().getMethod(method.getClassName(), method.getMethodName()); method.setId(override_id); } catch (Exception e) { e.printStackTrace(); } return method; } }
public class class_name { public String getJsDoc() { Comment comment = getJsDocNode(); if (comment != null) { return comment.getValue(); } return null; } }
public class class_name { public String getJsDoc() { Comment comment = getJsDocNode(); if (comment != null) { return comment.getValue(); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public DoubleVector centerOfMass() { // Handle lazy initialization if (centroid == null) { if (indices.size() == 1) centroid = sumVector; else { // Update the centroid by normalizing by the number of elements. // We expect that the centroid vector might be compared with // other vectors multiple times. If we used a ScaledVector here, // we would be re-doing this multiplication each time, which is // wasted. The centerOfMass is already lazily instantiated, so // we know that if we do the computation here we'll be using the // results at least once. Therefore do the normalization here // once to save cost. int length = sumVector.length(); double d = 1d / indices.size(); if (sumVector instanceof SparseVector) { centroid = new SparseHashDoubleVector(length); SparseVector sv = (SparseVector)sumVector; for (int nz : sv.getNonZeroIndices()) centroid.set(nz, sumVector.get(nz) * d); } else { centroid = new DenseVector(length); for (int i = 0; i < length; ++i) centroid.set(i, sumVector.get(i) * d); } } } return centroid; } }
public class class_name { public DoubleVector centerOfMass() { // Handle lazy initialization if (centroid == null) { if (indices.size() == 1) centroid = sumVector; else { // Update the centroid by normalizing by the number of elements. // We expect that the centroid vector might be compared with // other vectors multiple times. If we used a ScaledVector here, // we would be re-doing this multiplication each time, which is // wasted. The centerOfMass is already lazily instantiated, so // we know that if we do the computation here we'll be using the // results at least once. Therefore do the normalization here // once to save cost. int length = sumVector.length(); double d = 1d / indices.size(); if (sumVector instanceof SparseVector) { centroid = new SparseHashDoubleVector(length); // depends on control dependency: [if], data = [none] SparseVector sv = (SparseVector)sumVector; for (int nz : sv.getNonZeroIndices()) centroid.set(nz, sumVector.get(nz) * d); } else { centroid = new DenseVector(length); // depends on control dependency: [if], data = [none] for (int i = 0; i < length; ++i) centroid.set(i, sumVector.get(i) * d); } } } return centroid; } }
public class class_name { private static synchronized LogRecordHandler getBinaryHandler() { if (binaryHandler == null) { binaryHandler = new LogRecordHandler(TRACE_THRESHOLD, LogRepositoryManagerImpl.KNOWN_FORMATTERS[0]); } return binaryHandler; } }
public class class_name { private static synchronized LogRecordHandler getBinaryHandler() { if (binaryHandler == null) { binaryHandler = new LogRecordHandler(TRACE_THRESHOLD, LogRepositoryManagerImpl.KNOWN_FORMATTERS[0]); // depends on control dependency: [if], data = [none] } return binaryHandler; } }
public class class_name { public List<List<Object>> getParameterSet(final Statement statement) { List<List<Object>> result = new LinkedList<>(); for (ShardingExecuteGroup<StatementExecuteUnit> each : getExecuteGroups()) { Optional<StatementExecuteUnit> target = getStatementExecuteUnit(statement, each); if (target.isPresent()) { result = getParameterSets(target.get()); break; } } return result; } }
public class class_name { public List<List<Object>> getParameterSet(final Statement statement) { List<List<Object>> result = new LinkedList<>(); for (ShardingExecuteGroup<StatementExecuteUnit> each : getExecuteGroups()) { Optional<StatementExecuteUnit> target = getStatementExecuteUnit(statement, each); if (target.isPresent()) { result = getParameterSets(target.get()); // depends on control dependency: [if], data = [none] break; } } return result; } }
public class class_name { public void marshall(ListResourceInventoryRequest listResourceInventoryRequest, ProtocolMarshaller protocolMarshaller) { if (listResourceInventoryRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listResourceInventoryRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listResourceInventoryRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listResourceInventoryRequest.getFilters(), FILTERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListResourceInventoryRequest listResourceInventoryRequest, ProtocolMarshaller protocolMarshaller) { if (listResourceInventoryRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listResourceInventoryRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listResourceInventoryRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listResourceInventoryRequest.getFilters(), FILTERS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { triggerMaximisation((Component) evt.getSource()); } } }
public class class_name { @Override public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { triggerMaximisation((Component) evt.getSource()); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected static double calcFirstScore(double estimatedValue, double realValue, double estimatedSigma, int smoothingWindow) { if (estimatedSigma == 0) { return 0.0d; } else { // 確率密度関数を適用した結果を算出 double logNumerator = Math.exp(((PDF_EXP_VALUE) * Math.pow(realValue - estimatedValue, 2)) / estimatedSigma); double logDenominator = Math.sqrt(2 * Math.PI) * Math.sqrt(Math.abs(estimatedSigma)); double logValue = logNumerator / logDenominator; return -Math.log(logValue); } } }
public class class_name { protected static double calcFirstScore(double estimatedValue, double realValue, double estimatedSigma, int smoothingWindow) { if (estimatedSigma == 0) { return 0.0d; // depends on control dependency: [if], data = [none] } else { // 確率密度関数を適用した結果を算出 double logNumerator = Math.exp(((PDF_EXP_VALUE) * Math.pow(realValue - estimatedValue, 2)) / estimatedSigma); double logDenominator = Math.sqrt(2 * Math.PI) * Math.sqrt(Math.abs(estimatedSigma)); double logValue = logNumerator / logDenominator; return -Math.log(logValue); // depends on control dependency: [if], data = [none] } } }
public class class_name { public double getProd() { double prod = s.one(); for (int c = 0; c < this.values.length; c++) { prod = s.times(prod, values[c]); } return prod; } }
public class class_name { public double getProd() { double prod = s.one(); for (int c = 0; c < this.values.length; c++) { prod = s.times(prod, values[c]); // depends on control dependency: [for], data = [c] } return prod; } }
public class class_name { public Observable<ServiceResponse<Page<DetectorResponseInner>>> listSiteDetectorResponsesSlotSinglePageAsync(final String resourceGroupName, final String siteName, final String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (siteName == null) { throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DetectorResponseInner>>>>() { @Override public Observable<ServiceResponse<Page<DetectorResponseInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DetectorResponseInner>> result = listSiteDetectorResponsesSlotDelegate(response); return Observable.just(new ServiceResponse<Page<DetectorResponseInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<Page<DetectorResponseInner>>> listSiteDetectorResponsesSlotSinglePageAsync(final String resourceGroupName, final String siteName, final String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (siteName == null) { throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); } if (slot == null) { throw new IllegalArgumentException("Parameter slot is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DetectorResponseInner>>>>() { @Override public Observable<ServiceResponse<Page<DetectorResponseInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DetectorResponseInner>> result = listSiteDetectorResponsesSlotDelegate(response); return Observable.just(new ServiceResponse<Page<DetectorResponseInner>>(result.body(), result.response())); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public long getRowCount(String tileSourceName) { if (tileSourceName == null) { return getRowCount(null, null); } return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName}); } }
public class class_name { public long getRowCount(String tileSourceName) { if (tileSourceName == null) { return getRowCount(null, null); // depends on control dependency: [if], data = [null)] } return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName}); } }
public class class_name { public static Object lookup(String name) { Exception ex = null; try { Object value = new InitialContext().lookup(name); if (value != null) return value; } catch (NamingException e) { ex = e; } if (! name.startsWith("java:")) { try { Object value = new InitialContext().lookup("java:comp/env/" + name); if (value != null) return value; } catch (NamingException e) { ex = e; } } if (ex != null && log.isLoggable(Level.FINEST)) log.log(Level.FINEST, ex.toString(), ex); return null; } }
public class class_name { public static Object lookup(String name) { Exception ex = null; try { Object value = new InitialContext().lookup(name); if (value != null) return value; } catch (NamingException e) { ex = e; } // depends on control dependency: [catch], data = [none] if (! name.startsWith("java:")) { try { Object value = new InitialContext().lookup("java:comp/env/" + name); if (value != null) return value; } catch (NamingException e) { ex = e; } // depends on control dependency: [catch], data = [none] } if (ex != null && log.isLoggable(Level.FINEST)) log.log(Level.FINEST, ex.toString(), ex); return null; } }
public class class_name { public <X> DataSource<X> readFile(FileInputFormat<X> inputFormat, String filePath) { if (inputFormat == null) { throw new IllegalArgumentException("InputFormat must not be null."); } if (filePath == null) { throw new IllegalArgumentException("The file path must not be null."); } inputFormat.setFilePath(new Path(filePath)); try { return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat)); } catch (Exception e) { throw new InvalidProgramException("The type returned by the input format could not be automatically determined. " + "Please specify the TypeInformation of the produced type explicitly by using the " + "'createInput(InputFormat, TypeInformation)' method instead."); } } }
public class class_name { public <X> DataSource<X> readFile(FileInputFormat<X> inputFormat, String filePath) { if (inputFormat == null) { throw new IllegalArgumentException("InputFormat must not be null."); } if (filePath == null) { throw new IllegalArgumentException("The file path must not be null."); } inputFormat.setFilePath(new Path(filePath)); try { return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat)); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new InvalidProgramException("The type returned by the input format could not be automatically determined. " + "Please specify the TypeInformation of the produced type explicitly by using the " + "'createInput(InputFormat, TypeInformation)' method instead."); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void computeMean() { meanError = 0; int size = allPoints.size(); for (PointIndex<Point> inlier : allPoints) { Point pt = inlier.data; meanError += modelError.computeDistance(pt); } meanError /= size; } }
public class class_name { private void computeMean() { meanError = 0; int size = allPoints.size(); for (PointIndex<Point> inlier : allPoints) { Point pt = inlier.data; meanError += modelError.computeDistance(pt); // depends on control dependency: [for], data = [none] } meanError /= size; } }
public class class_name { private static boolean contains(Object[] arr, Object member) { for (Object mem : arr) { if (Objects.equals(mem, member)) { return true; } } return false; } }
public class class_name { private static boolean contains(Object[] arr, Object member) { for (Object mem : arr) { if (Objects.equals(mem, member)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { @Override @SuppressFBWarnings ("IL_INFINITE_LOOP") public void write (final char [] cbuf, final int nOfs, final int nLen) throws IOException { _ensureOpen (); ValueEnforcer.isArrayOfsLen (cbuf, nOfs, nLen); if (nLen == 0) return; if (nLen >= m_nChars) { /* * If the request length exceeds the size of the output buffer, flush the * buffer and then write the data directly. In this way buffered streams * will cascade harmlessly. */ flushBuffer (); m_aWriter.write (cbuf, nOfs, nLen); } else { int b = nOfs; final int t = nOfs + nLen; while (b < t) { final int d = Math.min (m_nChars - m_nNextChar, t - b); System.arraycopy (cbuf, b, m_aBuf, m_nNextChar, d); b += d; m_nNextChar += d; if (m_nNextChar >= m_nChars) flushBuffer (); } } } }
public class class_name { @Override @SuppressFBWarnings ("IL_INFINITE_LOOP") public void write (final char [] cbuf, final int nOfs, final int nLen) throws IOException { _ensureOpen (); ValueEnforcer.isArrayOfsLen (cbuf, nOfs, nLen); if (nLen == 0) return; if (nLen >= m_nChars) { /* * If the request length exceeds the size of the output buffer, flush the * buffer and then write the data directly. In this way buffered streams * will cascade harmlessly. */ flushBuffer (); m_aWriter.write (cbuf, nOfs, nLen); } else { int b = nOfs; final int t = nOfs + nLen; while (b < t) { final int d = Math.min (m_nChars - m_nNextChar, t - b); System.arraycopy (cbuf, b, m_aBuf, m_nNextChar, d); // depends on control dependency: [while], data = [none] b += d; // depends on control dependency: [while], data = [none] m_nNextChar += d; // depends on control dependency: [while], data = [none] if (m_nNextChar >= m_nChars) flushBuffer (); } } } }
public class class_name { public int delete(CMASpaceMembership membership) { final String id = getResourceIdOrThrow(membership, "membership"); final String spaceId = getSpaceIdOrThrow(membership, "membership"); final CMASystem sys = membership.getSystem(); membership.setSystem(null); try { final Response<Void> response = service.delete(spaceId, id).blockingFirst(); return response.code(); } finally { membership.setSystem(sys); } } }
public class class_name { public int delete(CMASpaceMembership membership) { final String id = getResourceIdOrThrow(membership, "membership"); final String spaceId = getSpaceIdOrThrow(membership, "membership"); final CMASystem sys = membership.getSystem(); membership.setSystem(null); try { final Response<Void> response = service.delete(spaceId, id).blockingFirst(); return response.code(); // depends on control dependency: [try], data = [none] } finally { membership.setSystem(sys); } } }
public class class_name { public void parse() throws EOFException { if (!startedStreaming && levelStack.isEmpty()) { readNextChar(null); switch (currentChar) { case (byte) 0xEF: pushLevel(Mode.BOM); break; case O_CURLY: pushLevel(Mode.JSON_OBJECT); break; case O_SQUARE: pushLevel(Mode.JSON_ARRAY); break; default: throw new IllegalStateException("Only UTF-8 is supported"); } startedStreaming = true; } while (true) { if (levelStack.isEmpty()) { return; //nothing more to do } JsonLevel currentLevel = levelStack.peek(); switch (currentLevel.peekMode()) { case BOM: readBOM(); break; case JSON_OBJECT: readObject(currentLevel); break; case JSON_ARRAY: readArray(currentLevel); break; case JSON_OBJECT_VALUE: case JSON_ARRAY_VALUE: case JSON_STRING_HASH_KEY: case JSON_STRING_VALUE: case JSON_BOOLEAN_TRUE_VALUE: case JSON_BOOLEAN_FALSE_VALUE: case JSON_NUMBER_VALUE: case JSON_NULL_VALUE: readValue(currentLevel); break; } } } }
public class class_name { public void parse() throws EOFException { if (!startedStreaming && levelStack.isEmpty()) { readNextChar(null); switch (currentChar) { case (byte) 0xEF: pushLevel(Mode.BOM); break; case O_CURLY: pushLevel(Mode.JSON_OBJECT); break; case O_SQUARE: pushLevel(Mode.JSON_ARRAY); break; default: throw new IllegalStateException("Only UTF-8 is supported"); } startedStreaming = true; } while (true) { if (levelStack.isEmpty()) { return; //nothing more to do // depends on control dependency: [if], data = [none] } JsonLevel currentLevel = levelStack.peek(); switch (currentLevel.peekMode()) { case BOM: readBOM(); break; case JSON_OBJECT: readObject(currentLevel); break; case JSON_ARRAY: readArray(currentLevel); break; case JSON_OBJECT_VALUE: case JSON_ARRAY_VALUE: case JSON_STRING_HASH_KEY: case JSON_STRING_VALUE: case JSON_BOOLEAN_TRUE_VALUE: case JSON_BOOLEAN_FALSE_VALUE: case JSON_NUMBER_VALUE: case JSON_NULL_VALUE: readValue(currentLevel); break; } } } }
public class class_name { @GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{gavc}") public Response get(@PathParam("gavc") final String gavc){ if(LOG.isInfoEnabled()) { LOG.info(String.format("Got a get artifact request [%s]", gavc)); } final ArtifactView view = new ArtifactView(); final DbArtifact dbArtifact = getArtifactHandler().getArtifact(gavc); view.setShouldNotBeUse(dbArtifact.getDoNotUse()); final Artifact artifact = getModelMapper().getArtifact(dbArtifact); view.setArtifact(artifact); final DbOrganization dbOrganization = getArtifactHandler().getOrganization(dbArtifact); if(dbOrganization != null){ final Organization organization = getModelMapper().getOrganization(dbOrganization); view.setOrganization(organization); } DbComment dbComment = getCommentHandler().getLatestComment(gavc, DbArtifact.class.getSimpleName()); if(dbComment != null) { final Comment comment = getModelMapper().getComment(dbComment); view.setComment(comment); } return Response.ok(view).build(); } }
public class class_name { @GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{gavc}") public Response get(@PathParam("gavc") final String gavc){ if(LOG.isInfoEnabled()) { LOG.info(String.format("Got a get artifact request [%s]", gavc)); // depends on control dependency: [if], data = [none] } final ArtifactView view = new ArtifactView(); final DbArtifact dbArtifact = getArtifactHandler().getArtifact(gavc); view.setShouldNotBeUse(dbArtifact.getDoNotUse()); final Artifact artifact = getModelMapper().getArtifact(dbArtifact); view.setArtifact(artifact); final DbOrganization dbOrganization = getArtifactHandler().getOrganization(dbArtifact); if(dbOrganization != null){ final Organization organization = getModelMapper().getOrganization(dbOrganization); view.setOrganization(organization); // depends on control dependency: [if], data = [none] } DbComment dbComment = getCommentHandler().getLatestComment(gavc, DbArtifact.class.getSimpleName()); if(dbComment != null) { final Comment comment = getModelMapper().getComment(dbComment); view.setComment(comment); // depends on control dependency: [if], data = [none] } return Response.ok(view).build(); } }
public class class_name { public static String removeQuerystring(String uriString) { URI uri = createURI(uriString); try { return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), null, null) .toASCIIString(); } catch (URISyntaxException e) { throw new InvalidUriException(e); } } }
public class class_name { public static String removeQuerystring(String uriString) { URI uri = createURI(uriString); try { return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), null, null) .toASCIIString(); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { throw new InvalidUriException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static boolean bestFit( Se3_F64 a ) { SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(true,true,true); if( !svd.decompose(a.R)) throw new RuntimeException("SVD Failed"); CommonOps_DDRM.multTransB(svd.getU(null,false),svd.getV(null,false),a.R); // determinant should be +1 double det = CommonOps_DDRM.det(a.R); if( det < 0 ) { CommonOps_DDRM.scale(-1, a.R); } // compute the determinant of the singular matrix double b = 1.0; double s[] = svd.getSingularValues(); for( int i = 0; i < svd.numberOfSingularValues(); i++ ) { b *= s[i]; } b = Math.signum(det) / Math.pow(b,1.0/3.0); GeometryMath_F64.scale(a.T,b); return true; } }
public class class_name { public static boolean bestFit( Se3_F64 a ) { SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(true,true,true); if( !svd.decompose(a.R)) throw new RuntimeException("SVD Failed"); CommonOps_DDRM.multTransB(svd.getU(null,false),svd.getV(null,false),a.R); // determinant should be +1 double det = CommonOps_DDRM.det(a.R); if( det < 0 ) { CommonOps_DDRM.scale(-1, a.R); // depends on control dependency: [if], data = [none] } // compute the determinant of the singular matrix double b = 1.0; double s[] = svd.getSingularValues(); for( int i = 0; i < svd.numberOfSingularValues(); i++ ) { b *= s[i]; // depends on control dependency: [for], data = [i] } b = Math.signum(det) / Math.pow(b,1.0/3.0); GeometryMath_F64.scale(a.T,b); return true; } }
public class class_name { private void iterateChangedAndAdded(ZipEntryOrInfoAdapter zipEntryCallback) { for (ZipEntrySource entrySource : changedEntries) { InputStream entrySourceStream = null; try { ZipEntry entry = entrySource.getEntry(); if (nameMapper != null) { String mappedName = nameMapper.map(entry.getName()); if (mappedName == null) { continue; // we should ignore this entry } else if (!mappedName.equals(entry.getName())) { // if name is different, do nothing entry = ZipEntryUtil.copy(entry, mappedName); } } entrySourceStream = entrySource.getInputStream(); zipEntryCallback.process(entrySourceStream, entry); } catch (ZipBreakException ex) { break; } catch (IOException e) { ZipExceptionUtil.rethrow(e); } finally { IOUtils.closeQuietly(entrySourceStream); } } } }
public class class_name { private void iterateChangedAndAdded(ZipEntryOrInfoAdapter zipEntryCallback) { for (ZipEntrySource entrySource : changedEntries) { InputStream entrySourceStream = null; try { ZipEntry entry = entrySource.getEntry(); if (nameMapper != null) { String mappedName = nameMapper.map(entry.getName()); if (mappedName == null) { continue; // we should ignore this entry } else if (!mappedName.equals(entry.getName())) { // if name is different, do nothing entry = ZipEntryUtil.copy(entry, mappedName); // depends on control dependency: [if], data = [none] } } entrySourceStream = entrySource.getInputStream(); // depends on control dependency: [try], data = [none] zipEntryCallback.process(entrySourceStream, entry); // depends on control dependency: [try], data = [none] } catch (ZipBreakException ex) { break; } // depends on control dependency: [catch], data = [none] catch (IOException e) { ZipExceptionUtil.rethrow(e); } // depends on control dependency: [catch], data = [none] finally { IOUtils.closeQuietly(entrySourceStream); } } } }
public class class_name { public FillOptions withLatLngs(List<List<LatLng>> latLngs) { List<List<Point>> points = new ArrayList<>(); for (List<LatLng> innerLatLngs : latLngs) { List<Point>innerList = new ArrayList<>(); for (LatLng latLng : innerLatLngs) { innerList.add(Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude())); } points.add(innerList); } geometry = Polygon.fromLngLats(points); return this; } }
public class class_name { public FillOptions withLatLngs(List<List<LatLng>> latLngs) { List<List<Point>> points = new ArrayList<>(); for (List<LatLng> innerLatLngs : latLngs) { List<Point>innerList = new ArrayList<>(); for (LatLng latLng : innerLatLngs) { innerList.add(Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude())); // depends on control dependency: [for], data = [latLng] } points.add(innerList); // depends on control dependency: [for], data = [none] } geometry = Polygon.fromLngLats(points); return this; } }
public class class_name { public <T extends LocalizableResource> T create(Class<T> cls, String locale) { Locale l = null; if (locale != null) { String[] parts = locale.split("_", 3); l = new Locale( parts[0], parts.length > 1 ? parts[1] : "", parts.length > 2 ? parts[2] : "" ); } return LocaleProxy.create(cls, l); } }
public class class_name { public <T extends LocalizableResource> T create(Class<T> cls, String locale) { Locale l = null; if (locale != null) { String[] parts = locale.split("_", 3); l = new Locale( parts[0], parts.length > 1 ? parts[1] : "", parts.length > 2 ? parts[2] : "" ); // depends on control dependency: [if], data = [none] } return LocaleProxy.create(cls, l); } }
public class class_name { public boolean sendCommand(String command) { if (writer != null) { try { logger.info("Sending command " + command + " to remote host " + remoteHost); writer.write(command); writer.write('\r'); writer.flush(); } catch (IOException e) { logger.fatal("Error while sending command " + command + " to remote host " + remoteHost, e); return false; } return true; } else { return false; } } }
public class class_name { public boolean sendCommand(String command) { if (writer != null) { try { logger.info("Sending command " + command + " to remote host " + remoteHost); // depends on control dependency: [try], data = [none] writer.write(command); // depends on control dependency: [try], data = [none] writer.write('\r'); // depends on control dependency: [try], data = [none] writer.flush(); // depends on control dependency: [try], data = [none] } catch (IOException e) { logger.fatal("Error while sending command " + command + " to remote host " + remoteHost, e); return false; } // depends on control dependency: [catch], data = [none] 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 update() { if (this.measures == null || this.measures.length == 0) { // no measures to show -> empty entries for (int i = 0; i < this.currentValues.length; i++) { this.currentValues[i].setText("-"); this.meanValues[i].setText("-"); } return; } DecimalFormat d = new DecimalFormat("0.00"); MeasureCollection mc; if (this.measures.length > this.measureCollectionSelected) { mc = this.measures[this.measureCollectionSelected]; } else { mc = this.measures[0]; } for (int i = 0; i < this.currentValues.length; i++) { // set current value if(Double.isNaN(mc.getLastValue(i))) { this.currentValues[i].setText("-"); } else { this.currentValues[i].setText(d.format(mc.getLastValue(i))); } // set mean value if(Double.isNaN(mc.getMean(i))) { this.meanValues[i].setText("-"); } else { this.meanValues[i].setText(d.format(mc.getMean(i))); } } } }
public class class_name { public void update() { if (this.measures == null || this.measures.length == 0) { // no measures to show -> empty entries for (int i = 0; i < this.currentValues.length; i++) { this.currentValues[i].setText("-"); // depends on control dependency: [for], data = [i] this.meanValues[i].setText("-"); // depends on control dependency: [for], data = [i] } return; // depends on control dependency: [if], data = [none] } DecimalFormat d = new DecimalFormat("0.00"); MeasureCollection mc; if (this.measures.length > this.measureCollectionSelected) { mc = this.measures[this.measureCollectionSelected]; // depends on control dependency: [if], data = [none] } else { mc = this.measures[0]; // depends on control dependency: [if], data = [none] } for (int i = 0; i < this.currentValues.length; i++) { // set current value if(Double.isNaN(mc.getLastValue(i))) { this.currentValues[i].setText("-"); // depends on control dependency: [if], data = [none] } else { this.currentValues[i].setText(d.format(mc.getLastValue(i))); // depends on control dependency: [if], data = [none] } // set mean value if(Double.isNaN(mc.getMean(i))) { this.meanValues[i].setText("-"); // depends on control dependency: [if], data = [none] } else { this.meanValues[i].setText(d.format(mc.getMean(i))); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public java.util.List<DnsEntry> getDnsEntries() { if (dnsEntries == null) { dnsEntries = new com.amazonaws.internal.SdkInternalList<DnsEntry>(); } return dnsEntries; } }
public class class_name { public java.util.List<DnsEntry> getDnsEntries() { if (dnsEntries == null) { dnsEntries = new com.amazonaws.internal.SdkInternalList<DnsEntry>(); // depends on control dependency: [if], data = [none] } return dnsEntries; } }
public class class_name { @Override public RandomVariable add(RandomVariable randomVariable) { if(randomVariable.getTypePriority() > this.getTypePriority()) { // Check type priority return randomVariable.add(this); } // Set time of this random variable to maximum of time with respect to which measurability is known. double newTime = Math.max(time, randomVariable.getFiltrationTime()); if(isDeterministic() && randomVariable.isDeterministic()) { double newValueIfNonStochastic = valueIfNonStochastic + randomVariable.get(0); return new RandomVariableFromDoubleArray(newTime, newValueIfNonStochastic); } else if(isDeterministic()) { double[] newRealizations = new double[Math.max(size(), randomVariable.size())]; for(int i=0; i<newRealizations.length; i++) { newRealizations[i] = valueIfNonStochastic + randomVariable.get(i); } return new RandomVariableFromDoubleArray(newTime, newRealizations); } else { double[] newRealizations = new double[Math.max(size(), randomVariable.size())]; for(int i=0; i<newRealizations.length; i++) { newRealizations[i] = realizations[i] + randomVariable.get(i); } return new RandomVariableFromDoubleArray(newTime, newRealizations); } } }
public class class_name { @Override public RandomVariable add(RandomVariable randomVariable) { if(randomVariable.getTypePriority() > this.getTypePriority()) { // Check type priority return randomVariable.add(this); // depends on control dependency: [if], data = [none] } // Set time of this random variable to maximum of time with respect to which measurability is known. double newTime = Math.max(time, randomVariable.getFiltrationTime()); if(isDeterministic() && randomVariable.isDeterministic()) { double newValueIfNonStochastic = valueIfNonStochastic + randomVariable.get(0); return new RandomVariableFromDoubleArray(newTime, newValueIfNonStochastic); // depends on control dependency: [if], data = [none] } else if(isDeterministic()) { double[] newRealizations = new double[Math.max(size(), randomVariable.size())]; for(int i=0; i<newRealizations.length; i++) { newRealizations[i] = valueIfNonStochastic + randomVariable.get(i); // depends on control dependency: [for], data = [i] } return new RandomVariableFromDoubleArray(newTime, newRealizations); // depends on control dependency: [if], data = [none] } else { double[] newRealizations = new double[Math.max(size(), randomVariable.size())]; for(int i=0; i<newRealizations.length; i++) { newRealizations[i] = realizations[i] + randomVariable.get(i); // depends on control dependency: [for], data = [i] } return new RandomVariableFromDoubleArray(newTime, newRealizations); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static long quorumPosition(final ClusterMember[] members, final long[] rankedPositions) { final int length = rankedPositions.length; for (int i = 0; i < length; i++) { rankedPositions[i] = 0; } for (final ClusterMember member : members) { long newPosition = member.logPosition; for (int i = 0; i < length; i++) { final long rankedPosition = rankedPositions[i]; if (newPosition > rankedPosition) { rankedPositions[i] = newPosition; newPosition = rankedPosition; } } } return rankedPositions[length - 1]; } }
public class class_name { public static long quorumPosition(final ClusterMember[] members, final long[] rankedPositions) { final int length = rankedPositions.length; for (int i = 0; i < length; i++) { rankedPositions[i] = 0; // depends on control dependency: [for], data = [i] } for (final ClusterMember member : members) { long newPosition = member.logPosition; for (int i = 0; i < length; i++) { final long rankedPosition = rankedPositions[i]; if (newPosition > rankedPosition) { rankedPositions[i] = newPosition; // depends on control dependency: [if], data = [none] newPosition = rankedPosition; // depends on control dependency: [if], data = [none] } } } return rankedPositions[length - 1]; } }
public class class_name { public static String qualifyType(VisitorState state, SuggestedFix.Builder fix, String typeName) { for (int startOfClass = typeName.indexOf('.'); startOfClass > 0; startOfClass = typeName.indexOf('.', startOfClass + 1)) { int endOfClass = typeName.indexOf('.', startOfClass + 1); if (endOfClass < 0) { endOfClass = typeName.length(); } if (!Character.isUpperCase(typeName.charAt(startOfClass + 1))) { continue; } String className = typeName.substring(startOfClass + 1); Symbol found = FindIdentifiers.findIdent(className, state, KindSelector.VAL_TYP); // No clashing name: import it and return. if (found == null) { fix.addImport(typeName.substring(0, endOfClass)); return className; } // Type already imported. if (found.getQualifiedName().contentEquals(typeName)) { return className; } } return typeName; } }
public class class_name { public static String qualifyType(VisitorState state, SuggestedFix.Builder fix, String typeName) { for (int startOfClass = typeName.indexOf('.'); startOfClass > 0; startOfClass = typeName.indexOf('.', startOfClass + 1)) { int endOfClass = typeName.indexOf('.', startOfClass + 1); if (endOfClass < 0) { endOfClass = typeName.length(); // depends on control dependency: [if], data = [none] } if (!Character.isUpperCase(typeName.charAt(startOfClass + 1))) { continue; } String className = typeName.substring(startOfClass + 1); Symbol found = FindIdentifiers.findIdent(className, state, KindSelector.VAL_TYP); // No clashing name: import it and return. if (found == null) { fix.addImport(typeName.substring(0, endOfClass)); // depends on control dependency: [if], data = [none] return className; // depends on control dependency: [if], data = [none] } // Type already imported. if (found.getQualifiedName().contentEquals(typeName)) { return className; // depends on control dependency: [if], data = [none] } } return typeName; } }
public class class_name { @Override public @NonNull MirroredIndex getIndex(@NonNull String indexName) { MirroredIndex index = null; WeakReference<Object> existingIndex = indices.get(indexName); if (existingIndex != null) { index = (MirroredIndex)existingIndex.get(); } if (index == null) { index = new MirroredIndex(this, indexName); indices.put(indexName, new WeakReference<Object>(index)); } return index; } }
public class class_name { @Override public @NonNull MirroredIndex getIndex(@NonNull String indexName) { MirroredIndex index = null; WeakReference<Object> existingIndex = indices.get(indexName); if (existingIndex != null) { index = (MirroredIndex)existingIndex.get(); // depends on control dependency: [if], data = [none] } if (index == null) { index = new MirroredIndex(this, indexName); // depends on control dependency: [if], data = [none] indices.put(indexName, new WeakReference<Object>(index)); // depends on control dependency: [if], data = [(index] } return index; } }
public class class_name { public static Iterator<ResidueNumber> multiIterator(final AtomPositionMap map, final ResidueRange... rrs) { return new Iterator<ResidueNumber>() { private int r = 0; private Iterator<ResidueNumber> internal; @Override public boolean hasNext() { if (r == rrs.length - 1) { init(); return internal.hasNext(); } return true; } private void init() { if (internal == null) { internal = rrs[r].iterator(map); } } @Override public ResidueNumber next() { if (rrs.length == 0) throw new NoSuchElementException(); init(); if (!hasNext()) throw new NoSuchElementException(); if (!internal.hasNext()) { r++; internal = rrs[r].iterator(map); } return internal.next(); } @Override public void remove() { throw new UnsupportedOperationException("Not modifiable"); } }; } }
public class class_name { public static Iterator<ResidueNumber> multiIterator(final AtomPositionMap map, final ResidueRange... rrs) { return new Iterator<ResidueNumber>() { private int r = 0; private Iterator<ResidueNumber> internal; @Override public boolean hasNext() { if (r == rrs.length - 1) { init(); // depends on control dependency: [if], data = [none] return internal.hasNext(); // depends on control dependency: [if], data = [none] } return true; } private void init() { if (internal == null) { internal = rrs[r].iterator(map); // depends on control dependency: [if], data = [none] } } @Override public ResidueNumber next() { if (rrs.length == 0) throw new NoSuchElementException(); init(); if (!hasNext()) throw new NoSuchElementException(); if (!internal.hasNext()) { r++; // depends on control dependency: [if], data = [none] internal = rrs[r].iterator(map); // depends on control dependency: [if], data = [none] } return internal.next(); } @Override public void remove() { throw new UnsupportedOperationException("Not modifiable"); } }; } }
public class class_name { private static List<ModuleRef> findModuleRefsFromCallstack(final Class<?>[] callStack, final ScanSpec scanSpec, final LogNode log) { final LinkedHashSet<Object> layers = new LinkedHashSet<>(); if (callStack != null) { for (final Class<?> stackFrameClass : callStack) { final Object /* Module */ module = ReflectionUtils.invokeMethod(stackFrameClass, "getModule", /* throwException = */ false); if (module != null) { final Object /* ModuleLayer */ layer = ReflectionUtils.invokeMethod(module, "getLayer", /* throwException = */ true); // getLayer() returns null for unnamed modules -- have to get their classes from java.class.path if (layer != null) { layers.add(layer); } } } } // Add system modules from boot layer, if they weren't already found in stacktrace Class<?> moduleLayerClass = null; try { moduleLayerClass = Class.forName("java.lang.ModuleLayer"); } catch (ClassNotFoundException | LinkageError e) { // Ignored } if (moduleLayerClass != null) { final Object /* ModuleLayer */ bootLayer = ReflectionUtils.invokeStaticMethod(moduleLayerClass, "boot", /* throwException = */ false); if (bootLayer != null) { layers.add(bootLayer); } } return findModuleRefs(layers, scanSpec, log); } }
public class class_name { private static List<ModuleRef> findModuleRefsFromCallstack(final Class<?>[] callStack, final ScanSpec scanSpec, final LogNode log) { final LinkedHashSet<Object> layers = new LinkedHashSet<>(); if (callStack != null) { for (final Class<?> stackFrameClass : callStack) { final Object /* Module */ module = ReflectionUtils.invokeMethod(stackFrameClass, "getModule", /* throwException = */ false); if (module != null) { final Object /* ModuleLayer */ layer = ReflectionUtils.invokeMethod(module, "getLayer", /* throwException = */ true); // getLayer() returns null for unnamed modules -- have to get their classes from java.class.path if (layer != null) { layers.add(layer); // depends on control dependency: [if], data = [(layer] } } } } // Add system modules from boot layer, if they weren't already found in stacktrace Class<?> moduleLayerClass = null; try { moduleLayerClass = Class.forName("java.lang.ModuleLayer"); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException | LinkageError e) { // Ignored } // depends on control dependency: [catch], data = [none] if (moduleLayerClass != null) { final Object /* ModuleLayer */ bootLayer = ReflectionUtils.invokeStaticMethod(moduleLayerClass, "boot", /* throwException = */ false); if (bootLayer != null) { layers.add(bootLayer); // depends on control dependency: [if], data = [(bootLayer] } } return findModuleRefs(layers, scanSpec, log); } }
public class class_name { @Override public EEnum getIfcInternalOrExternalEnum() { if (ifcInternalOrExternalEnumEEnum == null) { ifcInternalOrExternalEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(1004); } return ifcInternalOrExternalEnumEEnum; } }
public class class_name { @Override public EEnum getIfcInternalOrExternalEnum() { if (ifcInternalOrExternalEnumEEnum == null) { ifcInternalOrExternalEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(1004); // depends on control dependency: [if], data = [none] } return ifcInternalOrExternalEnumEEnum; } }
public class class_name { private void rewriteMethodBody(MutableClass mutableClass, MethodNode callingMethod) { ListIterator<AbstractInsnNode> instructions = callingMethod.instructions.iterator(); while (instructions.hasNext()) { AbstractInsnNode node = instructions.next(); switch (node.getOpcode()) { case Opcodes.NEW: TypeInsnNode newInsnNode = (TypeInsnNode) node; newInsnNode.desc = mutableClass.config.mappedTypeName(newInsnNode.desc); break; case Opcodes.GETFIELD: /* falls through */ case Opcodes.PUTFIELD: /* falls through */ case Opcodes.GETSTATIC: /* falls through */ case Opcodes.PUTSTATIC: FieldInsnNode fieldInsnNode = (FieldInsnNode) node; fieldInsnNode.desc = mutableClass.config.mappedTypeName(fieldInsnNode.desc); // todo test break; case Opcodes.INVOKESTATIC: /* falls through */ case Opcodes.INVOKEINTERFACE: /* falls through */ case Opcodes.INVOKESPECIAL: /* falls through */ case Opcodes.INVOKEVIRTUAL: MethodInsnNode targetMethod = (MethodInsnNode) node; targetMethod.desc = mutableClass.config.remapParams(targetMethod.desc); if (isGregorianCalendarBooleanConstructor(targetMethod)) { replaceGregorianCalendarBooleanConstructor(instructions, targetMethod); } else if (mutableClass.config.shouldIntercept(targetMethod)) { interceptInvokeVirtualMethod(mutableClass, instructions, targetMethod); } break; case Opcodes.INVOKEDYNAMIC: /* no unusual behavior */ break; default: break; } } } }
public class class_name { private void rewriteMethodBody(MutableClass mutableClass, MethodNode callingMethod) { ListIterator<AbstractInsnNode> instructions = callingMethod.instructions.iterator(); while (instructions.hasNext()) { AbstractInsnNode node = instructions.next(); switch (node.getOpcode()) { case Opcodes.NEW: TypeInsnNode newInsnNode = (TypeInsnNode) node; // depends on control dependency: [while], data = [none] newInsnNode.desc = mutableClass.config.mappedTypeName(newInsnNode.desc); // depends on control dependency: [while], data = [none] break; case Opcodes.GETFIELD: /* falls through */ case Opcodes.PUTFIELD: /* falls through */ case Opcodes.GETSTATIC: /* falls through */ case Opcodes.PUTSTATIC: FieldInsnNode fieldInsnNode = (FieldInsnNode) node; fieldInsnNode.desc = mutableClass.config.mappedTypeName(fieldInsnNode.desc); // todo test // depends on control dependency: [while], data = [none] break; case Opcodes.INVOKESTATIC: /* falls through */ case Opcodes.INVOKEINTERFACE: /* falls through */ case Opcodes.INVOKESPECIAL: /* falls through */ case Opcodes.INVOKEVIRTUAL: MethodInsnNode targetMethod = (MethodInsnNode) node; targetMethod.desc = mutableClass.config.remapParams(targetMethod.desc); // depends on control dependency: [while], data = [none] if (isGregorianCalendarBooleanConstructor(targetMethod)) { replaceGregorianCalendarBooleanConstructor(instructions, targetMethod); // depends on control dependency: [if], data = [none] } else if (mutableClass.config.shouldIntercept(targetMethod)) { interceptInvokeVirtualMethod(mutableClass, instructions, targetMethod); // depends on control dependency: [if], data = [none] } break; case Opcodes.INVOKEDYNAMIC: /* no unusual behavior */ break; default: break; } } } }
public class class_name { public static List<BlockingState> sortedCopy(final Iterable<BlockingState> blockingStates) { final List<BlockingState> blockingStatesSomewhatSorted = Ordering.<BlockingState>natural().immutableSortedCopy(blockingStates); final List<BlockingState> result = new LinkedList<BlockingState>(); // Make sure same-day transitions are always returned in the same order depending on their attributes final Iterator<BlockingState> iterator = blockingStatesSomewhatSorted.iterator(); BlockingState prev = null; while (iterator.hasNext()) { final BlockingState current = iterator.next(); if (iterator.hasNext()) { final BlockingState next = iterator.next(); if (prev != null && current.getEffectiveDate().equals(next.getEffectiveDate()) && current.getBlockedId().equals(next.getBlockedId()) && !current.getService().equals(next.getService())) { // Same date, same blockable id, different services (for same-service events, trust the total ordering) // Make sure block billing transitions are respected first BlockingState prevCandidate = insertTiedBlockingStatesInTheRightOrder(result, current, next, prev.isBlockBilling(), current.isBlockBilling(), next.isBlockBilling()); if (prevCandidate == null) { // Then respect block entitlement transitions prevCandidate = insertTiedBlockingStatesInTheRightOrder(result, current, next, prev.isBlockEntitlement(), current.isBlockEntitlement(), next.isBlockEntitlement()); if (prevCandidate == null) { // And finally block changes transitions prevCandidate = insertTiedBlockingStatesInTheRightOrder(result, current, next, prev.isBlockChange(), current.isBlockChange(), next.isBlockChange()); if (prevCandidate == null) { // Trust the current sorting result.add(current); result.add(next); prev = next; } else { prev = prevCandidate; } } else { prev = prevCandidate; } } else { prev = prevCandidate; } } else { result.add(current); result.add(next); prev = next; } } else { // End of the list result.add(current); } } return result; } }
public class class_name { public static List<BlockingState> sortedCopy(final Iterable<BlockingState> blockingStates) { final List<BlockingState> blockingStatesSomewhatSorted = Ordering.<BlockingState>natural().immutableSortedCopy(blockingStates); final List<BlockingState> result = new LinkedList<BlockingState>(); // Make sure same-day transitions are always returned in the same order depending on their attributes final Iterator<BlockingState> iterator = blockingStatesSomewhatSorted.iterator(); BlockingState prev = null; while (iterator.hasNext()) { final BlockingState current = iterator.next(); if (iterator.hasNext()) { final BlockingState next = iterator.next(); if (prev != null && current.getEffectiveDate().equals(next.getEffectiveDate()) && current.getBlockedId().equals(next.getBlockedId()) && !current.getService().equals(next.getService())) { // Same date, same blockable id, different services (for same-service events, trust the total ordering) // Make sure block billing transitions are respected first BlockingState prevCandidate = insertTiedBlockingStatesInTheRightOrder(result, current, next, prev.isBlockBilling(), current.isBlockBilling(), next.isBlockBilling()); if (prevCandidate == null) { // Then respect block entitlement transitions prevCandidate = insertTiedBlockingStatesInTheRightOrder(result, current, next, prev.isBlockEntitlement(), current.isBlockEntitlement(), next.isBlockEntitlement()); // depends on control dependency: [if], data = [none] if (prevCandidate == null) { // And finally block changes transitions prevCandidate = insertTiedBlockingStatesInTheRightOrder(result, current, next, prev.isBlockChange(), current.isBlockChange(), next.isBlockChange()); // depends on control dependency: [if], data = [none] if (prevCandidate == null) { // Trust the current sorting result.add(current); // depends on control dependency: [if], data = [none] result.add(next); // depends on control dependency: [if], data = [none] prev = next; // depends on control dependency: [if], data = [none] } else { prev = prevCandidate; // depends on control dependency: [if], data = [none] } } else { prev = prevCandidate; // depends on control dependency: [if], data = [none] } } else { prev = prevCandidate; // depends on control dependency: [if], data = [none] } } else { result.add(current); // depends on control dependency: [if], data = [none] result.add(next); // depends on control dependency: [if], data = [none] prev = next; // depends on control dependency: [if], data = [none] } } else { // End of the list result.add(current); // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { private WritableIntegerDataStore computeSubtreeSizes(DBIDs order) { WritableIntegerDataStore siz = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1); DBIDVar v1 = DBIDUtil.newVar(); for(DBIDIter it = order.iter(); it.valid(); it.advance()) { if(DBIDUtil.equal(it, parent.assignVar(it, v1))) { continue; } siz.increment(v1, siz.intValue(it)); } return siz; } }
public class class_name { private WritableIntegerDataStore computeSubtreeSizes(DBIDs order) { WritableIntegerDataStore siz = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1); DBIDVar v1 = DBIDUtil.newVar(); for(DBIDIter it = order.iter(); it.valid(); it.advance()) { if(DBIDUtil.equal(it, parent.assignVar(it, v1))) { continue; } siz.increment(v1, siz.intValue(it)); // depends on control dependency: [for], data = [it] } return siz; } }
public class class_name { static List<GoogleToken> getGoogleTokens(String sentence, boolean addStartToken, Tokenizer wordTokenizer) { List<GoogleToken> result = new ArrayList<>(); if (addStartToken) { result.add(new GoogleToken(LanguageModel.GOOGLE_SENTENCE_START, 0, 0)); } List<String> tokens = wordTokenizer.tokenize(sentence); int startPos = 0; for (String token : tokens) { if (!StringTools.isWhitespace(token)) { result.add(new GoogleToken(token, startPos, startPos+token.length())); } startPos += token.length(); } return result; } }
public class class_name { static List<GoogleToken> getGoogleTokens(String sentence, boolean addStartToken, Tokenizer wordTokenizer) { List<GoogleToken> result = new ArrayList<>(); if (addStartToken) { result.add(new GoogleToken(LanguageModel.GOOGLE_SENTENCE_START, 0, 0)); // depends on control dependency: [if], data = [none] } List<String> tokens = wordTokenizer.tokenize(sentence); int startPos = 0; for (String token : tokens) { if (!StringTools.isWhitespace(token)) { result.add(new GoogleToken(token, startPos, startPos+token.length())); // depends on control dependency: [if], data = [none] } startPos += token.length(); // depends on control dependency: [for], data = [token] } return result; } }