code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public int getFCD16(int c) { if(c<0) { return 0; } else if(c<0x180) { return tccc180[c]; } else if(c<=0xffff) { if(!singleLeadMightHaveNonZeroFCD16(c)) { return 0; } } return getFCD16FromNormData(c); } }
public class class_name { public int getFCD16(int c) { if(c<0) { return 0; // depends on control dependency: [if], data = [none] } else if(c<0x180) { return tccc180[c]; // depends on control dependency: [if], data = [none] } else if(c<=0xffff) { if(!singleLeadMightHaveNonZeroFCD16(c)) { return 0; } // depends on control dependency: [if], data = [none] } return getFCD16FromNormData(c); } }
public class class_name { AddressBuilderQuery query(CharSequence name, Object... values) { if (name != null && values != null) { this.queries.put(name.toString(), Parameter.create(name.toString(), values)); } return new AddressBuilderQuery(this); } }
public class class_name { AddressBuilderQuery query(CharSequence name, Object... values) { if (name != null && values != null) { this.queries.put(name.toString(), Parameter.create(name.toString(), values)); // depends on control dependency: [if], data = [(name] } return new AddressBuilderQuery(this); } }
public class class_name { protected List<CmsUser> internalGetUsers( CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive, boolean readAdditionalInfos) throws CmsDataAccessException { List<CmsUser> users = new ArrayList<CmsUser>(); ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; try { // create statement conn = m_sqlManager.getConnection(dbc); if (orgUnit.hasFlagWebuser()) { stmt = m_sqlManager.getPreparedStatement(conn, "C_USERS_GET_WEBUSERS_FOR_ORGUNIT_1"); } else { stmt = m_sqlManager.getPreparedStatement(conn, "C_USERS_GET_USERS_FOR_ORGUNIT_1"); } String param = CmsOrganizationalUnit.SEPARATOR + orgUnit.getName(); if (recursive) { param += "%"; } stmt.setString(1, param); res = stmt.executeQuery(); // create new Cms group objects while (res.next()) { users.add(internalCreateUser(dbc, res)); } } catch (SQLException e) { throw new CmsDbSqlException( Messages.get().container(Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)), e); } finally { m_sqlManager.closeAll(dbc, conn, stmt, res); } if (readAdditionalInfos) { for (CmsUser user : users) { Map<String, Object> info = readUserInfos(dbc, user.getId()); user.setAdditionalInfo(info); } } return users; } }
public class class_name { protected List<CmsUser> internalGetUsers( CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive, boolean readAdditionalInfos) throws CmsDataAccessException { List<CmsUser> users = new ArrayList<CmsUser>(); ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; try { // create statement conn = m_sqlManager.getConnection(dbc); if (orgUnit.hasFlagWebuser()) { stmt = m_sqlManager.getPreparedStatement(conn, "C_USERS_GET_WEBUSERS_FOR_ORGUNIT_1"); // depends on control dependency: [if], data = [none] } else { stmt = m_sqlManager.getPreparedStatement(conn, "C_USERS_GET_USERS_FOR_ORGUNIT_1"); // depends on control dependency: [if], data = [none] } String param = CmsOrganizationalUnit.SEPARATOR + orgUnit.getName(); if (recursive) { param += "%"; // depends on control dependency: [if], data = [none] } stmt.setString(1, param); res = stmt.executeQuery(); // create new Cms group objects while (res.next()) { users.add(internalCreateUser(dbc, res)); // depends on control dependency: [while], data = [none] } } catch (SQLException e) { throw new CmsDbSqlException( Messages.get().container(Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)), e); } finally { m_sqlManager.closeAll(dbc, conn, stmt, res); } if (readAdditionalInfos) { for (CmsUser user : users) { Map<String, Object> info = readUserInfos(dbc, user.getId()); user.setAdditionalInfo(info); // depends on control dependency: [for], data = [user] } } return users; } }
public class class_name { public java.util.List<String> getDomainControllers() { if (domainControllers == null) { domainControllers = new com.amazonaws.internal.SdkInternalList<String>(); } return domainControllers; } }
public class class_name { public java.util.List<String> getDomainControllers() { if (domainControllers == null) { domainControllers = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none] } return domainControllers; } }
public class class_name { public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl, Proxy proxy, int connectTimeout, int readTimeout, Map<String, String> requestProperties) { ApplicationStatus status = ApplicationStatus.UNKNOWN; if (localVersion != null) { if (!localVersion.isEmpty()) { if (updateUrl != null) { // Fetch remote version String remoteVersion = null; try { LOG.debug("Fetching appcast from update URL ''{}''...", updateUrl); Appcast appcast = appcastManager.fetch(updateUrl, proxy, connectTimeout, readTimeout, requestProperties); if (appcast != null) { remoteVersion = appcast.getLatestVersion(); } if (appcast == null || remoteVersion == null) { status = ApplicationStatus.FAILURE; status.setInfo("No version information found"); } else { VersionComparator vc = new VersionComparator(); int compare = vc.compare(localVersion, remoteVersion); if (compare == 0) { status = ApplicationStatus.OK; status.setInfo("No update available"); } else if (compare < 0) { status = ApplicationStatus.UPDATE_AVAILABLE; String shortVersionString = appcast.getLatestEnclosure().getShortVersionString(); if (shortVersionString != null && !shortVersionString.isEmpty()) { status.setInfo(shortVersionString); } else { status.setInfo(remoteVersion); } status.setAppcast(appcast); } else if (compare > 0) { status = ApplicationStatus.OK; } } } catch (AppcastException aex) { LOG.warn("{} ''{}'': {} {}", aex.getMessage(), aex.getUrl(), aex.getStatus(), aex.getStatusInfo()); status = ApplicationStatus.FAILURE; status.setInfo(aex.getMessage() + " '" + aex.getUrl() + "': " + aex.getStatus() + " " + aex.getStatusInfo()); } catch (Exception ex) { // Seems the be a network problem (e.g. no internet connection) // Just log it, status should be unknown status.setInfo(ex.getMessage()); LOG.warn("Could not connect to update server: {}", ex.getMessage()); } status.setUpdateTime(new Date()); } } } else { // No version information about installed application!? // Seems to be not installed at all status = ApplicationStatus.NOT_INSTALLED; } return status; } }
public class class_name { public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl, Proxy proxy, int connectTimeout, int readTimeout, Map<String, String> requestProperties) { ApplicationStatus status = ApplicationStatus.UNKNOWN; if (localVersion != null) { if (!localVersion.isEmpty()) { if (updateUrl != null) { // Fetch remote version String remoteVersion = null; try { LOG.debug("Fetching appcast from update URL ''{}''...", updateUrl); // depends on control dependency: [try], data = [none] Appcast appcast = appcastManager.fetch(updateUrl, proxy, connectTimeout, readTimeout, requestProperties); if (appcast != null) { remoteVersion = appcast.getLatestVersion(); // depends on control dependency: [if], data = [none] } if (appcast == null || remoteVersion == null) { status = ApplicationStatus.FAILURE; // depends on control dependency: [if], data = [none] status.setInfo("No version information found"); // depends on control dependency: [if], data = [none] } else { VersionComparator vc = new VersionComparator(); int compare = vc.compare(localVersion, remoteVersion); if (compare == 0) { status = ApplicationStatus.OK; // depends on control dependency: [if], data = [none] status.setInfo("No update available"); // depends on control dependency: [if], data = [none] } else if (compare < 0) { status = ApplicationStatus.UPDATE_AVAILABLE; // depends on control dependency: [if], data = [none] String shortVersionString = appcast.getLatestEnclosure().getShortVersionString(); if (shortVersionString != null && !shortVersionString.isEmpty()) { status.setInfo(shortVersionString); // depends on control dependency: [if], data = [(shortVersionString] } else { status.setInfo(remoteVersion); // depends on control dependency: [if], data = [none] } status.setAppcast(appcast); // depends on control dependency: [if], data = [none] } else if (compare > 0) { status = ApplicationStatus.OK; // depends on control dependency: [if], data = [none] } } } catch (AppcastException aex) { LOG.warn("{} ''{}'': {} {}", aex.getMessage(), aex.getUrl(), aex.getStatus(), aex.getStatusInfo()); status = ApplicationStatus.FAILURE; status.setInfo(aex.getMessage() + " '" + aex.getUrl() + "': " + aex.getStatus() + " " + aex.getStatusInfo()); } catch (Exception ex) { // depends on control dependency: [catch], data = [none] // Seems the be a network problem (e.g. no internet connection) // Just log it, status should be unknown status.setInfo(ex.getMessage()); LOG.warn("Could not connect to update server: {}", ex.getMessage()); } // depends on control dependency: [catch], data = [none] status.setUpdateTime(new Date()); // depends on control dependency: [if], data = [none] } } } else { // No version information about installed application!? // Seems to be not installed at all status = ApplicationStatus.NOT_INSTALLED; // depends on control dependency: [if], data = [none] } return status; } }
public class class_name { int concatenateLists(int list1, int list2) { int tailNode1 = m_lists.getField(list1, 1); int headNode2 = m_lists.getField(list2, 0); if (headNode2 != nullNode())// do not concatenate empty lists { if (tailNode1 != nullNode()) { // connect head of list2 to the tail of list1. m_listNodes.setField(tailNode1, 1, headNode2); // set the tail of the list1 to be the tail of list2. m_lists.setField(list1, 1, m_lists.getField(list2, 1)); } else {// list1 is empty, while list2 is not. m_lists.setField(list1, 0, headNode2); m_lists.setField(list1, 1, m_lists.getField(list2, 1)); } } if (m_b_allow_navigation_between_lists) { int prevList = m_lists.getField(list2, 2); int nextList = m_lists.getField(list2, 3); if (prevList != nullNode()) m_lists.setField(prevList, 3, nextList); else m_list_of_lists = nextList; if (nextList != nullNode()) m_lists.setField(nextList, 2, prevList); } freeList_(list2); return list1; } }
public class class_name { int concatenateLists(int list1, int list2) { int tailNode1 = m_lists.getField(list1, 1); int headNode2 = m_lists.getField(list2, 0); if (headNode2 != nullNode())// do not concatenate empty lists { if (tailNode1 != nullNode()) { // connect head of list2 to the tail of list1. m_listNodes.setField(tailNode1, 1, headNode2); // depends on control dependency: [if], data = [(tailNode1] // set the tail of the list1 to be the tail of list2. m_lists.setField(list1, 1, m_lists.getField(list2, 1)); // depends on control dependency: [if], data = [none] } else {// list1 is empty, while list2 is not. m_lists.setField(list1, 0, headNode2); // depends on control dependency: [if], data = [none] m_lists.setField(list1, 1, m_lists.getField(list2, 1)); // depends on control dependency: [if], data = [none] } } if (m_b_allow_navigation_between_lists) { int prevList = m_lists.getField(list2, 2); int nextList = m_lists.getField(list2, 3); if (prevList != nullNode()) m_lists.setField(prevList, 3, nextList); else m_list_of_lists = nextList; if (nextList != nullNode()) m_lists.setField(nextList, 2, prevList); } freeList_(list2); return list1; } }
public class class_name { public Cursor query(SQLiteDatabase db, String[] projectionIn, String selection, String[] selectionArgs, String groupBy, String having, String sortOrder, String limit, CancellationSignal cancellationSignal) { if (mTables == null) { return null; } if (mStrict && selection != null && selection.length() > 0) { // Validate the user-supplied selection to detect syntactic anomalies // in the selection string that could indicate a SQL injection attempt. // The idea is to ensure that the selection clause is a valid SQL expression // by compiling it twice: once wrapped in parentheses and once as // originally specified. An attacker cannot create an expression that // would escape the SQL expression while maintaining balanced parentheses // in both the wrapped and original forms. String sqlForValidation = buildQuery(projectionIn, "(" + selection + ")", groupBy, having, sortOrder, limit); validateQuerySql(db, sqlForValidation, cancellationSignal); // will throw if query is invalid } String sql = buildQuery( projectionIn, selection, groupBy, having, sortOrder, limit); DLog.d(TAG, "Performing query: " + sql); return db.rawQueryWithFactory( mFactory, sql, selectionArgs, SQLiteDatabase.findEditTable(mTables), cancellationSignal); // will throw if query is invalid } }
public class class_name { public Cursor query(SQLiteDatabase db, String[] projectionIn, String selection, String[] selectionArgs, String groupBy, String having, String sortOrder, String limit, CancellationSignal cancellationSignal) { if (mTables == null) { return null; // depends on control dependency: [if], data = [none] } if (mStrict && selection != null && selection.length() > 0) { // Validate the user-supplied selection to detect syntactic anomalies // in the selection string that could indicate a SQL injection attempt. // The idea is to ensure that the selection clause is a valid SQL expression // by compiling it twice: once wrapped in parentheses and once as // originally specified. An attacker cannot create an expression that // would escape the SQL expression while maintaining balanced parentheses // in both the wrapped and original forms. String sqlForValidation = buildQuery(projectionIn, "(" + selection + ")", groupBy, having, sortOrder, limit); validateQuerySql(db, sqlForValidation, cancellationSignal); // will throw if query is invalid // depends on control dependency: [if], data = [none] } String sql = buildQuery( projectionIn, selection, groupBy, having, sortOrder, limit); DLog.d(TAG, "Performing query: " + sql); return db.rawQueryWithFactory( mFactory, sql, selectionArgs, SQLiteDatabase.findEditTable(mTables), cancellationSignal); // will throw if query is invalid } }
public class class_name { public void deleteCCOrder(String orderId, String actorId) { List<CCOrder> ccorders = access().getCCOrder(orderId, actorId); AssertHelper.notNull(ccorders); for(CCOrder ccorder : ccorders) { access().deleteCCOrder(ccorder); } } }
public class class_name { public void deleteCCOrder(String orderId, String actorId) { List<CCOrder> ccorders = access().getCCOrder(orderId, actorId); AssertHelper.notNull(ccorders); for(CCOrder ccorder : ccorders) { access().deleteCCOrder(ccorder); // depends on control dependency: [for], data = [ccorder] } } }
public class class_name { private String nextQuotedValue(char quote) { // Like nextNonWhitespace, this uses locals 'p' and 'l' to save inner-loop field access. StringBuilder builder = new StringBuilder(); int p = pos; /* the index of the first character not yet appended to the builder. */ int start = p; while (p < limit) { int c = in.charAt(p++); if (c == quote) { pos = p; builder.append(in.substring(start, p - 1)); return builder.toString(); } else if (c == '\\') { pos = p; builder.append(in.substring(start, p - 1)); builder.append(readEscapeCharacter()); p = pos; start = p; } else if (c == '\n') { lineNumber++; lineStart = p; } } throw syntaxError("Unterminated string"); } }
public class class_name { private String nextQuotedValue(char quote) { // Like nextNonWhitespace, this uses locals 'p' and 'l' to save inner-loop field access. StringBuilder builder = new StringBuilder(); int p = pos; /* the index of the first character not yet appended to the builder. */ int start = p; while (p < limit) { int c = in.charAt(p++); if (c == quote) { pos = p; // depends on control dependency: [if], data = [none] builder.append(in.substring(start, p - 1)); // depends on control dependency: [if], data = [none] return builder.toString(); // depends on control dependency: [if], data = [none] } else if (c == '\\') { pos = p; // depends on control dependency: [if], data = [none] builder.append(in.substring(start, p - 1)); // depends on control dependency: [if], data = [none] builder.append(readEscapeCharacter()); // depends on control dependency: [if], data = [none] p = pos; // depends on control dependency: [if], data = [none] start = p; // depends on control dependency: [if], data = [none] } else if (c == '\n') { lineNumber++; // depends on control dependency: [if], data = [none] lineStart = p; // depends on control dependency: [if], data = [none] } } throw syntaxError("Unterminated string"); } }
public class class_name { IndexWriter getIndexWriterForProviders( Set<String> providerNames ) { List<IndexProvider> reindexProviders = new LinkedList<>(); for (IndexProvider provider : providers.values()) { if (providerNames.contains(provider.getName())) { reindexProviders.add(provider); } } return CompositeIndexWriter.create(reindexProviders); } }
public class class_name { IndexWriter getIndexWriterForProviders( Set<String> providerNames ) { List<IndexProvider> reindexProviders = new LinkedList<>(); for (IndexProvider provider : providers.values()) { if (providerNames.contains(provider.getName())) { reindexProviders.add(provider); // depends on control dependency: [if], data = [none] } } return CompositeIndexWriter.create(reindexProviders); } }
public class class_name { private int gatherInfo(LblTree aT, int postorder) { int currentSize = 0; int childrenCount = 0; int descSizes = 0; int krSizesSum = 0; int revkrSizesSum = 0; int preorder = preorderTmp; int heavyChild = -1; int leftChild = -1; int rightChild = -1; int weight = -1; int maxWeight = -1; int currentPostorder = -1; int oldHeavyChild = -1; ArrayList<Integer> heavyRelSubtreesTmp = new ArrayList<>(); ArrayList<Integer> leftRelSubtreesTmp = new ArrayList<>(); ArrayList<Integer> rightRelSubtreesTmp = new ArrayList<>(); ArrayList<Integer> childrenPostorders = new ArrayList<>(); preorderTmp++; // enumerate over children of current node for (Enumeration<?> e = aT.children(); e.hasMoreElements(); ) { childrenCount++; postorder = gatherInfo((LblTree) e.nextElement(), postorder); childrenPostorders.add(postorder); currentPostorder = postorder; // heavy path weight = sizeTmp + 1; if (weight >= maxWeight) { maxWeight = weight; oldHeavyChild = heavyChild; heavyChild = currentPostorder; } else { heavyRelSubtreesTmp.add(currentPostorder); } if (oldHeavyChild != -1) { heavyRelSubtreesTmp.add(oldHeavyChild); oldHeavyChild = -1; } // left path if (childrenCount == 1) { leftChild = currentPostorder; } else { leftRelSubtreesTmp.add(currentPostorder); } // right path rightChild = currentPostorder; if (e.hasMoreElements()) { rightRelSubtreesTmp.add(currentPostorder); } // subtree size currentSize += 1 + sizeTmp; descSizes += descSizesTmp; if (childrenCount > 1) { krSizesSum += krSizesSumTmp + sizeTmp + 1; } else { krSizesSum += krSizesSumTmp; nodeType[LEFT][currentPostorder] = true; } if (e.hasMoreElements()) { revkrSizesSum += revkrSizesSumTmp + sizeTmp + 1; } else { revkrSizesSum += revkrSizesSumTmp; nodeType[RIGHT][currentPostorder] = true; } } postorder++; // postorder aT.setTmpData(postorder); int currentDescSizes = descSizes + currentSize + 1; info[POST2_DESC_SUM][postorder] = (currentSize + 1) * (currentSize + 1 + 3) / 2 - currentDescSizes; info[POST2_KR_SUM][postorder] = krSizesSum + currentSize + 1; info[POST2_REV_KR_SUM][postorder] = revkrSizesSum + currentSize + 1; // POST2_LABEL // labels[rootNumber] = ld.store(aT.getLabel()); info[POST2_LABEL][postorder] = ld.store(aT.getLabel()); // POST2_PARENT for (Integer i : childrenPostorders) { info[POST2_PARENT][i] = postorder; } // POST2_SIZE info[POST2_SIZE][postorder] = currentSize + 1; if (currentSize == 0) { leafCount++; } // POST2_PRE info[POST2_PRE][postorder] = preorder; // PRE2_POST info[PRE2_POST][preorder] = postorder; // RPOST2_POST info[RPOST2_POST][treeSize - 1 - preorder] = postorder; // heavy path if (heavyChild != -1) { paths[HEAVY][postorder] = heavyChild; nodeType[HEAVY][heavyChild] = true; if (leftChild < heavyChild && heavyChild < rightChild) { info[POST2_STRATEGY][postorder] = BOTH; } else if (heavyChild == leftChild) { info[POST2_STRATEGY][postorder] = RIGHT; } else if (heavyChild == rightChild) { info[POST2_STRATEGY][postorder] = LEFT; } } else { info[POST2_STRATEGY][postorder] = RIGHT; } // left path if (leftChild != -1) { paths[LEFT][postorder] = leftChild; } // right path if (rightChild != -1) { paths[RIGHT][postorder] = rightChild; } // heavy/left/right relevant subtrees relSubtrees[HEAVY][postorder] = toIntArray(heavyRelSubtreesTmp); relSubtrees[RIGHT][postorder] = toIntArray(rightRelSubtreesTmp); relSubtrees[LEFT][postorder] = toIntArray(leftRelSubtreesTmp); descSizesTmp = currentDescSizes; sizeTmp = currentSize; krSizesSumTmp = krSizesSum; revkrSizesSumTmp = revkrSizesSum; return postorder; } }
public class class_name { private int gatherInfo(LblTree aT, int postorder) { int currentSize = 0; int childrenCount = 0; int descSizes = 0; int krSizesSum = 0; int revkrSizesSum = 0; int preorder = preorderTmp; int heavyChild = -1; int leftChild = -1; int rightChild = -1; int weight = -1; int maxWeight = -1; int currentPostorder = -1; int oldHeavyChild = -1; ArrayList<Integer> heavyRelSubtreesTmp = new ArrayList<>(); ArrayList<Integer> leftRelSubtreesTmp = new ArrayList<>(); ArrayList<Integer> rightRelSubtreesTmp = new ArrayList<>(); ArrayList<Integer> childrenPostorders = new ArrayList<>(); preorderTmp++; // enumerate over children of current node for (Enumeration<?> e = aT.children(); e.hasMoreElements(); ) { childrenCount++; // depends on control dependency: [for], data = [none] postorder = gatherInfo((LblTree) e.nextElement(), postorder); // depends on control dependency: [for], data = [e] childrenPostorders.add(postorder); // depends on control dependency: [for], data = [none] currentPostorder = postorder; // depends on control dependency: [for], data = [none] // heavy path weight = sizeTmp + 1; // depends on control dependency: [for], data = [none] if (weight >= maxWeight) { maxWeight = weight; // depends on control dependency: [if], data = [none] oldHeavyChild = heavyChild; // depends on control dependency: [if], data = [none] heavyChild = currentPostorder; // depends on control dependency: [if], data = [none] } else { heavyRelSubtreesTmp.add(currentPostorder); // depends on control dependency: [if], data = [none] } if (oldHeavyChild != -1) { heavyRelSubtreesTmp.add(oldHeavyChild); // depends on control dependency: [if], data = [(oldHeavyChild] oldHeavyChild = -1; // depends on control dependency: [if], data = [none] } // left path if (childrenCount == 1) { leftChild = currentPostorder; // depends on control dependency: [if], data = [none] } else { leftRelSubtreesTmp.add(currentPostorder); // depends on control dependency: [if], data = [none] } // right path rightChild = currentPostorder; // depends on control dependency: [for], data = [none] if (e.hasMoreElements()) { rightRelSubtreesTmp.add(currentPostorder); // depends on control dependency: [if], data = [none] } // subtree size currentSize += 1 + sizeTmp; // depends on control dependency: [for], data = [none] descSizes += descSizesTmp; // depends on control dependency: [for], data = [none] if (childrenCount > 1) { krSizesSum += krSizesSumTmp + sizeTmp + 1; // depends on control dependency: [if], data = [none] } else { krSizesSum += krSizesSumTmp; // depends on control dependency: [if], data = [none] nodeType[LEFT][currentPostorder] = true; // depends on control dependency: [if], data = [none] } if (e.hasMoreElements()) { revkrSizesSum += revkrSizesSumTmp + sizeTmp + 1; // depends on control dependency: [if], data = [none] } else { revkrSizesSum += revkrSizesSumTmp; // depends on control dependency: [if], data = [none] nodeType[RIGHT][currentPostorder] = true; // depends on control dependency: [if], data = [none] } } postorder++; // postorder aT.setTmpData(postorder); int currentDescSizes = descSizes + currentSize + 1; info[POST2_DESC_SUM][postorder] = (currentSize + 1) * (currentSize + 1 + 3) / 2 - currentDescSizes; info[POST2_KR_SUM][postorder] = krSizesSum + currentSize + 1; info[POST2_REV_KR_SUM][postorder] = revkrSizesSum + currentSize + 1; // POST2_LABEL // labels[rootNumber] = ld.store(aT.getLabel()); info[POST2_LABEL][postorder] = ld.store(aT.getLabel()); // POST2_PARENT for (Integer i : childrenPostorders) { info[POST2_PARENT][i] = postorder; // depends on control dependency: [for], data = [i] } // POST2_SIZE info[POST2_SIZE][postorder] = currentSize + 1; if (currentSize == 0) { leafCount++; // depends on control dependency: [if], data = [none] } // POST2_PRE info[POST2_PRE][postorder] = preorder; // PRE2_POST info[PRE2_POST][preorder] = postorder; // RPOST2_POST info[RPOST2_POST][treeSize - 1 - preorder] = postorder; // heavy path if (heavyChild != -1) { paths[HEAVY][postorder] = heavyChild; // depends on control dependency: [if], data = [none] nodeType[HEAVY][heavyChild] = true; // depends on control dependency: [if], data = [none] if (leftChild < heavyChild && heavyChild < rightChild) { info[POST2_STRATEGY][postorder] = BOTH; // depends on control dependency: [if], data = [none] } else if (heavyChild == leftChild) { info[POST2_STRATEGY][postorder] = RIGHT; // depends on control dependency: [if], data = [none] } else if (heavyChild == rightChild) { info[POST2_STRATEGY][postorder] = LEFT; // depends on control dependency: [if], data = [none] } } else { info[POST2_STRATEGY][postorder] = RIGHT; // depends on control dependency: [if], data = [none] } // left path if (leftChild != -1) { paths[LEFT][postorder] = leftChild; // depends on control dependency: [if], data = [none] } // right path if (rightChild != -1) { paths[RIGHT][postorder] = rightChild; // depends on control dependency: [if], data = [none] } // heavy/left/right relevant subtrees relSubtrees[HEAVY][postorder] = toIntArray(heavyRelSubtreesTmp); relSubtrees[RIGHT][postorder] = toIntArray(rightRelSubtreesTmp); relSubtrees[LEFT][postorder] = toIntArray(leftRelSubtreesTmp); descSizesTmp = currentDescSizes; sizeTmp = currentSize; krSizesSumTmp = krSizesSum; revkrSizesSumTmp = revkrSizesSum; return postorder; } }
public class class_name { private List<String> getLabels(GDLParser.HeaderContext header) { if (header != null && header.label() != null) { return header .label() .stream() .map(RuleContext::getText) .map(x -> x.substring(1)) .collect(Collectors.toList()); } return null; } }
public class class_name { private List<String> getLabels(GDLParser.HeaderContext header) { if (header != null && header.label() != null) { return header .label() .stream() .map(RuleContext::getText) .map(x -> x.substring(1)) .collect(Collectors.toList()); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { private JSONObject emitAttributes(ObjectName objName) throws Exception { MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); MBeanInfo mBeanInfo = mBeanServer.getMBeanInfo(objName); JSONObject resp = new JSONObject(); if (mBeanInfo != null) { MBeanAttributeInfo[] attrs = mBeanInfo.getAttributes(); if (attrs != null) { List<String> attrNames = new ArrayList<String>(attrs.length); for (MBeanAttributeInfo attr : attrs) { attrNames.add(attr.getName()); } AttributeList attrList = mBeanServer.getAttributes(objName, attrNames.toArray(new String[0])); for (Attribute attr : attrList.asList()) { Object value = attr.getValue(); String attrName = attr.getName(); if (attrName != null && value != null) { String attrValue = null; if (value instanceof CompositeDataSupport) { CompositeDataSupport compositeValue = (CompositeDataSupport) value; if (compositeValue != null) { try { if (compositeValue.containsKey(CURRENT_VALUE)) { Object curValue = compositeValue .get(CURRENT_VALUE); attrValue = (curValue == null ? "null" : curValue.toString()); } } catch (Exception e) { attrValue = compositeValue.toString(); } } } if (attrValue == null) { attrValue = value.toString(); } resp.put(attrName, (attrValue == null ? "null" : attrValue)); } } } } return resp; } }
public class class_name { private JSONObject emitAttributes(ObjectName objName) throws Exception { MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); MBeanInfo mBeanInfo = mBeanServer.getMBeanInfo(objName); JSONObject resp = new JSONObject(); if (mBeanInfo != null) { MBeanAttributeInfo[] attrs = mBeanInfo.getAttributes(); if (attrs != null) { List<String> attrNames = new ArrayList<String>(attrs.length); for (MBeanAttributeInfo attr : attrs) { attrNames.add(attr.getName()); // depends on control dependency: [for], data = [attr] } AttributeList attrList = mBeanServer.getAttributes(objName, attrNames.toArray(new String[0])); for (Attribute attr : attrList.asList()) { Object value = attr.getValue(); String attrName = attr.getName(); if (attrName != null && value != null) { String attrValue = null; if (value instanceof CompositeDataSupport) { CompositeDataSupport compositeValue = (CompositeDataSupport) value; if (compositeValue != null) { try { if (compositeValue.containsKey(CURRENT_VALUE)) { Object curValue = compositeValue .get(CURRENT_VALUE); attrValue = (curValue == null ? "null" : curValue.toString()); // depends on control dependency: [if], data = [none] } } catch (Exception e) { attrValue = compositeValue.toString(); } // depends on control dependency: [catch], data = [none] } } if (attrValue == null) { attrValue = value.toString(); // depends on control dependency: [if], data = [none] } resp.put(attrName, (attrValue == null ? "null" : attrValue)); // depends on control dependency: [if], data = [(attrName] } } } } return resp; } }
public class class_name { public void setCollapsedColumns(Object... collapsedColumns) { Set<Object> collapsedSet = Sets.newHashSet(); for (Object collapsed : collapsedColumns) { collapsedSet.add(collapsed); } for (Object key : m_fileTable.getVisibleColumns()) { m_fileTable.setColumnCollapsed(key, collapsedSet.contains(key)); } } }
public class class_name { public void setCollapsedColumns(Object... collapsedColumns) { Set<Object> collapsedSet = Sets.newHashSet(); for (Object collapsed : collapsedColumns) { collapsedSet.add(collapsed); // depends on control dependency: [for], data = [collapsed] } for (Object key : m_fileTable.getVisibleColumns()) { m_fileTable.setColumnCollapsed(key, collapsedSet.contains(key)); // depends on control dependency: [for], data = [key] } } }
public class class_name { public void contributeToToolBar(IToolBarManager tbm) { if (fInViewMenu) return; for (int i= 0; i < fFilterActions.length; i++) { tbm.add(fFilterActions[i]); } } }
public class class_name { public void contributeToToolBar(IToolBarManager tbm) { if (fInViewMenu) return; for (int i= 0; i < fFilterActions.length; i++) { tbm.add(fFilterActions[i]); // depends on control dependency: [for], data = [i] } } }
public class class_name { static <E> RingBuffer<E> createSingleProducer(Supplier<E> factory, int bufferSize, WaitStrategy waitStrategy, @Nullable Runnable spinObserver) { SingleProducerSequencer sequencer = new SingleProducerSequencer(bufferSize, waitStrategy, spinObserver); if (hasUnsafe() && Queues.isPowerOfTwo(bufferSize)) { return new UnsafeRingBuffer<>(factory, sequencer); } else { return new NotFunRingBuffer<>(factory, sequencer); } } }
public class class_name { static <E> RingBuffer<E> createSingleProducer(Supplier<E> factory, int bufferSize, WaitStrategy waitStrategy, @Nullable Runnable spinObserver) { SingleProducerSequencer sequencer = new SingleProducerSequencer(bufferSize, waitStrategy, spinObserver); if (hasUnsafe() && Queues.isPowerOfTwo(bufferSize)) { return new UnsafeRingBuffer<>(factory, sequencer); // depends on control dependency: [if], data = [none] } else { return new NotFunRingBuffer<>(factory, sequencer); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static LuceneDefaults fromAnnotation(Defaults defaults) { LuceneDefaults lid = new LuceneDefaults(); boolean hasValues = false; if (!StringUtils.isBlank(defaults.field())) { lid.setField(defaults.field()); hasValues = true; } if (!StringUtils.isBlank(defaults.type())) { lid.setType(defaults.type()); hasValues = true; } if (!StringUtils.isBlank(defaults.store())) { lid.setStore(defaults.store()); hasValues = true; } if (!StringUtils.isBlank(defaults.index())) { lid.setIndex(defaults.index()); hasValues = true; } return hasValues ? lid : null; } }
public class class_name { public static LuceneDefaults fromAnnotation(Defaults defaults) { LuceneDefaults lid = new LuceneDefaults(); boolean hasValues = false; if (!StringUtils.isBlank(defaults.field())) { lid.setField(defaults.field()); // depends on control dependency: [if], data = [none] hasValues = true; // depends on control dependency: [if], data = [none] } if (!StringUtils.isBlank(defaults.type())) { lid.setType(defaults.type()); // depends on control dependency: [if], data = [none] hasValues = true; // depends on control dependency: [if], data = [none] } if (!StringUtils.isBlank(defaults.store())) { lid.setStore(defaults.store()); // depends on control dependency: [if], data = [none] hasValues = true; // depends on control dependency: [if], data = [none] } if (!StringUtils.isBlank(defaults.index())) { lid.setIndex(defaults.index()); // depends on control dependency: [if], data = [none] hasValues = true; // depends on control dependency: [if], data = [none] } return hasValues ? lid : null; } }
public class class_name { private static String parseProfileName(String trimmedLine) { if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) { String profileName = trimmedLine.substring(1, trimmedLine.length() - 1); return profileName.trim(); } return null; } }
public class class_name { private static String parseProfileName(String trimmedLine) { if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) { String profileName = trimmedLine.substring(1, trimmedLine.length() - 1); return profileName.trim(); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { protected void leaveFunctor(Functor functor) { int pos = traverser.getPosition(); if (!traverser.isInHead() && (pos >= 0)) { Functor transformed = builtInTransform.apply(functor); if (functor != transformed) { /*log.fine("Transformed: " + functor + " to " + transformed.getClass());*/ BuiltInFunctor builtInFunctor = (BuiltInFunctor) transformed; Term parentTerm = traverser.getParentContext().getTerm(); if (parentTerm instanceof Clause) { Clause parentClause = (Clause) parentTerm; parentClause.getBody()[pos] = builtInFunctor; } else if (parentTerm instanceof Functor) { Functor parentFunctor = (Functor) parentTerm; parentFunctor.getArguments()[pos] = builtInFunctor; } } } } }
public class class_name { protected void leaveFunctor(Functor functor) { int pos = traverser.getPosition(); if (!traverser.isInHead() && (pos >= 0)) { Functor transformed = builtInTransform.apply(functor); if (functor != transformed) { /*log.fine("Transformed: " + functor + " to " + transformed.getClass());*/ BuiltInFunctor builtInFunctor = (BuiltInFunctor) transformed; Term parentTerm = traverser.getParentContext().getTerm(); if (parentTerm instanceof Clause) { Clause parentClause = (Clause) parentTerm; parentClause.getBody()[pos] = builtInFunctor; // depends on control dependency: [if], data = [none] } else if (parentTerm instanceof Functor) { Functor parentFunctor = (Functor) parentTerm; parentFunctor.getArguments()[pos] = builtInFunctor; // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public List<EmbedApp> getEmbedApps(String token, String email) throws URISyntaxException, ClientProtocolException, IOException, ParserConfigurationException, SAXException, XPathExpressionException { cleanError(); URIBuilder url = new URIBuilder(Constants.EMBED_APP_URL); url.addParameter("token", token); url.addParameter("email", email); CloseableHttpClient httpclient = HttpClients.createDefault(); HttpGet httpGet = new HttpGet(url.toString()); httpGet.setHeader("Accept", "application/json"); CloseableHttpResponse response = httpclient.execute(httpGet); String xmlString = EntityUtils.toString(response.getEntity()); List<EmbedApp> embedApps = new ArrayList<EmbedApp>(); DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = docfactory.newDocumentBuilder(); Document doc = builder.parse(new InputSource(new StringReader(xmlString))); XPath xpath = XPathFactory.newInstance().newXPath(); NodeList appNodeList = (NodeList) xpath.evaluate("/apps/app", doc, XPathConstants.NODESET); if (appNodeList.getLength() > 0) { Node appNode; NodeList appAttrs; EmbedApp embedApp; for (int i = 0; i < appNodeList.getLength(); i++) { appNode = appNodeList.item(0); appAttrs = appNode.getChildNodes(); String appAttrName; JSONObject appJson = new JSONObject(); Set<String> desiredAttrs = new HashSet<String>(Arrays.asList(new String[] {"id", "icon", "name", "provisioned", "extension_required", "personal", "login_id"})); for (int j = 0; j < appAttrs.getLength(); j++) { appAttrName = appAttrs.item(j).getNodeName(); if (desiredAttrs.contains(appAttrName)) { appJson.put(appAttrName, appAttrs.item(j).getTextContent()); } } embedApp = new EmbedApp(appJson); embedApps.add(embedApp); } } return embedApps; } }
public class class_name { public List<EmbedApp> getEmbedApps(String token, String email) throws URISyntaxException, ClientProtocolException, IOException, ParserConfigurationException, SAXException, XPathExpressionException { cleanError(); URIBuilder url = new URIBuilder(Constants.EMBED_APP_URL); url.addParameter("token", token); url.addParameter("email", email); CloseableHttpClient httpclient = HttpClients.createDefault(); HttpGet httpGet = new HttpGet(url.toString()); httpGet.setHeader("Accept", "application/json"); CloseableHttpResponse response = httpclient.execute(httpGet); String xmlString = EntityUtils.toString(response.getEntity()); List<EmbedApp> embedApps = new ArrayList<EmbedApp>(); DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = docfactory.newDocumentBuilder(); Document doc = builder.parse(new InputSource(new StringReader(xmlString))); XPath xpath = XPathFactory.newInstance().newXPath(); NodeList appNodeList = (NodeList) xpath.evaluate("/apps/app", doc, XPathConstants.NODESET); if (appNodeList.getLength() > 0) { Node appNode; NodeList appAttrs; EmbedApp embedApp; for (int i = 0; i < appNodeList.getLength(); i++) { appNode = appNodeList.item(0); appAttrs = appNode.getChildNodes(); String appAttrName; JSONObject appJson = new JSONObject(); Set<String> desiredAttrs = new HashSet<String>(Arrays.asList(new String[] {"id", "icon", "name", "provisioned", "extension_required", "personal", "login_id"})); for (int j = 0; j < appAttrs.getLength(); j++) { appAttrName = appAttrs.item(j).getNodeName(); // depends on control dependency: [for], data = [j] if (desiredAttrs.contains(appAttrName)) { appJson.put(appAttrName, appAttrs.item(j).getTextContent()); // depends on control dependency: [if], data = [none] } } embedApp = new EmbedApp(appJson); embedApps.add(embedApp); } } return embedApps; } }
public class class_name { public T getGeoPackage(String name) { T geoPackage = null; PropertiesCoreExtension<T, ?, ?, ?> properties = propertiesMap .get(name); if (properties != null) { geoPackage = properties.getGeoPackage(); } return geoPackage; } }
public class class_name { public T getGeoPackage(String name) { T geoPackage = null; PropertiesCoreExtension<T, ?, ?, ?> properties = propertiesMap .get(name); if (properties != null) { geoPackage = properties.getGeoPackage(); // depends on control dependency: [if], data = [none] } return geoPackage; } }
public class class_name { protected void deleteDirectory(File directoryName){ if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "empty directory "+((directoryName == null) ? "None": directoryName.getPath())); } if (AccessHelper.deleteFile(directoryName)) { // If directory is empty, delete if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "delete "+directoryName.getName()); } } else { // Else the directory is not empty, and deletion fails if (isDebugEnabled()) { debugLogger.logp(Level.WARNING, thisClass, "deleteDirectory", "Failed to delete directory "+directoryName.getPath()); } } } }
public class class_name { protected void deleteDirectory(File directoryName){ if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "empty directory "+((directoryName == null) ? "None": directoryName.getPath())); // depends on control dependency: [if], data = [none] } if (AccessHelper.deleteFile(directoryName)) { // If directory is empty, delete if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "delete "+directoryName.getName()); // depends on control dependency: [if], data = [none] } } else { // Else the directory is not empty, and deletion fails if (isDebugEnabled()) { debugLogger.logp(Level.WARNING, thisClass, "deleteDirectory", "Failed to delete directory "+directoryName.getPath()); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void setNetworkSourcePort(java.util.Collection<NumberFilter> networkSourcePort) { if (networkSourcePort == null) { this.networkSourcePort = null; return; } this.networkSourcePort = new java.util.ArrayList<NumberFilter>(networkSourcePort); } }
public class class_name { public void setNetworkSourcePort(java.util.Collection<NumberFilter> networkSourcePort) { if (networkSourcePort == null) { this.networkSourcePort = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.networkSourcePort = new java.util.ArrayList<NumberFilter>(networkSourcePort); } }
public class class_name { public synchronized Map<String, String> getMetaData() { final Map<String, String> map = new TreeMap<>(); for (Entry<Object, Object> entry : properties.entrySet()) { final String key = (String) entry.getKey(); if (!"version".equals(key)) { if (key.startsWith("NVD CVE ")) { try { final long epoch = Long.parseLong((String) entry.getValue()); final DateTime date = new DateTime(epoch); final DateTimeFormatter format = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss"); final String formatted = format.print(date); // final Date date = new Date(epoch); // final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); // final String formatted = format.format(date); map.put(key, formatted); } catch (Throwable ex) { //deliberately being broad in this catch clause LOGGER.debug("Unable to parse timestamp from DB", ex); map.put(key, (String) entry.getValue()); } } else { map.put(key, (String) entry.getValue()); } } } return map; } }
public class class_name { public synchronized Map<String, String> getMetaData() { final Map<String, String> map = new TreeMap<>(); for (Entry<Object, Object> entry : properties.entrySet()) { final String key = (String) entry.getKey(); if (!"version".equals(key)) { if (key.startsWith("NVD CVE ")) { try { final long epoch = Long.parseLong((String) entry.getValue()); final DateTime date = new DateTime(epoch); final DateTimeFormatter format = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss"); final String formatted = format.print(date); // final Date date = new Date(epoch); // final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); // final String formatted = format.format(date); map.put(key, formatted); // depends on control dependency: [try], data = [none] } catch (Throwable ex) { //deliberately being broad in this catch clause LOGGER.debug("Unable to parse timestamp from DB", ex); map.put(key, (String) entry.getValue()); } // depends on control dependency: [catch], data = [none] } else { map.put(key, (String) entry.getValue()); // depends on control dependency: [if], data = [none] } } } return map; } }
public class class_name { public void marshall(ApplicationDetail applicationDetail, ProtocolMarshaller protocolMarshaller) { if (applicationDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(applicationDetail.getApplicationARN(), APPLICATIONARN_BINDING); protocolMarshaller.marshall(applicationDetail.getApplicationDescription(), APPLICATIONDESCRIPTION_BINDING); protocolMarshaller.marshall(applicationDetail.getApplicationName(), APPLICATIONNAME_BINDING); protocolMarshaller.marshall(applicationDetail.getRuntimeEnvironment(), RUNTIMEENVIRONMENT_BINDING); protocolMarshaller.marshall(applicationDetail.getServiceExecutionRole(), SERVICEEXECUTIONROLE_BINDING); protocolMarshaller.marshall(applicationDetail.getApplicationStatus(), APPLICATIONSTATUS_BINDING); protocolMarshaller.marshall(applicationDetail.getApplicationVersionId(), APPLICATIONVERSIONID_BINDING); protocolMarshaller.marshall(applicationDetail.getCreateTimestamp(), CREATETIMESTAMP_BINDING); protocolMarshaller.marshall(applicationDetail.getLastUpdateTimestamp(), LASTUPDATETIMESTAMP_BINDING); protocolMarshaller.marshall(applicationDetail.getApplicationConfigurationDescription(), APPLICATIONCONFIGURATIONDESCRIPTION_BINDING); protocolMarshaller.marshall(applicationDetail.getCloudWatchLoggingOptionDescriptions(), CLOUDWATCHLOGGINGOPTIONDESCRIPTIONS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ApplicationDetail applicationDetail, ProtocolMarshaller protocolMarshaller) { if (applicationDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(applicationDetail.getApplicationARN(), APPLICATIONARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getApplicationDescription(), APPLICATIONDESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getApplicationName(), APPLICATIONNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getRuntimeEnvironment(), RUNTIMEENVIRONMENT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getServiceExecutionRole(), SERVICEEXECUTIONROLE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getApplicationStatus(), APPLICATIONSTATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getApplicationVersionId(), APPLICATIONVERSIONID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getCreateTimestamp(), CREATETIMESTAMP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getLastUpdateTimestamp(), LASTUPDATETIMESTAMP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getApplicationConfigurationDescription(), APPLICATIONCONFIGURATIONDESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationDetail.getCloudWatchLoggingOptionDescriptions(), CLOUDWATCHLOGGINGOPTIONDESCRIPTIONS_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 { private void checkTransitives(Tile neighbor, String group, GroupTransition current, TileRef ref) { if (!group.equals(current.getOut()) && TransitionType.CENTER == mapTransition.getTransition(ref, current.getOut()).getType()) { map.setTile(map.createTile(ref.getSheet(), ref.getNumber(), neighbor.getX(), neighbor.getY())); } } }
public class class_name { private void checkTransitives(Tile neighbor, String group, GroupTransition current, TileRef ref) { if (!group.equals(current.getOut()) && TransitionType.CENTER == mapTransition.getTransition(ref, current.getOut()).getType()) { map.setTile(map.createTile(ref.getSheet(), ref.getNumber(), neighbor.getX(), neighbor.getY())); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void addGroupBy(String fieldName) { if (fieldName != null) { m_groupby.add(new FieldHelper(fieldName, false)); } } }
public class class_name { public void addGroupBy(String fieldName) { if (fieldName != null) { m_groupby.add(new FieldHelper(fieldName, false)); // depends on control dependency: [if], data = [(fieldName] } } }
public class class_name { public StorageRestoreParameters withStorageBundleBackup(byte[] storageBundleBackup) { if (storageBundleBackup == null) { this.storageBundleBackup = null; } else { this.storageBundleBackup = Base64Url.encode(storageBundleBackup); } return this; } }
public class class_name { public StorageRestoreParameters withStorageBundleBackup(byte[] storageBundleBackup) { if (storageBundleBackup == null) { this.storageBundleBackup = null; // depends on control dependency: [if], data = [none] } else { this.storageBundleBackup = Base64Url.encode(storageBundleBackup); // depends on control dependency: [if], data = [(storageBundleBackup] } return this; } }
public class class_name { public Weeks plus(int weeks) { if (weeks == 0) { return this; } return Weeks.weeks(FieldUtils.safeAdd(getValue(), weeks)); } }
public class class_name { public Weeks plus(int weeks) { if (weeks == 0) { return this; // depends on control dependency: [if], data = [none] } return Weeks.weeks(FieldUtils.safeAdd(getValue(), weeks)); } }
public class class_name { private void parseGlobalAttributes(DAS das, DodsV root, DODSNetcdfFile dodsfile) { List<DODSAttribute> atts = root.attributes; for (ucar.nc2.Attribute ncatt : atts) { rootGroup.addAttribute(ncatt); } // loop over attribute tables, collect global attributes Enumeration tableNames = das.getNames(); while (tableNames.hasMoreElements()) { String tableName = (String) tableNames.nextElement(); AttributeTable attTable = das.getAttributeTableN(tableName); if (attTable == null) continue; // should probably never happen /* if (tableName.equals("NC_GLOBAL") || tableName.equals("HDF_GLOBAL")) { java.util.Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); dods.dap.Attribute att = attTable.getAttribute(attName); DODSAttribute ncatt = new DODSAttribute( attName, att); addAttribute( null, ncatt); } } else */ if (tableName.equals("DODS_EXTRA")) { Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); if (attName.equals("Unlimited_Dimension")) { opendap.dap.Attribute att = attTable.getAttribute(attName); DODSAttribute ncatt = new DODSAttribute(attName, att); setUnlimited(ncatt.getStringValue()); } else logger.warn(" Unknown DODS_EXTRA attribute = " + attName + " " + location); } } else if (tableName.equals("EXTRA_DIMENSION")) { Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); opendap.dap.Attribute att = attTable.getAttribute(attName); DODSAttribute ncatt = new DODSAttribute(attName, att); int length = ncatt.getNumericValue().intValue(); Dimension extraDim = new Dimension(attName, length); addDimension(null, extraDim); } } /* else if (null == root.findDodsV( tableName, false)) { addAttributes(attTable.getName(), attTable); } */ } } }
public class class_name { private void parseGlobalAttributes(DAS das, DodsV root, DODSNetcdfFile dodsfile) { List<DODSAttribute> atts = root.attributes; for (ucar.nc2.Attribute ncatt : atts) { rootGroup.addAttribute(ncatt); // depends on control dependency: [for], data = [ncatt] } // loop over attribute tables, collect global attributes Enumeration tableNames = das.getNames(); while (tableNames.hasMoreElements()) { String tableName = (String) tableNames.nextElement(); AttributeTable attTable = das.getAttributeTableN(tableName); if (attTable == null) continue; // should probably never happen /* if (tableName.equals("NC_GLOBAL") || tableName.equals("HDF_GLOBAL")) { java.util.Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); dods.dap.Attribute att = attTable.getAttribute(attName); DODSAttribute ncatt = new DODSAttribute( attName, att); addAttribute( null, ncatt); } } else */ if (tableName.equals("DODS_EXTRA")) { Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); if (attName.equals("Unlimited_Dimension")) { opendap.dap.Attribute att = attTable.getAttribute(attName); DODSAttribute ncatt = new DODSAttribute(attName, att); setUnlimited(ncatt.getStringValue()); // depends on control dependency: [if], data = [none] } else logger.warn(" Unknown DODS_EXTRA attribute = " + attName + " " + location); } } else if (tableName.equals("EXTRA_DIMENSION")) { Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); opendap.dap.Attribute att = attTable.getAttribute(attName); DODSAttribute ncatt = new DODSAttribute(attName, att); int length = ncatt.getNumericValue().intValue(); Dimension extraDim = new Dimension(attName, length); addDimension(null, extraDim); // depends on control dependency: [while], data = [none] } } /* else if (null == root.findDodsV( tableName, false)) { addAttributes(attTable.getName(), attTable); } */ } } }
public class class_name { private static Map<Circuit, Collection<TileRef>> getCircuits(MapTile map) { final MapTileGroup mapGroup = map.getFeature(MapTileGroup.class); final Map<Circuit, Collection<TileRef>> circuits = new HashMap<>(); final MapCircuitExtractor extractor = new MapCircuitExtractor(map); for (int ty = 1; ty < map.getInTileHeight() - 1; ty++) { for (int tx = 1; tx < map.getInTileWidth() - 1; tx++) { final Tile tile = map.getTile(tx, ty); if (tile != null && TileGroupType.CIRCUIT == mapGroup.getType(tile)) { checkCircuit(circuits, extractor, map, tile); } } } return circuits; } }
public class class_name { private static Map<Circuit, Collection<TileRef>> getCircuits(MapTile map) { final MapTileGroup mapGroup = map.getFeature(MapTileGroup.class); final Map<Circuit, Collection<TileRef>> circuits = new HashMap<>(); final MapCircuitExtractor extractor = new MapCircuitExtractor(map); for (int ty = 1; ty < map.getInTileHeight() - 1; ty++) { for (int tx = 1; tx < map.getInTileWidth() - 1; tx++) { final Tile tile = map.getTile(tx, ty); if (tile != null && TileGroupType.CIRCUIT == mapGroup.getType(tile)) { checkCircuit(circuits, extractor, map, tile); // depends on control dependency: [if], data = [none] } } } return circuits; } }
public class class_name { public Object invoke(T target, Object... args) throws InvocationTargetException { Method m = getMethod(target.getClass()); if (m == null) { throw new AssertionError("Method " + methodName + " not supported for object " + target); } try { return m.invoke(target, args); } catch (IllegalAccessException e) { // Method should be public: we checked. AssertionError error = new AssertionError("Unexpectedly could not call: " + m); error.initCause(e); throw error; } } }
public class class_name { public Object invoke(T target, Object... args) throws InvocationTargetException { Method m = getMethod(target.getClass()); if (m == null) { throw new AssertionError("Method " + methodName + " not supported for object " + target); } try { return m.invoke(target, args); // depends on control dependency: [try], data = [none] } catch (IllegalAccessException e) { // Method should be public: we checked. AssertionError error = new AssertionError("Unexpectedly could not call: " + m); error.initCause(e); throw error; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private Map<Integer, String> getResolutionUrlMapFromM3u8(String m3u8Content) { Map<Integer, String> resolutionUrlMap = new HashMap<>(); // Split nach #, um für jede Auflösung eine eigenen String zu erhalten String[] parts = m3u8Content.split("#"); for (String part : parts) { String resolution = getSubstring(part, M3U8_RESOLUTION_BEGIN, M3U8_RESOLUTION_END); String url = getSubstring(part, M3U8_URL_BEGIN, M3U8_URL_END); if(!resolution.isEmpty() && !url.isEmpty()) { url = M3U8_URL_BEGIN + url + M3U8_URL_END; int resolutionValue = Integer.parseInt(resolution); resolutionUrlMap.put(resolutionValue, url); } } return resolutionUrlMap; } }
public class class_name { private Map<Integer, String> getResolutionUrlMapFromM3u8(String m3u8Content) { Map<Integer, String> resolutionUrlMap = new HashMap<>(); // Split nach #, um für jede Auflösung eine eigenen String zu erhalten String[] parts = m3u8Content.split("#"); for (String part : parts) { String resolution = getSubstring(part, M3U8_RESOLUTION_BEGIN, M3U8_RESOLUTION_END); String url = getSubstring(part, M3U8_URL_BEGIN, M3U8_URL_END); if(!resolution.isEmpty() && !url.isEmpty()) { url = M3U8_URL_BEGIN + url + M3U8_URL_END; // depends on control dependency: [if], data = [none] int resolutionValue = Integer.parseInt(resolution); resolutionUrlMap.put(resolutionValue, url); // depends on control dependency: [if], data = [none] } } return resolutionUrlMap; } }
public class class_name { public static String hashString(String input, int length) { MessageDigest md; try { md = MessageDigest.getInstance("SHA"); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("The SHA Algorithm could not be found", e); } byte[] bytes = input.getBytes(); md.update(bytes); String hashed = convertToHex(md.digest()); hashed = reduceHash(hashed, length); return hashed; } }
public class class_name { public static String hashString(String input, int length) { MessageDigest md; try { md = MessageDigest.getInstance("SHA"); // depends on control dependency: [try], data = [none] } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("The SHA Algorithm could not be found", e); } // depends on control dependency: [catch], data = [none] byte[] bytes = input.getBytes(); md.update(bytes); String hashed = convertToHex(md.digest()); hashed = reduceHash(hashed, length); return hashed; } }
public class class_name { public Map<Object, Boolean> getIsEqual() { if (m_isEqual == null) { m_isEqual = CmsCollectionsGenericWrapper.createLazyMap(new CmsIsEqualTransformer()); } return m_isEqual; } }
public class class_name { public Map<Object, Boolean> getIsEqual() { if (m_isEqual == null) { m_isEqual = CmsCollectionsGenericWrapper.createLazyMap(new CmsIsEqualTransformer()); // depends on control dependency: [if], data = [none] } return m_isEqual; } }
public class class_name { public static boolean parametersInRange( double[] parameters, double[]... ranges ) { for( int i = 0; i < ranges.length; i++ ) { if (!NumericsUtilities.isBetween(parameters[i], ranges[i])) { return false; } } return true; } }
public class class_name { public static boolean parametersInRange( double[] parameters, double[]... ranges ) { for( int i = 0; i < ranges.length; i++ ) { if (!NumericsUtilities.isBetween(parameters[i], ranges[i])) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public List<String> getPropertyNames() { final int size = this.properties.size(); if (0 == size) { return Collections.emptyList(); } List<String> names = new ArrayList<String>(size); names.addAll(this.properties.keySet()); return names; } }
public class class_name { public List<String> getPropertyNames() { final int size = this.properties.size(); if (0 == size) { return Collections.emptyList(); // depends on control dependency: [if], data = [none] } List<String> names = new ArrayList<String>(size); names.addAll(this.properties.keySet()); return names; } }
public class class_name { public InputStream open(String fileName) { try { URL urlToFile = new URL(url, fileName); return urlToFile.openStream(); } catch (MalformedURLException e) { throw new RuntimeException(String.format("error while forming new URL from URL %s and filename %s", url.getPath(), fileName), e); } catch (IOException e) { return null; } } }
public class class_name { public InputStream open(String fileName) { try { URL urlToFile = new URL(url, fileName); return urlToFile.openStream(); // depends on control dependency: [try], data = [none] } catch (MalformedURLException e) { throw new RuntimeException(String.format("error while forming new URL from URL %s and filename %s", url.getPath(), fileName), e); } catch (IOException e) { // depends on control dependency: [catch], data = [none] return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public List<Map<String, Object>> queryListMap(String sql, Object[] params) { Connection conn = getConn(); try { return conn.createQuery(sql) .withParams(params) .setAutoDeriveColumnNames(true) .throwOnMappingFailure(false) .executeAndFetchTable() .asList(); } finally { this.closeConn(conn); this.clean(null); } } }
public class class_name { public List<Map<String, Object>> queryListMap(String sql, Object[] params) { Connection conn = getConn(); try { return conn.createQuery(sql) .withParams(params) .setAutoDeriveColumnNames(true) .throwOnMappingFailure(false) .executeAndFetchTable() .asList(); // depends on control dependency: [try], data = [none] } finally { this.closeConn(conn); this.clean(null); } } }
public class class_name { private void swapHeapValues(int i, int j) { if(fastValueRemove == Mode.HASH) { valueIndexMap.put(heap[i], j); valueIndexMap.put(heap[j], i); } else if(fastValueRemove == Mode.BOUNDED) { //Already in the array, so just need to set valueIndexStore[heap[i]] = j; valueIndexStore[heap[j]] = i; } int tmp = heap[i]; heap[i] = heap[j]; heap[j] = tmp; } }
public class class_name { private void swapHeapValues(int i, int j) { if(fastValueRemove == Mode.HASH) { valueIndexMap.put(heap[i], j); // depends on control dependency: [if], data = [none] valueIndexMap.put(heap[j], i); // depends on control dependency: [if], data = [none] } else if(fastValueRemove == Mode.BOUNDED) { //Already in the array, so just need to set valueIndexStore[heap[i]] = j; // depends on control dependency: [if], data = [none] valueIndexStore[heap[j]] = i; // depends on control dependency: [if], data = [none] } int tmp = heap[i]; heap[i] = heap[j]; heap[j] = tmp; } }
public class class_name { @Override public void stop(final Logger logger) { try { logger.logInfo("Stopping ApacheDS server"); server.stop(); service.shutdown(); logger.logInfo("Stopped ApacheDS server"); } catch (final Exception e) { logger.logError("Error stopping ApacheDS server", e); } } }
public class class_name { @Override public void stop(final Logger logger) { try { logger.logInfo("Stopping ApacheDS server"); // depends on control dependency: [try], data = [none] server.stop(); // depends on control dependency: [try], data = [none] service.shutdown(); // depends on control dependency: [try], data = [none] logger.logInfo("Stopped ApacheDS server"); // depends on control dependency: [try], data = [none] } catch (final Exception e) { logger.logError("Error stopping ApacheDS server", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static <E> ImmutableList<E> copyOf(Iterator<? extends E> elements) { // We special-case for 0 or 1 elements, but going further is madness. if (!elements.hasNext()) { return of(); } E first = elements.next(); if (!elements.hasNext()) { return of(first); } else { return new ImmutableList.Builder<E>().add(first).addAll(elements).build(); } } }
public class class_name { public static <E> ImmutableList<E> copyOf(Iterator<? extends E> elements) { // We special-case for 0 or 1 elements, but going further is madness. if (!elements.hasNext()) { return of(); // depends on control dependency: [if], data = [none] } E first = elements.next(); if (!elements.hasNext()) { return of(first); // depends on control dependency: [if], data = [none] } else { return new ImmutableList.Builder<E>().add(first).addAll(elements).build(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Integer getInteger(String key){ try { return Integer.valueOf(resource.getString(key)); } catch (MissingResourceException e) { return new Integer(-1); } } }
public class class_name { public Integer getInteger(String key){ try { return Integer.valueOf(resource.getString(key)); // depends on control dependency: [try], data = [none] } catch (MissingResourceException e) { return new Integer(-1); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Deprecated protected void validateInstanceMethods(List<Throwable> errors) { validatePublicVoidNoArgMethods(After.class, false, errors); validatePublicVoidNoArgMethods(Before.class, false, errors); validateTestMethods(errors); if (computeTestMethods().isEmpty()) { errors.add(new Exception("No runnable methods")); } } }
public class class_name { @Deprecated protected void validateInstanceMethods(List<Throwable> errors) { validatePublicVoidNoArgMethods(After.class, false, errors); validatePublicVoidNoArgMethods(Before.class, false, errors); validateTestMethods(errors); if (computeTestMethods().isEmpty()) { errors.add(new Exception("No runnable methods")); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void handleExpandedState(final Request request) { String[] paramValue = request.getParameterValues(getId() + OPEN_REQUEST_KEY); if (paramValue == null) { paramValue = new String[0]; } String[] expandedRowIds = removeEmptyStrings(paramValue); Set<String> newExpansionIds = new HashSet<>(); if (expandedRowIds != null) { int offset = getItemIdPrefix().length(); for (String expandedRowId : expandedRowIds) { if (expandedRowId.length() <= offset) { LOG.warn("Expanded row id [" + expandedRowId + "] does not have a valid prefix and will be ignored."); continue; } // Remove prefix to get item id String itemId = expandedRowId.substring(offset); // Assume the item id is valid newExpansionIds.add(itemId); } } setExpandedRows(newExpansionIds); } }
public class class_name { private void handleExpandedState(final Request request) { String[] paramValue = request.getParameterValues(getId() + OPEN_REQUEST_KEY); if (paramValue == null) { paramValue = new String[0]; // depends on control dependency: [if], data = [none] } String[] expandedRowIds = removeEmptyStrings(paramValue); Set<String> newExpansionIds = new HashSet<>(); if (expandedRowIds != null) { int offset = getItemIdPrefix().length(); for (String expandedRowId : expandedRowIds) { if (expandedRowId.length() <= offset) { LOG.warn("Expanded row id [" + expandedRowId + "] does not have a valid prefix and will be ignored."); // depends on control dependency: [if], data = [none] continue; } // Remove prefix to get item id String itemId = expandedRowId.substring(offset); // Assume the item id is valid newExpansionIds.add(itemId); // depends on control dependency: [for], data = [none] } } setExpandedRows(newExpansionIds); } }
public class class_name { public void checkInitialRemoteInformation(SipServletMessageImpl sipServletMessage, ViaHeader nextViaHeader) { final SIPTransaction transaction = (SIPTransaction)sipServletMessage.getTransaction(); String remoteAddr = transaction.getPeerAddress(); int remotePort = transaction.getPeerPort(); if(transaction.getPeerPacketSourceAddress() != null) { remoteAddr = transaction.getPeerPacketSourceAddress().getHostAddress(); remotePort = transaction.getPeerPacketSourcePort(); } final String initialRemoteAddr = remoteAddr; final int initialRemotePort = remotePort; final String initialRemoteTransport = transaction.getTransport(); final TransactionApplicationData transactionApplicationData = sipServletMessage.getTransactionApplicationData(); // if the message comes from an external source we add the initial remote info from the transaction if(sipApplicationDispatcher.isExternal(initialRemoteAddr, initialRemotePort, initialRemoteTransport)) { transactionApplicationData.setInitialRemoteHostAddress(initialRemoteAddr); transactionApplicationData.setInitialRemotePort(initialRemotePort); transactionApplicationData.setInitialRemoteTransport(initialRemoteTransport); // there is no other way to pass the information to the next applications in chain // (to avoid maintaining in memory information that would be to be clustered as well...) // than adding it as a custom information, we add it as headers only if // the next via header is for the container if(nextViaHeader != null && !sipApplicationDispatcher.isViaHeaderExternal(nextViaHeader)) { sipServletMessage.setHeaderInternal(JainSipUtils.INITIAL_REMOTE_ADDR_HEADER_NAME, initialRemoteAddr, true); sipServletMessage.setHeaderInternal(JainSipUtils.INITIAL_REMOTE_PORT_HEADER_NAME, "" + initialRemotePort, true); sipServletMessage.setHeaderInternal(JainSipUtils.INITIAL_REMOTE_TRANSPORT_HEADER_NAME, initialRemoteTransport, true); } } else { // if the message comes from an internal source we add the initial remote info from the previously added headers String remoteAddressHeader = sipServletMessage.getHeader(JainSipUtils.INITIAL_REMOTE_ADDR_HEADER_NAME); String remotePortHeader = sipServletMessage.getHeader(JainSipUtils.INITIAL_REMOTE_PORT_HEADER_NAME); String remoteTransportHeader = sipServletMessage.getHeader(JainSipUtils.INITIAL_REMOTE_TRANSPORT_HEADER_NAME); int intRemotePort = -1; if(remotePortHeader != null) { intRemotePort = Integer.parseInt(remotePortHeader); } if(remoteAddressHeader == null && remoteTransportHeader == null && remotePortHeader == null) { transactionApplicationData.setInitialRemoteHostAddress(initialRemoteAddr); transactionApplicationData.setInitialRemotePort(initialRemotePort); transactionApplicationData.setInitialRemoteTransport(initialRemoteTransport); } else { transactionApplicationData.setInitialRemoteHostAddress(remoteAddressHeader); transactionApplicationData.setInitialRemotePort(intRemotePort); transactionApplicationData.setInitialRemoteTransport(remoteTransportHeader); if(nextViaHeader == null || sipApplicationDispatcher.isViaHeaderExternal(nextViaHeader)) { sipServletMessage.removeHeaderInternal(JainSipUtils.INITIAL_REMOTE_ADDR_HEADER_NAME, true); sipServletMessage.removeHeaderInternal(JainSipUtils.INITIAL_REMOTE_PORT_HEADER_NAME, true); sipServletMessage.removeHeaderInternal(JainSipUtils.INITIAL_REMOTE_TRANSPORT_HEADER_NAME, true); } } } } }
public class class_name { public void checkInitialRemoteInformation(SipServletMessageImpl sipServletMessage, ViaHeader nextViaHeader) { final SIPTransaction transaction = (SIPTransaction)sipServletMessage.getTransaction(); String remoteAddr = transaction.getPeerAddress(); int remotePort = transaction.getPeerPort(); if(transaction.getPeerPacketSourceAddress() != null) { remoteAddr = transaction.getPeerPacketSourceAddress().getHostAddress(); // depends on control dependency: [if], data = [none] remotePort = transaction.getPeerPacketSourcePort(); // depends on control dependency: [if], data = [none] } final String initialRemoteAddr = remoteAddr; final int initialRemotePort = remotePort; final String initialRemoteTransport = transaction.getTransport(); final TransactionApplicationData transactionApplicationData = sipServletMessage.getTransactionApplicationData(); // if the message comes from an external source we add the initial remote info from the transaction if(sipApplicationDispatcher.isExternal(initialRemoteAddr, initialRemotePort, initialRemoteTransport)) { transactionApplicationData.setInitialRemoteHostAddress(initialRemoteAddr); // depends on control dependency: [if], data = [none] transactionApplicationData.setInitialRemotePort(initialRemotePort); // depends on control dependency: [if], data = [none] transactionApplicationData.setInitialRemoteTransport(initialRemoteTransport); // depends on control dependency: [if], data = [none] // there is no other way to pass the information to the next applications in chain // (to avoid maintaining in memory information that would be to be clustered as well...) // than adding it as a custom information, we add it as headers only if // the next via header is for the container if(nextViaHeader != null && !sipApplicationDispatcher.isViaHeaderExternal(nextViaHeader)) { sipServletMessage.setHeaderInternal(JainSipUtils.INITIAL_REMOTE_ADDR_HEADER_NAME, initialRemoteAddr, true); // depends on control dependency: [if], data = [none] sipServletMessage.setHeaderInternal(JainSipUtils.INITIAL_REMOTE_PORT_HEADER_NAME, "" + initialRemotePort, true); // depends on control dependency: [if], data = [none] sipServletMessage.setHeaderInternal(JainSipUtils.INITIAL_REMOTE_TRANSPORT_HEADER_NAME, initialRemoteTransport, true); // depends on control dependency: [if], data = [none] } } else { // if the message comes from an internal source we add the initial remote info from the previously added headers String remoteAddressHeader = sipServletMessage.getHeader(JainSipUtils.INITIAL_REMOTE_ADDR_HEADER_NAME); String remotePortHeader = sipServletMessage.getHeader(JainSipUtils.INITIAL_REMOTE_PORT_HEADER_NAME); String remoteTransportHeader = sipServletMessage.getHeader(JainSipUtils.INITIAL_REMOTE_TRANSPORT_HEADER_NAME); int intRemotePort = -1; if(remotePortHeader != null) { intRemotePort = Integer.parseInt(remotePortHeader); // depends on control dependency: [if], data = [(remotePortHeader] } if(remoteAddressHeader == null && remoteTransportHeader == null && remotePortHeader == null) { transactionApplicationData.setInitialRemoteHostAddress(initialRemoteAddr); // depends on control dependency: [if], data = [none] transactionApplicationData.setInitialRemotePort(initialRemotePort); // depends on control dependency: [if], data = [none] transactionApplicationData.setInitialRemoteTransport(initialRemoteTransport); // depends on control dependency: [if], data = [none] } else { transactionApplicationData.setInitialRemoteHostAddress(remoteAddressHeader); // depends on control dependency: [if], data = [(remoteAddressHeader] transactionApplicationData.setInitialRemotePort(intRemotePort); // depends on control dependency: [if], data = [none] transactionApplicationData.setInitialRemoteTransport(remoteTransportHeader); // depends on control dependency: [if], data = [none] if(nextViaHeader == null || sipApplicationDispatcher.isViaHeaderExternal(nextViaHeader)) { sipServletMessage.removeHeaderInternal(JainSipUtils.INITIAL_REMOTE_ADDR_HEADER_NAME, true); // depends on control dependency: [if], data = [none] sipServletMessage.removeHeaderInternal(JainSipUtils.INITIAL_REMOTE_PORT_HEADER_NAME, true); // depends on control dependency: [if], data = [none] sipServletMessage.removeHeaderInternal(JainSipUtils.INITIAL_REMOTE_TRANSPORT_HEADER_NAME, true); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public ListUserPoolsResult withUserPools(UserPoolDescriptionType... userPools) { if (this.userPools == null) { setUserPools(new java.util.ArrayList<UserPoolDescriptionType>(userPools.length)); } for (UserPoolDescriptionType ele : userPools) { this.userPools.add(ele); } return this; } }
public class class_name { public ListUserPoolsResult withUserPools(UserPoolDescriptionType... userPools) { if (this.userPools == null) { setUserPools(new java.util.ArrayList<UserPoolDescriptionType>(userPools.length)); // depends on control dependency: [if], data = [none] } for (UserPoolDescriptionType ele : userPools) { this.userPools.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public final srecParser.method_body_return method_body() throws RecognitionException { srecParser.method_body_return retval = new srecParser.method_body_return(); retval.start = input.LT(1); CommonTree root_0 = null; srecParser.script_stmt_block_return script_stmt_block52 = null; RewriteRuleSubtreeStream stream_script_stmt_block=new RewriteRuleSubtreeStream(adaptor,"rule script_stmt_block"); try { // /home/victor/srec/core/src/main/antlr/srec.g:89:2: ( ( script_stmt_block )? -> ^( METHOD_BODY ( script_stmt_block )? ) ) // /home/victor/srec/core/src/main/antlr/srec.g:89:4: ( script_stmt_block )? { // /home/victor/srec/core/src/main/antlr/srec.g:89:4: ( script_stmt_block )? int alt12=2; int LA12_0 = input.LA(1); if ( (LA12_0==ID||LA12_0==33) ) { alt12=1; } switch (alt12) { case 1 : // /home/victor/srec/core/src/main/antlr/srec.g:89:4: script_stmt_block { pushFollow(FOLLOW_script_stmt_block_in_method_body481); script_stmt_block52=script_stmt_block(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_script_stmt_block.add(script_stmt_block52.getTree()); } break; } // AST REWRITE // elements: script_stmt_block // token labels: // rule labels: retval // token list labels: // rule list labels: // wildcard labels: if ( state.backtracking==0 ) { retval.tree = root_0; RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); root_0 = (CommonTree)adaptor.nil(); // 90:3: -> ^( METHOD_BODY ( script_stmt_block )? ) { // /home/victor/srec/core/src/main/antlr/srec.g:90:6: ^( METHOD_BODY ( script_stmt_block )? ) { CommonTree root_1 = (CommonTree)adaptor.nil(); root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(METHOD_BODY, "METHOD_BODY"), root_1); // /home/victor/srec/core/src/main/antlr/srec.g:90:20: ( script_stmt_block )? if ( stream_script_stmt_block.hasNext() ) { adaptor.addChild(root_1, stream_script_stmt_block.nextTree()); } stream_script_stmt_block.reset(); adaptor.addChild(root_0, root_1); } } retval.tree = root_0;} } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { } return retval; } }
public class class_name { public final srecParser.method_body_return method_body() throws RecognitionException { srecParser.method_body_return retval = new srecParser.method_body_return(); retval.start = input.LT(1); CommonTree root_0 = null; srecParser.script_stmt_block_return script_stmt_block52 = null; RewriteRuleSubtreeStream stream_script_stmt_block=new RewriteRuleSubtreeStream(adaptor,"rule script_stmt_block"); try { // /home/victor/srec/core/src/main/antlr/srec.g:89:2: ( ( script_stmt_block )? -> ^( METHOD_BODY ( script_stmt_block )? ) ) // /home/victor/srec/core/src/main/antlr/srec.g:89:4: ( script_stmt_block )? { // /home/victor/srec/core/src/main/antlr/srec.g:89:4: ( script_stmt_block )? int alt12=2; int LA12_0 = input.LA(1); if ( (LA12_0==ID||LA12_0==33) ) { alt12=1; // depends on control dependency: [if], data = [none] } switch (alt12) { case 1 : // /home/victor/srec/core/src/main/antlr/srec.g:89:4: script_stmt_block { pushFollow(FOLLOW_script_stmt_block_in_method_body481); script_stmt_block52=script_stmt_block(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_script_stmt_block.add(script_stmt_block52.getTree()); } break; } // AST REWRITE // elements: script_stmt_block // token labels: // rule labels: retval // token list labels: // rule list labels: // wildcard labels: if ( state.backtracking==0 ) { retval.tree = root_0; // depends on control dependency: [if], data = [none] RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); root_0 = (CommonTree)adaptor.nil(); // depends on control dependency: [if], data = [none] // 90:3: -> ^( METHOD_BODY ( script_stmt_block )? ) { // /home/victor/srec/core/src/main/antlr/srec.g:90:6: ^( METHOD_BODY ( script_stmt_block )? ) { CommonTree root_1 = (CommonTree)adaptor.nil(); root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(METHOD_BODY, "METHOD_BODY"), root_1); // /home/victor/srec/core/src/main/antlr/srec.g:90:20: ( script_stmt_block )? if ( stream_script_stmt_block.hasNext() ) { adaptor.addChild(root_1, stream_script_stmt_block.nextTree()); // depends on control dependency: [if], data = [none] } stream_script_stmt_block.reset(); adaptor.addChild(root_0, root_1); } } retval.tree = root_0;} // depends on control dependency: [if], data = [none] } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); // depends on control dependency: [if], data = [none] adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); // depends on control dependency: [if], data = [none] } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { } return retval; } }
public class class_name { public static List<Class<?>> findAllImplementations(Class<?> c, boolean everything, boolean parameterizable) { if(c == null) { return Collections.emptyList(); } // Default is served from the registry if(!everything && parameterizable) { return findAllImplementations(c); } // This codepath is used by utility classes to also find buggy // implementations (e.g. non-instantiable, abstract) of the interfaces. List<Class<?>> known = findAllImplementations(c); // For quickly skipping seen entries: HashSet<Class<?>> dupes = new HashSet<>(known); for(Iterator<Class<?>> iter = ELKIServiceScanner.nonindexedClasses(); iter.hasNext();) { Class<?> cls = iter.next(); if(dupes.contains(cls)) { continue; } // skip abstract / private classes. if(!everything && (Modifier.isInterface(cls.getModifiers()) || Modifier.isAbstract(cls.getModifiers()) || Modifier.isPrivate(cls.getModifiers()))) { continue; } if(!c.isAssignableFrom(cls)) { continue; } if(parameterizable) { boolean instantiable = false; try { instantiable = cls.getConstructor() != null; } catch(Exception | Error e) { // ignore } try { instantiable = instantiable || ClassGenericsUtil.getParameterizer(cls) != null; } catch(Exception | Error e) { // ignore } if(!instantiable) { continue; } } known.add(cls); dupes.add(cls); } return known; } }
public class class_name { public static List<Class<?>> findAllImplementations(Class<?> c, boolean everything, boolean parameterizable) { if(c == null) { return Collections.emptyList(); } // Default is served from the registry if(!everything && parameterizable) { return findAllImplementations(c); } // This codepath is used by utility classes to also find buggy // implementations (e.g. non-instantiable, abstract) of the interfaces. List<Class<?>> known = findAllImplementations(c); // For quickly skipping seen entries: HashSet<Class<?>> dupes = new HashSet<>(known); for(Iterator<Class<?>> iter = ELKIServiceScanner.nonindexedClasses(); iter.hasNext();) { Class<?> cls = iter.next(); if(dupes.contains(cls)) { continue; } // skip abstract / private classes. if(!everything && (Modifier.isInterface(cls.getModifiers()) || Modifier.isAbstract(cls.getModifiers()) || Modifier.isPrivate(cls.getModifiers()))) { continue; } if(!c.isAssignableFrom(cls)) { continue; } if(parameterizable) { boolean instantiable = false; try { instantiable = cls.getConstructor() != null; // depends on control dependency: [try], data = [none] } catch(Exception | Error e) { // ignore } // depends on control dependency: [catch], data = [none] try { instantiable = instantiable || ClassGenericsUtil.getParameterizer(cls) != null; // depends on control dependency: [try], data = [none] } catch(Exception | Error e) { // ignore } // depends on control dependency: [catch], data = [none] if(!instantiable) { continue; } } known.add(cls); dupes.add(cls); } return known; } }
public class class_name { public ServerConfig setParameters(Map<String, String> parameters) { if (this.parameters == null) { this.parameters = new ConcurrentHashMap<String, String>(); this.parameters.putAll(parameters); } return this; } }
public class class_name { public ServerConfig setParameters(Map<String, String> parameters) { if (this.parameters == null) { this.parameters = new ConcurrentHashMap<String, String>(); // depends on control dependency: [if], data = [none] this.parameters.putAll(parameters); // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) { for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) { final String headerName = headerAttributeEntry.getKey(); final String value = httpServletRequest.getHeader(headerName); if (value != null) { for (final String attributeName : headerAttributeEntry.getValue()) { attributes.put(attributeName, headersToIgnoreSemicolons.contains(headerName) ? list(value) : splitOnSemiColonHandlingBackslashEscaping(value)); } } } } }
public class class_name { protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) { for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) { final String headerName = headerAttributeEntry.getKey(); final String value = httpServletRequest.getHeader(headerName); if (value != null) { for (final String attributeName : headerAttributeEntry.getValue()) { attributes.put(attributeName, headersToIgnoreSemicolons.contains(headerName) ? list(value) : splitOnSemiColonHandlingBackslashEscaping(value)); // depends on control dependency: [for], data = [attributeName] } } } } }
public class class_name { public int getHistoryCount(int profileId, String clientUUID, HashMap<String, String[]> searchFilter) { int count = 0; Statement query = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { String sqlQuery = "SELECT COUNT(" + Constants.GENERIC_ID + ") FROM " + Constants.DB_TABLE_HISTORY + " "; // see if profileId is set or not (-1) if (profileId != -1) { sqlQuery += "WHERE " + Constants.GENERIC_PROFILE_ID + "=" + profileId + " "; } if (clientUUID != null && clientUUID.compareTo("") != 0) { sqlQuery += "AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID + "' "; } sqlQuery += ";"; logger.info("Query: {}", sqlQuery); query = sqlConnection.createStatement(); results = query.executeQuery(sqlQuery); if (results.next()) { count = results.getInt(1); } query.close(); } catch (Exception e) { } finally { try { if (results != null) { results.close(); } } catch (Exception e) { } try { if (query != null) { query.close(); } } catch (Exception e) { } } return count; } }
public class class_name { public int getHistoryCount(int profileId, String clientUUID, HashMap<String, String[]> searchFilter) { int count = 0; Statement query = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { String sqlQuery = "SELECT COUNT(" + Constants.GENERIC_ID + ") FROM " + Constants.DB_TABLE_HISTORY + " "; // see if profileId is set or not (-1) if (profileId != -1) { sqlQuery += "WHERE " + Constants.GENERIC_PROFILE_ID + "=" + profileId + " "; // depends on control dependency: [if], data = [none] } if (clientUUID != null && clientUUID.compareTo("") != 0) { sqlQuery += "AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID + "' "; // depends on control dependency: [if], data = [none] } sqlQuery += ";"; logger.info("Query: {}", sqlQuery); query = sqlConnection.createStatement(); results = query.executeQuery(sqlQuery); if (results.next()) { count = results.getInt(1); // depends on control dependency: [if], data = [none] } query.close(); } catch (Exception e) { } 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 (query != null) { query.close(); // depends on control dependency: [if], data = [none] } } catch (Exception e) { } // depends on control dependency: [catch], data = [none] } return count; } }
public class class_name { public static void HighLevel( GrayF32 input) { System.out.println("\n------------------- Dense High Level"); DescribeImageDense<GrayF32,TupleDesc_F64> describer = FactoryDescribeImageDense. hog(new ConfigDenseHoG(),input.getImageType()); // sift(new ConfigDenseSift(),GrayF32.class); // surfFast(new ConfigDenseSurfFast(),GrayF32.class); // process the image and compute the dense image features describer.process(input); // print out part of the first few features System.out.println("Total Features = "+describer.getLocations().size()); for (int i = 0; i < 5; i++) { Point2D_I32 p = describer.getLocations().get(i); TupleDesc_F64 d = describer.getDescriptions().get(i); System.out.printf("%3d %3d = [ %f %f %f %f\n",p.x,p.y,d.value[0],d.value[1],d.value[2],d.value[3]); // You would process the feature descriptor here } } }
public class class_name { public static void HighLevel( GrayF32 input) { System.out.println("\n------------------- Dense High Level"); DescribeImageDense<GrayF32,TupleDesc_F64> describer = FactoryDescribeImageDense. hog(new ConfigDenseHoG(),input.getImageType()); // sift(new ConfigDenseSift(),GrayF32.class); // surfFast(new ConfigDenseSurfFast(),GrayF32.class); // process the image and compute the dense image features describer.process(input); // print out part of the first few features System.out.println("Total Features = "+describer.getLocations().size()); for (int i = 0; i < 5; i++) { Point2D_I32 p = describer.getLocations().get(i); TupleDesc_F64 d = describer.getDescriptions().get(i); System.out.printf("%3d %3d = [ %f %f %f %f\n",p.x,p.y,d.value[0],d.value[1],d.value[2],d.value[3]); // depends on control dependency: [for], data = [none] // You would process the feature descriptor here } } }
public class class_name { private void processInterface(ClassDoc cd) { ClassDoc[] intfacs = cd.interfaces(); if (intfacs.length > 0) { for (int i = 0; i < intfacs.length; i++) { if (!add(subinterfaces, intfacs[i], cd)) { return; } else { processInterface(intfacs[i]); // Recurse } } } else { // we need to add all the interfaces who do not have // super-interfaces to baseinterfaces list to traverse them if (!baseinterfaces.contains(cd)) { baseinterfaces.add(cd); } } } }
public class class_name { private void processInterface(ClassDoc cd) { ClassDoc[] intfacs = cd.interfaces(); if (intfacs.length > 0) { for (int i = 0; i < intfacs.length; i++) { if (!add(subinterfaces, intfacs[i], cd)) { return; // depends on control dependency: [if], data = [none] } else { processInterface(intfacs[i]); // Recurse // depends on control dependency: [if], data = [none] } } } else { // we need to add all the interfaces who do not have // super-interfaces to baseinterfaces list to traverse them if (!baseinterfaces.contains(cd)) { baseinterfaces.add(cd); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static ModelNode createAddOperation(PathAddress address, Map<Attribute, ModelNode> parameters) { ModelNode operation = Util.createAddOperation(address); for (Map.Entry<Attribute, ModelNode> entry : parameters.entrySet()) { operation.get(entry.getKey().getName()).set(entry.getValue()); } return operation; } }
public class class_name { public static ModelNode createAddOperation(PathAddress address, Map<Attribute, ModelNode> parameters) { ModelNode operation = Util.createAddOperation(address); for (Map.Entry<Attribute, ModelNode> entry : parameters.entrySet()) { operation.get(entry.getKey().getName()).set(entry.getValue()); // depends on control dependency: [for], data = [entry] } return operation; } }
public class class_name { public void add(StorageDirView dir, long blockId, long blockSizeBytes) { Pair<List<Long>, Long> candidate; if (mDirCandidates.containsKey(dir)) { candidate = mDirCandidates.get(dir); } else { candidate = new Pair<List<Long>, Long>(new ArrayList<Long>(), 0L); mDirCandidates.put(dir, candidate); } candidate.getFirst().add(blockId); long blockBytes = candidate.getSecond() + blockSizeBytes; candidate.setSecond(blockBytes); long sum = blockBytes + dir.getAvailableBytes(); if (mMaxBytes < sum) { mMaxBytes = sum; mDirWithMaxBytes = dir; } } }
public class class_name { public void add(StorageDirView dir, long blockId, long blockSizeBytes) { Pair<List<Long>, Long> candidate; if (mDirCandidates.containsKey(dir)) { candidate = mDirCandidates.get(dir); // depends on control dependency: [if], data = [none] } else { candidate = new Pair<List<Long>, Long>(new ArrayList<Long>(), 0L); // depends on control dependency: [if], data = [none] mDirCandidates.put(dir, candidate); // depends on control dependency: [if], data = [none] } candidate.getFirst().add(blockId); long blockBytes = candidate.getSecond() + blockSizeBytes; candidate.setSecond(blockBytes); long sum = blockBytes + dir.getAvailableBytes(); if (mMaxBytes < sum) { mMaxBytes = sum; // depends on control dependency: [if], data = [none] mDirWithMaxBytes = dir; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setComment(String comment) { if (comment != null) { this.comment = zc.getBytes(comment); if (this.comment.length > 0xffff) throw new IllegalArgumentException("ZIP file comment too long."); } } }
public class class_name { public void setComment(String comment) { if (comment != null) { this.comment = zc.getBytes(comment); // depends on control dependency: [if], data = [(comment] if (this.comment.length > 0xffff) throw new IllegalArgumentException("ZIP file comment too long."); } } }
public class class_name { public GetIntegrationResponsesResult withItems(IntegrationResponse... items) { if (this.items == null) { setItems(new java.util.ArrayList<IntegrationResponse>(items.length)); } for (IntegrationResponse ele : items) { this.items.add(ele); } return this; } }
public class class_name { public GetIntegrationResponsesResult withItems(IntegrationResponse... items) { if (this.items == null) { setItems(new java.util.ArrayList<IntegrationResponse>(items.length)); // depends on control dependency: [if], data = [none] } for (IntegrationResponse ele : items) { this.items.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public <T> void runProcessors(final WordprocessingMLPackage document, final ProxyBuilder<T> proxyBuilder) { final Map<BigInteger, CommentWrapper> comments = CommentUtil.getComments(document); CoordinatesWalker walker = new BaseCoordinatesWalker(document) { @Override protected void onParagraph(ParagraphCoordinates paragraphCoordinates) { runProcessorsOnParagraphComment(document, comments, proxyBuilder, paragraphCoordinates); runProcessorsOnInlineContent(proxyBuilder, paragraphCoordinates); } @Override protected CommentWrapper onRun(RunCoordinates runCoordinates, ParagraphCoordinates paragraphCoordinates) { return runProcessorsOnRunComment(document, comments, proxyBuilder, runCoordinates, paragraphCoordinates); } }; walker.walk(); for (ICommentProcessor processor : commentProcessors) { processor.commitChanges(document); } } }
public class class_name { public <T> void runProcessors(final WordprocessingMLPackage document, final ProxyBuilder<T> proxyBuilder) { final Map<BigInteger, CommentWrapper> comments = CommentUtil.getComments(document); CoordinatesWalker walker = new BaseCoordinatesWalker(document) { @Override protected void onParagraph(ParagraphCoordinates paragraphCoordinates) { runProcessorsOnParagraphComment(document, comments, proxyBuilder, paragraphCoordinates); runProcessorsOnInlineContent(proxyBuilder, paragraphCoordinates); } @Override protected CommentWrapper onRun(RunCoordinates runCoordinates, ParagraphCoordinates paragraphCoordinates) { return runProcessorsOnRunComment(document, comments, proxyBuilder, runCoordinates, paragraphCoordinates); } }; walker.walk(); for (ICommentProcessor processor : commentProcessors) { processor.commitChanges(document); // depends on control dependency: [for], data = [processor] } } }
public class class_name { private static String readStreamAsString(BufferedInputStream is) { try { byte[] data = new byte[4096]; StringBuffer inBuffer = new StringBuffer(); int read; while ((read = is.read(data)) != -1) { String s = new String(data, 0, read); inBuffer.append(s); } return inBuffer.toString(); } catch (IOException e) { throw new IllegalStateException(e); } } }
public class class_name { private static String readStreamAsString(BufferedInputStream is) { try { byte[] data = new byte[4096]; StringBuffer inBuffer = new StringBuffer(); int read; while ((read = is.read(data)) != -1) { String s = new String(data, 0, read); inBuffer.append(s); // depends on control dependency: [while], data = [none] } return inBuffer.toString(); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new IllegalStateException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String xor(String string, int key) { char[] encrypt = string.toCharArray(); for (int i = 0; i < encrypt.length; i++) { encrypt[i] = (char) (encrypt[i] ^ key); } return new String(encrypt); } }
public class class_name { public static String xor(String string, int key) { char[] encrypt = string.toCharArray(); for (int i = 0; i < encrypt.length; i++) { encrypt[i] = (char) (encrypt[i] ^ key); // depends on control dependency: [for], data = [i] } return new String(encrypt); } }
public class class_name { private int getPort() { int port = uri.getPort(); if( port == -1 ) { String scheme = uri.getScheme(); if( "wss".equals( scheme ) ) { return WebSocketImpl.DEFAULT_WSS_PORT; } else if( "ws".equals( scheme ) ) { return WebSocketImpl.DEFAULT_PORT; } else { throw new IllegalArgumentException( "unknown scheme: " + scheme ); } } return port; } }
public class class_name { private int getPort() { int port = uri.getPort(); if( port == -1 ) { String scheme = uri.getScheme(); if( "wss".equals( scheme ) ) { return WebSocketImpl.DEFAULT_WSS_PORT; // depends on control dependency: [if], data = [none] } else if( "ws".equals( scheme ) ) { return WebSocketImpl.DEFAULT_PORT; // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException( "unknown scheme: " + scheme ); } } return port; } }
public class class_name { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws ServletException, IOException { servletRequest.setCharacterEncoding("UTF-8"); httpRequest.set(servletRequest); httpResponse.set(servletResponse); Request appRequest = null; try { // String sessionToken = ServletSupport.getSessionTokenFromCookie(servletRequest); String sessionToken = ServletSupport.getCookieValue(servletRequest, SESSION_TOKEN_KEY); String userId = ServletSupport.getCookieValue(servletRequest, USER_ID_KEY); if("".equals(sessionToken)) { sessionToken = null; } if("".equals(userId)) { userId = null; } if(accessManager != null) { appRequest = accessManager.bindRequest(this); // System.out.println("request bound!! " + appRequest); Session session = appRequest.resolveSession(sessionToken, userId); } if (this.syncUserPrefs && appRequest.getTimesEntered() == 0) { //pass user preferences here ServletSupport.importCookieValues(servletRequest, appRequest.getUserSettings()); ServletSupport.exportCookieValues(servletResponse, appRequest.getUserSettings(), "/", userPrefsMaxAge, Arrays.asList(new String[]{SESSION_TOKEN_KEY})); } //if a user logged in, the user id must be stored if(userId == null) { User user = appRequest.getUser(); if(user != null) { storeSessionDataInCookie(USER_ID_KEY, user.getId(), servletResponse); } } //role based access control // checkAccess(servletRequest, appRequest); //delegate request chain.doFilter(servletRequest, servletResponse); } catch (Throwable t)//make sure user gets a controlled response { //is this the actual entry point or is this entry point wrapped? if ( appRequest != null && appRequest.getTimesEntered() > 1) { //it's wrapped, so the exception must be thrown at the top entry point ServletSupport.rethrow(t); } handleException(servletRequest, servletResponse, t); } finally { /* if(loggingEnabled) { application.log(new PageVisitLogEntry((HttpServletRequest) servletRequest)); } application.releaseRequest(); */ if(accessManager != null) { accessManager.releaseRequest(); } } } }
public class class_name { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws ServletException, IOException { servletRequest.setCharacterEncoding("UTF-8"); httpRequest.set(servletRequest); httpResponse.set(servletResponse); Request appRequest = null; try { // String sessionToken = ServletSupport.getSessionTokenFromCookie(servletRequest); String sessionToken = ServletSupport.getCookieValue(servletRequest, SESSION_TOKEN_KEY); String userId = ServletSupport.getCookieValue(servletRequest, USER_ID_KEY); if("".equals(sessionToken)) { sessionToken = null; // depends on control dependency: [if], data = [none] } if("".equals(userId)) { userId = null; // depends on control dependency: [if], data = [none] } if(accessManager != null) { appRequest = accessManager.bindRequest(this); // depends on control dependency: [if], data = [none] // System.out.println("request bound!! " + appRequest); Session session = appRequest.resolveSession(sessionToken, userId); } if (this.syncUserPrefs && appRequest.getTimesEntered() == 0) { //pass user preferences here ServletSupport.importCookieValues(servletRequest, appRequest.getUserSettings()); // depends on control dependency: [if], data = [none] ServletSupport.exportCookieValues(servletResponse, appRequest.getUserSettings(), "/", userPrefsMaxAge, Arrays.asList(new String[]{SESSION_TOKEN_KEY})); // depends on control dependency: [if], data = [none] } //if a user logged in, the user id must be stored if(userId == null) { User user = appRequest.getUser(); if(user != null) { storeSessionDataInCookie(USER_ID_KEY, user.getId(), servletResponse); // depends on control dependency: [if], data = [none] } } //role based access control // checkAccess(servletRequest, appRequest); //delegate request chain.doFilter(servletRequest, servletResponse); } catch (Throwable t)//make sure user gets a controlled response { //is this the actual entry point or is this entry point wrapped? if ( appRequest != null && appRequest.getTimesEntered() > 1) { //it's wrapped, so the exception must be thrown at the top entry point ServletSupport.rethrow(t); // depends on control dependency: [if], data = [none] } handleException(servletRequest, servletResponse, t); } finally { /* if(loggingEnabled) { application.log(new PageVisitLogEntry((HttpServletRequest) servletRequest)); } application.releaseRequest(); */ if(accessManager != null) { accessManager.releaseRequest(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } // build out target set, check that each node is in the KAM final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { // remove source from target before search to prevent search the same // paths twice in the bidirectional search targetSet.remove(source); pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); } return pathsFound.toArray(new SimplePath[pathsFound.size()]); } }
public class class_name { @Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } // build out target set, check that each node is in the KAM final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); // depends on control dependency: [for], data = [none] } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { // remove source from target before search to prevent search the same // paths twice in the bidirectional search targetSet.remove(source); // depends on control dependency: [for], data = [source] pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); // depends on control dependency: [for], data = [source] } return pathsFound.toArray(new SimplePath[pathsFound.size()]); } }
public class class_name { public Response executeLocal() throws Exception { try { conn = this.generateConn(); if (useSSL) { InputStream cerIn = null; if (!StringUtil.isEmpty(cerBase64)) { cerIn = new ByteArrayInputStream(Base64.getDecoder().decode(cerBase64)); } HttpsURLConnection httpsConn = ((HttpsURLConnection) conn); httpsConn.setSSLSocketFactory(Https.getSslSocketFactory(cerIn, storePass)); httpsConn.setHostnameVerifier(Https.UnSafeHostnameVerifier); } // 请求方式 conn.setRequestMethod(method); // 链接超时时间 conn.setConnectTimeout(5000); //响应超时时间 conn.setReadTimeout(XianConfig.getIntValue("httpclient.read_timeout", 1000 * 10)); conn.setDoOutput(true); conn.setDoInput(true); conn.setUseCaches(false); // 构建请求头 this.generateHeader(); this.generateBody(); conn.connect(); LOG.info(String.format("--请求路径%s,请求方法%s-", url, method)); Response response = new Response(); response.setBody(conn.getInputStream()); response.setStatus(conn.getResponseCode()); response.setHeaders(conn.getHeaderFields()); return response; } finally { if (conn != null) conn.disconnect(); } } }
public class class_name { public Response executeLocal() throws Exception { try { conn = this.generateConn(); if (useSSL) { InputStream cerIn = null; if (!StringUtil.isEmpty(cerBase64)) { cerIn = new ByteArrayInputStream(Base64.getDecoder().decode(cerBase64)); // depends on control dependency: [if], data = [none] } HttpsURLConnection httpsConn = ((HttpsURLConnection) conn); httpsConn.setSSLSocketFactory(Https.getSslSocketFactory(cerIn, storePass)); httpsConn.setHostnameVerifier(Https.UnSafeHostnameVerifier); } // 请求方式 conn.setRequestMethod(method); // 链接超时时间 conn.setConnectTimeout(5000); //响应超时时间 conn.setReadTimeout(XianConfig.getIntValue("httpclient.read_timeout", 1000 * 10)); conn.setDoOutput(true); conn.setDoInput(true); conn.setUseCaches(false); // 构建请求头 this.generateHeader(); this.generateBody(); conn.connect(); LOG.info(String.format("--请求路径%s,请求方法%s-", url, method)); Response response = new Response(); response.setBody(conn.getInputStream()); response.setStatus(conn.getResponseCode()); response.setHeaders(conn.getHeaderFields()); return response; } finally { if (conn != null) conn.disconnect(); } } }
public class class_name { public SolutionStackDescription withPermittedFileTypes(String... permittedFileTypes) { if (this.permittedFileTypes == null) { setPermittedFileTypes(new com.amazonaws.internal.SdkInternalList<String>(permittedFileTypes.length)); } for (String ele : permittedFileTypes) { this.permittedFileTypes.add(ele); } return this; } }
public class class_name { public SolutionStackDescription withPermittedFileTypes(String... permittedFileTypes) { if (this.permittedFileTypes == null) { setPermittedFileTypes(new com.amazonaws.internal.SdkInternalList<String>(permittedFileTypes.length)); // depends on control dependency: [if], data = [none] } for (String ele : permittedFileTypes) { this.permittedFileTypes.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public <T> ObjectInstantiator<T> newInstantiatorOf(Class<T> type) { if (FeatureDetection.hasUnsafe()) { return new UnsafeFactoryInstantiator<T>(type); } return super.newInstantiatorOf(type); } }
public class class_name { public <T> ObjectInstantiator<T> newInstantiatorOf(Class<T> type) { if (FeatureDetection.hasUnsafe()) { return new UnsafeFactoryInstantiator<T>(type); // depends on control dependency: [if], data = [none] } return super.newInstantiatorOf(type); } }
public class class_name { protected ControlRequestFlush createControlRequestFlush() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createControlRequestFlush"); ControlRequestFlush rflushMsg = null; // Create new message try { rflushMsg = _cmf.createNewControlRequestFlush(); } catch (MessageCreateFailedException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlRequestFlush", "1:1717:1.323", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exception(tc, e); SibTr.exit(tc, "createControlRequestFlush", e); } SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler", "1:1729:1.323", e }); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler", "1:1737:1.323", e }, null), e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createControlRequestFlush", rflushMsg); return rflushMsg; } }
public class class_name { protected ControlRequestFlush createControlRequestFlush() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createControlRequestFlush"); ControlRequestFlush rflushMsg = null; // Create new message try { rflushMsg = _cmf.createNewControlRequestFlush(); } catch (MessageCreateFailedException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlRequestFlush", "1:1717:1.323", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exception(tc, e); // depends on control dependency: [if], data = [none] SibTr.exit(tc, "createControlRequestFlush", e); // depends on control dependency: [if], data = [none] } SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler", "1:1729:1.323", e }); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler", "1:1737:1.323", e }, null), e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createControlRequestFlush", rflushMsg); return rflushMsg; } }
public class class_name { public void setDefault(XExpression newDefault) { if (newDefault != default_) { NotificationChain msgs = null; if (default_ != null) msgs = ((InternalEObject)default_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSWITCH_EXPRESSION__DEFAULT, null, msgs); if (newDefault != null) msgs = ((InternalEObject)newDefault).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSWITCH_EXPRESSION__DEFAULT, null, msgs); msgs = basicSetDefault(newDefault, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XSWITCH_EXPRESSION__DEFAULT, newDefault, newDefault)); } }
public class class_name { public void setDefault(XExpression newDefault) { if (newDefault != default_) { NotificationChain msgs = null; if (default_ != null) msgs = ((InternalEObject)default_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSWITCH_EXPRESSION__DEFAULT, null, msgs); if (newDefault != null) msgs = ((InternalEObject)newDefault).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSWITCH_EXPRESSION__DEFAULT, null, msgs); msgs = basicSetDefault(newDefault, msgs); // depends on control dependency: [if], data = [(newDefault] if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XSWITCH_EXPRESSION__DEFAULT, newDefault, newDefault)); } }
public class class_name { public static JsonNode toNode(String value, ObjectMapper mapper) { try { return mapper.readTree(value); } catch (IOException ex) { throw new FacebookException(ex); } } }
public class class_name { public static JsonNode toNode(String value, ObjectMapper mapper) { try { return mapper.readTree(value); // depends on control dependency: [try], data = [none] } catch (IOException ex) { throw new FacebookException(ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setParentResource(CmsResource parentResource) { if (parentResource.isFile()) { m_parentPath = CmsResource.getFolderPath(parentResource.getRootPath()); } else { m_parentPath = parentResource.getRootPath(); } } }
public class class_name { public void setParentResource(CmsResource parentResource) { if (parentResource.isFile()) { m_parentPath = CmsResource.getFolderPath(parentResource.getRootPath()); // depends on control dependency: [if], data = [none] } else { m_parentPath = parentResource.getRootPath(); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected void setZoomVisible(boolean visible) { Style style = m_zoomLabel.getElement().getParentElement().getStyle(); if (visible) { style.clearDisplay(); } else { style.setDisplay(Display.NONE); } } }
public class class_name { protected void setZoomVisible(boolean visible) { Style style = m_zoomLabel.getElement().getParentElement().getStyle(); if (visible) { style.clearDisplay(); // depends on control dependency: [if], data = [none] } else { style.setDisplay(Display.NONE); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void forwardEvent(final EventTransferObject<Object> event) { if (debug) logger.debug("forwardEvent " + event.channel() + " size " + eventConnectors.size()); for (int index = 0; index < eventConnectors.size(); index++) { EventConnector eventConnector = null; try { eventConnector = eventConnectors.get(index); eventConnector.forwardEvent(event); } catch (Exception ex) { logger.error("problem sending event to event connector", ex); if (eventConnector instanceof RemoteTCPClientProxy) { if (!((RemoteTCPClientProxy) eventConnector).connected()) { eventConnectors.remove(eventConnector); } } } } if (debug) logger.debug("forwardEvent done " + event.channel()); } }
public class class_name { @Override public void forwardEvent(final EventTransferObject<Object> event) { if (debug) logger.debug("forwardEvent " + event.channel() + " size " + eventConnectors.size()); for (int index = 0; index < eventConnectors.size(); index++) { EventConnector eventConnector = null; try { eventConnector = eventConnectors.get(index); // depends on control dependency: [try], data = [none] eventConnector.forwardEvent(event); // depends on control dependency: [try], data = [none] } catch (Exception ex) { logger.error("problem sending event to event connector", ex); if (eventConnector instanceof RemoteTCPClientProxy) { if (!((RemoteTCPClientProxy) eventConnector).connected()) { eventConnectors.remove(eventConnector); // depends on control dependency: [if], data = [none] } } } // depends on control dependency: [catch], data = [none] } if (debug) logger.debug("forwardEvent done " + event.channel()); } }
public class class_name { @Override public void merge(Row row, String prefix) { Map<String, Object> otherMap = ((MapRow) row).m_map; for (Map.Entry<String, Object> entry : otherMap.entrySet()) { m_map.put(prefix + entry.getKey(), entry.getValue()); } } }
public class class_name { @Override public void merge(Row row, String prefix) { Map<String, Object> otherMap = ((MapRow) row).m_map; for (Map.Entry<String, Object> entry : otherMap.entrySet()) { m_map.put(prefix + entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [entry] } } }
public class class_name { private static void processSeasons(EpisodeList epList, NodeList nlSeasons) { if (nlSeasons == null || nlSeasons.getLength() == 0) { return; } Node nEpisodeList; for (int loop = 0; loop < nlSeasons.getLength(); loop++) { nEpisodeList = nlSeasons.item(loop); if (nEpisodeList.getNodeType() == Node.ELEMENT_NODE) { processSeasonEpisodes((Element) nEpisodeList, epList); } } } }
public class class_name { private static void processSeasons(EpisodeList epList, NodeList nlSeasons) { if (nlSeasons == null || nlSeasons.getLength() == 0) { return; // depends on control dependency: [if], data = [none] } Node nEpisodeList; for (int loop = 0; loop < nlSeasons.getLength(); loop++) { nEpisodeList = nlSeasons.item(loop); // depends on control dependency: [for], data = [loop] if (nEpisodeList.getNodeType() == Node.ELEMENT_NODE) { processSeasonEpisodes((Element) nEpisodeList, epList); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public List<FutureReadResultEntry> close() { List<FutureReadResultEntry> result; synchronized (this.reads) { if (this.closed) { result = Collections.emptyList(); } else { result = new ArrayList<>(this.reads); this.reads.clear(); this.closed = true; } } return result; } }
public class class_name { public List<FutureReadResultEntry> close() { List<FutureReadResultEntry> result; synchronized (this.reads) { if (this.closed) { result = Collections.emptyList(); // depends on control dependency: [if], data = [none] } else { result = new ArrayList<>(this.reads); // depends on control dependency: [if], data = [none] this.reads.clear(); // depends on control dependency: [if], data = [none] this.closed = true; // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { private String dumpJavaColonCompEnvMap() { StringBuffer buffer = new StringBuffer(""); buffer.append("EJBContext.lookup data structure contents:\n"); buffer.append(" Contains **" + ivJavaColonCompEnvMap.size() + "** bindings.\n"); if (!ivJavaColonCompEnvMap.isEmpty()) { Set<Map.Entry<String, InjectionBinding<?>>> entries = ivJavaColonCompEnvMap.entrySet(); Iterator<Map.Entry<String, InjectionBinding<?>>> entryIterator = entries.iterator(); int count = 0; while (entryIterator.hasNext()) { Map.Entry<String, InjectionBinding<?>> oneEntry = entryIterator.next(); buffer.append(" Entry " + count + "\n"); buffer.append(" Key: **" + oneEntry.getKey() + "**\n"); buffer.append(" Value: **" + oneEntry.getValue() + "**\n"); buffer.append("\n"); count++; } } return buffer.toString(); } }
public class class_name { private String dumpJavaColonCompEnvMap() { StringBuffer buffer = new StringBuffer(""); buffer.append("EJBContext.lookup data structure contents:\n"); buffer.append(" Contains **" + ivJavaColonCompEnvMap.size() + "** bindings.\n"); if (!ivJavaColonCompEnvMap.isEmpty()) { Set<Map.Entry<String, InjectionBinding<?>>> entries = ivJavaColonCompEnvMap.entrySet(); Iterator<Map.Entry<String, InjectionBinding<?>>> entryIterator = entries.iterator(); int count = 0; while (entryIterator.hasNext()) { Map.Entry<String, InjectionBinding<?>> oneEntry = entryIterator.next(); buffer.append(" Entry " + count + "\n"); buffer.append(" Key: **" + oneEntry.getKey() + "**\n"); // depends on control dependency: [while], data = [none] buffer.append(" Value: **" + oneEntry.getValue() + "**\n"); // depends on control dependency: [while], data = [none] buffer.append("\n"); // depends on control dependency: [while], data = [none] count++; // depends on control dependency: [while], data = [none] } } return buffer.toString(); } }
public class class_name { private void sendStatusAndClose(final Channel chan, final HttpResponseStatus status) { if (chan.isConnected()) { final DefaultHttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status); final ChannelFuture future = chan.write(response); future.addListener(ChannelFutureListener.CLOSE); } } }
public class class_name { private void sendStatusAndClose(final Channel chan, final HttpResponseStatus status) { if (chan.isConnected()) { final DefaultHttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status); final ChannelFuture future = chan.write(response); future.addListener(ChannelFutureListener.CLOSE); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Class[] getArgTypes() { List<Class> types = new ArrayList<>(); if (args != null) { for (MethodArg arg : args.getArgs()) { try { types.add(Class.forName(arg.getType())); } catch (ClassNotFoundException e) { throw new CitrusRuntimeException("Failed to access method argument type", e); } } } return types.toArray(new Class[types.size()]); } }
public class class_name { public Class[] getArgTypes() { List<Class> types = new ArrayList<>(); if (args != null) { for (MethodArg arg : args.getArgs()) { try { types.add(Class.forName(arg.getType())); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { throw new CitrusRuntimeException("Failed to access method argument type", e); } // depends on control dependency: [catch], data = [none] } } return types.toArray(new Class[types.size()]); } }
public class class_name { public java.util.List<EventTopic> getEventTopics() { if (eventTopics == null) { eventTopics = new com.amazonaws.internal.SdkInternalList<EventTopic>(); } return eventTopics; } }
public class class_name { public java.util.List<EventTopic> getEventTopics() { if (eventTopics == null) { eventTopics = new com.amazonaws.internal.SdkInternalList<EventTopic>(); // depends on control dependency: [if], data = [none] } return eventTopics; } }
public class class_name { public OutlierResult run(Database database, Relation<O> relation) { final DBIDs ids = relation.getDBIDs(); DistanceQuery<O> distFunc = database.getDistanceQuery(relation, getDistanceFunction()); // Get k nearest neighbor and range query on the relation. KNNQuery<O> knnq = database.getKNNQuery(distFunc, k, DatabaseQuery.HINT_HEAVY_USE); RangeQuery<O> rnnQuery = database.getRangeQuery(distFunc, DatabaseQuery.HINT_HEAVY_USE); StepProgress stepProg = LOG.isVerbose() ? new StepProgress("DWOF", 2) : null; // DWOF output score storage. WritableDoubleDataStore dwofs = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB | DataStoreFactory.HINT_HOT, 0.); if(stepProg != null) { stepProg.beginStep(1, "Initializing objects' Radii", LOG); } WritableDoubleDataStore radii = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_TEMP | DataStoreFactory.HINT_HOT, 0.); // Find an initial radius for each object: initializeRadii(ids, knnq, distFunc, radii); WritableIntegerDataStore oldSizes = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT, 1); WritableIntegerDataStore newSizes = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT, 1); int countUnmerged = relation.size(); if(stepProg != null) { stepProg.beginStep(2, "Clustering-Evaluating Cycles.", LOG); } IndefiniteProgress clusEvalProgress = LOG.isVerbose() ? new IndefiniteProgress("Evaluating DWOFs", LOG) : null; while(countUnmerged > 0) { LOG.incrementProcessed(clusEvalProgress); // Increase radii for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { radii.putDouble(iter, radii.doubleValue(iter) * delta); } // stores the clustering label for each object WritableDataStore<ModifiableDBIDs> labels = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_TEMP, ModifiableDBIDs.class); // Cluster objects based on the current radius clusterData(ids, rnnQuery, radii, labels); // simple reference swap WritableIntegerDataStore temp = newSizes; newSizes = oldSizes; oldSizes = temp; // Update the cluster size count for each object. countUnmerged = updateSizes(ids, labels, newSizes); labels.destroy(); // Update DWOF scores. for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { double newScore = (newSizes.intValue(iter) > 0) ? ((double) (oldSizes.intValue(iter) - 1) / (double) newSizes.intValue(iter)) : 0.0; dwofs.putDouble(iter, dwofs.doubleValue(iter) + newScore); } } LOG.setCompleted(clusEvalProgress); LOG.setCompleted(stepProg); // Build result representation. DoubleMinMax minmax = new DoubleMinMax(); for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { minmax.put(dwofs.doubleValue(iter)); } OutlierScoreMeta meta = new InvertedOutlierScoreMeta(minmax.getMin(), minmax.getMax(), 0.0, Double.POSITIVE_INFINITY); DoubleRelation rel = new MaterializedDoubleRelation("Dynamic-Window Outlier Factors", "dwof-outlier", dwofs, ids); return new OutlierResult(meta, rel); } }
public class class_name { public OutlierResult run(Database database, Relation<O> relation) { final DBIDs ids = relation.getDBIDs(); DistanceQuery<O> distFunc = database.getDistanceQuery(relation, getDistanceFunction()); // Get k nearest neighbor and range query on the relation. KNNQuery<O> knnq = database.getKNNQuery(distFunc, k, DatabaseQuery.HINT_HEAVY_USE); RangeQuery<O> rnnQuery = database.getRangeQuery(distFunc, DatabaseQuery.HINT_HEAVY_USE); StepProgress stepProg = LOG.isVerbose() ? new StepProgress("DWOF", 2) : null; // DWOF output score storage. WritableDoubleDataStore dwofs = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB | DataStoreFactory.HINT_HOT, 0.); if(stepProg != null) { stepProg.beginStep(1, "Initializing objects' Radii", LOG); // depends on control dependency: [if], data = [none] } WritableDoubleDataStore radii = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_TEMP | DataStoreFactory.HINT_HOT, 0.); // Find an initial radius for each object: initializeRadii(ids, knnq, distFunc, radii); WritableIntegerDataStore oldSizes = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT, 1); WritableIntegerDataStore newSizes = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT, 1); int countUnmerged = relation.size(); if(stepProg != null) { stepProg.beginStep(2, "Clustering-Evaluating Cycles.", LOG); // depends on control dependency: [if], data = [none] } IndefiniteProgress clusEvalProgress = LOG.isVerbose() ? new IndefiniteProgress("Evaluating DWOFs", LOG) : null; while(countUnmerged > 0) { LOG.incrementProcessed(clusEvalProgress); // depends on control dependency: [while], data = [none] // Increase radii for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { radii.putDouble(iter, radii.doubleValue(iter) * delta); // depends on control dependency: [for], data = [iter] } // stores the clustering label for each object WritableDataStore<ModifiableDBIDs> labels = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_TEMP, ModifiableDBIDs.class); // Cluster objects based on the current radius clusterData(ids, rnnQuery, radii, labels); // depends on control dependency: [while], data = [none] // simple reference swap WritableIntegerDataStore temp = newSizes; newSizes = oldSizes; // depends on control dependency: [while], data = [none] oldSizes = temp; // depends on control dependency: [while], data = [none] // Update the cluster size count for each object. countUnmerged = updateSizes(ids, labels, newSizes); // depends on control dependency: [while], data = [none] labels.destroy(); // depends on control dependency: [while], data = [none] // Update DWOF scores. for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { double newScore = (newSizes.intValue(iter) > 0) ? ((double) (oldSizes.intValue(iter) - 1) / (double) newSizes.intValue(iter)) : 0.0; dwofs.putDouble(iter, dwofs.doubleValue(iter) + newScore); // depends on control dependency: [for], data = [iter] } } LOG.setCompleted(clusEvalProgress); LOG.setCompleted(stepProg); // Build result representation. DoubleMinMax minmax = new DoubleMinMax(); for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { minmax.put(dwofs.doubleValue(iter)); // depends on control dependency: [for], data = [iter] } OutlierScoreMeta meta = new InvertedOutlierScoreMeta(minmax.getMin(), minmax.getMax(), 0.0, Double.POSITIVE_INFINITY); DoubleRelation rel = new MaterializedDoubleRelation("Dynamic-Window Outlier Factors", "dwof-outlier", dwofs, ids); return new OutlierResult(meta, rel); } }
public class class_name { @Override public void send(final Object message) throws MessageTransportException { if (shutdown.get()) throw new MessageTransportException("send called on shutdown queue."); if (blocking) { while (true) { try { queue.put(message); if (statsCollector != null) statsCollector.messageSent(message); break; } catch (final InterruptedException ie) { if (shutdown.get()) throw new MessageTransportException("Shutting down durring send."); } } } else { if (!queue.offer(message)) { if (statsCollector != null) statsCollector.messageNotSent(); throw new MessageTransportException("Failed to queue message due to capacity."); } else if (statsCollector != null) statsCollector.messageSent(message); } } }
public class class_name { @Override public void send(final Object message) throws MessageTransportException { if (shutdown.get()) throw new MessageTransportException("send called on shutdown queue."); if (blocking) { while (true) { try { queue.put(message); // depends on control dependency: [try], data = [none] if (statsCollector != null) statsCollector.messageSent(message); break; } catch (final InterruptedException ie) { if (shutdown.get()) throw new MessageTransportException("Shutting down durring send."); } // depends on control dependency: [catch], data = [none] } } else { if (!queue.offer(message)) { if (statsCollector != null) statsCollector.messageNotSent(); throw new MessageTransportException("Failed to queue message due to capacity."); } else if (statsCollector != null) statsCollector.messageSent(message); } } }
public class class_name { public void initialize(Context context, Locale locale, TimePickerController timePickerController, Timepoint initialTime, boolean is24HourMode) { if (mTimeInitialized) { Log.e(TAG, "Time has already been initialized."); return; } mController = timePickerController; mIs24HourMode = mAccessibilityManager.isTouchExplorationEnabled() || is24HourMode; // Initialize the circle and AM/PM circles if applicable. mCircleView.initialize(context, mController); mCircleView.invalidate(); if (!mIs24HourMode && mController.getVersion() == TimePickerDialog.Version.VERSION_1) { mAmPmCirclesView.initialize(context, locale, mController, initialTime.isAM() ? AM : PM); mAmPmCirclesView.invalidate(); } // Create the selection validators RadialTextsView.SelectionValidator secondValidator = selection -> { Timepoint newTime = new Timepoint(mCurrentTime.getHour(), mCurrentTime.getMinute(), selection); return !mController.isOutOfRange(newTime, SECOND_INDEX); }; RadialTextsView.SelectionValidator minuteValidator = selection -> { Timepoint newTime = new Timepoint(mCurrentTime.getHour(), selection, mCurrentTime.getSecond()); return !mController.isOutOfRange(newTime, MINUTE_INDEX); }; RadialTextsView.SelectionValidator hourValidator = selection -> { Timepoint newTime = new Timepoint(selection, mCurrentTime.getMinute(), mCurrentTime.getSecond()); if(!mIs24HourMode && getIsCurrentlyAmOrPm() == PM) newTime.setPM(); if(!mIs24HourMode && getIsCurrentlyAmOrPm() == AM) newTime.setAM(); return !mController.isOutOfRange(newTime, HOUR_INDEX); }; // Initialize the hours and minutes numbers. int[] hours = {12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; int[] hours_24 = {0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}; int[] minutes = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55}; int[] seconds = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55}; String[] hoursTexts = new String[12]; String[] innerHoursTexts = new String[12]; String[] minutesTexts = new String[12]; String[] secondsTexts = new String[12]; for (int i = 0; i < 12; i++) { hoursTexts[i] = is24HourMode? String.format(locale, "%02d", hours_24[i]) : String.format(locale, "%d", hours[i]); innerHoursTexts[i] = String.format(locale, "%d", hours[i]); minutesTexts[i] = String.format(locale, "%02d", minutes[i]); secondsTexts[i] = String.format(locale, "%02d", seconds[i]); } // The version 2 layout has the hours > 12 on the inner circle rather than the outer circle // Inner circle and outer circle should be swapped (see #411) if (mController.getVersion() == TimePickerDialog.Version.VERSION_2) { String[] temp = hoursTexts; hoursTexts = innerHoursTexts; innerHoursTexts = temp; } mHourRadialTextsView.initialize(context, hoursTexts, (is24HourMode ? innerHoursTexts : null), mController, hourValidator, true); mHourRadialTextsView.setSelection(is24HourMode ? initialTime.getHour() : hours[initialTime.getHour() % 12]); mHourRadialTextsView.invalidate(); mMinuteRadialTextsView.initialize(context, minutesTexts, null, mController, minuteValidator, false); mMinuteRadialTextsView.setSelection(initialTime.getMinute()); mMinuteRadialTextsView.invalidate(); mSecondRadialTextsView.initialize(context, secondsTexts, null, mController, secondValidator, false); mSecondRadialTextsView.setSelection(initialTime.getSecond()); mSecondRadialTextsView.invalidate(); // Initialize the currently-selected hour and minute. mCurrentTime = initialTime; int hourDegrees = (initialTime.getHour() % 12) * HOUR_VALUE_TO_DEGREES_STEP_SIZE; mHourRadialSelectorView.initialize(context, mController, is24HourMode, true, hourDegrees, isHourInnerCircle(initialTime.getHour())); int minuteDegrees = initialTime.getMinute() * MINUTE_VALUE_TO_DEGREES_STEP_SIZE; mMinuteRadialSelectorView.initialize(context, mController, false, false, minuteDegrees, false); int secondDegrees = initialTime.getSecond() * SECOND_VALUE_TO_DEGREES_STEP_SIZE; mSecondRadialSelectorView.initialize(context, mController, false, false, secondDegrees, false); mTimeInitialized = true; } }
public class class_name { public void initialize(Context context, Locale locale, TimePickerController timePickerController, Timepoint initialTime, boolean is24HourMode) { if (mTimeInitialized) { Log.e(TAG, "Time has already been initialized."); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } mController = timePickerController; mIs24HourMode = mAccessibilityManager.isTouchExplorationEnabled() || is24HourMode; // Initialize the circle and AM/PM circles if applicable. mCircleView.initialize(context, mController); mCircleView.invalidate(); if (!mIs24HourMode && mController.getVersion() == TimePickerDialog.Version.VERSION_1) { mAmPmCirclesView.initialize(context, locale, mController, initialTime.isAM() ? AM : PM); // depends on control dependency: [if], data = [none] mAmPmCirclesView.invalidate(); // depends on control dependency: [if], data = [none] } // Create the selection validators RadialTextsView.SelectionValidator secondValidator = selection -> { Timepoint newTime = new Timepoint(mCurrentTime.getHour(), mCurrentTime.getMinute(), selection); return !mController.isOutOfRange(newTime, SECOND_INDEX); }; RadialTextsView.SelectionValidator minuteValidator = selection -> { Timepoint newTime = new Timepoint(mCurrentTime.getHour(), selection, mCurrentTime.getSecond()); return !mController.isOutOfRange(newTime, MINUTE_INDEX); }; RadialTextsView.SelectionValidator hourValidator = selection -> { Timepoint newTime = new Timepoint(selection, mCurrentTime.getMinute(), mCurrentTime.getSecond()); if(!mIs24HourMode && getIsCurrentlyAmOrPm() == PM) newTime.setPM(); if(!mIs24HourMode && getIsCurrentlyAmOrPm() == AM) newTime.setAM(); return !mController.isOutOfRange(newTime, HOUR_INDEX); }; // Initialize the hours and minutes numbers. int[] hours = {12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; int[] hours_24 = {0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}; int[] minutes = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55}; int[] seconds = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55}; String[] hoursTexts = new String[12]; String[] innerHoursTexts = new String[12]; String[] minutesTexts = new String[12]; String[] secondsTexts = new String[12]; for (int i = 0; i < 12; i++) { hoursTexts[i] = is24HourMode? String.format(locale, "%02d", hours_24[i]) : String.format(locale, "%d", hours[i]); innerHoursTexts[i] = String.format(locale, "%d", hours[i]); minutesTexts[i] = String.format(locale, "%02d", minutes[i]); secondsTexts[i] = String.format(locale, "%02d", seconds[i]); } // The version 2 layout has the hours > 12 on the inner circle rather than the outer circle // Inner circle and outer circle should be swapped (see #411) if (mController.getVersion() == TimePickerDialog.Version.VERSION_2) { String[] temp = hoursTexts; hoursTexts = innerHoursTexts; innerHoursTexts = temp; } mHourRadialTextsView.initialize(context, hoursTexts, (is24HourMode ? innerHoursTexts : null), mController, hourValidator, true); mHourRadialTextsView.setSelection(is24HourMode ? initialTime.getHour() : hours[initialTime.getHour() % 12]); mHourRadialTextsView.invalidate(); mMinuteRadialTextsView.initialize(context, minutesTexts, null, mController, minuteValidator, false); mMinuteRadialTextsView.setSelection(initialTime.getMinute()); mMinuteRadialTextsView.invalidate(); mSecondRadialTextsView.initialize(context, secondsTexts, null, mController, secondValidator, false); mSecondRadialTextsView.setSelection(initialTime.getSecond()); mSecondRadialTextsView.invalidate(); // Initialize the currently-selected hour and minute. mCurrentTime = initialTime; int hourDegrees = (initialTime.getHour() % 12) * HOUR_VALUE_TO_DEGREES_STEP_SIZE; mHourRadialSelectorView.initialize(context, mController, is24HourMode, true, hourDegrees, isHourInnerCircle(initialTime.getHour())); int minuteDegrees = initialTime.getMinute() * MINUTE_VALUE_TO_DEGREES_STEP_SIZE; mMinuteRadialSelectorView.initialize(context, mController, false, false, minuteDegrees, false); int secondDegrees = initialTime.getSecond() * SECOND_VALUE_TO_DEGREES_STEP_SIZE; mSecondRadialSelectorView.initialize(context, mController, false, false, secondDegrees, false); mTimeInitialized = true; } }
public class class_name { void writeCsv(ResourceInst resourceInst,List<String> headers,List<String> values) { File file = null; if(this.statsFile == null) file = csvFile; else file = Paths.get(this.outputDirectory.toFile().getAbsolutePath(), this.statsFile.getName()+"."+resourceInst.getType().getName()+".csv").toFile(); CsvWriter csvWriter = new CsvWriter(file); try { csvWriter.writeHeader(headers); csvWriter.appendRow(values); } catch (IOException e) { throw new RuntimeException(e); } } }
public class class_name { void writeCsv(ResourceInst resourceInst,List<String> headers,List<String> values) { File file = null; if(this.statsFile == null) file = csvFile; else file = Paths.get(this.outputDirectory.toFile().getAbsolutePath(), this.statsFile.getName()+"."+resourceInst.getType().getName()+".csv").toFile(); CsvWriter csvWriter = new CsvWriter(file); try { csvWriter.writeHeader(headers); // depends on control dependency: [try], data = [none] csvWriter.appendRow(values); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Trivial public static void erasePassword(@Sensitive byte[] pwdBytes) { if (pwdBytes != null) { for (int i = 0; i < pwdBytes.length; i++) { pwdBytes[i] = 0x00; } } } }
public class class_name { @Trivial public static void erasePassword(@Sensitive byte[] pwdBytes) { if (pwdBytes != null) { for (int i = 0; i < pwdBytes.length; i++) { pwdBytes[i] = 0x00; // depends on control dependency: [for], data = [i] } } } }
public class class_name { private boolean fetchRegistry() { boolean success; Stopwatch tracer = fetchRegistryTimer.start(); try { // If the delta is disabled or if it is the first time, get all applications if (serverConfig.shouldDisableDeltaForRemoteRegions() || (getApplications() == null) || (getApplications().getRegisteredApplications().size() == 0)) { logger.info("Disable delta property : {}", serverConfig.shouldDisableDeltaForRemoteRegions()); logger.info("Application is null : {}", getApplications() == null); logger.info("Registered Applications size is zero : {}", getApplications().getRegisteredApplications().isEmpty()); success = storeFullRegistry(); } else { success = fetchAndStoreDelta(); } logTotalInstances(); } catch (Throwable e) { logger.error("Unable to fetch registry information from the remote registry {}", this.remoteRegionURL, e); return false; } finally { if (tracer != null) { tracer.stop(); } } return success; } }
public class class_name { private boolean fetchRegistry() { boolean success; Stopwatch tracer = fetchRegistryTimer.start(); try { // If the delta is disabled or if it is the first time, get all applications if (serverConfig.shouldDisableDeltaForRemoteRegions() || (getApplications() == null) || (getApplications().getRegisteredApplications().size() == 0)) { logger.info("Disable delta property : {}", serverConfig.shouldDisableDeltaForRemoteRegions()); // depends on control dependency: [if], data = [none] logger.info("Application is null : {}", getApplications() == null); // depends on control dependency: [if], data = [none] logger.info("Registered Applications size is zero : {}", getApplications().getRegisteredApplications().isEmpty()); // depends on control dependency: [if], data = [none] success = storeFullRegistry(); // depends on control dependency: [if], data = [none] } else { success = fetchAndStoreDelta(); // depends on control dependency: [if], data = [none] } logTotalInstances(); // depends on control dependency: [try], data = [none] } catch (Throwable e) { logger.error("Unable to fetch registry information from the remote registry {}", this.remoteRegionURL, e); return false; } finally { // depends on control dependency: [catch], data = [none] if (tracer != null) { tracer.stop(); // depends on control dependency: [if], data = [none] } } return success; } }
public class class_name { public EClass getIfcText() { if (ifcTextEClass == null) { ifcTextEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers() .get(744); } return ifcTextEClass; } }
public class class_name { public EClass getIfcText() { if (ifcTextEClass == null) { ifcTextEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers() .get(744); // depends on control dependency: [if], data = [none] } return ifcTextEClass; } }
public class class_name { public java.util.List<Region> getRegions() { if (regions == null) { regions = new com.amazonaws.internal.SdkInternalList<Region>(); } return regions; } }
public class class_name { public java.util.List<Region> getRegions() { if (regions == null) { regions = new com.amazonaws.internal.SdkInternalList<Region>(); // depends on control dependency: [if], data = [none] } return regions; } }
public class class_name { @Override public void deselectByValue(String value) { if (!isMultiple()) { throw new UnsupportedOperationException( "You may only deselect options of a multi-select"); } for (WebElement option : findOptionsByValue(value)) { setSelected(option, false); } } }
public class class_name { @Override public void deselectByValue(String value) { if (!isMultiple()) { throw new UnsupportedOperationException( "You may only deselect options of a multi-select"); } for (WebElement option : findOptionsByValue(value)) { setSelected(option, false); // depends on control dependency: [for], data = [option] } } }
public class class_name { public void setFeedback(SetFeedbackRequest request) { checkNotNull(request, "object request should not be null."); if (request.getEmail() != null && request.getEmail().trim().length() > 0) { checkIsEmail(request.getEmail()); } if (request.getType() == null) { request.setType(1); } if (!Arrays.asList(new Integer[] { 1, 2, 3 }).contains(request.getType())) { throw new IllegalArgumentException("illegal type."); } InternalRequest internalRequest = this.createRequest("feedback", request, HttpMethodName.PUT); // fill in the request payload internalRequest = fillRequestPayload(internalRequest, JsonUtils.toJsonString(request)); this.invokeHttpClient(internalRequest, SesResponse.class); } }
public class class_name { public void setFeedback(SetFeedbackRequest request) { checkNotNull(request, "object request should not be null."); if (request.getEmail() != null && request.getEmail().trim().length() > 0) { checkIsEmail(request.getEmail()); // depends on control dependency: [if], data = [(request.getEmail()] } if (request.getType() == null) { request.setType(1); // depends on control dependency: [if], data = [none] } if (!Arrays.asList(new Integer[] { 1, 2, 3 }).contains(request.getType())) { throw new IllegalArgumentException("illegal type."); } InternalRequest internalRequest = this.createRequest("feedback", request, HttpMethodName.PUT); // fill in the request payload internalRequest = fillRequestPayload(internalRequest, JsonUtils.toJsonString(request)); this.invokeHttpClient(internalRequest, SesResponse.class); } }
public class class_name { public BoxTask.Info addTask(BoxTask.Action action, String message, Date dueAt) { JsonObject itemJSON = new JsonObject(); itemJSON.add("type", "file"); itemJSON.add("id", this.getID()); JsonObject requestJSON = new JsonObject(); requestJSON.add("item", itemJSON); requestJSON.add("action", action.toJSONString()); if (message != null && !message.isEmpty()) { requestJSON.add("message", message); } if (dueAt != null) { requestJSON.add("due_at", BoxDateFormat.format(dueAt)); } URL url = ADD_TASK_URL_TEMPLATE.build(this.getAPI().getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); request.setBody(requestJSON.toString()); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject responseJSON = JsonObject.readFrom(response.getJSON()); BoxTask addedTask = new BoxTask(this.getAPI(), responseJSON.get("id").asString()); return addedTask.new Info(responseJSON); } }
public class class_name { public BoxTask.Info addTask(BoxTask.Action action, String message, Date dueAt) { JsonObject itemJSON = new JsonObject(); itemJSON.add("type", "file"); itemJSON.add("id", this.getID()); JsonObject requestJSON = new JsonObject(); requestJSON.add("item", itemJSON); requestJSON.add("action", action.toJSONString()); if (message != null && !message.isEmpty()) { requestJSON.add("message", message); // depends on control dependency: [if], data = [none] } if (dueAt != null) { requestJSON.add("due_at", BoxDateFormat.format(dueAt)); // depends on control dependency: [if], data = [(dueAt] } URL url = ADD_TASK_URL_TEMPLATE.build(this.getAPI().getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); request.setBody(requestJSON.toString()); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject responseJSON = JsonObject.readFrom(response.getJSON()); BoxTask addedTask = new BoxTask(this.getAPI(), responseJSON.get("id").asString()); return addedTask.new Info(responseJSON); } }
public class class_name { public ConversationReceiveListener dataReceived(WsByteBuffer data, int segmentType, int requestNumber, int priority, boolean allocatedFromBufferPool, boolean partOfExchange, // f181007 Conversation conversation) { if (tc.isEntryEnabled()) SibTr.entry(tc, "dataReceived"); ConversationReceiveListener listener = null; // F193735.3 int connectionType = -1; ServerLinkLevelState lls = null; if (tc.isDebugEnabled()) { String LF = System.getProperty("line.separator"); String debugInfo = LF + LF + "-------------------------------------------------------" + LF; debugInfo += " Segment type : " + JFapChannelConstants.getSegmentName(segmentType) + " - " + segmentType + " (0x" + Integer.toHexString(segmentType) + ")" + LF; debugInfo += " Request number: " + requestNumber + LF; debugInfo += " Priority : " + priority + LF; debugInfo += " Exchange? : " + partOfExchange + LF; debugInfo += " From pool? : " + allocatedFromBufferPool + LF; debugInfo += " Conversation : " + conversation + LF; debugInfo += "-------------------------------------------------------" + LF; SibTr.debug(this, tc, debugInfo); SibTr.debug(this, tc, conversation.getFullSummary()); } // If no listener has yet been associated with this conversation, determine // the appropriate one to use based on the first byte of the handshake data. // SEG_HANDSHAKE is expected at this point. if (segmentType == JFapChannelConstants.SEG_HANDSHAKE) { data.flip(); //Now get connection mode connectionType = data.get(); // d175811 //Store away the connection type for fututre conversations switch (connectionType) { // Client handshake case CommsConstants.HANDSHAKE_CLIENT: listener = serverTransportAcceptListener.acceptConnection(conversation); lls = (ServerLinkLevelState) conversation.getLinkLevelAttachment(); lls.setConnectionType(CommsConstants.HANDSHAKE_CLIENT); break; // Unknown handshake type default: // begin F174602 String nlsText = nls.getFormattedMessage("INVALID_PROP_SICO8008", new Object[] { "" + connectionType }, // d192293 null); SIConnectionLostException commsException = new SIConnectionLostException(nlsText); StaticCATHelper.sendExceptionToClient(commsException, null, // d186970 conversation, requestNumber); break; // end F174602 } } else { //We've previously noted the initiating connection type from an earlier //conversation on this connections so we can retrieve it from the //Link level state lls = (ServerLinkLevelState) conversation.getLinkLevelAttachment(); connectionType = lls.getConnectionType(); switch (connectionType) { // Client handshake case CommsConstants.HANDSHAKE_CLIENT: if (tc.isDebugEnabled()) SibTr.debug(tc, "Conversation was initiated by a Client. Filtering accordingly"); listener = serverTransportAcceptListener.acceptConnection(conversation); break; // Unknown handshake type default: //F174776 if (tc.isDebugEnabled()) SibTr.debug(tc, "Conversation was initiated by an unknown entity ", "" + connectionType); break; // end F174602 } } if (tc.isEntryEnabled()) SibTr.exit(tc, "dataReceived", listener); // F193735.3 // F174776 Return the chosen subordinate listener to handle all data from // now on, on this conversation return listener; } }
public class class_name { public ConversationReceiveListener dataReceived(WsByteBuffer data, int segmentType, int requestNumber, int priority, boolean allocatedFromBufferPool, boolean partOfExchange, // f181007 Conversation conversation) { if (tc.isEntryEnabled()) SibTr.entry(tc, "dataReceived"); ConversationReceiveListener listener = null; // F193735.3 int connectionType = -1; ServerLinkLevelState lls = null; if (tc.isDebugEnabled()) { String LF = System.getProperty("line.separator"); String debugInfo = LF + LF + "-------------------------------------------------------" + LF; debugInfo += " Segment type : " + JFapChannelConstants.getSegmentName(segmentType) + // depends on control dependency: [if], data = [none] " - " + segmentType + " (0x" + Integer.toHexString(segmentType) + ")" + LF; debugInfo += " Request number: " + requestNumber + LF; // depends on control dependency: [if], data = [none] debugInfo += " Priority : " + priority + LF; // depends on control dependency: [if], data = [none] debugInfo += " Exchange? : " + partOfExchange + LF; // depends on control dependency: [if], data = [none] debugInfo += " From pool? : " + allocatedFromBufferPool + LF; // depends on control dependency: [if], data = [none] debugInfo += " Conversation : " + conversation + LF; // depends on control dependency: [if], data = [none] debugInfo += "-------------------------------------------------------" + LF; // depends on control dependency: [if], data = [none] SibTr.debug(this, tc, debugInfo); // depends on control dependency: [if], data = [none] SibTr.debug(this, tc, conversation.getFullSummary()); // depends on control dependency: [if], data = [none] } // If no listener has yet been associated with this conversation, determine // the appropriate one to use based on the first byte of the handshake data. // SEG_HANDSHAKE is expected at this point. if (segmentType == JFapChannelConstants.SEG_HANDSHAKE) { data.flip(); // depends on control dependency: [if], data = [none] //Now get connection mode connectionType = data.get(); // d175811 // depends on control dependency: [if], data = [none] //Store away the connection type for fututre conversations switch (connectionType) { // Client handshake case CommsConstants.HANDSHAKE_CLIENT: listener = serverTransportAcceptListener.acceptConnection(conversation); lls = (ServerLinkLevelState) conversation.getLinkLevelAttachment(); lls.setConnectionType(CommsConstants.HANDSHAKE_CLIENT); break; // Unknown handshake type default: // begin F174602 String nlsText = nls.getFormattedMessage("INVALID_PROP_SICO8008", new Object[] { "" + connectionType }, // d192293 null); SIConnectionLostException commsException = new SIConnectionLostException(nlsText); StaticCATHelper.sendExceptionToClient(commsException, null, // d186970 conversation, requestNumber); break; // end F174602 } } else { //We've previously noted the initiating connection type from an earlier //conversation on this connections so we can retrieve it from the //Link level state lls = (ServerLinkLevelState) conversation.getLinkLevelAttachment(); // depends on control dependency: [if], data = [none] connectionType = lls.getConnectionType(); // depends on control dependency: [if], data = [none] switch (connectionType) { // Client handshake case CommsConstants.HANDSHAKE_CLIENT: if (tc.isDebugEnabled()) SibTr.debug(tc, "Conversation was initiated by a Client. Filtering accordingly"); listener = serverTransportAcceptListener.acceptConnection(conversation); break; // Unknown handshake type default: //F174776 if (tc.isDebugEnabled()) SibTr.debug(tc, "Conversation was initiated by an unknown entity ", "" + connectionType); break; // end F174602 } } if (tc.isEntryEnabled()) SibTr.exit(tc, "dataReceived", listener); // F193735.3 // F174776 Return the chosen subordinate listener to handle all data from // now on, on this conversation return listener; } }
public class class_name { public double[] getStandardComponents(double[] x){ if(x.length != originalN){ throw new IllegalArgumentException("wrong array dimension: " + x.length); } double[] ret = new double[standardN]; for(int i=0; i<x.length; i++){ if (splittedVariablesList.contains(i)) { // this variable was splitted: x = xPlus-xMinus if(x[i] >= 0){ //value for xPlus ret[standardS + i] = x[i]; }else{ int pos = -1; for(int k=0; k<splittedVariablesList.size(); k++){ if(splittedVariablesList.get(k)==i){ pos = k; break; } } //value for xMinus ret[standardS + x.length + pos] = -x[i]; } }else{ ret[standardS + i] = x[i]; } } if(standardS>0){ DoubleMatrix1D residuals = ColtUtils.zMult(standardA, F1.make(ret), standardB, -1); for(int i=0; i<standardS; i++){ ret[i] = -residuals.get(i) + ret[i]; } } return ret; } }
public class class_name { public double[] getStandardComponents(double[] x){ if(x.length != originalN){ throw new IllegalArgumentException("wrong array dimension: " + x.length); } double[] ret = new double[standardN]; for(int i=0; i<x.length; i++){ if (splittedVariablesList.contains(i)) { // this variable was splitted: x = xPlus-xMinus if(x[i] >= 0){ //value for xPlus ret[standardS + i] = x[i]; // depends on control dependency: [if], data = [none] }else{ int pos = -1; for(int k=0; k<splittedVariablesList.size(); k++){ if(splittedVariablesList.get(k)==i){ pos = k; // depends on control dependency: [if], data = [none] break; } } //value for xMinus ret[standardS + x.length + pos] = -x[i]; // depends on control dependency: [if], data = [none] } }else{ ret[standardS + i] = x[i]; // depends on control dependency: [if], data = [none] } } if(standardS>0){ DoubleMatrix1D residuals = ColtUtils.zMult(standardA, F1.make(ret), standardB, -1); for(int i=0; i<standardS; i++){ ret[i] = -residuals.get(i) + ret[i]; // depends on control dependency: [for], data = [i] } } return ret; } }
public class class_name { public static int[] getMatchNos(String[] strings, String[] s) { int[] nos = new int[s.length]; for (int i = 0, j = 0; i < strings.length; i++) { for (int k = 0; k < s.length; k++) { if (s[k].equals(strings[i])) { nos[j] = i; j++; } } } return nos; } }
public class class_name { public static int[] getMatchNos(String[] strings, String[] s) { int[] nos = new int[s.length]; for (int i = 0, j = 0; i < strings.length; i++) { for (int k = 0; k < s.length; k++) { if (s[k].equals(strings[i])) { nos[j] = i; // depends on control dependency: [if], data = [none] j++; // depends on control dependency: [if], data = [none] } } } return nos; } }
public class class_name { @Override public double calculatePhaseTimeGradient(AbstractPhaseScope phaseScope) { double timeGradient = 0.0; for (Termination termination : terminationList) { double nextTimeGradient = termination.calculatePhaseTimeGradient(phaseScope); if (nextTimeGradient >= 0.0) { timeGradient = Math.max(timeGradient, nextTimeGradient); } } return timeGradient; } }
public class class_name { @Override public double calculatePhaseTimeGradient(AbstractPhaseScope phaseScope) { double timeGradient = 0.0; for (Termination termination : terminationList) { double nextTimeGradient = termination.calculatePhaseTimeGradient(phaseScope); if (nextTimeGradient >= 0.0) { timeGradient = Math.max(timeGradient, nextTimeGradient); // depends on control dependency: [if], data = [none] } } return timeGradient; } }
public class class_name { public String autoDetectPackageName(final File file) { try { final Set<String> packageNames = new HashSet<>(); try (JarFile jarFile = new JarFile(file)) { final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); String name = entry.getName(); if (name.endsWith(".class")) { logger.debug("Considering package of entry '{}'", name); final int lastIndexOfSlash = name.lastIndexOf('/'); if (lastIndexOfSlash != -1) { name = name.substring(0, lastIndexOfSlash); packageNames.add(name); } } } } if (packageNames.isEmpty()) { return null; } logger.info("Found {} packages in extension jar: {}", packageNames.size(), packageNames); // find the longest common prefix of all the package names String packageName = StringUtils.getLongestCommonToken(packageNames, '/'); if (packageName == "") { logger.debug("No common package prefix"); return null; } packageName = packageName.replace('/', '.'); return packageName; } catch (final Exception e) { logger.warn("Error occurred while auto detecting package name", e); return null; } } }
public class class_name { public String autoDetectPackageName(final File file) { try { final Set<String> packageNames = new HashSet<>(); try (JarFile jarFile = new JarFile(file)) { final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); String name = entry.getName(); if (name.endsWith(".class")) { logger.debug("Considering package of entry '{}'", name); // depends on control dependency: [if], data = [none] final int lastIndexOfSlash = name.lastIndexOf('/'); if (lastIndexOfSlash != -1) { name = name.substring(0, lastIndexOfSlash); // depends on control dependency: [if], data = [none] packageNames.add(name); // depends on control dependency: [if], data = [none] } } } } if (packageNames.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } logger.info("Found {} packages in extension jar: {}", packageNames.size(), packageNames); // find the longest common prefix of all the package names String packageName = StringUtils.getLongestCommonToken(packageNames, '/'); if (packageName == "") { logger.debug("No common package prefix"); // depends on control dependency: [if], data = [none] return null; // depends on control dependency: [if], data = [none] } packageName = packageName.replace('/', '.'); return packageName; } catch (final Exception e) { logger.warn("Error occurred while auto detecting package name", e); return null; } } }
public class class_name { @FFDCIgnore(value = { InterruptedException.class }) public Client checkoutClient() { Client client = null; try { // need to poll here as the dequeue can be permanently emptied by close method at any time while (client == null && numClientsClosed.get() == 0) { client = clients.poll(200, TimeUnit.MILLISECONDS); } } catch (InterruptedException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) Tr.event(tc, "InterruptedException during checkout"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { int clientHash = (client != null) ? client.hashCode() : 0; Tr.event(tc, "post-checkout - (" + clientHash + ") " + (numClients - clients.remainingCapacity()) + " of " + numClients + " clients available."); } return client; } }
public class class_name { @FFDCIgnore(value = { InterruptedException.class }) public Client checkoutClient() { Client client = null; try { // need to poll here as the dequeue can be permanently emptied by close method at any time while (client == null && numClientsClosed.get() == 0) { client = clients.poll(200, TimeUnit.MILLISECONDS); // depends on control dependency: [while], data = [none] } } catch (InterruptedException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) Tr.event(tc, "InterruptedException during checkout"); } // depends on control dependency: [catch], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { int clientHash = (client != null) ? client.hashCode() : 0; Tr.event(tc, "post-checkout - (" + clientHash + ") " + (numClients - clients.remainingCapacity()) + " of " + numClients + " clients available."); } return client; // depends on control dependency: [if], data = [none] } }
public class class_name { @Override public boolean isTemporary() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "isTemporary"); SibTr.exit(tc, "isTemporary", Boolean.valueOf(_isTemporary)); } return _isTemporary; } }
public class class_name { @Override public boolean isTemporary() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "isTemporary"); // depends on control dependency: [if], data = [none] SibTr.exit(tc, "isTemporary", Boolean.valueOf(_isTemporary)); // depends on control dependency: [if], data = [none] } return _isTemporary; } }
public class class_name { public List<Item> getDisplayedItems() { final List<Item> result = new ArrayList<>(); if (mInternalItemDisplayedList == null) { return result; } for (int i = 0 ; i < mInternalItemDisplayedList.length ; i ++) { if (mInternalItemDisplayedList[i]) { result.add(getItem(i)); } } return result; } }
public class class_name { public List<Item> getDisplayedItems() { final List<Item> result = new ArrayList<>(); if (mInternalItemDisplayedList == null) { return result; // depends on control dependency: [if], data = [none] } for (int i = 0 ; i < mInternalItemDisplayedList.length ; i ++) { if (mInternalItemDisplayedList[i]) { result.add(getItem(i)); // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public ValidationResult validate(String pid) { if (pid == null) { throw new NullPointerException("pid may not be null."); } ObjectInfo object = null; try { object = objectSource.getValidationObject(pid); } catch (ObjectSourceException e) { // This falls into the case of object==null. } if (object == null) { ValidationResult result = new ValidationResult(new BasicObjectInfo(pid)); result.addNote(ValidationResultNotation.objectNotFound(pid)); return result; } else { return validate(object); } } }
public class class_name { public ValidationResult validate(String pid) { if (pid == null) { throw new NullPointerException("pid may not be null."); } ObjectInfo object = null; try { object = objectSource.getValidationObject(pid); // depends on control dependency: [try], data = [none] } catch (ObjectSourceException e) { // This falls into the case of object==null. } // depends on control dependency: [catch], data = [none] if (object == null) { ValidationResult result = new ValidationResult(new BasicObjectInfo(pid)); result.addNote(ValidationResultNotation.objectNotFound(pid)); // depends on control dependency: [if], data = [none] return result; // depends on control dependency: [if], data = [none] } else { return validate(object); // depends on control dependency: [if], data = [(object] } } }