code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; // 13.4.7 } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; // 13.4.9 #1 } else { final int compatibleChanges = Opcodes.ACC_FINAL | // 13.4.9 #2 Opcodes.ACC_TRANSIENT; // 13.4.11 #1 final int accessPermissions = Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE; final int oldAccess2 = oldAccess & ~compatibleChanges & ~accessPermissions; final int newAccess2 = newAccess & ~compatibleChanges & ~accessPermissions; return oldAccess2 != newAccess2; } } }
public class class_name { public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; // 13.4.7 // depends on control dependency: [if], data = [none] } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; // 13.4.9 #1 // depends on control dependency: [if], data = [none] } else { final int compatibleChanges = Opcodes.ACC_FINAL | // 13.4.9 #2 Opcodes.ACC_TRANSIENT; // 13.4.11 #1 final int accessPermissions = Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE; final int oldAccess2 = oldAccess & ~compatibleChanges & ~accessPermissions; final int newAccess2 = newAccess & ~compatibleChanges & ~accessPermissions; return oldAccess2 != newAccess2; // depends on control dependency: [if], data = [none] } } }
public class class_name { public ListBackupSelectionsResult withBackupSelectionsList(BackupSelectionsListMember... backupSelectionsList) { if (this.backupSelectionsList == null) { setBackupSelectionsList(new java.util.ArrayList<BackupSelectionsListMember>(backupSelectionsList.length)); } for (BackupSelectionsListMember ele : backupSelectionsList) { this.backupSelectionsList.add(ele); } return this; } }
public class class_name { public ListBackupSelectionsResult withBackupSelectionsList(BackupSelectionsListMember... backupSelectionsList) { if (this.backupSelectionsList == null) { setBackupSelectionsList(new java.util.ArrayList<BackupSelectionsListMember>(backupSelectionsList.length)); // depends on control dependency: [if], data = [none] } for (BackupSelectionsListMember ele : backupSelectionsList) { this.backupSelectionsList.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static Object value(final Field f, final Object bean) { try { f.setAccessible(true); return f.get(bean); } catch (IllegalArgumentException | IllegalAccessException e) { throw new UroborosqlRuntimeException(e); } } }
public class class_name { public static Object value(final Field f, final Object bean) { try { f.setAccessible(true); // depends on control dependency: [try], data = [none] return f.get(bean); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException | IllegalAccessException e) { throw new UroborosqlRuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String canonicalizePath(String path, boolean discardRelativePrefix) { // the first character of the current path segment int segmentStart = 0; // the number of segments seen thus far that can be erased by sequences of '..'. int deletableSegments = 0; for (int i = 0; i <= path.length(); ) { int nextSegmentStart; if (i == path.length()) { nextSegmentStart = i; } else if (path.charAt(i) == '/') { nextSegmentStart = i + 1; } else { i++; continue; } /* * We've encountered either the end of a segment or the end of the * complete path. If the final segment was "." or "..", remove the * appropriate segments of the path. */ if (i == segmentStart + 1 && path.regionMatches(segmentStart, ".", 0, 1)) { // Given "abc/def/./ghi", remove "./" to get "abc/def/ghi". path = path.substring(0, segmentStart) + path.substring(nextSegmentStart); i = segmentStart; } else if (i == segmentStart + 2 && path.regionMatches(segmentStart, "..", 0, 2)) { if (deletableSegments > 0 || discardRelativePrefix) { // Given "abc/def/../ghi", remove "def/../" to get "abc/ghi". deletableSegments--; int prevSegmentStart = path.lastIndexOf('/', segmentStart - 2) + 1; path = path.substring(0, prevSegmentStart) + path.substring(nextSegmentStart); i = segmentStart = prevSegmentStart; } else { // There's no segment to delete; this ".." segment must be retained. i++; segmentStart = i; } } else { if (i > 0) { deletableSegments++; } i++; segmentStart = i; } } return path; } }
public class class_name { public static String canonicalizePath(String path, boolean discardRelativePrefix) { // the first character of the current path segment int segmentStart = 0; // the number of segments seen thus far that can be erased by sequences of '..'. int deletableSegments = 0; for (int i = 0; i <= path.length(); ) { int nextSegmentStart; if (i == path.length()) { nextSegmentStart = i; // depends on control dependency: [if], data = [none] } else if (path.charAt(i) == '/') { nextSegmentStart = i + 1; // depends on control dependency: [if], data = [none] } else { i++; // depends on control dependency: [if], data = [none] continue; } /* * We've encountered either the end of a segment or the end of the * complete path. If the final segment was "." or "..", remove the * appropriate segments of the path. */ if (i == segmentStart + 1 && path.regionMatches(segmentStart, ".", 0, 1)) { // Given "abc/def/./ghi", remove "./" to get "abc/def/ghi". path = path.substring(0, segmentStart) + path.substring(nextSegmentStart); // depends on control dependency: [if], data = [none] i = segmentStart; // depends on control dependency: [if], data = [none] } else if (i == segmentStart + 2 && path.regionMatches(segmentStart, "..", 0, 2)) { if (deletableSegments > 0 || discardRelativePrefix) { // Given "abc/def/../ghi", remove "def/../" to get "abc/ghi". deletableSegments--; // depends on control dependency: [if], data = [none] int prevSegmentStart = path.lastIndexOf('/', segmentStart - 2) + 1; path = path.substring(0, prevSegmentStart) + path.substring(nextSegmentStart); // depends on control dependency: [if], data = [none] i = segmentStart = prevSegmentStart; // depends on control dependency: [if], data = [none] } else { // There's no segment to delete; this ".." segment must be retained. i++; // depends on control dependency: [if], data = [none] segmentStart = i; // depends on control dependency: [if], data = [none] } } else { if (i > 0) { deletableSegments++; // depends on control dependency: [if], data = [none] } i++; // depends on control dependency: [if], data = [none] segmentStart = i; // depends on control dependency: [if], data = [none] } } return path; } }
public class class_name { public static Object getFieldValue(Object object, String fieldName) { try { return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } }
public class class_name { public static Object getFieldValue(Object object, String fieldName) { try { return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Nullable static SymbolOptions fromFeature(@NonNull Feature feature) { if (feature.geometry() == null) { throw new RuntimeException("geometry field is required"); } if (!(feature.geometry() instanceof Point)) { return null; } SymbolOptions options = new SymbolOptions(); options.geometry = (Point) feature.geometry(); if (feature.hasProperty(PROPERTY_ICON_SIZE)) { options.iconSize = feature.getProperty(PROPERTY_ICON_SIZE).getAsFloat(); } if (feature.hasProperty(PROPERTY_ICON_IMAGE)) { options.iconImage = feature.getProperty(PROPERTY_ICON_IMAGE).getAsString(); } if (feature.hasProperty(PROPERTY_ICON_ROTATE)) { options.iconRotate = feature.getProperty(PROPERTY_ICON_ROTATE).getAsFloat(); } if (feature.hasProperty(PROPERTY_ICON_OFFSET)) { options.iconOffset = toFloatArray(feature.getProperty(PROPERTY_ICON_OFFSET).getAsJsonArray()); } if (feature.hasProperty(PROPERTY_ICON_ANCHOR)) { options.iconAnchor = feature.getProperty(PROPERTY_ICON_ANCHOR).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_FIELD)) { options.textField = feature.getProperty(PROPERTY_TEXT_FIELD).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_FONT)) { options.textFont = toStringArray(feature.getProperty(PROPERTY_TEXT_FONT).getAsJsonArray()); } if (feature.hasProperty(PROPERTY_TEXT_SIZE)) { options.textSize = feature.getProperty(PROPERTY_TEXT_SIZE).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_MAX_WIDTH)) { options.textMaxWidth = feature.getProperty(PROPERTY_TEXT_MAX_WIDTH).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_LETTER_SPACING)) { options.textLetterSpacing = feature.getProperty(PROPERTY_TEXT_LETTER_SPACING).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_JUSTIFY)) { options.textJustify = feature.getProperty(PROPERTY_TEXT_JUSTIFY).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_ANCHOR)) { options.textAnchor = feature.getProperty(PROPERTY_TEXT_ANCHOR).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_ROTATE)) { options.textRotate = feature.getProperty(PROPERTY_TEXT_ROTATE).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_TRANSFORM)) { options.textTransform = feature.getProperty(PROPERTY_TEXT_TRANSFORM).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_OFFSET)) { options.textOffset = toFloatArray(feature.getProperty(PROPERTY_TEXT_OFFSET).getAsJsonArray()); } if (feature.hasProperty(PROPERTY_ICON_OPACITY)) { options.iconOpacity = feature.getProperty(PROPERTY_ICON_OPACITY).getAsFloat(); } if (feature.hasProperty(PROPERTY_ICON_COLOR)) { options.iconColor = feature.getProperty(PROPERTY_ICON_COLOR).getAsString(); } if (feature.hasProperty(PROPERTY_ICON_HALO_COLOR)) { options.iconHaloColor = feature.getProperty(PROPERTY_ICON_HALO_COLOR).getAsString(); } if (feature.hasProperty(PROPERTY_ICON_HALO_WIDTH)) { options.iconHaloWidth = feature.getProperty(PROPERTY_ICON_HALO_WIDTH).getAsFloat(); } if (feature.hasProperty(PROPERTY_ICON_HALO_BLUR)) { options.iconHaloBlur = feature.getProperty(PROPERTY_ICON_HALO_BLUR).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_OPACITY)) { options.textOpacity = feature.getProperty(PROPERTY_TEXT_OPACITY).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_COLOR)) { options.textColor = feature.getProperty(PROPERTY_TEXT_COLOR).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_HALO_COLOR)) { options.textHaloColor = feature.getProperty(PROPERTY_TEXT_HALO_COLOR).getAsString(); } if (feature.hasProperty(PROPERTY_TEXT_HALO_WIDTH)) { options.textHaloWidth = feature.getProperty(PROPERTY_TEXT_HALO_WIDTH).getAsFloat(); } if (feature.hasProperty(PROPERTY_TEXT_HALO_BLUR)) { options.textHaloBlur = feature.getProperty(PROPERTY_TEXT_HALO_BLUR).getAsFloat(); } if (feature.hasProperty(PROPERTY_Z_INDEX)) { options.zIndex = feature.getProperty(PROPERTY_Z_INDEX).getAsInt(); } if (feature.hasProperty(PROPERTY_IS_DRAGGABLE)) { options.isDraggable = feature.getProperty(PROPERTY_IS_DRAGGABLE).getAsBoolean(); } return options; } }
public class class_name { @Nullable static SymbolOptions fromFeature(@NonNull Feature feature) { if (feature.geometry() == null) { throw new RuntimeException("geometry field is required"); } if (!(feature.geometry() instanceof Point)) { return null; // depends on control dependency: [if], data = [none] } SymbolOptions options = new SymbolOptions(); options.geometry = (Point) feature.geometry(); if (feature.hasProperty(PROPERTY_ICON_SIZE)) { options.iconSize = feature.getProperty(PROPERTY_ICON_SIZE).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_IMAGE)) { options.iconImage = feature.getProperty(PROPERTY_ICON_IMAGE).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_ROTATE)) { options.iconRotate = feature.getProperty(PROPERTY_ICON_ROTATE).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_OFFSET)) { options.iconOffset = toFloatArray(feature.getProperty(PROPERTY_ICON_OFFSET).getAsJsonArray()); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_ANCHOR)) { options.iconAnchor = feature.getProperty(PROPERTY_ICON_ANCHOR).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_FIELD)) { options.textField = feature.getProperty(PROPERTY_TEXT_FIELD).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_FONT)) { options.textFont = toStringArray(feature.getProperty(PROPERTY_TEXT_FONT).getAsJsonArray()); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_SIZE)) { options.textSize = feature.getProperty(PROPERTY_TEXT_SIZE).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_MAX_WIDTH)) { options.textMaxWidth = feature.getProperty(PROPERTY_TEXT_MAX_WIDTH).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_LETTER_SPACING)) { options.textLetterSpacing = feature.getProperty(PROPERTY_TEXT_LETTER_SPACING).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_JUSTIFY)) { options.textJustify = feature.getProperty(PROPERTY_TEXT_JUSTIFY).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_ANCHOR)) { options.textAnchor = feature.getProperty(PROPERTY_TEXT_ANCHOR).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_ROTATE)) { options.textRotate = feature.getProperty(PROPERTY_TEXT_ROTATE).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_TRANSFORM)) { options.textTransform = feature.getProperty(PROPERTY_TEXT_TRANSFORM).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_OFFSET)) { options.textOffset = toFloatArray(feature.getProperty(PROPERTY_TEXT_OFFSET).getAsJsonArray()); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_OPACITY)) { options.iconOpacity = feature.getProperty(PROPERTY_ICON_OPACITY).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_COLOR)) { options.iconColor = feature.getProperty(PROPERTY_ICON_COLOR).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_HALO_COLOR)) { options.iconHaloColor = feature.getProperty(PROPERTY_ICON_HALO_COLOR).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_HALO_WIDTH)) { options.iconHaloWidth = feature.getProperty(PROPERTY_ICON_HALO_WIDTH).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_ICON_HALO_BLUR)) { options.iconHaloBlur = feature.getProperty(PROPERTY_ICON_HALO_BLUR).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_OPACITY)) { options.textOpacity = feature.getProperty(PROPERTY_TEXT_OPACITY).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_COLOR)) { options.textColor = feature.getProperty(PROPERTY_TEXT_COLOR).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_HALO_COLOR)) { options.textHaloColor = feature.getProperty(PROPERTY_TEXT_HALO_COLOR).getAsString(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_HALO_WIDTH)) { options.textHaloWidth = feature.getProperty(PROPERTY_TEXT_HALO_WIDTH).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_TEXT_HALO_BLUR)) { options.textHaloBlur = feature.getProperty(PROPERTY_TEXT_HALO_BLUR).getAsFloat(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_Z_INDEX)) { options.zIndex = feature.getProperty(PROPERTY_Z_INDEX).getAsInt(); // depends on control dependency: [if], data = [none] } if (feature.hasProperty(PROPERTY_IS_DRAGGABLE)) { options.isDraggable = feature.getProperty(PROPERTY_IS_DRAGGABLE).getAsBoolean(); // depends on control dependency: [if], data = [none] } return options; } }
public class class_name { public Text nextLine() { if (linePointer == 0) { linePointer = pos; } else { linePointer++; } int mark = linePointer; int limit = pos + len; while (linePointer < limit && chars[linePointer] != '\n') { linePointer++; } return new Text(chars, mark, linePointer - mark); } }
public class class_name { public Text nextLine() { if (linePointer == 0) { linePointer = pos; // depends on control dependency: [if], data = [none] } else { linePointer++; // depends on control dependency: [if], data = [none] } int mark = linePointer; int limit = pos + len; while (linePointer < limit && chars[linePointer] != '\n') { linePointer++; // depends on control dependency: [while], data = [none] } return new Text(chars, mark, linePointer - mark); } }
public class class_name { @Override public void setLines(int lines) { super.setLines(lines); if (mHelper != null) { mHelper.setMaxLines(lines); } } }
public class class_name { @Override public void setLines(int lines) { super.setLines(lines); if (mHelper != null) { mHelper.setMaxLines(lines); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected String paramsAsUrlString() { StringBuilder bob = new StringBuilder(); bob.append('?'); MultiList<String> params = params(); for (String key : params.keySet()) { for (String value : params.list(key)) { bob.append(key); bob.append('='); bob.append(value); bob.append('&'); } } bob.deleteCharAt(bob.length()-1); //removes the last '&' return bob.toString(); } }
public class class_name { protected String paramsAsUrlString() { StringBuilder bob = new StringBuilder(); bob.append('?'); MultiList<String> params = params(); for (String key : params.keySet()) { for (String value : params.list(key)) { bob.append(key); // depends on control dependency: [for], data = [none] bob.append('='); // depends on control dependency: [for], data = [none] bob.append(value); // depends on control dependency: [for], data = [value] bob.append('&'); // depends on control dependency: [for], data = [none] } } bob.deleteCharAt(bob.length()-1); //removes the last '&' return bob.toString(); } }
public class class_name { public Set<String> getVocab() { Set<String> vocab = new HashSet<String>(); for (Sentence sent : this) { for (String label : sent) { vocab.add(label); } } return vocab; } }
public class class_name { public Set<String> getVocab() { Set<String> vocab = new HashSet<String>(); for (Sentence sent : this) { for (String label : sent) { vocab.add(label); // depends on control dependency: [for], data = [label] } } return vocab; } }
public class class_name { @CanIgnoreReturnValue // TODO(kak): Consider removing this? public static <T> T getOnlyElement(Iterator<T> iterator) { T first = iterator.next(); if (!iterator.hasNext()) { return first; } StringBuilder sb = new StringBuilder().append("expected one element but was: <").append(first); for (int i = 0; i < 4 && iterator.hasNext(); i++) { sb.append(", ").append(iterator.next()); } if (iterator.hasNext()) { sb.append(", ..."); } sb.append('>'); throw new IllegalArgumentException(sb.toString()); } }
public class class_name { @CanIgnoreReturnValue // TODO(kak): Consider removing this? public static <T> T getOnlyElement(Iterator<T> iterator) { T first = iterator.next(); if (!iterator.hasNext()) { return first; // depends on control dependency: [if], data = [none] } StringBuilder sb = new StringBuilder().append("expected one element but was: <").append(first); for (int i = 0; i < 4 && iterator.hasNext(); i++) { sb.append(", ").append(iterator.next()); // depends on control dependency: [for], data = [none] } if (iterator.hasNext()) { sb.append(", ..."); // depends on control dependency: [if], data = [none] } sb.append('>'); throw new IllegalArgumentException(sb.toString()); } }
public class class_name { private static int lookupId(final HBaseClient client, final byte[] table, final short idwidth, final long lid, final String kind) { final byte[] id = idInBytes(idwidth, lid); if (id == null) { return 1; } else if (kind != null) { return extactLookupId(client, table, idwidth, kind, id); } return findAndPrintRow(client, table, id, CliUtils.NAME_FAMILY, false); } }
public class class_name { private static int lookupId(final HBaseClient client, final byte[] table, final short idwidth, final long lid, final String kind) { final byte[] id = idInBytes(idwidth, lid); if (id == null) { return 1; // depends on control dependency: [if], data = [none] } else if (kind != null) { return extactLookupId(client, table, idwidth, kind, id); // depends on control dependency: [if], data = [none] } return findAndPrintRow(client, table, id, CliUtils.NAME_FAMILY, false); } }
public class class_name { public URL getParent() { if (isField()) { return getCharacteristicURL(); } else if (isCharacteristic()) { return getServiceURL(); } else if (isService()) { return getDeviceURL(); } else if (isDevice()) { return getAdapterURL(); } else if (isAdapter()) { return getProtocolURL(); } else { return null; } } }
public class class_name { public URL getParent() { if (isField()) { return getCharacteristicURL(); // depends on control dependency: [if], data = [none] } else if (isCharacteristic()) { return getServiceURL(); // depends on control dependency: [if], data = [none] } else if (isService()) { return getDeviceURL(); // depends on control dependency: [if], data = [none] } else if (isDevice()) { return getAdapterURL(); // depends on control dependency: [if], data = [none] } else if (isAdapter()) { return getProtocolURL(); // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public String serialize() { StringBuilder sb = new StringBuilder(); boolean first = true; for (String key : options.keySet()) { if (first) { first = false; } else { sb.append(';'); } sb.append(key).append('=').append(options.get(key)); } return sb.toString(); } }
public class class_name { public String serialize() { StringBuilder sb = new StringBuilder(); boolean first = true; for (String key : options.keySet()) { if (first) { first = false; // depends on control dependency: [if], data = [none] } else { sb.append(';'); // depends on control dependency: [if], data = [none] } sb.append(key).append('=').append(options.get(key)); // depends on control dependency: [for], data = [key] } return sb.toString(); } }
public class class_name { private String buildErrorChapter(final BuildData buildData) { log.info("\tBuilding Error Chapter"); String errorItemizedLists = ""; if (buildData.getErrorDatabase().hasItems(buildData.getBuildLocale())) { for (final TopicErrorData topicErrorData : buildData.getErrorDatabase().getErrors(buildData.getBuildLocale())) { // Check if the app should be shutdown if (isShuttingDown.get()) { return null; } final BaseTopicWrapper<?> topic = topicErrorData.getTopic(); final List<String> topicErrorItems = new ArrayList<String>(); final String tags = EntityUtilities.getCommaSeparatedTagList(topic); final String url = topic.getPressGangURL(); topicErrorItems.add(DocBookUtilities.buildListItem("INFO: " + StringEscapeUtils.escapeXml(topic.getTitle()))); if (tags != null && !tags.isEmpty()) { topicErrorItems.add(DocBookUtilities.buildListItem("INFO: " + StringEscapeUtils.escapeXml(tags))); } if (buildData.getDocBookVersion() == DocBookVersion.DOCBOOK_50) { topicErrorItems.add(DocBookUtilities.buildListItem("INFO: <link xlink:href=\"" + url + "\">Topic URL</link>")); } else { topicErrorItems.add(DocBookUtilities.buildListItem("INFO: <ulink url=\"" + url + "\">Topic URL</ulink>")); } for (final String error : topicErrorData.getItemsOfType(ErrorLevel.ERROR)) { topicErrorItems.add(DocBookUtilities.buildListItem("ERROR: " + error)); } for (final String warning : topicErrorData.getItemsOfType(ErrorLevel.WARNING)) { topicErrorItems.add(DocBookUtilities.buildListItem("WARNING: " + warning)); } /* * this should never be false, because a topic will only be listed in the errors collection once a error or * warning has been added. The count of 2 comes from the standard list items we added above for the title and * url. */ if (topicErrorItems.size() > 2) { final String title; if (topic instanceof TranslatedTopicWrapper) { title = "Topic ID " + topic.getTopicId() + ", Revision " + topic.getTopicRevision(); } else { title = "Topic ID " + topic.getTopicId(); } final String id = topic.getErrorXRefId(); errorItemizedLists += DocBookUtilities.wrapListItems(buildData.getDocBookVersion(), topicErrorItems, title, id); } } // Create the glossary final String errorGlossary = buildErrorChapterGlossary(buildData, "Compiler Glossary"); if (errorGlossary != null) { errorItemizedLists += errorGlossary; } } else { errorItemizedLists = "<para>No Errors Found</para>"; } if (buildData.getContentSpec().getBookType() == BookType.ARTICLE || buildData.getContentSpec().getBookType() == BookType .ARTICLE_DRAFT) { return DocBookBuildUtilities.addDocBookPreamble(buildData.getDocBookVersion(), DocBookUtilities.buildSection(errorItemizedLists, "Compiler Output"), "section", buildData.getEntityFileName()); } else { return DocBookBuildUtilities.addDocBookPreamble(buildData.getDocBookVersion(), DocBookUtilities.buildChapter(errorItemizedLists, "Compiler Output"), "chapter", buildData.getEntityFileName()); } } }
public class class_name { private String buildErrorChapter(final BuildData buildData) { log.info("\tBuilding Error Chapter"); String errorItemizedLists = ""; if (buildData.getErrorDatabase().hasItems(buildData.getBuildLocale())) { for (final TopicErrorData topicErrorData : buildData.getErrorDatabase().getErrors(buildData.getBuildLocale())) { // Check if the app should be shutdown if (isShuttingDown.get()) { return null; // depends on control dependency: [if], data = [none] } final BaseTopicWrapper<?> topic = topicErrorData.getTopic(); final List<String> topicErrorItems = new ArrayList<String>(); final String tags = EntityUtilities.getCommaSeparatedTagList(topic); final String url = topic.getPressGangURL(); topicErrorItems.add(DocBookUtilities.buildListItem("INFO: " + StringEscapeUtils.escapeXml(topic.getTitle()))); // depends on control dependency: [for], data = [none] if (tags != null && !tags.isEmpty()) { topicErrorItems.add(DocBookUtilities.buildListItem("INFO: " + StringEscapeUtils.escapeXml(tags))); // depends on control dependency: [if], data = [(tags] } if (buildData.getDocBookVersion() == DocBookVersion.DOCBOOK_50) { topicErrorItems.add(DocBookUtilities.buildListItem("INFO: <link xlink:href=\"" + url + "\">Topic URL</link>")); // depends on control dependency: [if], data = [none] } else { topicErrorItems.add(DocBookUtilities.buildListItem("INFO: <ulink url=\"" + url + "\">Topic URL</ulink>")); // depends on control dependency: [if], data = [none] } for (final String error : topicErrorData.getItemsOfType(ErrorLevel.ERROR)) { topicErrorItems.add(DocBookUtilities.buildListItem("ERROR: " + error)); // depends on control dependency: [for], data = [error] } for (final String warning : topicErrorData.getItemsOfType(ErrorLevel.WARNING)) { topicErrorItems.add(DocBookUtilities.buildListItem("WARNING: " + warning)); // depends on control dependency: [for], data = [warning] } /* * this should never be false, because a topic will only be listed in the errors collection once a error or * warning has been added. The count of 2 comes from the standard list items we added above for the title and * url. */ if (topicErrorItems.size() > 2) { final String title; if (topic instanceof TranslatedTopicWrapper) { title = "Topic ID " + topic.getTopicId() + ", Revision " + topic.getTopicRevision(); // depends on control dependency: [if], data = [none] } else { title = "Topic ID " + topic.getTopicId(); // depends on control dependency: [if], data = [none] } final String id = topic.getErrorXRefId(); errorItemizedLists += DocBookUtilities.wrapListItems(buildData.getDocBookVersion(), topicErrorItems, title, id); // depends on control dependency: [if], data = [none] } } // Create the glossary final String errorGlossary = buildErrorChapterGlossary(buildData, "Compiler Glossary"); if (errorGlossary != null) { errorItemizedLists += errorGlossary; // depends on control dependency: [if], data = [none] } } else { errorItemizedLists = "<para>No Errors Found</para>"; // depends on control dependency: [if], data = [none] } if (buildData.getContentSpec().getBookType() == BookType.ARTICLE || buildData.getContentSpec().getBookType() == BookType .ARTICLE_DRAFT) { return DocBookBuildUtilities.addDocBookPreamble(buildData.getDocBookVersion(), DocBookUtilities.buildSection(errorItemizedLists, "Compiler Output"), "section", buildData.getEntityFileName()); // depends on control dependency: [if], data = [none] } else { return DocBookBuildUtilities.addDocBookPreamble(buildData.getDocBookVersion(), DocBookUtilities.buildChapter(errorItemizedLists, "Compiler Output"), "chapter", buildData.getEntityFileName()); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected void appendCriteria(TableAlias alias, PathInfo pathInfo, SelectionCriteria c, StringBuffer buf) { if (c instanceof FieldCriteria) { appendFieldCriteria(alias, pathInfo, (FieldCriteria) c, buf); } else if (c instanceof NullCriteria) { appendNullCriteria(alias, pathInfo, (NullCriteria) c, buf); } else if (c instanceof BetweenCriteria) { appendBetweenCriteria(alias, pathInfo, (BetweenCriteria) c, buf); } else if (c instanceof InCriteria) { appendInCriteria(alias, pathInfo, (InCriteria) c, buf); } else if (c instanceof SqlCriteria) { appendSQLCriteria((SqlCriteria) c, buf); } else if (c instanceof ExistsCriteria) { appendExistsCriteria((ExistsCriteria) c, buf); } else if (c instanceof LikeCriteria) { appendLikeCriteria(alias, pathInfo, (LikeCriteria) c, buf); } else { appendSelectionCriteria(alias, pathInfo, c, buf); } } }
public class class_name { protected void appendCriteria(TableAlias alias, PathInfo pathInfo, SelectionCriteria c, StringBuffer buf) { if (c instanceof FieldCriteria) { appendFieldCriteria(alias, pathInfo, (FieldCriteria) c, buf); // depends on control dependency: [if], data = [none] } else if (c instanceof NullCriteria) { appendNullCriteria(alias, pathInfo, (NullCriteria) c, buf); // depends on control dependency: [if], data = [none] } else if (c instanceof BetweenCriteria) { appendBetweenCriteria(alias, pathInfo, (BetweenCriteria) c, buf); // depends on control dependency: [if], data = [none] } else if (c instanceof InCriteria) { appendInCriteria(alias, pathInfo, (InCriteria) c, buf); // depends on control dependency: [if], data = [none] } else if (c instanceof SqlCriteria) { appendSQLCriteria((SqlCriteria) c, buf); // depends on control dependency: [if], data = [none] } else if (c instanceof ExistsCriteria) { appendExistsCriteria((ExistsCriteria) c, buf); // depends on control dependency: [if], data = [none] } else if (c instanceof LikeCriteria) { appendLikeCriteria(alias, pathInfo, (LikeCriteria) c, buf); // depends on control dependency: [if], data = [none] } else { appendSelectionCriteria(alias, pathInfo, c, buf); // depends on control dependency: [if], data = [none] } } }
public class class_name { private int getMaxMemory() { int total = 0; for (MemoryPoolMXBean mpBean: ManagementFactory.getMemoryPoolMXBeans()) { if (mpBean.getType() == MemoryType.HEAP) { total += mpBean.getUsage().getMax() >> 20; } } return total; } }
public class class_name { private int getMaxMemory() { int total = 0; for (MemoryPoolMXBean mpBean: ManagementFactory.getMemoryPoolMXBeans()) { if (mpBean.getType() == MemoryType.HEAP) { total += mpBean.getUsage().getMax() >> 20; // depends on control dependency: [if], data = [none] } } return total; } }
public class class_name { void sessionError(final SibRaMessagingEngineConnection connection, final ConsumerSession session, final Throwable throwable) { final String methodName = "sessionError"; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, new Object[] { connection, session }); } final SIDestinationAddress destination = session .getDestinationAddress(); if (_remoteDestination) { /* * Output a message to the admin console and attempt to create a new * listener */ SibTr.warning(TRACE, "CONSUMER_FAILED_CWSIV0770", new Object[] { destination.getDestinationName(), _endpointConfiguration.getBusName(), this, throwable }); try { createListener(connection); } catch (final ResourceException exception) { // No FFDC code needed } } else { if (SibRaEngineComponent.isMessagingEngineReloading(connection .getConnection().getMeUuid())) { /* * Output a warning to the admin console and close the * connection - will be recreated during engineReloaded if * required */ SibTr.warning(TRACE, "FAILURE_DURING_RELOAD_CWSIV0774", new Object[] { throwable, destination.getDestinationName(), connection.getConnection().getMeName(), destination.getBusName(), this }); closeConnection(connection.getConnection().getMeUuid()); } else { /* * Output a message to the admin console and deactivate the * endpoint */ SibTr.error(TRACE, "SESSION_ERROR_CWSIV0766", new Object[] { throwable, destination.getDestinationName(), connection.getConnection().getMeName(), destination.getBusName(), this }); deactivate(); } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); } } }
public class class_name { void sessionError(final SibRaMessagingEngineConnection connection, final ConsumerSession session, final Throwable throwable) { final String methodName = "sessionError"; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, new Object[] { connection, session }); // depends on control dependency: [if], data = [none] } final SIDestinationAddress destination = session .getDestinationAddress(); if (_remoteDestination) { /* * Output a message to the admin console and attempt to create a new * listener */ SibTr.warning(TRACE, "CONSUMER_FAILED_CWSIV0770", new Object[] { destination.getDestinationName(), _endpointConfiguration.getBusName(), this, throwable }); // depends on control dependency: [if], data = [none] try { createListener(connection); // depends on control dependency: [try], data = [none] } catch (final ResourceException exception) { // No FFDC code needed } // depends on control dependency: [catch], data = [none] } else { if (SibRaEngineComponent.isMessagingEngineReloading(connection .getConnection().getMeUuid())) { /* * Output a warning to the admin console and close the * connection - will be recreated during engineReloaded if * required */ SibTr.warning(TRACE, "FAILURE_DURING_RELOAD_CWSIV0774", new Object[] { throwable, destination.getDestinationName(), connection.getConnection().getMeName(), destination.getBusName(), this }); // depends on control dependency: [if], data = [none] closeConnection(connection.getConnection().getMeUuid()); // depends on control dependency: [if], data = [none] } else { /* * Output a message to the admin console and deactivate the * endpoint */ SibTr.error(TRACE, "SESSION_ERROR_CWSIV0766", new Object[] { throwable, destination.getDestinationName(), connection.getConnection().getMeName(), destination.getBusName(), this }); // depends on control dependency: [if], data = [none] deactivate(); // depends on control dependency: [if], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setTypeAttributes( String name, String key, String icon, String bigIcon, String smallIconStyle, String bigIconStyle, String reference, String elementView, String isView, String namePattern, String viewOrder) { setName(name); setKey(key); setIcon(icon); setBigIcon(bigIcon); setSmallIconStyle(smallIconStyle); setBigIconStyle(bigIconStyle); setReference(reference); setElementView(elementView); try { m_viewOrder = Integer.valueOf(viewOrder); } catch (NumberFormatException e) { LOG.debug("Type " + name + " has no or invalid view order:" + viewOrder); } m_isView = Boolean.valueOf(isView).booleanValue(); m_namePattern = namePattern; } }
public class class_name { public void setTypeAttributes( String name, String key, String icon, String bigIcon, String smallIconStyle, String bigIconStyle, String reference, String elementView, String isView, String namePattern, String viewOrder) { setName(name); setKey(key); setIcon(icon); setBigIcon(bigIcon); setSmallIconStyle(smallIconStyle); setBigIconStyle(bigIconStyle); setReference(reference); setElementView(elementView); try { m_viewOrder = Integer.valueOf(viewOrder); // depends on control dependency: [try], data = [none] } catch (NumberFormatException e) { LOG.debug("Type " + name + " has no or invalid view order:" + viewOrder); } // depends on control dependency: [catch], data = [none] m_isView = Boolean.valueOf(isView).booleanValue(); m_namePattern = namePattern; } }
public class class_name { public FulltextMatch setProperties( final Collection<String> properties ) { if (properties == null || properties.size() == 0) { clearProperties(); return this; } synchronized (properties) { for (String binding : properties) { if (binding == null) { throw new IllegalArgumentException( "null element" ); } } clearProperties(); for (String property : properties) { addProperty( property ); } } return this; } }
public class class_name { public FulltextMatch setProperties( final Collection<String> properties ) { if (properties == null || properties.size() == 0) { clearProperties(); // depends on control dependency: [if], data = [none] return this; // depends on control dependency: [if], data = [none] } synchronized (properties) { for (String binding : properties) { if (binding == null) { throw new IllegalArgumentException( "null element" ); } } clearProperties(); for (String property : properties) { addProperty( property ); // depends on control dependency: [for], data = [property] } } return this; } }
public class class_name { public static List getDisconnected( Collection leftCollection, Graph relation, Collection rightCollection) { List disconnected; Iterator iter; Object left; EdgeIterator relationIter; disconnected = new ArrayList(); iter = leftCollection.iterator(); while (iter.hasNext()) { left = iter.next(); relationIter = relation.edges(); while (relationIter.step()) { if (relationIter.left() == left) { if (!rightCollection.contains(relationIter.right())) { relationIter = null; break; } } } if (relationIter != null) { disconnected.add(left); } } return disconnected; } }
public class class_name { public static List getDisconnected( Collection leftCollection, Graph relation, Collection rightCollection) { List disconnected; Iterator iter; Object left; EdgeIterator relationIter; disconnected = new ArrayList(); iter = leftCollection.iterator(); while (iter.hasNext()) { left = iter.next(); // depends on control dependency: [while], data = [none] relationIter = relation.edges(); // depends on control dependency: [while], data = [none] while (relationIter.step()) { if (relationIter.left() == left) { if (!rightCollection.contains(relationIter.right())) { relationIter = null; // depends on control dependency: [if], data = [none] break; } } } if (relationIter != null) { disconnected.add(left); // depends on control dependency: [if], data = [none] } } return disconnected; } }
public class class_name { public Annotator getAnnotator(Class<? extends Annotator> clazz) { if (!Annotator.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException("The class name given as a custom annotator (" + clazz.getName() + ") does not refer to a class that implements " + Annotator.class.getName()); } try { try { Constructor<? extends Annotator> constructor = clazz.getConstructor(GenerationConfig.class); return constructor.newInstance(generationConfig); } catch (NoSuchMethodException e) { return clazz.newInstance(); } } catch (InvocationTargetException | InstantiationException e) { throw new IllegalArgumentException("Failed to create a custom annotator from the given class. An exception was thrown on trying to create a new instance.", e.getCause()); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Failed to create a custom annotator from the given class. It appears that we do not have access to this class - is both the class and its no-arg constructor marked public?", e); } } }
public class class_name { public Annotator getAnnotator(Class<? extends Annotator> clazz) { if (!Annotator.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException("The class name given as a custom annotator (" + clazz.getName() + ") does not refer to a class that implements " + Annotator.class.getName()); } try { try { Constructor<? extends Annotator> constructor = clazz.getConstructor(GenerationConfig.class); // depends on control dependency: [try], data = [none] return constructor.newInstance(generationConfig); // depends on control dependency: [try], data = [none] } catch (NoSuchMethodException e) { return clazz.newInstance(); } // depends on control dependency: [catch], data = [none] } catch (InvocationTargetException | InstantiationException e) { throw new IllegalArgumentException("Failed to create a custom annotator from the given class. An exception was thrown on trying to create a new instance.", e.getCause()); } catch (IllegalAccessException e) { // depends on control dependency: [catch], data = [none] throw new IllegalArgumentException("Failed to create a custom annotator from the given class. It appears that we do not have access to this class - is both the class and its no-arg constructor marked public?", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public String getUrl() { ContentAccess content = getContentAccess(); String mode = DisplayMode.PROMPT_TO_SAVE.equals(getDisplayMode()) ? "attach" : "inline"; // Check for a "static" resource if (content instanceof InternalResource) { String url = ((InternalResource) content).getTargetUrl(); // This magic parameter is a work-around to the loading indicator becoming // "stuck" in certain browsers. // It is also used by the static resource handler to set the correct headers url = url + "&" + URL_CONTENT_MODE_PARAMETER_KEY + "=" + mode; return url; } Environment env = getEnvironment(); Map<String, String> parameters = env.getHiddenParameters(); parameters.put(Environment.TARGET_ID, getTargetId()); if (Util.empty(getCacheKey())) { // Add some randomness to the URL to prevent caching String random = WebUtilities.generateRandom(); parameters.put(Environment.UNIQUE_RANDOM_PARAM, random); } else { // Remove step counter as not required for cached content parameters.remove(Environment.STEP_VARIABLE); parameters.remove(Environment.SESSION_TOKEN_VARIABLE); // Add the cache key parameters.put(Environment.CONTENT_CACHE_KEY, getCacheKey()); } // This magic parameter is a work-around to the loading indicator becoming // "stuck" in certain browsers. It is only read by the theme. parameters.put(URL_CONTENT_MODE_PARAMETER_KEY, mode); // The targetable path needs to be configured for the portal environment. String url = env.getWServletPath(); // Note the last parameter. In javascript we don't want to encode "&". return WebUtilities.getPath(url, parameters, true); } }
public class class_name { public String getUrl() { ContentAccess content = getContentAccess(); String mode = DisplayMode.PROMPT_TO_SAVE.equals(getDisplayMode()) ? "attach" : "inline"; // Check for a "static" resource if (content instanceof InternalResource) { String url = ((InternalResource) content).getTargetUrl(); // This magic parameter is a work-around to the loading indicator becoming // "stuck" in certain browsers. // It is also used by the static resource handler to set the correct headers url = url + "&" + URL_CONTENT_MODE_PARAMETER_KEY + "=" + mode; // depends on control dependency: [if], data = [none] return url; // depends on control dependency: [if], data = [none] } Environment env = getEnvironment(); Map<String, String> parameters = env.getHiddenParameters(); parameters.put(Environment.TARGET_ID, getTargetId()); if (Util.empty(getCacheKey())) { // Add some randomness to the URL to prevent caching String random = WebUtilities.generateRandom(); parameters.put(Environment.UNIQUE_RANDOM_PARAM, random); // depends on control dependency: [if], data = [none] } else { // Remove step counter as not required for cached content parameters.remove(Environment.STEP_VARIABLE); // depends on control dependency: [if], data = [none] parameters.remove(Environment.SESSION_TOKEN_VARIABLE); // depends on control dependency: [if], data = [none] // Add the cache key parameters.put(Environment.CONTENT_CACHE_KEY, getCacheKey()); // depends on control dependency: [if], data = [none] } // This magic parameter is a work-around to the loading indicator becoming // "stuck" in certain browsers. It is only read by the theme. parameters.put(URL_CONTENT_MODE_PARAMETER_KEY, mode); // The targetable path needs to be configured for the portal environment. String url = env.getWServletPath(); // Note the last parameter. In javascript we don't want to encode "&". return WebUtilities.getPath(url, parameters, true); } }
public class class_name { public boolean isBye() { if (message == null) { return false; } return (((Request) message).getMethod().equals(Request.BYE)); } }
public class class_name { public boolean isBye() { if (message == null) { return false; // depends on control dependency: [if], data = [none] } return (((Request) message).getMethod().equals(Request.BYE)); } }
public class class_name { private void reportList(List collected, boolean doReport) { int size = collected.size(); // now loop through all collected resources m_report.println( Messages.get().container(Messages.RPT_NUM_PAGES_1, new Integer(size)), I_CmsReport.FORMAT_HEADLINE); if (doReport) { int count = 1; Iterator i = collected.iterator(); while (i.hasNext()) { String resName = (String)i.next(); m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(count++), String.valueOf(size)), I_CmsReport.FORMAT_NOTE); m_report.println(Messages.get().container(Messages.RPT_PROCESS_1, resName), I_CmsReport.FORMAT_NOTE); } } m_report.println(Messages.get().container(Messages.RPT_MERGE_PAGES_END_0), I_CmsReport.FORMAT_HEADLINE); } }
public class class_name { private void reportList(List collected, boolean doReport) { int size = collected.size(); // now loop through all collected resources m_report.println( Messages.get().container(Messages.RPT_NUM_PAGES_1, new Integer(size)), I_CmsReport.FORMAT_HEADLINE); if (doReport) { int count = 1; Iterator i = collected.iterator(); while (i.hasNext()) { String resName = (String)i.next(); m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(count++), String.valueOf(size)), I_CmsReport.FORMAT_NOTE); // depends on control dependency: [while], data = [none] m_report.println(Messages.get().container(Messages.RPT_PROCESS_1, resName), I_CmsReport.FORMAT_NOTE); // depends on control dependency: [while], data = [none] } } m_report.println(Messages.get().container(Messages.RPT_MERGE_PAGES_END_0), I_CmsReport.FORMAT_HEADLINE); } }
public class class_name { public static String splitListByComma(List<String> hosts) { boolean firstHost = true; StringBuilder hostConnection = new StringBuilder(); for (String host : hosts) { if (!firstHost) { hostConnection.append(","); } hostConnection.append(host.trim()); firstHost = false; } return hostConnection.toString(); } }
public class class_name { public static String splitListByComma(List<String> hosts) { boolean firstHost = true; StringBuilder hostConnection = new StringBuilder(); for (String host : hosts) { if (!firstHost) { hostConnection.append(","); // depends on control dependency: [if], data = [none] } hostConnection.append(host.trim()); // depends on control dependency: [for], data = [host] firstHost = false; // depends on control dependency: [for], data = [none] } return hostConnection.toString(); } }
public class class_name { public boolean addUserToTeam(final UserPrincipal user, final Team team) { List<Team> teams = user.getTeams(); boolean found = false; if (teams == null) { teams = new ArrayList<>(); } for (final Team t: teams) { if (team.getUuid().equals(t.getUuid())) { found = true; } } if (!found) { pm.currentTransaction().begin(); teams.add(team); user.setTeams(teams); pm.currentTransaction().commit(); return true; } return false; } }
public class class_name { public boolean addUserToTeam(final UserPrincipal user, final Team team) { List<Team> teams = user.getTeams(); boolean found = false; if (teams == null) { teams = new ArrayList<>(); // depends on control dependency: [if], data = [none] } for (final Team t: teams) { if (team.getUuid().equals(t.getUuid())) { found = true; // depends on control dependency: [if], data = [none] } } if (!found) { pm.currentTransaction().begin(); // depends on control dependency: [if], data = [none] teams.add(team); // depends on control dependency: [if], data = [none] user.setTeams(teams); // depends on control dependency: [if], data = [none] pm.currentTransaction().commit(); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public WindowFuture<K,R,P> cancel(K key) throws InterruptedException { if (!this.futures.containsKey(key)) { return null; } this.lock.lockInterruptibly(); try { // try to remove future from window DefaultWindowFuture<K,R,P> future = this.futures.remove(key); if (future == null) { return null; } // set failed using helper method (bypasses signalAll and requests.remove(key)) future.cancelHelper(System.currentTimeMillis()); // signal that a future is completed this.completedCondition.signalAll(); return future; } finally { this.lock.unlock(); } } }
public class class_name { public WindowFuture<K,R,P> cancel(K key) throws InterruptedException { if (!this.futures.containsKey(key)) { return null; } this.lock.lockInterruptibly(); try { // try to remove future from window DefaultWindowFuture<K,R,P> future = this.futures.remove(key); if (future == null) { return null; // depends on control dependency: [if], data = [none] } // set failed using helper method (bypasses signalAll and requests.remove(key)) future.cancelHelper(System.currentTimeMillis()); // signal that a future is completed this.completedCondition.signalAll(); return future; } finally { this.lock.unlock(); } } }
public class class_name { protected void renderLabel(final Tag group) { final Tag label = group.block("label").text(getKey()); if (getComment() != null) { label.attr(new Attr("class", "has-comment")); label.attr(new Attr("data-comment", getComment())); } } }
public class class_name { protected void renderLabel(final Tag group) { final Tag label = group.block("label").text(getKey()); if (getComment() != null) { label.attr(new Attr("class", "has-comment")); // depends on control dependency: [if], data = [none] label.attr(new Attr("data-comment", getComment())); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Document toDocument(BaseComponent root, String... excludedProperties) { try { CWF2XML instance = new CWF2XML(excludedProperties); instance.toXML(root, instance.doc); return instance.doc; } catch (ParserConfigurationException e) { return null; } } }
public class class_name { public static Document toDocument(BaseComponent root, String... excludedProperties) { try { CWF2XML instance = new CWF2XML(excludedProperties); instance.toXML(root, instance.doc); // depends on control dependency: [try], data = [none] return instance.doc; // depends on control dependency: [try], data = [none] } catch (ParserConfigurationException e) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void logout() throws IOException { if (this.loggedIn) { Map<String, String> params = new HashMap<>(); params.put("action", "logout"); params.put("format", "json"); // reduce the output try { sendJsonRequest("POST", params); } catch (MediaWikiApiErrorException e) { throw new IOException(e.getMessage(), e); //TODO: we should throw a better exception } this.loggedIn = false; this.username = ""; this.password = ""; } } }
public class class_name { public void logout() throws IOException { if (this.loggedIn) { Map<String, String> params = new HashMap<>(); params.put("action", "logout"); params.put("format", "json"); // reduce the output try { sendJsonRequest("POST", params); // depends on control dependency: [try], data = [none] } catch (MediaWikiApiErrorException e) { throw new IOException(e.getMessage(), e); //TODO: we should throw a better exception } // depends on control dependency: [catch], data = [none] this.loggedIn = false; this.username = ""; this.password = ""; } } }
public class class_name { public Observable<ServiceResponse<IPAddressAvailabilityResultInner>> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (virtualNetworkName == null) { throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2018-07-01"; final String ipAddress = null; return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<IPAddressAvailabilityResultInner>>>() { @Override public Observable<ServiceResponse<IPAddressAvailabilityResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<IPAddressAvailabilityResultInner> clientResponse = checkIPAddressAvailabilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<IPAddressAvailabilityResultInner>> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (virtualNetworkName == null) { throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2018-07-01"; final String ipAddress = null; return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<IPAddressAvailabilityResultInner>>>() { @Override public Observable<ServiceResponse<IPAddressAvailabilityResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<IPAddressAvailabilityResultInner> clientResponse = checkIPAddressAvailabilityDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { private boolean validMapunionExpression(Node expr) { // The expression must have four children: // - The mapunion keyword // - A union type expression // - A map function if (!checkParameterCount(expr, Keywords.MAPUNION)) { return false; } // The second child must be a valid union type expression if (!validTypeTransformationExpression(getCallArgument(expr, 0))) { warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 0)); return false; } // The third child must be a function if (!getCallArgument(expr, 1).isFunction()) { warnInvalid("map function", getCallArgument(expr, 1)); warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1)); return false; } Node mapFn = getCallArgument(expr, 1); // The map function must have only one parameter int mapFnParamCount = getFunctionParamCount(mapFn); if (mapFnParamCount < 1) { warnMissingParam("map function", mapFn); warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1)); return false; } if (mapFnParamCount > 1) { warnExtraParam("map function", mapFn); warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1)); return false; } // The body must be a valid type transformation expression Node mapFnBody = getFunctionBody(mapFn); if (!validTypeTransformationExpression(mapFnBody)) { warnInvalidInside("map function body", mapFnBody); return false; } return true; } }
public class class_name { private boolean validMapunionExpression(Node expr) { // The expression must have four children: // - The mapunion keyword // - A union type expression // - A map function if (!checkParameterCount(expr, Keywords.MAPUNION)) { return false; // depends on control dependency: [if], data = [none] } // The second child must be a valid union type expression if (!validTypeTransformationExpression(getCallArgument(expr, 0))) { warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 0)); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } // The third child must be a function if (!getCallArgument(expr, 1).isFunction()) { warnInvalid("map function", getCallArgument(expr, 1)); // depends on control dependency: [if], data = [none] warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1)); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } Node mapFn = getCallArgument(expr, 1); // The map function must have only one parameter int mapFnParamCount = getFunctionParamCount(mapFn); if (mapFnParamCount < 1) { warnMissingParam("map function", mapFn); // depends on control dependency: [if], data = [none] warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1)); // depends on control dependency: [if], data = [1)] return false; // depends on control dependency: [if], data = [none] } if (mapFnParamCount > 1) { warnExtraParam("map function", mapFn); // depends on control dependency: [if], data = [none] warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1)); // depends on control dependency: [if], data = [1)] return false; // depends on control dependency: [if], data = [none] } // The body must be a valid type transformation expression Node mapFnBody = getFunctionBody(mapFn); if (!validTypeTransformationExpression(mapFnBody)) { warnInvalidInside("map function body", mapFnBody); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { public void put(double[] val) { assert (val.length == mean.length); final double nwsum = wsum + 1.; // Compute new means for(int i = 0; i < mean.length; i++) { final double delta = val[i] - mean[i]; nmea[i] = mean[i] + delta / nwsum; } // Update covariance matrix for(int i = 0; i < mean.length; i++) { for(int j = i; j < mean.length; j++) { // We DO want to use the new mean once and the old mean once! // It does not matter which one is which. double delta = (val[i] - nmea[i]) * (val[j] - mean[j]); elements[i][j] = elements[i][j] + delta; // Optimize via symmetry if(i != j) { elements[j][i] = elements[j][i] + delta; } } } // Use new values. wsum = nwsum; System.arraycopy(nmea, 0, mean, 0, nmea.length); } }
public class class_name { public void put(double[] val) { assert (val.length == mean.length); final double nwsum = wsum + 1.; // Compute new means for(int i = 0; i < mean.length; i++) { final double delta = val[i] - mean[i]; nmea[i] = mean[i] + delta / nwsum; // depends on control dependency: [for], data = [i] } // Update covariance matrix for(int i = 0; i < mean.length; i++) { for(int j = i; j < mean.length; j++) { // We DO want to use the new mean once and the old mean once! // It does not matter which one is which. double delta = (val[i] - nmea[i]) * (val[j] - mean[j]); elements[i][j] = elements[i][j] + delta; // depends on control dependency: [for], data = [j] // Optimize via symmetry if(i != j) { elements[j][i] = elements[j][i] + delta; // depends on control dependency: [if], data = [none] } } } // Use new values. wsum = nwsum; System.arraycopy(nmea, 0, mean, 0, nmea.length); } }
public class class_name { @Override @FFDCIgnore(value = { RejectedExecutionException.class }) public <T> T invokeAny(Collection<? extends Callable<T>> tasks, PolicyTaskCallback[] callbacks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { int taskCount = tasks.size(); long stop = System.nanoTime() + unit.toNanos(timeout); long qWait, remaining; if (taskCount == 0) // JavaDoc doesn't specify what to do in this case. Match behavior of untimed invokeAny. throw new IllegalArgumentException(); InvokeAnyLatch latch = new InvokeAnyLatch(taskCount); ArrayList<PolicyTaskFutureImpl<T>> futures = new ArrayList<PolicyTaskFutureImpl<T>>(taskCount); try { // create futures in advance, which gives the callback an opportunity to reject int t = 0; for (Callable<T> task : tasks) { remaining = stop - System.nanoTime(); PolicyTaskCallback callback = callbacks == null ? null : callbacks[t++]; PolicyExecutorImpl executor = callback == null ? this : (PolicyExecutorImpl) callback.getExecutor(this); long startTimeoutNS = callback == null ? startTimeout : callback.getStartTimeout(executor.startTimeout); PolicyTaskFutureImpl<T> taskFuture = new PolicyTaskFutureImpl<T>(executor, task, callback, startTimeoutNS, latch); futures.add(taskFuture); if (remaining <= 0) throw new RejectedExecutionException(Tr.formatMessage(tc, "CWWKE1204.unable.to.invoke", taskFuture.getIdentifier(), taskCount - futures.size(), taskCount, timeout, unit)); } // enqueue all tasks for (PolicyTaskFutureImpl<T> taskFuture : futures) { remaining = stop - System.nanoTime(); // check if done before enqueuing more tasks if (latch.getCount() == 0) break; if (remaining <= 0) throw new RejectedExecutionException(Tr.formatMessage(tc, "CWWKE1204.unable.to.invoke", taskFuture.getIdentifier(), taskCount - futures.size(), taskCount, timeout, unit)); qWait = taskFuture.executor.maxWaitForEnqueueNS.get(); taskFuture.executor.enqueue(taskFuture, qWait < remaining ? qWait : remaining, // limit waiting to lesser of maxWaitForEnqueue and remaining time false); // never run on the current thread because it would prevent timeout } // wait for completion remaining = stop - System.nanoTime(); return latch.await(remaining < 0 ? 0 : remaining, futures); } catch (RejectedExecutionException x) { if (x.getCause() instanceof InterruptedException) throw (InterruptedException) x.getCause(); else throw x; } finally { for (Future<?> f : futures) f.cancel(true); } } }
public class class_name { @Override @FFDCIgnore(value = { RejectedExecutionException.class }) public <T> T invokeAny(Collection<? extends Callable<T>> tasks, PolicyTaskCallback[] callbacks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { int taskCount = tasks.size(); long stop = System.nanoTime() + unit.toNanos(timeout); long qWait, remaining; if (taskCount == 0) // JavaDoc doesn't specify what to do in this case. Match behavior of untimed invokeAny. throw new IllegalArgumentException(); InvokeAnyLatch latch = new InvokeAnyLatch(taskCount); ArrayList<PolicyTaskFutureImpl<T>> futures = new ArrayList<PolicyTaskFutureImpl<T>>(taskCount); try { // create futures in advance, which gives the callback an opportunity to reject int t = 0; for (Callable<T> task : tasks) { remaining = stop - System.nanoTime(); // depends on control dependency: [for], data = [none] PolicyTaskCallback callback = callbacks == null ? null : callbacks[t++]; PolicyExecutorImpl executor = callback == null ? this : (PolicyExecutorImpl) callback.getExecutor(this); long startTimeoutNS = callback == null ? startTimeout : callback.getStartTimeout(executor.startTimeout); PolicyTaskFutureImpl<T> taskFuture = new PolicyTaskFutureImpl<T>(executor, task, callback, startTimeoutNS, latch); futures.add(taskFuture); // depends on control dependency: [for], data = [task] if (remaining <= 0) throw new RejectedExecutionException(Tr.formatMessage(tc, "CWWKE1204.unable.to.invoke", taskFuture.getIdentifier(), taskCount - futures.size(), taskCount, timeout, unit)); } // enqueue all tasks for (PolicyTaskFutureImpl<T> taskFuture : futures) { remaining = stop - System.nanoTime(); // depends on control dependency: [for], data = [none] // check if done before enqueuing more tasks if (latch.getCount() == 0) break; if (remaining <= 0) throw new RejectedExecutionException(Tr.formatMessage(tc, "CWWKE1204.unable.to.invoke", taskFuture.getIdentifier(), taskCount - futures.size(), taskCount, timeout, unit)); qWait = taskFuture.executor.maxWaitForEnqueueNS.get(); // depends on control dependency: [for], data = [taskFuture] taskFuture.executor.enqueue(taskFuture, qWait < remaining ? qWait : remaining, // limit waiting to lesser of maxWaitForEnqueue and remaining time false); // never run on the current thread because it would prevent timeout // depends on control dependency: [for], data = [taskFuture] } // wait for completion remaining = stop - System.nanoTime(); return latch.await(remaining < 0 ? 0 : remaining, futures); } catch (RejectedExecutionException x) { if (x.getCause() instanceof InterruptedException) throw (InterruptedException) x.getCause(); else throw x; } finally { for (Future<?> f : futures) f.cancel(true); } } }
public class class_name { public final void setVisibility(final int visibility, final boolean animate) { boolean visible = visibility == View.VISIBLE; Boolean tag = (Boolean) getTag(); setTag(visible); if (animate) { if (tag == null || tag != visible) { if (getAnimation() != null) { getAnimation().cancel(); } animate().alpha(visible ? 1 : 0).setDuration( getResources().getInteger(android.R.integer.config_mediumAnimTime)) .setListener(createVisibilityAnimationListener(visible)).start(); } } else { super.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } } }
public class class_name { public final void setVisibility(final int visibility, final boolean animate) { boolean visible = visibility == View.VISIBLE; Boolean tag = (Boolean) getTag(); setTag(visible); if (animate) { if (tag == null || tag != visible) { if (getAnimation() != null) { getAnimation().cancel(); // depends on control dependency: [if], data = [none] } animate().alpha(visible ? 1 : 0).setDuration( getResources().getInteger(android.R.integer.config_mediumAnimTime)) .setListener(createVisibilityAnimationListener(visible)).start(); // depends on control dependency: [if], data = [none] } } else { super.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Map<String, String> getRegisterdSASLMechanisms() { Map<String, String> answer = new LinkedHashMap<>(); synchronized (REGISTERED_MECHANISMS) { for (SASLMechanism mechanism : REGISTERED_MECHANISMS) { answer.put(mechanism.getClass().getName(), mechanism.toString()); } } return answer; } }
public class class_name { public static Map<String, String> getRegisterdSASLMechanisms() { Map<String, String> answer = new LinkedHashMap<>(); synchronized (REGISTERED_MECHANISMS) { for (SASLMechanism mechanism : REGISTERED_MECHANISMS) { answer.put(mechanism.getClass().getName(), mechanism.toString()); // depends on control dependency: [for], data = [mechanism] } } return answer; } }
public class class_name { private void initializeControls() { if (originalFile != null) { resourceGroup.setContainerFullPath(originalFile.getParent() .getFullPath()); String fileName = originalFile.getName(); int index = fileName.lastIndexOf("."); if (index != -1) { fileName = fileName.substring(0, index); } fileName += "-image.png"; resourceGroup.setResource(fileName); } else if (originalName != null) { resourceGroup.setResource(originalName); } setDialogComplete(validatePage()); } }
public class class_name { private void initializeControls() { if (originalFile != null) { resourceGroup.setContainerFullPath(originalFile.getParent() .getFullPath()); // depends on control dependency: [if], data = [none] String fileName = originalFile.getName(); int index = fileName.lastIndexOf("."); if (index != -1) { fileName = fileName.substring(0, index); // depends on control dependency: [if], data = [none] } fileName += "-image.png"; // depends on control dependency: [if], data = [none] resourceGroup.setResource(fileName); // depends on control dependency: [if], data = [none] } else if (originalName != null) { resourceGroup.setResource(originalName); // depends on control dependency: [if], data = [(originalName] } setDialogComplete(validatePage()); } }
public class class_name { protected AffineTransform createTransform(ElementBox elem) { if (elem.isBlock() || elem.isReplaced()) { CSSDecoder dec = new CSSDecoder(elem.getVisualContext()); Rectangle bounds = elem.getAbsoluteBorderBounds(); //decode the origin int ox, oy; CSSProperty.TransformOrigin origin = elem.getStyle().getProperty("transform-origin"); if (origin == CSSProperty.TransformOrigin.list_values) { TermList values = elem.getStyle().getValue(TermList.class, "transform-origin"); ox = dec.getLength((TermLengthOrPercent) values.get(0), false, bounds.width / 2, 0, bounds.width); oy = dec.getLength((TermLengthOrPercent) values.get(1), false, bounds.height / 2, 0, bounds.height); } else { ox = bounds.width / 2; oy = bounds.height / 2; } ox += bounds.x; oy += bounds.y; //compute the transformation matrix AffineTransform ret = null; CSSProperty.Transform trans = elem.getStyle().getProperty("transform"); if (trans == CSSProperty.Transform.list_values) { ret = new AffineTransform(); ret.translate(ox, oy); TermList values = elem.getStyle().getValue(TermList.class, "transform"); for (Term<?> term : values) { if (term instanceof TermFunction) { final TermFunction func = (TermFunction) term; final String fname = func.getFunctionName().toLowerCase(); if (fname.equals("rotate")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double theta = dec.getAngle((TermAngle) func.get(0)); ret.rotate(theta); } } else if (fname.equals("translate")) { if (func.size() == 1 && func.get(0) instanceof TermLengthOrPercent) { int tx = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.width); ret.translate(tx, 0.0); } else if (func.size() == 2 && func.get(0) instanceof TermLengthOrPercent && func.get(1) instanceof TermLengthOrPercent) { int tx = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.width); int ty = dec.getLength((TermLengthOrPercent) func.get(1), false, 0, 0, bounds.height); ret.translate(tx, ty); } } else if (fname.equals("translatex")) { if (func.size() == 1 && func.get(0) instanceof TermLengthOrPercent) { int tx = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.width); ret.translate(tx, 0.0); } } else if (fname.equals("translatey")) { if (func.size() == 1 && func.get(0) instanceof TermLengthOrPercent) { int ty = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.height); ret.translate(0.0, ty); } } else if (fname.equals("scale")) { if (func.size() == 1 && isNumber(func.get(0))) { float sx = getNumber(func.get(0)); ret.scale(sx, sx); } else if (func.size() == 2 && isNumber(func.get(0)) && isNumber(func.get(1))) { float sx = getNumber(func.get(0)); float sy = getNumber(func.get(1)); ret.scale(sx, sy); } } else if (fname.equals("scalex")) { if (func.size() == 1 && isNumber(func.get(0))) { float sx = getNumber(func.get(0)); ret.scale(sx, 1.0); } } else if (fname.equals("scaley")) { if (func.size() == 1 && isNumber(func.get(0))) { float sy = getNumber(func.get(0)); ret.scale(1.0, sy); } } else if (fname.equals("skew")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double ax = dec.getAngle((TermAngle) func.get(0)); ret.shear(Math.tan(ax), 0.0); } else if (func.size() == 2 && func.get(0) instanceof TermAngle && func.get(1) instanceof TermAngle) { double ax = dec.getAngle((TermAngle) func.get(0)); double ay = dec.getAngle((TermAngle) func.get(1)); ret.shear(Math.tan(ax), Math.tan(ay)); } } else if (fname.equals("skewx")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double ax = dec.getAngle((TermAngle) func.get(0)); ret.shear(Math.tan(ax), 0.0); } } else if (fname.equals("skewy")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double ay = dec.getAngle((TermAngle) func.get(0)); ret.shear(0.0, Math.tan(ay)); } } else if (fname.equals("matrix")) { if (func.size() == 6) { double[] vals = new double[6]; boolean typesOk = true; for (int i = 0; i < 6; i++) { if (isNumber(func.get(i))) vals[i] = getNumber(func.get(i)); else typesOk = false; } if (typesOk) { ret.concatenate(new AffineTransform(vals)); } } } } } ret.translate(-ox, -oy); } return ret; } else return null; } }
public class class_name { protected AffineTransform createTransform(ElementBox elem) { if (elem.isBlock() || elem.isReplaced()) { CSSDecoder dec = new CSSDecoder(elem.getVisualContext()); Rectangle bounds = elem.getAbsoluteBorderBounds(); //decode the origin int ox, oy; CSSProperty.TransformOrigin origin = elem.getStyle().getProperty("transform-origin"); if (origin == CSSProperty.TransformOrigin.list_values) { TermList values = elem.getStyle().getValue(TermList.class, "transform-origin"); ox = dec.getLength((TermLengthOrPercent) values.get(0), false, bounds.width / 2, 0, bounds.width); // depends on control dependency: [if], data = [none] oy = dec.getLength((TermLengthOrPercent) values.get(1), false, bounds.height / 2, 0, bounds.height); // depends on control dependency: [if], data = [none] } else { ox = bounds.width / 2; // depends on control dependency: [if], data = [none] oy = bounds.height / 2; // depends on control dependency: [if], data = [none] } ox += bounds.x; // depends on control dependency: [if], data = [none] oy += bounds.y; // depends on control dependency: [if], data = [none] //compute the transformation matrix AffineTransform ret = null; CSSProperty.Transform trans = elem.getStyle().getProperty("transform"); if (trans == CSSProperty.Transform.list_values) { ret = new AffineTransform(); // depends on control dependency: [if], data = [none] ret.translate(ox, oy); // depends on control dependency: [if], data = [none] TermList values = elem.getStyle().getValue(TermList.class, "transform"); for (Term<?> term : values) { if (term instanceof TermFunction) { final TermFunction func = (TermFunction) term; final String fname = func.getFunctionName().toLowerCase(); if (fname.equals("rotate")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double theta = dec.getAngle((TermAngle) func.get(0)); ret.rotate(theta); // depends on control dependency: [if], data = [none] } } else if (fname.equals("translate")) { if (func.size() == 1 && func.get(0) instanceof TermLengthOrPercent) { int tx = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.width); ret.translate(tx, 0.0); // depends on control dependency: [if], data = [none] } else if (func.size() == 2 && func.get(0) instanceof TermLengthOrPercent && func.get(1) instanceof TermLengthOrPercent) { int tx = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.width); int ty = dec.getLength((TermLengthOrPercent) func.get(1), false, 0, 0, bounds.height); ret.translate(tx, ty); // depends on control dependency: [if], data = [none] } } else if (fname.equals("translatex")) { if (func.size() == 1 && func.get(0) instanceof TermLengthOrPercent) { int tx = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.width); ret.translate(tx, 0.0); // depends on control dependency: [if], data = [none] } } else if (fname.equals("translatey")) { if (func.size() == 1 && func.get(0) instanceof TermLengthOrPercent) { int ty = dec.getLength((TermLengthOrPercent) func.get(0), false, 0, 0, bounds.height); ret.translate(0.0, ty); // depends on control dependency: [if], data = [none] } } else if (fname.equals("scale")) { if (func.size() == 1 && isNumber(func.get(0))) { float sx = getNumber(func.get(0)); ret.scale(sx, sx); // depends on control dependency: [if], data = [none] } else if (func.size() == 2 && isNumber(func.get(0)) && isNumber(func.get(1))) { float sx = getNumber(func.get(0)); float sy = getNumber(func.get(1)); ret.scale(sx, sy); // depends on control dependency: [if], data = [none] } } else if (fname.equals("scalex")) { if (func.size() == 1 && isNumber(func.get(0))) { float sx = getNumber(func.get(0)); ret.scale(sx, 1.0); // depends on control dependency: [if], data = [none] } } else if (fname.equals("scaley")) { if (func.size() == 1 && isNumber(func.get(0))) { float sy = getNumber(func.get(0)); ret.scale(1.0, sy); // depends on control dependency: [if], data = [none] } } else if (fname.equals("skew")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double ax = dec.getAngle((TermAngle) func.get(0)); ret.shear(Math.tan(ax), 0.0); // depends on control dependency: [if], data = [none] } else if (func.size() == 2 && func.get(0) instanceof TermAngle && func.get(1) instanceof TermAngle) { double ax = dec.getAngle((TermAngle) func.get(0)); double ay = dec.getAngle((TermAngle) func.get(1)); ret.shear(Math.tan(ax), Math.tan(ay)); // depends on control dependency: [if], data = [none] } } else if (fname.equals("skewx")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double ax = dec.getAngle((TermAngle) func.get(0)); ret.shear(Math.tan(ax), 0.0); // depends on control dependency: [if], data = [none] } } else if (fname.equals("skewy")) { if (func.size() == 1 && func.get(0) instanceof TermAngle) { double ay = dec.getAngle((TermAngle) func.get(0)); ret.shear(0.0, Math.tan(ay)); // depends on control dependency: [if], data = [none] } } else if (fname.equals("matrix")) { if (func.size() == 6) { double[] vals = new double[6]; boolean typesOk = true; for (int i = 0; i < 6; i++) { if (isNumber(func.get(i))) vals[i] = getNumber(func.get(i)); else typesOk = false; } if (typesOk) { ret.concatenate(new AffineTransform(vals)); // depends on control dependency: [if], data = [none] } } } } } ret.translate(-ox, -oy); // depends on control dependency: [if], data = [none] } return ret; // depends on control dependency: [if], data = [none] } else return null; } }
public class class_name { void reportError(Node n, Var var, String name) { JSDocInfo info = NodeUtil.getBestJSDocInfo(n); if (info == null || !info.getSuppressions().contains("const")) { Node declNode = var.getNode(); String declaredPosition = declNode.getSourceFileName() + ":" + declNode.getLineno(); compiler.report(JSError.make(n, CONST_REASSIGNED_VALUE_ERROR, name, declaredPosition)); } } }
public class class_name { void reportError(Node n, Var var, String name) { JSDocInfo info = NodeUtil.getBestJSDocInfo(n); if (info == null || !info.getSuppressions().contains("const")) { Node declNode = var.getNode(); String declaredPosition = declNode.getSourceFileName() + ":" + declNode.getLineno(); compiler.report(JSError.make(n, CONST_REASSIGNED_VALUE_ERROR, name, declaredPosition)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void addExStrFeats(double weight, Object xObj, Object yObj, List<String>[] fvStrs) { FeatureVector[] fvs = new FeatureVector[fvStrs.length]; for (int i=0; i<fvs.length; i++) { fvs[i] = new FeatureVector(); for (String featName : fvStrs[i]) { fvs[i].add(featAlphabet.lookupIndex(featName), 1); } } addEx(weight, xObj, yObj, fvs); } }
public class class_name { public void addExStrFeats(double weight, Object xObj, Object yObj, List<String>[] fvStrs) { FeatureVector[] fvs = new FeatureVector[fvStrs.length]; for (int i=0; i<fvs.length; i++) { fvs[i] = new FeatureVector(); // depends on control dependency: [for], data = [i] for (String featName : fvStrs[i]) { fvs[i].add(featAlphabet.lookupIndex(featName), 1); // depends on control dependency: [for], data = [featName] } } addEx(weight, xObj, yObj, fvs); } }
public class class_name { public boolean hasFullRank() { // if (R == null) { // R = new SparseCCDoubleMatrix2D(N.U); // if (rcMatrix) { // R = ((SparseCCDoubleMatrix2D) R).getRowCompressed(); // } // // } int mn = Math.min(m, n); double mng = Math.sqrt(m * n); // double threshold = ALG.property().tolerance(); double threshold = mng * Utils.getDoubleMachineEpsilon(); for (int j = 0; j < mn; j++) { // if (R.getQuick(j, j) == 0){ double rjj = getQuick(N.U, j, j); // log.debug("r(" + j + "," + j + "): " + rjj); // if (rjj < Utils.getDoubleMachineEpsilon()) { // return false; // } if (rjj < threshold) { return false; } } return true; } }
public class class_name { public boolean hasFullRank() { // if (R == null) { // R = new SparseCCDoubleMatrix2D(N.U); // if (rcMatrix) { // R = ((SparseCCDoubleMatrix2D) R).getRowCompressed(); // } // // } int mn = Math.min(m, n); double mng = Math.sqrt(m * n); // double threshold = ALG.property().tolerance(); double threshold = mng * Utils.getDoubleMachineEpsilon(); for (int j = 0; j < mn; j++) { // if (R.getQuick(j, j) == 0){ double rjj = getQuick(N.U, j, j); // log.debug("r(" + j + "," + j + "): " + rjj); // if (rjj < Utils.getDoubleMachineEpsilon()) { // return false; // } if (rjj < threshold) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public static void closeWriter(String filePath) { Writer writer = writerCache.get(filePath); if (writer != null) { try { writer.close(); } catch (IOException e) { e.printStackTrace(); } } writerCache.remove(writer); } }
public class class_name { public static void closeWriter(String filePath) { Writer writer = writerCache.get(filePath); if (writer != null) { try { writer.close(); // depends on control dependency: [try], data = [none] } catch (IOException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } writerCache.remove(writer); } }
public class class_name { public static Weeks from(TemporalAmount amount) { if (amount instanceof Weeks) { return (Weeks) amount; } Objects.requireNonNull(amount, "amount"); int weeks = 0; for (TemporalUnit unit : amount.getUnits()) { long value = amount.get(unit); if (value != 0) { long[] converted = Temporals.convertAmount(value, unit, WEEKS); if (converted[1] != 0) { throw new DateTimeException( "Amount could not be converted to a whole number of weeks: " + value + " " + unit); } weeks = Math.addExact(weeks, Math.toIntExact(converted[0])); } } return of(weeks); } }
public class class_name { public static Weeks from(TemporalAmount amount) { if (amount instanceof Weeks) { return (Weeks) amount; // depends on control dependency: [if], data = [none] } Objects.requireNonNull(amount, "amount"); int weeks = 0; for (TemporalUnit unit : amount.getUnits()) { long value = amount.get(unit); if (value != 0) { long[] converted = Temporals.convertAmount(value, unit, WEEKS); if (converted[1] != 0) { throw new DateTimeException( "Amount could not be converted to a whole number of weeks: " + value + " " + unit); } weeks = Math.addExact(weeks, Math.toIntExact(converted[0])); // depends on control dependency: [if], data = [none] } } return of(weeks); } }
public class class_name { public void marshall(DeleteDeploymentConfigRequest deleteDeploymentConfigRequest, ProtocolMarshaller protocolMarshaller) { if (deleteDeploymentConfigRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteDeploymentConfigRequest.getDeploymentConfigName(), DEPLOYMENTCONFIGNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DeleteDeploymentConfigRequest deleteDeploymentConfigRequest, ProtocolMarshaller protocolMarshaller) { if (deleteDeploymentConfigRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteDeploymentConfigRequest.getDeploymentConfigName(), DEPLOYMENTCONFIGNAME_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public boolean record(final Throwable observation) { final long timestamp = clock.time(); DistinctObservation distinctObservation; synchronized (this) { distinctObservation = find(distinctObservations, observation); if (null == distinctObservation) { distinctObservation = newObservation(timestamp, observation); if (INSUFFICIENT_SPACE == distinctObservation) { return false; } } } final int offset = distinctObservation.offset; buffer.getAndAddInt(offset + OBSERVATION_COUNT_OFFSET, 1); buffer.putLongOrdered(offset + LAST_OBSERVATION_TIMESTAMP_OFFSET, timestamp); return true; } }
public class class_name { public boolean record(final Throwable observation) { final long timestamp = clock.time(); DistinctObservation distinctObservation; synchronized (this) { distinctObservation = find(distinctObservations, observation); if (null == distinctObservation) { distinctObservation = newObservation(timestamp, observation); // depends on control dependency: [if], data = [none] if (INSUFFICIENT_SPACE == distinctObservation) { return false; // depends on control dependency: [if], data = [none] } } } final int offset = distinctObservation.offset; buffer.getAndAddInt(offset + OBSERVATION_COUNT_OFFSET, 1); buffer.putLongOrdered(offset + LAST_OBSERVATION_TIMESTAMP_OFFSET, timestamp); return true; } }
public class class_name { private static int findCommandIndex(String[] args) { int commandIndex = -1; for (int i = 0; i < args.length; i++) { for (Command command : Command.values()) { if (command.getName().equals(args[i].trim())) { commandIndex = i; break; } } } return commandIndex; } }
public class class_name { private static int findCommandIndex(String[] args) { int commandIndex = -1; for (int i = 0; i < args.length; i++) { for (Command command : Command.values()) { if (command.getName().equals(args[i].trim())) { commandIndex = i; // depends on control dependency: [if], data = [none] break; } } } return commandIndex; } }
public class class_name { public static Swagger from(final Swagger router, final Object... objs) { for (Object o : objs) { Processor.process(router, o); } return router; } }
public class class_name { public static Swagger from(final Swagger router, final Object... objs) { for (Object o : objs) { Processor.process(router, o); // depends on control dependency: [for], data = [o] } return router; } }
public class class_name { @Override public void writePropertiesTo(SLProperties props, Result result) { ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props); try { JAXBElement<ServiceLocatorPropertiesType> elementProps = ENDPOINT_OBJECT_FACTORY.createServiceLocatorProperties(jaxbProps); createMarshaller().marshal(elementProps, result); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize endpoint data", e); } } } }
public class class_name { @Override public void writePropertiesTo(SLProperties props, Result result) { ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props); try { JAXBElement<ServiceLocatorPropertiesType> elementProps = ENDPOINT_OBJECT_FACTORY.createServiceLocatorProperties(jaxbProps); createMarshaller().marshal(elementProps, result); // depends on control dependency: [try], data = [none] } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize endpoint data", e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } }
public class class_name { public MultipartContent setContentParts(Collection<? extends HttpContent> contentParts) { this.parts = new ArrayList<Part>(contentParts.size()); for (HttpContent contentPart : contentParts) { addPart(new Part(contentPart)); } return this; } }
public class class_name { public MultipartContent setContentParts(Collection<? extends HttpContent> contentParts) { this.parts = new ArrayList<Part>(contentParts.size()); for (HttpContent contentPart : contentParts) { addPart(new Part(contentPart)); // depends on control dependency: [for], data = [contentPart] } return this; } }
public class class_name { public float getBand(int band) { float eq = 0.0f; if ((band>=0) && (band<BANDS)) { eq = settings[band]; } return eq; } }
public class class_name { public float getBand(int band) { float eq = 0.0f; if ((band>=0) && (band<BANDS)) { eq = settings[band]; // depends on control dependency: [if], data = [none] } return eq; } }
public class class_name { @Override public void start() { try { url = new URL(getStringSetting(SETTING_URL, DEFAULT_LIBRATO_API_URL)); user = getStringSetting(SETTING_USERNAME); token = getStringSetting(SETTING_TOKEN); basicAuthentication = Base64Variants.getDefaultVariant().encode((user + ":" + token).getBytes(Charset.forName("US-ASCII"))); if (getStringSetting(SETTING_PROXY_HOST, null) != null && !getStringSetting(SETTING_PROXY_HOST).isEmpty()) { proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(getStringSetting(SETTING_PROXY_HOST), getIntSetting(SETTING_PROXY_PORT))); } libratoApiTimeoutInMillis = getIntSetting(SETTING_LIBRATO_API_TIMEOUT_IN_MILLIS, DEFAULT_LIBRATO_API_TIMEOUT_IN_MILLIS); source = getStringSetting(SETTING_SOURCE, DEFAULT_SOURCE); source = getStrategy().resolveExpression(source); logger.info("Start Librato writer connected to '{}', proxy {} with user '{}' ...", url, proxy, user); } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } } }
public class class_name { @Override public void start() { try { url = new URL(getStringSetting(SETTING_URL, DEFAULT_LIBRATO_API_URL)); // depends on control dependency: [try], data = [none] user = getStringSetting(SETTING_USERNAME); // depends on control dependency: [try], data = [none] token = getStringSetting(SETTING_TOKEN); // depends on control dependency: [try], data = [none] basicAuthentication = Base64Variants.getDefaultVariant().encode((user + ":" + token).getBytes(Charset.forName("US-ASCII"))); // depends on control dependency: [try], data = [none] if (getStringSetting(SETTING_PROXY_HOST, null) != null && !getStringSetting(SETTING_PROXY_HOST).isEmpty()) { proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(getStringSetting(SETTING_PROXY_HOST), getIntSetting(SETTING_PROXY_PORT))); // depends on control dependency: [if], data = [none] } libratoApiTimeoutInMillis = getIntSetting(SETTING_LIBRATO_API_TIMEOUT_IN_MILLIS, DEFAULT_LIBRATO_API_TIMEOUT_IN_MILLIS); // depends on control dependency: [try], data = [none] source = getStringSetting(SETTING_SOURCE, DEFAULT_SOURCE); // depends on control dependency: [try], data = [none] source = getStrategy().resolveExpression(source); // depends on control dependency: [try], data = [none] logger.info("Start Librato writer connected to '{}', proxy {} with user '{}' ...", url, proxy, user); // depends on control dependency: [try], data = [none] } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Nullable private Status validateInitialMetadata(Metadata headers) { Integer httpStatus = headers.get(HTTP2_STATUS); if (httpStatus == null) { return Status.INTERNAL.withDescription("Missing HTTP status code"); } String contentType = headers.get(GrpcUtil.CONTENT_TYPE_KEY); if (!GrpcUtil.isGrpcContentType(contentType)) { return GrpcUtil.httpStatusToGrpcStatus(httpStatus) .augmentDescription("invalid content-type: " + contentType); } return null; } }
public class class_name { @Nullable private Status validateInitialMetadata(Metadata headers) { Integer httpStatus = headers.get(HTTP2_STATUS); if (httpStatus == null) { return Status.INTERNAL.withDescription("Missing HTTP status code"); // depends on control dependency: [if], data = [none] } String contentType = headers.get(GrpcUtil.CONTENT_TYPE_KEY); if (!GrpcUtil.isGrpcContentType(contentType)) { return GrpcUtil.httpStatusToGrpcStatus(httpStatus) .augmentDescription("invalid content-type: " + contentType); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public static String rtrim(String str, String defaultValue) { if (str == null) return defaultValue; int len = str.length(); while ((0 < len) && (str.charAt(len - 1) <= ' ')) { len--; } return (len < str.length()) ? str.substring(0, len) : str; } }
public class class_name { public static String rtrim(String str, String defaultValue) { if (str == null) return defaultValue; int len = str.length(); while ((0 < len) && (str.charAt(len - 1) <= ' ')) { len--; // depends on control dependency: [while], data = [none] } return (len < str.length()) ? str.substring(0, len) : str; } }
public class class_name { public void putDestination(List<Descriptor> descriptors, int branchId, State state) { if (!hasLineageInfo(state)) { log.warn("State has no lineage info but branch " + branchId + " puts {} descriptors", descriptors.size()); return; } log.info(String.format("Put destination %s for branch %d", Descriptor.toJson(descriptors), branchId)); synchronized (state.getProp(getKey(NAME_KEY))) { List<Descriptor> resolvedDescriptors = new ArrayList<>(); for (Descriptor descriptor : descriptors) { Descriptor resolvedDescriptor = resolver.resolve(descriptor, state); if (resolvedDescriptor == null) { continue; } resolvedDescriptors.add(resolvedDescriptor); } String destinationKey = getKey(BRANCH, branchId, LineageEventBuilder.DESTINATION); String currentDestinations = state.getProp(destinationKey); List<Descriptor> allDescriptors = Lists.newArrayList(); if (StringUtils.isNotEmpty(currentDestinations)) { allDescriptors = Descriptor.fromJsonList(currentDestinations); } allDescriptors.addAll(resolvedDescriptors); state.setProp(destinationKey, Descriptor.toJson(allDescriptors)); } } }
public class class_name { public void putDestination(List<Descriptor> descriptors, int branchId, State state) { if (!hasLineageInfo(state)) { log.warn("State has no lineage info but branch " + branchId + " puts {} descriptors", descriptors.size()); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } log.info(String.format("Put destination %s for branch %d", Descriptor.toJson(descriptors), branchId)); synchronized (state.getProp(getKey(NAME_KEY))) { List<Descriptor> resolvedDescriptors = new ArrayList<>(); for (Descriptor descriptor : descriptors) { Descriptor resolvedDescriptor = resolver.resolve(descriptor, state); if (resolvedDescriptor == null) { continue; } resolvedDescriptors.add(resolvedDescriptor); // depends on control dependency: [for], data = [none] } String destinationKey = getKey(BRANCH, branchId, LineageEventBuilder.DESTINATION); String currentDestinations = state.getProp(destinationKey); List<Descriptor> allDescriptors = Lists.newArrayList(); if (StringUtils.isNotEmpty(currentDestinations)) { allDescriptors = Descriptor.fromJsonList(currentDestinations); // depends on control dependency: [if], data = [none] } allDescriptors.addAll(resolvedDescriptors); state.setProp(destinationKey, Descriptor.toJson(allDescriptors)); } } }
public class class_name { private void tagvalue(Options opt, Doc c) { Tag tags[] = c.tags("tagvalue"); if (tags.length == 0) return; for (Tag tag : tags) { String t[] = tokenize(tag.text()); if (t.length != 2) { System.err.println("@tagvalue expects two fields: " + tag.text()); continue; } tableLine(Align.RIGHT, Font.TAG.wrap(opt, "{" + t[0] + " = " + t[1] + "}")); } } }
public class class_name { private void tagvalue(Options opt, Doc c) { Tag tags[] = c.tags("tagvalue"); if (tags.length == 0) return; for (Tag tag : tags) { String t[] = tokenize(tag.text()); if (t.length != 2) { System.err.println("@tagvalue expects two fields: " + tag.text()); // depends on control dependency: [if], data = [none] continue; } tableLine(Align.RIGHT, Font.TAG.wrap(opt, "{" + t[0] + " = " + t[1] + "}")); // depends on control dependency: [for], data = [none] } } }
public class class_name { void openPrincipalSelect() { CmsPrincipalSelectDialog dialog; m_window = CmsBasicDialog.prepareWindow(DialogWidth.max); WidgetType defaultType = WidgetType.groupwidget; if (m_principalTypeSelect.getValue().equals(I_CmsPrincipal.PRINCIPAL_USER)) { defaultType = WidgetType.userwidget; } dialog = new CmsPrincipalSelectDialog( this, m_ou == null ? A_CmsUI.getCmsObject().getRequestContext().getOuFqn() : m_ou, m_window, m_widgetType, m_realOnly, defaultType, m_includeWebOus); dialog.setOuComboBoxEnabled(m_ouChangeEnabled); m_window.setCaption( CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_PRINCIPALSELECTION_LIST_ACTION_SELECT_NAME_0)); m_window.setContent(dialog); A_CmsUI.get().addWindow(m_window); } }
public class class_name { void openPrincipalSelect() { CmsPrincipalSelectDialog dialog; m_window = CmsBasicDialog.prepareWindow(DialogWidth.max); WidgetType defaultType = WidgetType.groupwidget; if (m_principalTypeSelect.getValue().equals(I_CmsPrincipal.PRINCIPAL_USER)) { defaultType = WidgetType.userwidget; // depends on control dependency: [if], data = [none] } dialog = new CmsPrincipalSelectDialog( this, m_ou == null ? A_CmsUI.getCmsObject().getRequestContext().getOuFqn() : m_ou, m_window, m_widgetType, m_realOnly, defaultType, m_includeWebOus); dialog.setOuComboBoxEnabled(m_ouChangeEnabled); m_window.setCaption( CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_PRINCIPALSELECTION_LIST_ACTION_SELECT_NAME_0)); m_window.setContent(dialog); A_CmsUI.get().addWindow(m_window); } }
public class class_name { @Override public final AbstractGauge init(final int WIDTH, final int HEIGHT) { if (WIDTH <= 1 || HEIGHT <= 1) { return this; } if (isLcdVisible()) { if (isDigitalFont()) { setLcdValueFont(getModel().getDigitalBaseFont().deriveFont(0.7f * WIDTH * 0.15f)); } else { setLcdValueFont(getModel().getStandardBaseFont().deriveFont(0.625f * WIDTH * 0.15f)); } if (isCustomLcdUnitFontEnabled()) { setLcdUnitFont(getCustomLcdUnitFont().deriveFont(0.25f * WIDTH * 0.15f)); } else { setLcdUnitFont(getModel().getStandardBaseFont().deriveFont(0.25f * WIDTH * 0.15f)); } setLcdInfoFont(getModel().getStandardInfoFont().deriveFont(0.15f * WIDTH * 0.15f)); } // Create Background Image if (bImage != null) { bImage.flush(); } bImage = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT); // Create Foreground Image if (fImage != null) { fImage.flush(); } fImage = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT); if (isFrameVisible()) { switch (getFrameType()) { case ROUND: FRAME_FACTORY.createRadialFrame(WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage); break; case SQUARE: FRAME_FACTORY.createLinearFrame(WIDTH, WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage); break; default: FRAME_FACTORY.createRadialFrame(WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage); break; } } if (isBackgroundVisible()) { create_BACKGROUND_Image(WIDTH, "", "", bImage); } if (isForegroundVisible()) { switch (getFrameType()) { case SQUARE: FOREGROUND_FACTORY.createLinearForeground(WIDTH, WIDTH, false, bImage); break; case ROUND: default: FOREGROUND_FACTORY.createRadialForeground(WIDTH, false, getForegroundType(), fImage); break; } } if (isLcdVisible()) { createLcdImage(new Rectangle2D.Double(((getGaugeBounds().width - WIDTH * 0.48) / 2.0), (getGaugeBounds().height * 0.425), (WIDTH * 0.48), (WIDTH * 0.15)), getLcdColor(), getCustomLcdBackground(), bImage); LCD.setRect(((getGaugeBounds().width - WIDTH * 0.4) / 2.0), (getGaugeBounds().height * 0.55), WIDTH * 0.48, WIDTH * 0.15); // Create the lcd threshold indicator image if (lcdThresholdImage != null) { lcdThresholdImage.flush(); } lcdThresholdImage = create_LCD_THRESHOLD_Image((int) (LCD.getHeight() * 0.2045454545), (int) (LCD.getHeight() * 0.2045454545), getLcdColor().TEXT_COLOR); } if (disabledImage != null) { disabledImage.flush(); } disabledImage = create_DISABLED_Image(WIDTH); ledPosition = new java.awt.Point[]{ // LED 1 new java.awt.Point((int) (WIDTH * 0.186915887850467), (int) (WIDTH * 0.649532710280374)), // LED 2 new java.awt.Point((int) (WIDTH * 0.116822429906542), (int) (WIDTH * 0.546728971962617)), // LED 3 new java.awt.Point((int) (WIDTH * 0.088785046728972), (int) (WIDTH * 0.41588785046729)), // LED 4 new java.awt.Point((int) (WIDTH * 0.116822429906542), (int) (WIDTH * 0.285046728971963)), // LED 5 new java.awt.Point((int) (WIDTH * 0.177570093457944), (int) (WIDTH * 0.182242990654206)), // LED 6 new java.awt.Point((int) (WIDTH * 0.280373831775701), (int) (WIDTH * 0.117222429906542)), // LED 7 new java.awt.Point((int) (WIDTH * 0.411214953271028), (int) (WIDTH * 0.0794392523364486)), // LED 8 new java.awt.Point((int) (WIDTH * 0.542056074766355), (int) (WIDTH * 0.117222429906542)), // LED 9 new java.awt.Point((int) (WIDTH * 0.649532710280374), (int) (WIDTH * 0.182242990654206)), // LED 10 new java.awt.Point((int) (WIDTH * 0.719626168224299), (int) (WIDTH * 0.285046728971963)), // LED 11 new java.awt.Point((int) (WIDTH * 0.738317757009346), (int) (WIDTH * 0.41588785046729)), // LED 12 new java.awt.Point((int) (WIDTH * 0.710280373831776), (int) (WIDTH * 0.546728971962617)), // LED 13 new java.awt.Point((int) (WIDTH * 0.64018691588785), (int) (WIDTH * 0.649532710280374)) }; ledGreenOff.flush(); ledGreenOff = create_LED_OFF_Image(WIDTH, LedColor.GREEN); ledYellowOff.flush(); ledYellowOff = create_LED_OFF_Image(WIDTH, LedColor.YELLOW); ledRedOff.flush(); ledRedOff = create_LED_OFF_Image(WIDTH, LedColor.RED); ledGreenOn.flush(); ledGreenOn = create_LED_ON_Image(WIDTH, LedColor.GREEN); ledYellowOn.flush(); ledYellowOn = create_LED_ON_Image(WIDTH, LedColor.YELLOW); ledRedOn.flush(); ledRedOn = create_LED_ON_Image(WIDTH, LedColor.RED); return this; } }
public class class_name { @Override public final AbstractGauge init(final int WIDTH, final int HEIGHT) { if (WIDTH <= 1 || HEIGHT <= 1) { return this; // depends on control dependency: [if], data = [none] } if (isLcdVisible()) { if (isDigitalFont()) { setLcdValueFont(getModel().getDigitalBaseFont().deriveFont(0.7f * WIDTH * 0.15f)); // depends on control dependency: [if], data = [none] } else { setLcdValueFont(getModel().getStandardBaseFont().deriveFont(0.625f * WIDTH * 0.15f)); // depends on control dependency: [if], data = [none] } if (isCustomLcdUnitFontEnabled()) { setLcdUnitFont(getCustomLcdUnitFont().deriveFont(0.25f * WIDTH * 0.15f)); // depends on control dependency: [if], data = [none] } else { setLcdUnitFont(getModel().getStandardBaseFont().deriveFont(0.25f * WIDTH * 0.15f)); // depends on control dependency: [if], data = [none] } setLcdInfoFont(getModel().getStandardInfoFont().deriveFont(0.15f * WIDTH * 0.15f)); // depends on control dependency: [if], data = [none] } // Create Background Image if (bImage != null) { bImage.flush(); // depends on control dependency: [if], data = [none] } bImage = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT); // Create Foreground Image if (fImage != null) { fImage.flush(); // depends on control dependency: [if], data = [none] } fImage = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT); if (isFrameVisible()) { switch (getFrameType()) { case ROUND: FRAME_FACTORY.createRadialFrame(WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage); break; case SQUARE: FRAME_FACTORY.createLinearFrame(WIDTH, WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage); break; default: FRAME_FACTORY.createRadialFrame(WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage); break; } } if (isBackgroundVisible()) { create_BACKGROUND_Image(WIDTH, "", "", bImage); // depends on control dependency: [if], data = [none] } if (isForegroundVisible()) { switch (getFrameType()) { case SQUARE: FOREGROUND_FACTORY.createLinearForeground(WIDTH, WIDTH, false, bImage); break; case ROUND: default: FOREGROUND_FACTORY.createRadialForeground(WIDTH, false, getForegroundType(), fImage); break; } } if (isLcdVisible()) { createLcdImage(new Rectangle2D.Double(((getGaugeBounds().width - WIDTH * 0.48) / 2.0), (getGaugeBounds().height * 0.425), (WIDTH * 0.48), (WIDTH * 0.15)), getLcdColor(), getCustomLcdBackground(), bImage); // depends on control dependency: [if], data = [none] LCD.setRect(((getGaugeBounds().width - WIDTH * 0.4) / 2.0), (getGaugeBounds().height * 0.55), WIDTH * 0.48, WIDTH * 0.15); // depends on control dependency: [if], data = [none] // Create the lcd threshold indicator image if (lcdThresholdImage != null) { lcdThresholdImage.flush(); // depends on control dependency: [if], data = [none] } lcdThresholdImage = create_LCD_THRESHOLD_Image((int) (LCD.getHeight() * 0.2045454545), (int) (LCD.getHeight() * 0.2045454545), getLcdColor().TEXT_COLOR); // depends on control dependency: [if], data = [none] } if (disabledImage != null) { disabledImage.flush(); // depends on control dependency: [if], data = [none] } disabledImage = create_DISABLED_Image(WIDTH); ledPosition = new java.awt.Point[]{ // LED 1 new java.awt.Point((int) (WIDTH * 0.186915887850467), (int) (WIDTH * 0.649532710280374)), // LED 2 new java.awt.Point((int) (WIDTH * 0.116822429906542), (int) (WIDTH * 0.546728971962617)), // LED 3 new java.awt.Point((int) (WIDTH * 0.088785046728972), (int) (WIDTH * 0.41588785046729)), // LED 4 new java.awt.Point((int) (WIDTH * 0.116822429906542), (int) (WIDTH * 0.285046728971963)), // LED 5 new java.awt.Point((int) (WIDTH * 0.177570093457944), (int) (WIDTH * 0.182242990654206)), // LED 6 new java.awt.Point((int) (WIDTH * 0.280373831775701), (int) (WIDTH * 0.117222429906542)), // LED 7 new java.awt.Point((int) (WIDTH * 0.411214953271028), (int) (WIDTH * 0.0794392523364486)), // LED 8 new java.awt.Point((int) (WIDTH * 0.542056074766355), (int) (WIDTH * 0.117222429906542)), // LED 9 new java.awt.Point((int) (WIDTH * 0.649532710280374), (int) (WIDTH * 0.182242990654206)), // LED 10 new java.awt.Point((int) (WIDTH * 0.719626168224299), (int) (WIDTH * 0.285046728971963)), // LED 11 new java.awt.Point((int) (WIDTH * 0.738317757009346), (int) (WIDTH * 0.41588785046729)), // LED 12 new java.awt.Point((int) (WIDTH * 0.710280373831776), (int) (WIDTH * 0.546728971962617)), // LED 13 new java.awt.Point((int) (WIDTH * 0.64018691588785), (int) (WIDTH * 0.649532710280374)) }; ledGreenOff.flush(); ledGreenOff = create_LED_OFF_Image(WIDTH, LedColor.GREEN); ledYellowOff.flush(); ledYellowOff = create_LED_OFF_Image(WIDTH, LedColor.YELLOW); ledRedOff.flush(); ledRedOff = create_LED_OFF_Image(WIDTH, LedColor.RED); ledGreenOn.flush(); ledGreenOn = create_LED_ON_Image(WIDTH, LedColor.GREEN); ledYellowOn.flush(); ledYellowOn = create_LED_ON_Image(WIDTH, LedColor.YELLOW); ledRedOn.flush(); ledRedOn = create_LED_ON_Image(WIDTH, LedColor.RED); return this; } }
public class class_name { @RequestMapping(value = "changelog/{uuid}/files", method = RequestMethod.GET) public GitChangeLogFiles changeLogFiles(@PathVariable String uuid) { // Gets the change log GitChangeLog changeLog = getChangeLog(uuid); // Cached? GitChangeLogFiles files = changeLog.getFiles(); if (files != null) { return files; } // Loads the files files = gitService.getChangeLogFiles(changeLog); // Stores in cache logCache.put(uuid, changeLog.withFiles(files)); // OK return files; } }
public class class_name { @RequestMapping(value = "changelog/{uuid}/files", method = RequestMethod.GET) public GitChangeLogFiles changeLogFiles(@PathVariable String uuid) { // Gets the change log GitChangeLog changeLog = getChangeLog(uuid); // Cached? GitChangeLogFiles files = changeLog.getFiles(); if (files != null) { return files; // depends on control dependency: [if], data = [none] } // Loads the files files = gitService.getChangeLogFiles(changeLog); // Stores in cache logCache.put(uuid, changeLog.withFiles(files)); // OK return files; } }
public class class_name { public GridNode goDownstreamSP() { Direction[] orderedDirs = Direction.getOrderedDirs(); double maxSlope = Double.NEGATIVE_INFINITY; GridNode nextNode = null; for( Direction direction : orderedDirs ) { int newCol = col + direction.col; int newRow = row + direction.row; if (isInRaster(newCol, newRow)) { GridNode node = new GridNode(gridIter, cols, rows, xRes, yRes, newCol, newRow); if (node.isValid()) { double slopeTo = getSlopeTo(node); if (slopeTo > 0 && slopeTo > maxSlope) { nextNode = node; maxSlope = slopeTo; } } } } if (nextNode == null && !isPit) { isOutlet = true; } return nextNode; } }
public class class_name { public GridNode goDownstreamSP() { Direction[] orderedDirs = Direction.getOrderedDirs(); double maxSlope = Double.NEGATIVE_INFINITY; GridNode nextNode = null; for( Direction direction : orderedDirs ) { int newCol = col + direction.col; int newRow = row + direction.row; if (isInRaster(newCol, newRow)) { GridNode node = new GridNode(gridIter, cols, rows, xRes, yRes, newCol, newRow); if (node.isValid()) { double slopeTo = getSlopeTo(node); if (slopeTo > 0 && slopeTo > maxSlope) { nextNode = node; // depends on control dependency: [if], data = [none] maxSlope = slopeTo; // depends on control dependency: [if], data = [none] } } } } if (nextNode == null && !isPit) { isOutlet = true; // depends on control dependency: [if], data = [none] } return nextNode; } }
public class class_name { @Override public Publisher<PropertySource> getPropertySources(Environment environment) { if (!awsParameterStoreConfiguration.isEnabled()) { return Flowable.empty(); } Set<String> activeNames = environment.getActiveNames(); Optional<String> serviceId = Optional.ofNullable(this.serviceId); String path = awsParameterStoreConfiguration.getRootHierarchyPath(); if (!path.endsWith("/")) { path += "/"; } String pathPrefix = path.substring(1); String commonConfigPath = path + Environment.DEFAULT_NAME; String commonPrefix = commonConfigPath.substring(1); final boolean hasApplicationSpecificConfig = serviceId.isPresent(); String applicationSpecificPath = hasApplicationSpecificConfig ? path + serviceId.get() : null; String applicationPrefix = hasApplicationSpecificConfig ? applicationSpecificPath.substring(1) : null; Flowable<ParametersWithBasePath> configurationValues = Flowable.fromPublisher(getParametersRecursive(commonConfigPath)); if (hasApplicationSpecificConfig) { configurationValues = Flowable.concat( configurationValues, Flowable.fromPublisher(getParametersRecursive(applicationSpecificPath))); } if (activeNames != null && activeNames.size() > 0) { // look for the environment configs since we can't wildcard partial paths on aws for (String activeName : activeNames) { String environmentSpecificPath = commonConfigPath + "_" + activeName; configurationValues = Flowable.concat( configurationValues, Flowable.fromPublisher(getParametersRecursive(environmentSpecificPath))); if (applicationSpecificPath != null) { String appEnvironmentSpecificPath = applicationSpecificPath + "_" + activeName; configurationValues = Flowable.concat( configurationValues, Flowable.fromPublisher(getParametersRecursive(appEnvironmentSpecificPath))); } } } final Map<String, Map<String, Object>> propertySources = new HashMap<>(); final Flowable<ParametersWithBasePath> parameterFlowable = configurationValues; Flowable<PropertySource> propertySourceFlowable = Flowable.create(emitter -> { parameterFlowable.subscribe( parametersWithBasePath -> { if (parametersWithBasePath.parameters.isEmpty()) { return; } String key = parametersWithBasePath.basePath; boolean isCommonConfigKey = key.substring(1).startsWith(commonPrefix); boolean isApplicationSpecificConfigKey = hasApplicationSpecificConfig && key.substring(1).startsWith(applicationPrefix); boolean validKey = isCommonConfigKey || isApplicationSpecificConfigKey; if (validKey) { String fullName = key.substring(pathPrefix.length() + 1); Set<String> propertySourceNames = calcPropertySourceNames(fullName, activeNames); Map<String, Object> properties = convertParametersToMap(parametersWithBasePath); for (String propertySourceName : propertySourceNames) { Map<String, Object> values = propertySources.computeIfAbsent(propertySourceName, s -> new LinkedHashMap<>()); values.putAll(properties); } } }, emitter::onError, () -> { for (Map.Entry<String, Map<String, Object>> entry : propertySources.entrySet()) { String name = entry.getKey(); int priority = EnvironmentPropertySource.POSITION + (name.endsWith("]") ? PRIORITY_TOP : PRIORITY_DOWN); if (hasApplicationSpecificConfig && name.startsWith(serviceId.get())) { priority += PRIORITY_INCREMENT; } emitter.onNext(PropertySource.of(Route53ClientDiscoveryConfiguration.SERVICE_ID + '-' + name, entry.getValue(), priority)); } emitter.onComplete(); }); }, BackpressureStrategy.ERROR); propertySourceFlowable = propertySourceFlowable.onErrorResumeNext(AWSParameterStoreConfigClient::onPropertySourceError); if (executionService != null) { return propertySourceFlowable.subscribeOn(io.reactivex.schedulers.Schedulers.from( executionService )); } else { return propertySourceFlowable; } } }
public class class_name { @Override public Publisher<PropertySource> getPropertySources(Environment environment) { if (!awsParameterStoreConfiguration.isEnabled()) { return Flowable.empty(); // depends on control dependency: [if], data = [none] } Set<String> activeNames = environment.getActiveNames(); Optional<String> serviceId = Optional.ofNullable(this.serviceId); String path = awsParameterStoreConfiguration.getRootHierarchyPath(); if (!path.endsWith("/")) { path += "/"; // depends on control dependency: [if], data = [none] } String pathPrefix = path.substring(1); String commonConfigPath = path + Environment.DEFAULT_NAME; String commonPrefix = commonConfigPath.substring(1); final boolean hasApplicationSpecificConfig = serviceId.isPresent(); String applicationSpecificPath = hasApplicationSpecificConfig ? path + serviceId.get() : null; String applicationPrefix = hasApplicationSpecificConfig ? applicationSpecificPath.substring(1) : null; Flowable<ParametersWithBasePath> configurationValues = Flowable.fromPublisher(getParametersRecursive(commonConfigPath)); if (hasApplicationSpecificConfig) { configurationValues = Flowable.concat( configurationValues, Flowable.fromPublisher(getParametersRecursive(applicationSpecificPath))); // depends on control dependency: [if], data = [none] } if (activeNames != null && activeNames.size() > 0) { // look for the environment configs since we can't wildcard partial paths on aws for (String activeName : activeNames) { String environmentSpecificPath = commonConfigPath + "_" + activeName; configurationValues = Flowable.concat( configurationValues, Flowable.fromPublisher(getParametersRecursive(environmentSpecificPath))); // depends on control dependency: [for], data = [none] if (applicationSpecificPath != null) { String appEnvironmentSpecificPath = applicationSpecificPath + "_" + activeName; configurationValues = Flowable.concat( configurationValues, Flowable.fromPublisher(getParametersRecursive(appEnvironmentSpecificPath))); // depends on control dependency: [if], data = [none] } } } final Map<String, Map<String, Object>> propertySources = new HashMap<>(); final Flowable<ParametersWithBasePath> parameterFlowable = configurationValues; Flowable<PropertySource> propertySourceFlowable = Flowable.create(emitter -> { parameterFlowable.subscribe( parametersWithBasePath -> { if (parametersWithBasePath.parameters.isEmpty()) { return; } String key = parametersWithBasePath.basePath; boolean isCommonConfigKey = key.substring(1).startsWith(commonPrefix); boolean isApplicationSpecificConfigKey = hasApplicationSpecificConfig && key.substring(1).startsWith(applicationPrefix); boolean validKey = isCommonConfigKey || isApplicationSpecificConfigKey; if (validKey) { String fullName = key.substring(pathPrefix.length() + 1); Set<String> propertySourceNames = calcPropertySourceNames(fullName, activeNames); Map<String, Object> properties = convertParametersToMap(parametersWithBasePath); for (String propertySourceName : propertySourceNames) { Map<String, Object> values = propertySources.computeIfAbsent(propertySourceName, s -> new LinkedHashMap<>()); values.putAll(properties); } } }, emitter::onError, () -> { for (Map.Entry<String, Map<String, Object>> entry : propertySources.entrySet()) { String name = entry.getKey(); int priority = EnvironmentPropertySource.POSITION + (name.endsWith("]") ? PRIORITY_TOP : PRIORITY_DOWN); if (hasApplicationSpecificConfig && name.startsWith(serviceId.get())) { priority += PRIORITY_INCREMENT; // depends on control dependency: [if], data = [none] } emitter.onNext(PropertySource.of(Route53ClientDiscoveryConfiguration.SERVICE_ID + '-' + name, entry.getValue(), priority)); } emitter.onComplete(); }); }, BackpressureStrategy.ERROR); propertySourceFlowable = propertySourceFlowable.onErrorResumeNext(AWSParameterStoreConfigClient::onPropertySourceError); if (executionService != null) { return propertySourceFlowable.subscribeOn(io.reactivex.schedulers.Schedulers.from( executionService )); } else { return propertySourceFlowable; } } }
public class class_name { private void publishEndedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED, correlationId); } } }
public class class_name { private void publishEndedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED, correlationId); // depends on control dependency: [if], data = [none] } } }
public class class_name { static void dumpAll(Printer printer, boolean verbose) { for (SQLiteDatabase db : getActiveDatabases()) { db.dump(printer, verbose); } } }
public class class_name { static void dumpAll(Printer printer, boolean verbose) { for (SQLiteDatabase db : getActiveDatabases()) { db.dump(printer, verbose); // depends on control dependency: [for], data = [db] } } }
public class class_name { private static Throwable getThrowable(final RuntimeErrorProto error) { final byte[] data = getData(error); if (data != null) { try { return CODEC.decode(data); } catch (final RemoteRuntimeException ex) { LOG.log(Level.FINE, "Could not decode exception {0}: {1}", new Object[]{error, ex}); } } return null; } }
public class class_name { private static Throwable getThrowable(final RuntimeErrorProto error) { final byte[] data = getData(error); if (data != null) { try { return CODEC.decode(data); // depends on control dependency: [try], data = [none] } catch (final RemoteRuntimeException ex) { LOG.log(Level.FINE, "Could not decode exception {0}: {1}", new Object[]{error, ex}); } // depends on control dependency: [catch], data = [none] } return null; } }
public class class_name { public static List<LauncherConfig> imports(Configurer configurer) { Check.notNull(configurer); final Collection<Xml> children = configurer.getRoot().getChildren(NODE_LAUNCHER); final List<LauncherConfig> launchers = new ArrayList<>(children.size()); for (final Xml launcher : children) { launchers.add(imports(launcher)); } return launchers; } }
public class class_name { public static List<LauncherConfig> imports(Configurer configurer) { Check.notNull(configurer); final Collection<Xml> children = configurer.getRoot().getChildren(NODE_LAUNCHER); final List<LauncherConfig> launchers = new ArrayList<>(children.size()); for (final Xml launcher : children) { launchers.add(imports(launcher)); // depends on control dependency: [for], data = [launcher] } return launchers; } }
public class class_name { public void writeToIndex(PrintWriter out) { out.println(StormEnvironment.BEGIN_DATABASE); Map<String,String> dbMap = new HashMap<String,String>(); dbMap.put("dbName", this.getDbName()); dbMap.put("dbVersion", String.valueOf(this.getDbVersion())); dbMap.put("helperClass", this.getQualifiedClassName()); String dbInfo = CsvUtils .mapToCsv(dbMap); out.println(dbInfo); // write TableHelpers for (String th: this.tableHelpers) { out.println(th); } out.println(StormEnvironment.END_DATABASE); } }
public class class_name { public void writeToIndex(PrintWriter out) { out.println(StormEnvironment.BEGIN_DATABASE); Map<String,String> dbMap = new HashMap<String,String>(); dbMap.put("dbName", this.getDbName()); dbMap.put("dbVersion", String.valueOf(this.getDbVersion())); dbMap.put("helperClass", this.getQualifiedClassName()); String dbInfo = CsvUtils .mapToCsv(dbMap); out.println(dbInfo); // write TableHelpers for (String th: this.tableHelpers) { out.println(th); // depends on control dependency: [for], data = [th] } out.println(StormEnvironment.END_DATABASE); } }
public class class_name { public static final int readAll(ReadableByteChannel ch, ByteBuffer dst) throws IOException { int count = 0; while (dst.hasRemaining()) { int rc = ch.read(dst); if (rc == -1) { if (count > 0) { return count; } return -1; } count += rc; } return count; } }
public class class_name { public static final int readAll(ReadableByteChannel ch, ByteBuffer dst) throws IOException { int count = 0; while (dst.hasRemaining()) { int rc = ch.read(dst); if (rc == -1) { if (count > 0) { return count; // depends on control dependency: [if], data = [none] } return -1; } count += rc; } return count; } }
public class class_name { public static base_responses add(nitro_service client, nspbr resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr addresources[] = new nspbr[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new nspbr(); addresources[i].name = resources[i].name; addresources[i].action = resources[i].action; addresources[i].td = resources[i].td; addresources[i].srcip = resources[i].srcip; addresources[i].srcipop = resources[i].srcipop; addresources[i].srcipval = resources[i].srcipval; addresources[i].srcport = resources[i].srcport; addresources[i].srcportop = resources[i].srcportop; addresources[i].srcportval = resources[i].srcportval; addresources[i].destip = resources[i].destip; addresources[i].destipop = resources[i].destipop; addresources[i].destipval = resources[i].destipval; addresources[i].destport = resources[i].destport; addresources[i].destportop = resources[i].destportop; addresources[i].destportval = resources[i].destportval; addresources[i].nexthop = resources[i].nexthop; addresources[i].nexthopval = resources[i].nexthopval; addresources[i].iptunnel = resources[i].iptunnel; addresources[i].iptunnelname = resources[i].iptunnelname; addresources[i].srcmac = resources[i].srcmac; addresources[i].protocol = resources[i].protocol; addresources[i].protocolnumber = resources[i].protocolnumber; addresources[i].vlan = resources[i].vlan; addresources[i].Interface = resources[i].Interface; addresources[i].priority = resources[i].priority; addresources[i].msr = resources[i].msr; addresources[i].monitor = resources[i].monitor; addresources[i].state = resources[i].state; } result = add_bulk_request(client, addresources); } return result; } }
public class class_name { public static base_responses add(nitro_service client, nspbr resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr addresources[] = new nspbr[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new nspbr(); // depends on control dependency: [for], data = [i] addresources[i].name = resources[i].name; // depends on control dependency: [for], data = [i] addresources[i].action = resources[i].action; // depends on control dependency: [for], data = [i] addresources[i].td = resources[i].td; // depends on control dependency: [for], data = [i] addresources[i].srcip = resources[i].srcip; // depends on control dependency: [for], data = [i] addresources[i].srcipop = resources[i].srcipop; // depends on control dependency: [for], data = [i] addresources[i].srcipval = resources[i].srcipval; // depends on control dependency: [for], data = [i] addresources[i].srcport = resources[i].srcport; // depends on control dependency: [for], data = [i] addresources[i].srcportop = resources[i].srcportop; // depends on control dependency: [for], data = [i] addresources[i].srcportval = resources[i].srcportval; // depends on control dependency: [for], data = [i] addresources[i].destip = resources[i].destip; // depends on control dependency: [for], data = [i] addresources[i].destipop = resources[i].destipop; // depends on control dependency: [for], data = [i] addresources[i].destipval = resources[i].destipval; // depends on control dependency: [for], data = [i] addresources[i].destport = resources[i].destport; // depends on control dependency: [for], data = [i] addresources[i].destportop = resources[i].destportop; // depends on control dependency: [for], data = [i] addresources[i].destportval = resources[i].destportval; // depends on control dependency: [for], data = [i] addresources[i].nexthop = resources[i].nexthop; // depends on control dependency: [for], data = [i] addresources[i].nexthopval = resources[i].nexthopval; // depends on control dependency: [for], data = [i] addresources[i].iptunnel = resources[i].iptunnel; // depends on control dependency: [for], data = [i] addresources[i].iptunnelname = resources[i].iptunnelname; // depends on control dependency: [for], data = [i] addresources[i].srcmac = resources[i].srcmac; // depends on control dependency: [for], data = [i] addresources[i].protocol = resources[i].protocol; // depends on control dependency: [for], data = [i] addresources[i].protocolnumber = resources[i].protocolnumber; // depends on control dependency: [for], data = [i] addresources[i].vlan = resources[i].vlan; // depends on control dependency: [for], data = [i] addresources[i].Interface = resources[i].Interface; // depends on control dependency: [for], data = [i] addresources[i].priority = resources[i].priority; // depends on control dependency: [for], data = [i] addresources[i].msr = resources[i].msr; // depends on control dependency: [for], data = [i] addresources[i].monitor = resources[i].monitor; // depends on control dependency: [for], data = [i] addresources[i].state = resources[i].state; // depends on control dependency: [for], data = [i] } result = add_bulk_request(client, addresources); } return result; } }
public class class_name { @Override public void addHeader(String name, String value) { if (isSuspended()) { return; } if (CmsRequestUtil.HEADER_CONTENT_TYPE.equalsIgnoreCase(name)) { setContentType(value); return; } if (m_cachingRequired && !m_includeMode) { addHeaderList(m_bufferHeaders, name, value); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXRESPONSE_ADDING_HEADER_TO_ELEMENT_BUFFER_2, name, value)); } } if (m_writeOnlyToBuffer) { addHeaderList(m_headers, name, value); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_FLEXRESPONSE_ADDING_HEADER_TO_HEADERS_2, name, value)); } } else { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXRESPONSE_ADDING_HEADER_TO_PARENT_RESPONSE_2, name, value)); } m_res.addHeader(name, value); } } }
public class class_name { @Override public void addHeader(String name, String value) { if (isSuspended()) { return; // depends on control dependency: [if], data = [none] } if (CmsRequestUtil.HEADER_CONTENT_TYPE.equalsIgnoreCase(name)) { setContentType(value); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (m_cachingRequired && !m_includeMode) { addHeaderList(m_bufferHeaders, name, value); // depends on control dependency: [if], data = [none] if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXRESPONSE_ADDING_HEADER_TO_ELEMENT_BUFFER_2, name, value)); // depends on control dependency: [if], data = [none] } } if (m_writeOnlyToBuffer) { addHeaderList(m_headers, name, value); // depends on control dependency: [if], data = [none] if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_FLEXRESPONSE_ADDING_HEADER_TO_HEADERS_2, name, value)); // depends on control dependency: [if], data = [none] } } else { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXRESPONSE_ADDING_HEADER_TO_PARENT_RESPONSE_2, name, value)); // depends on control dependency: [if], data = [none] } m_res.addHeader(name, value); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setDates(SortedSet<Date> dates) { if (!m_model.getIndividualDates().equals(dates)) { m_model.setIndividualDates(dates); onValueChange(); } } }
public class class_name { public void setDates(SortedSet<Date> dates) { if (!m_model.getIndividualDates().equals(dates)) { m_model.setIndividualDates(dates); // depends on control dependency: [if], data = [none] onValueChange(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String implodeObjects(Iterable<?> objects) { StringBuilder builder = new StringBuilder(); boolean first = true; for (Object o : objects) { if (first) { first = false; } else { builder.append("|"); } builder.append(o.toString()); } return builder.toString(); } }
public class class_name { public static String implodeObjects(Iterable<?> objects) { StringBuilder builder = new StringBuilder(); boolean first = true; for (Object o : objects) { if (first) { first = false; // depends on control dependency: [if], data = [none] } else { builder.append("|"); // depends on control dependency: [if], data = [none] } builder.append(o.toString()); // depends on control dependency: [for], data = [o] } return builder.toString(); } }
public class class_name { public void setViolators(java.util.Collection<ComplianceViolator> violators) { if (violators == null) { this.violators = null; return; } this.violators = new java.util.ArrayList<ComplianceViolator>(violators); } }
public class class_name { public void setViolators(java.util.Collection<ComplianceViolator> violators) { if (violators == null) { this.violators = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.violators = new java.util.ArrayList<ComplianceViolator>(violators); } }
public class class_name { public void setParties(java.util.Collection<HandshakeParty> parties) { if (parties == null) { this.parties = null; return; } this.parties = new java.util.ArrayList<HandshakeParty>(parties); } }
public class class_name { public void setParties(java.util.Collection<HandshakeParty> parties) { if (parties == null) { this.parties = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.parties = new java.util.ArrayList<HandshakeParty>(parties); } }
public class class_name { public void interrupt() { Thread t = threadVar.get(); if (t != null) { t.interrupt(); } threadVar.clear(); } }
public class class_name { public void interrupt() { Thread t = threadVar.get(); if (t != null) { t.interrupt(); // depends on control dependency: [if], data = [none] } threadVar.clear(); } }
public class class_name { private void writeVersion(VectorClock newClock) { File versionFile = getVersionFile(); try { if(!versionFile.exists() || versionFile.delete()) { String hexCode = new String(Hex.encodeHex(newClock.toBytes())); FileUtils.writeStringToFile(versionFile, hexCode, "UTF-8"); this.cachedVersion = newClock; } } catch(Exception e) { throw new VoldemortException("Failed to write Version for the current file :" + getName(), e); } } }
public class class_name { private void writeVersion(VectorClock newClock) { File versionFile = getVersionFile(); try { if(!versionFile.exists() || versionFile.delete()) { String hexCode = new String(Hex.encodeHex(newClock.toBytes())); FileUtils.writeStringToFile(versionFile, hexCode, "UTF-8"); // depends on control dependency: [if], data = [none] this.cachedVersion = newClock; // depends on control dependency: [if], data = [none] } } catch(Exception e) { throw new VoldemortException("Failed to write Version for the current file :" + getName(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setShrinkToFit() { if(cell.getCellStyle().getShrinkToFit()) { // 既に有効な場合 return; } cloneStyle(); cell.getCellStyle().setWrapText(false); cell.getCellStyle().setShrinkToFit(true); } }
public class class_name { public void setShrinkToFit() { if(cell.getCellStyle().getShrinkToFit()) { // 既に有効な場合 return; // depends on control dependency: [if], data = [none] } cloneStyle(); cell.getCellStyle().setWrapText(false); cell.getCellStyle().setShrinkToFit(true); } }
public class class_name { public int getIntValueFromPropertyOrDefault(String propertyName, int defaultValue) { int value = defaultValue; String valueEnv = System.getenv(propertyName); String valueSys = System.getProperty(propertyName); try { if (valueSys != null) { value = Integer.parseInt(valueSys); } else if (valueEnv != null) { value = Integer.parseInt(valueEnv); } return value; } catch (NumberFormatException e) { log.warn("Could not parse the '" + propertyName + "' system property. Using default value: " + defaultValue); return value; } } }
public class class_name { public int getIntValueFromPropertyOrDefault(String propertyName, int defaultValue) { int value = defaultValue; String valueEnv = System.getenv(propertyName); String valueSys = System.getProperty(propertyName); try { if (valueSys != null) { value = Integer.parseInt(valueSys); // depends on control dependency: [if], data = [(valueSys] } else if (valueEnv != null) { value = Integer.parseInt(valueEnv); // depends on control dependency: [if], data = [(valueEnv] } return value; // depends on control dependency: [try], data = [none] } catch (NumberFormatException e) { log.warn("Could not parse the '" + propertyName + "' system property. Using default value: " + defaultValue); return value; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static Image getClipboardImage() { Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); try { return (Image) clipboard.getData(DataFlavor.imageFlavor); } catch (Exception e) { return null; } } }
public class class_name { public static Image getClipboardImage() { Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); try { return (Image) clipboard.getData(DataFlavor.imageFlavor); // depends on control dependency: [try], data = [none] } catch (Exception e) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static void assemble( File moduleRoot, String moduleName, File srcOutputRoot, String factoryName, Map<String,String> controlTypeToImpl, Map<String,Set<String>> controlTypeToClients, ClassLoader cl ) throws ControlAssemblyException, IOException { if ( !moduleRoot.exists() || !srcOutputRoot.exists() ) throw new IOException( "Directories " + moduleRoot + " or " + srcOutputRoot + " don't exist!"); if ( factoryName == null ) throw new ControlAssemblyException( "Missing context factory names" ); if ( cl == null ) throw new ControlAssemblyException( "Must specify a classloader" ); ClassLoader origCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( cl ); try { // Create the requested ControlAssemblyContext.Factory Class factoryClass = cl.loadClass( factoryName ); ControlAssemblyContext.Factory factory = (ControlAssemblyContext.Factory)factoryClass.newInstance(); // Iterate over control types Set<String> controlTypes = controlTypeToImpl.keySet(); for ( String ct : controlTypes ) { // Search for applicable ControlAssemblers as specified on the control impls String cImpl = controlTypeToImpl.get( ct ); Class cImplClass = cl.loadClass( cImpl ); ControlImplementation a = (ControlImplementation)cImplClass.getAnnotation(ControlImplementation.class); if ( a == null ) throw new ControlAssemblyException( "Control implementation class=" + cImpl + " missing ControlImplementation annotation" ); // For each non-default ControlAssembler, create one and call it. Class<? extends ControlAssembler> assemblerClass = a.assembler(); if ( !assemblerClass.equals(DefaultControlAssembler.class) ) { ControlAssembler assembler = assemblerClass.newInstance(); Set<String> clients = controlTypeToClients.get( ct ); ControlAssemblyContext cac = factory.newInstance( cl.loadClass(ct), null, clients, moduleRoot, moduleName, srcOutputRoot ); assembler.assemble( cac ); } } } catch ( ControlAssemblyException cae ) { // just rethrow ControlAssemblyExceptions, which will typically come from user-provided assemblers. throw cae; } catch ( Throwable t ) { // Not expecting any throwables other than ControlAssemblyExceptions, so consider them as // unexpected infrastructure issues and wrap them in a CAE. throw new ControlAssemblyException( "Assembly infrastructure exception", t); } finally { Thread.currentThread().setContextClassLoader( origCL ); } } }
public class class_name { public static void assemble( File moduleRoot, String moduleName, File srcOutputRoot, String factoryName, Map<String,String> controlTypeToImpl, Map<String,Set<String>> controlTypeToClients, ClassLoader cl ) throws ControlAssemblyException, IOException { if ( !moduleRoot.exists() || !srcOutputRoot.exists() ) throw new IOException( "Directories " + moduleRoot + " or " + srcOutputRoot + " don't exist!"); if ( factoryName == null ) throw new ControlAssemblyException( "Missing context factory names" ); if ( cl == null ) throw new ControlAssemblyException( "Must specify a classloader" ); ClassLoader origCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( cl ); try { // Create the requested ControlAssemblyContext.Factory Class factoryClass = cl.loadClass( factoryName ); ControlAssemblyContext.Factory factory = (ControlAssemblyContext.Factory)factoryClass.newInstance(); // Iterate over control types Set<String> controlTypes = controlTypeToImpl.keySet(); for ( String ct : controlTypes ) { // Search for applicable ControlAssemblers as specified on the control impls String cImpl = controlTypeToImpl.get( ct ); Class cImplClass = cl.loadClass( cImpl ); // depends on control dependency: [for], data = [none] ControlImplementation a = (ControlImplementation)cImplClass.getAnnotation(ControlImplementation.class); if ( a == null ) throw new ControlAssemblyException( "Control implementation class=" + cImpl + " missing ControlImplementation annotation" ); // For each non-default ControlAssembler, create one and call it. Class<? extends ControlAssembler> assemblerClass = a.assembler(); if ( !assemblerClass.equals(DefaultControlAssembler.class) ) { ControlAssembler assembler = assemblerClass.newInstance(); Set<String> clients = controlTypeToClients.get( ct ); ControlAssemblyContext cac = factory.newInstance( cl.loadClass(ct), null, clients, moduleRoot, moduleName, srcOutputRoot ); assembler.assemble( cac ); // depends on control dependency: [if], data = [none] } } } catch ( ControlAssemblyException cae ) { // just rethrow ControlAssemblyExceptions, which will typically come from user-provided assemblers. throw cae; } catch ( Throwable t ) { // Not expecting any throwables other than ControlAssemblyExceptions, so consider them as // unexpected infrastructure issues and wrap them in a CAE. throw new ControlAssemblyException( "Assembly infrastructure exception", t); } finally { Thread.currentThread().setContextClassLoader( origCL ); } } }
public class class_name { private boolean addNodeIfNotAlreadyIncluded(T thisImport, LinkedList<T> imports, Set<T> alreadyIncludedImports) { if (alreadyIncludedImports.contains(thisImport)) { return false; } imports.add(thisImport); alreadyIncludedImports.add(thisImport); return true; } }
public class class_name { private boolean addNodeIfNotAlreadyIncluded(T thisImport, LinkedList<T> imports, Set<T> alreadyIncludedImports) { if (alreadyIncludedImports.contains(thisImport)) { return false; // depends on control dependency: [if], data = [none] } imports.add(thisImport); alreadyIncludedImports.add(thisImport); return true; } }
public class class_name { public static String getNameSpaceName(String pageTitle) { Matcher matcher = namespacePattern.matcher(pageTitle); if (matcher.find()) { // LOGGER.log(Level.INFO,pageTitle); return matcher.group(1); } return null; } }
public class class_name { public static String getNameSpaceName(String pageTitle) { Matcher matcher = namespacePattern.matcher(pageTitle); if (matcher.find()) { // LOGGER.log(Level.INFO,pageTitle); return matcher.group(1); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { static boolean isAuthenticationRelated ( final String message ) { for ( final DirectoryVendor vendor : DirectoryVendor.values() ) { final ErrorMap errorMap = vendor.getVendorFactory().getErrorMap(); if ( errorMap.isAuthenticationRelated( message ) ) { return true; } } return false; } }
public class class_name { static boolean isAuthenticationRelated ( final String message ) { for ( final DirectoryVendor vendor : DirectoryVendor.values() ) { final ErrorMap errorMap = vendor.getVendorFactory().getErrorMap(); if ( errorMap.isAuthenticationRelated( message ) ) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { private Node parseFilter() { Token token = expect(Filter.class); Filter filterToken = (Filter) token; AttributeList attr = (AttributeList) accept(AttributeList.class); lexer.setPipeless(true); Node tNode = parseTextBlock(); lexer.setPipeless(false); FilterNode node = new FilterNode(); node.setValue(filterToken.getValue()); node.setLineNumber(line()); node.setFileName(filename); if(tNode!=null) node.setTextBlock(tNode); else{ node.setTextBlock(new BlockNode()); } if (attr != null) { node.setAttributes(convertToNodeAttributes(attr)); } return node; } }
public class class_name { private Node parseFilter() { Token token = expect(Filter.class); Filter filterToken = (Filter) token; AttributeList attr = (AttributeList) accept(AttributeList.class); lexer.setPipeless(true); Node tNode = parseTextBlock(); lexer.setPipeless(false); FilterNode node = new FilterNode(); node.setValue(filterToken.getValue()); node.setLineNumber(line()); node.setFileName(filename); if(tNode!=null) node.setTextBlock(tNode); else{ node.setTextBlock(new BlockNode()); // depends on control dependency: [if], data = [none] } if (attr != null) { node.setAttributes(convertToNodeAttributes(attr)); // depends on control dependency: [if], data = [(attr] } return node; } }
public class class_name { public Packet readFrom(ByteBuffer src) { if (!headerComplete) { if (src.remaining() < HEADER_SIZE) { return null; } byte version = src.get(); if (VERSION != version) { throw new IllegalArgumentException("Packet versions are not matching! Expected -> " + VERSION + ", Incoming -> " + version); } flags = src.getChar(); partitionId = src.getInt(); size = src.getInt(); headerComplete = true; } if (readValue(src)) { Packet packet = new Packet(payload, partitionId).resetFlagsTo(flags); reset(); return packet; } else { return null; } } }
public class class_name { public Packet readFrom(ByteBuffer src) { if (!headerComplete) { if (src.remaining() < HEADER_SIZE) { return null; // depends on control dependency: [if], data = [none] } byte version = src.get(); if (VERSION != version) { throw new IllegalArgumentException("Packet versions are not matching! Expected -> " + VERSION + ", Incoming -> " + version); } flags = src.getChar(); // depends on control dependency: [if], data = [none] partitionId = src.getInt(); // depends on control dependency: [if], data = [none] size = src.getInt(); // depends on control dependency: [if], data = [none] headerComplete = true; // depends on control dependency: [if], data = [none] } if (readValue(src)) { Packet packet = new Packet(payload, partitionId).resetFlagsTo(flags); reset(); // depends on control dependency: [if], data = [none] return packet; // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static boolean registerProvider(ZoneModelProvider provider) { String name = provider.getName(); if (name.isEmpty()) { throw new IllegalArgumentException( "Missing name of zone model provider."); } else if (name.equals(NAME_TZDB)) { throw new IllegalArgumentException( "TZDB provider cannot be registered after startup."); } else if (name.equals(NAME_JUT)) { throw new IllegalArgumentException( "Platform provider cannot be replaced."); } else if (name.equals(NAME_DEFAULT)) { throw new IllegalArgumentException( "Default zone model provider cannot be overridden."); } boolean inserted = (PROVIDERS.putIfAbsent(name, provider) == null); if (inserted) { zonalKeys = new ZonalKeys(); } return inserted; } }
public class class_name { public static boolean registerProvider(ZoneModelProvider provider) { String name = provider.getName(); if (name.isEmpty()) { throw new IllegalArgumentException( "Missing name of zone model provider."); } else if (name.equals(NAME_TZDB)) { throw new IllegalArgumentException( "TZDB provider cannot be registered after startup."); } else if (name.equals(NAME_JUT)) { throw new IllegalArgumentException( "Platform provider cannot be replaced."); } else if (name.equals(NAME_DEFAULT)) { throw new IllegalArgumentException( "Default zone model provider cannot be overridden."); } boolean inserted = (PROVIDERS.putIfAbsent(name, provider) == null); if (inserted) { zonalKeys = new ZonalKeys(); // depends on control dependency: [if], data = [none] } return inserted; } }
public class class_name { public void setInstanceHealthList(java.util.Collection<SingleInstanceHealth> instanceHealthList) { if (instanceHealthList == null) { this.instanceHealthList = null; return; } this.instanceHealthList = new com.amazonaws.internal.SdkInternalList<SingleInstanceHealth>(instanceHealthList); } }
public class class_name { public void setInstanceHealthList(java.util.Collection<SingleInstanceHealth> instanceHealthList) { if (instanceHealthList == null) { this.instanceHealthList = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.instanceHealthList = new com.amazonaws.internal.SdkInternalList<SingleInstanceHealth>(instanceHealthList); } }
public class class_name { public MorphoFeatures fromTagString(String str) { List<String> feats = Arrays.asList(str.split("\\-")); MorphoFeatures mFeats = new MorphoFeatures(); for(String fPair : feats) { String[] keyValue = fPair.split(KEY_VAL_DELIM); if(keyValue.length != 2)//Manual state split annotations continue; MorphoFeatureType fName = MorphoFeatureType.valueOf(keyValue[0].trim()); mFeats.addFeature(fName, keyValue[1].trim()); } return mFeats; } }
public class class_name { public MorphoFeatures fromTagString(String str) { List<String> feats = Arrays.asList(str.split("\\-")); MorphoFeatures mFeats = new MorphoFeatures(); for(String fPair : feats) { String[] keyValue = fPair.split(KEY_VAL_DELIM); if(keyValue.length != 2)//Manual state split annotations continue; MorphoFeatureType fName = MorphoFeatureType.valueOf(keyValue[0].trim()); mFeats.addFeature(fName, keyValue[1].trim()); // depends on control dependency: [for], data = [none] } return mFeats; } }
public class class_name { synchronized byte[] getDataPtr() { if (mDataPtr == null) { mDataPtr = new byte[mDataLength]; InputStream is; try { if (isFromZip) { is = zipFile.getInputStream(zipEntry); } else { is = new FileInputStream(getFileName()); } try { readFully(is, mDataPtr); } finally { is.close(); } } catch (IOException e) { throw new RuntimeException(e); } } return mDataPtr; } }
public class class_name { synchronized byte[] getDataPtr() { if (mDataPtr == null) { mDataPtr = new byte[mDataLength]; // depends on control dependency: [if], data = [none] InputStream is; try { if (isFromZip) { is = zipFile.getInputStream(zipEntry); // depends on control dependency: [if], data = [none] } else { is = new FileInputStream(getFileName()); // depends on control dependency: [if], data = [none] } try { readFully(is, mDataPtr); // depends on control dependency: [try], data = [none] } finally { is.close(); } } catch (IOException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } return mDataPtr; } }
public class class_name { public List<Entry> getEntries() { if(_sortedEntries == null) { this._sortedEntries = Lists.newArrayListWithCapacity(entries.size()); for(Map.Entry<Term, Entry> e:entries.entrySet()) this._sortedEntries.add(e.getValue()); Collections.sort(this._sortedEntries); } return _sortedEntries; } }
public class class_name { public List<Entry> getEntries() { if(_sortedEntries == null) { this._sortedEntries = Lists.newArrayListWithCapacity(entries.size()); // depends on control dependency: [if], data = [none] for(Map.Entry<Term, Entry> e:entries.entrySet()) this._sortedEntries.add(e.getValue()); Collections.sort(this._sortedEntries); // depends on control dependency: [if], data = [none] } return _sortedEntries; } }
public class class_name { public void setPassword(String value) { try { OpenCms.getPasswordHandler().validatePassword(value); } catch (CmsSecurityException e) { throw new CmsIllegalArgumentException(e.getMessageContainer()); } m_password = value; } }
public class class_name { public void setPassword(String value) { try { OpenCms.getPasswordHandler().validatePassword(value); // depends on control dependency: [try], data = [none] } catch (CmsSecurityException e) { throw new CmsIllegalArgumentException(e.getMessageContainer()); } // depends on control dependency: [catch], data = [none] m_password = value; } }
public class class_name { public void marshall(UpdateDeviceDefinitionRequest updateDeviceDefinitionRequest, ProtocolMarshaller protocolMarshaller) { if (updateDeviceDefinitionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateDeviceDefinitionRequest.getDeviceDefinitionId(), DEVICEDEFINITIONID_BINDING); protocolMarshaller.marshall(updateDeviceDefinitionRequest.getName(), NAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateDeviceDefinitionRequest updateDeviceDefinitionRequest, ProtocolMarshaller protocolMarshaller) { if (updateDeviceDefinitionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateDeviceDefinitionRequest.getDeviceDefinitionId(), DEVICEDEFINITIONID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateDeviceDefinitionRequest.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setAtlasInformation(List<GVRAtlasInformation> atlasInformation) { if ((mImage != null) && (mImage instanceof GVRImageAtlas)) { ((GVRImageAtlas) mImage).setAtlasInformation(atlasInformation); } } }
public class class_name { public void setAtlasInformation(List<GVRAtlasInformation> atlasInformation) { if ((mImage != null) && (mImage instanceof GVRImageAtlas)) { ((GVRImageAtlas) mImage).setAtlasInformation(atlasInformation); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void run(String source, String output) { Report report = null; try { monitor.testRunning(getLocation(source, '/')); Execution execution = xmlRpcRemoteRunner.runSpecification( project, systemUnderTest, repositoryId, source, false, locale.getLanguage()); report = reportGenerator.openReport(getLocation(source, '-')); report.generate(execution); monitor.testDone(execution.getSuccess(), execution.getFailures(), execution.getErrors(), execution.getIgnored()); } catch (Throwable t) { if (report != null) { report.renderException(t); } monitor.exceptionOccured(t); } finally { closeReport(report); } } }
public class class_name { public void run(String source, String output) { Report report = null; try { monitor.testRunning(getLocation(source, '/')); // depends on control dependency: [try], data = [none] Execution execution = xmlRpcRemoteRunner.runSpecification( project, systemUnderTest, repositoryId, source, false, locale.getLanguage()); report = reportGenerator.openReport(getLocation(source, '-')); // depends on control dependency: [try], data = [none] report.generate(execution); // depends on control dependency: [try], data = [none] monitor.testDone(execution.getSuccess(), execution.getFailures(), execution.getErrors(), execution.getIgnored()); // depends on control dependency: [try], data = [none] } catch (Throwable t) { if (report != null) { report.renderException(t); // depends on control dependency: [if], data = [none] } monitor.exceptionOccured(t); } // depends on control dependency: [catch], data = [none] finally { closeReport(report); } } }
public class class_name { @Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); possibleForLoops = new HashSet<>(); super.visitClassContext(classContext); } finally { stack = null; possibleForLoops = null; } } }
public class class_name { @Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); // depends on control dependency: [try], data = [none] possibleForLoops = new HashSet<>(); // depends on control dependency: [try], data = [none] super.visitClassContext(classContext); // depends on control dependency: [try], data = [none] } finally { stack = null; possibleForLoops = null; } } }
public class class_name { public synchronized void stop(final StopContext context) { weldBootstrapServiceConsumer.accept(null); if (started) { // WeldStartService#stop() not completed - attempt to perform the container cleanup final Container container = Container.instance(deploymentName); if (container != null && !ContainerState.SHUTDOWN.equals(container.getState())) { final ExecutorService executorService = serverExecutorSupplier.get(); final Runnable task = new Runnable() { @Override public void run() { WeldLogger.DEPLOYMENT_LOGGER.debugf("Weld container cleanup for deployment %s", deploymentName); ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager .setCurrentContextClassLoaderPrivileged(deployment.getModule().getClassLoader()); WeldProvider.containerShutDown(container); container.setState(ContainerState.SHUTDOWN); container.cleanup(); setStarted(false); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); ModuleGroupSingletonProvider.removeClassLoader(deployment.getModule().getClassLoader()); context.complete(); } } }; try { executorService.execute(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } } } } }
public class class_name { public synchronized void stop(final StopContext context) { weldBootstrapServiceConsumer.accept(null); if (started) { // WeldStartService#stop() not completed - attempt to perform the container cleanup final Container container = Container.instance(deploymentName); if (container != null && !ContainerState.SHUTDOWN.equals(container.getState())) { final ExecutorService executorService = serverExecutorSupplier.get(); final Runnable task = new Runnable() { @Override public void run() { WeldLogger.DEPLOYMENT_LOGGER.debugf("Weld container cleanup for deployment %s", deploymentName); ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager .setCurrentContextClassLoaderPrivileged(deployment.getModule().getClassLoader()); // depends on control dependency: [try], data = [none] WeldProvider.containerShutDown(container); // depends on control dependency: [try], data = [none] container.setState(ContainerState.SHUTDOWN); // depends on control dependency: [try], data = [none] container.cleanup(); // depends on control dependency: [try], data = [none] setStarted(false); // depends on control dependency: [try], data = [none] } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); ModuleGroupSingletonProvider.removeClassLoader(deployment.getModule().getClassLoader()); context.complete(); } } }; try { executorService.execute(task); // depends on control dependency: [try], data = [none] } catch (RejectedExecutionException e) { task.run(); } finally { // depends on control dependency: [catch], data = [none] context.asynchronous(); } } } } }
public class class_name { @Override public List<Diagnostic> validate(final List<Diagnostic> diags) { if (!isValid()) { List<Serializable> argList = getMessageArguments(); Serializable[] args = argList.toArray(new Serializable[argList.size()]); diags.add(new DiagnosticImpl(Diagnostic.ERROR, input, getErrorMessage(), args)); } return diags; } }
public class class_name { @Override public List<Diagnostic> validate(final List<Diagnostic> diags) { if (!isValid()) { List<Serializable> argList = getMessageArguments(); Serializable[] args = argList.toArray(new Serializable[argList.size()]); diags.add(new DiagnosticImpl(Diagnostic.ERROR, input, getErrorMessage(), args)); // depends on control dependency: [if], data = [none] } return diags; } }
public class class_name { public static String getSystemProperty(String key) { try { String prop = System.getProperty(key); return (prop == null) ? getAndroidSystemProperty(key) : prop; } catch (SecurityException e) { return null; } } }
public class class_name { public static String getSystemProperty(String key) { try { String prop = System.getProperty(key); return (prop == null) ? getAndroidSystemProperty(key) : prop; // depends on control dependency: [try], data = [none] } catch (SecurityException e) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Trivial @SuppressWarnings({ "unchecked", "rawtypes" }) private Hashtable<String, ?> getSensitiveHashtable(Set<Object> creds, String[] properties) { List<String> props = new ArrayList<String>(); for (String property : properties) { props.add(property); } for (Object cred : creds) { if (cred instanceof Hashtable) { if (((Hashtable) cred).keySet().containsAll(props)) { return (Hashtable) cred; } } } return null; } }
public class class_name { @Trivial @SuppressWarnings({ "unchecked", "rawtypes" }) private Hashtable<String, ?> getSensitiveHashtable(Set<Object> creds, String[] properties) { List<String> props = new ArrayList<String>(); for (String property : properties) { props.add(property); // depends on control dependency: [for], data = [property] } for (Object cred : creds) { if (cred instanceof Hashtable) { if (((Hashtable) cred).keySet().containsAll(props)) { return (Hashtable) cred; // depends on control dependency: [if], data = [none] } } } return null; } }
public class class_name { private void remove(Class<?> type, Object object) { final Set<?> set = items.get(type); if (set != null) { set.remove(object); } } }
public class class_name { private void remove(Class<?> type, Object object) { final Set<?> set = items.get(type); if (set != null) { set.remove(object); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Catalog createCatalog() { final List<CatalogService> services = new ArrayList<>(); for (BrokerServiceAccessor serviceAccessor : serviceAccessors) { services.add(serviceAccessor.getServiceDescription()); } return new Catalog(services); } }
public class class_name { public Catalog createCatalog() { final List<CatalogService> services = new ArrayList<>(); for (BrokerServiceAccessor serviceAccessor : serviceAccessors) { services.add(serviceAccessor.getServiceDescription()); // depends on control dependency: [for], data = [serviceAccessor] } return new Catalog(services); } }