idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,045,515
private static void processInsn(RootNode root, MethodNode mth, InsnData insnData, UsageInfo usageInfo) {<NEW_LINE>if (insnData.getOpcode() == Opcode.UNKNOWN) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(insnData.getIndexType()) {<NEW_LINE>case TYPE_REF:<NEW_LINE>insnData.decode();<NEW_LINE>ArgType usedType = ArgType.parse(insnData.getIndexAsType());<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case FIELD_REF:<NEW_LINE>insnData.decode();<NEW_LINE>FieldNode fieldNode = root.resolveField(FieldInfo.fromRef(root, insnData.getIndexAsField()));<NEW_LINE>if (fieldNode != null) {<NEW_LINE>usageInfo.fieldUse(mth, fieldNode);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case METHOD_REF:<NEW_LINE>{<NEW_LINE>insnData.decode();<NEW_LINE>IMethodRef mthRef;<NEW_LINE>ICustomPayload payload = insnData.getPayload();<NEW_LINE>if (payload != null) {<NEW_LINE>mthRef = ((IMethodRef) payload);<NEW_LINE>} else {<NEW_LINE>mthRef = insnData.getIndexAsMethod();<NEW_LINE>}<NEW_LINE>MethodNode methodNode = root.resolveMethod(MethodInfo.fromRef(root, mthRef));<NEW_LINE>if (methodNode != null) {<NEW_LINE>usageInfo.methodUse(mth, methodNode);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case CALL_SITE:<NEW_LINE>{<NEW_LINE>insnData.decode();<NEW_LINE>ICallSite callSite = InsnDataUtils.getCallSite(insnData);<NEW_LINE>IMethodHandle methodHandle = InsnDataUtils.getMethodHandleAt(callSite, 4);<NEW_LINE>if (methodHandle != null) {<NEW_LINE>IMethodRef mthRef = methodHandle.getMethodRef();<NEW_LINE>MethodNode mthNode = root.resolveMethod(MethodInfo.fromRef(root, mthRef));<NEW_LINE>if (mthNode != null) {<NEW_LINE>usageInfo.methodUse(mth, mthNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
usageInfo.clsUse(mth, usedType);
580,348
private Object buildUserModel(Map<Integer, ReadCellData<?>> cellDataMap, ReadSheetHolder readSheetHolder, AnalysisContext context) {<NEW_LINE><MASK><NEW_LINE>Object resultModel;<NEW_LINE>try {<NEW_LINE>resultModel = excelReadHeadProperty.getHeadClazz().newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExcelDataConvertException(context.readRowHolder().getRowIndex(), 0, new ReadCellData<>(CellDataTypeEnum.EMPTY), null, "Can not instance class: " + excelReadHeadProperty.getHeadClazz().getName(), e);<NEW_LINE>}<NEW_LINE>Map<Integer, Head> headMap = excelReadHeadProperty.getHeadMap();<NEW_LINE>BeanMap dataMap = BeanMapUtils.create(resultModel);<NEW_LINE>for (Map.Entry<Integer, Head> entry : headMap.entrySet()) {<NEW_LINE>Integer index = entry.getKey();<NEW_LINE>Head head = entry.getValue();<NEW_LINE>String fieldName = head.getFieldName();<NEW_LINE>if (!cellDataMap.containsKey(index)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ReadCellData<?> cellData = cellDataMap.get(index);<NEW_LINE>Object value = ConverterUtils.convertToJavaObject(cellData, head.getField(), ClassUtils.declaredExcelContentProperty(dataMap, readSheetHolder.excelReadHeadProperty().getHeadClazz(), fieldName), readSheetHolder.converterMap(), context, context.readRowHolder().getRowIndex(), index);<NEW_LINE>if (value != null) {<NEW_LINE>dataMap.put(fieldName, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultModel;<NEW_LINE>}
ExcelReadHeadProperty excelReadHeadProperty = readSheetHolder.excelReadHeadProperty();
207,728
private Map<String, String> formatEmailInfo(SearchResult sResult, String targetKey) {<NEW_LINE>if (null == sResult) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>Map<String, String> result = new <MASK><NEW_LINE>try {<NEW_LINE>NamingEnumeration namingEnumeration = sResult.getAttributes().getAll();<NEW_LINE>while (namingEnumeration.hasMoreElements()) {<NEW_LINE>Attribute attr = (Attribute) namingEnumeration.next();<NEW_LINE>String attrId = attr.getID();<NEW_LINE>String attrValue = attr.getAll().next().toString();<NEW_LINE>if (targetKey.equals(attrId)) {<NEW_LINE>result.put("email", attrValue);<NEW_LINE>}<NEW_LINE>if ("cn".equals(attrId)) {<NEW_LINE>result.put("name", attrValue);<NEW_LINE>}<NEW_LINE>result.put(attrId, attrValue);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>loggerError("formatEmailInfo 591", "", e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
LinkedHashMap<String, String>();
1,245,055
protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite area = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite container = Widgets.createComposite(area, new GridLayout(2, false));<NEW_LINE>container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>for (API.Parameter param : command.getParametersList()) {<NEW_LINE>Service.ConstantSet constants = models.constants.<MASK><NEW_LINE>String typeString = Editor.getTypeString(param);<NEW_LINE>typeString = typeString.isEmpty() ? "" : " (" + typeString + ")";<NEW_LINE>createLabel(container, param.getName() + typeString + ":");<NEW_LINE>Editor<?> editor = Editor.getFor(container, param, constants);<NEW_LINE>editor.control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>editors.add(editor);<NEW_LINE>}<NEW_LINE>return area;<NEW_LINE>}
getConstants(param.getConstants());
1,316,974
public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-224", PREFIX + "$Digest224");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-256", PREFIX + "$Digest256");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-384", PREFIX + "$Digest384");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-512", PREFIX + "$Digest512");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_224, PREFIX + "$Digest224");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_256, PREFIX + "$Digest256");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_384, PREFIX + "$Digest384");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_512, PREFIX + "$Digest512");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHAKE256-512", PREFIX + "$DigestShake256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHAKE128-256", PREFIX + "$DigestShake128_256");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_shake256, PREFIX + "$DigestShake256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_shake128, PREFIX + "$DigestShake128_256");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.SHAKE256", "SHAKE256-512");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.SHAKE128", "SHAKE128-256");<NEW_LINE>addHMACAlgorithm(provider, "SHA3-224", PREFIX + "$HashMac224", PREFIX + "$KeyGenerator224");<NEW_LINE>addHMACAlias(provider, "SHA3-224", NISTObjectIdentifiers.id_hmacWithSHA3_224);<NEW_LINE>addHMACAlgorithm(provider, "SHA3-256", PREFIX + "$HashMac256", PREFIX + "$KeyGenerator256");<NEW_LINE>addHMACAlias(provider, "SHA3-256", NISTObjectIdentifiers.id_hmacWithSHA3_256);<NEW_LINE>addHMACAlgorithm(provider, "SHA3-384", PREFIX + "$HashMac384", PREFIX + "$KeyGenerator384");<NEW_LINE>addHMACAlias(provider, "SHA3-384", NISTObjectIdentifiers.id_hmacWithSHA3_384);<NEW_LINE>addHMACAlgorithm(provider, "SHA3-512", PREFIX + "$HashMac512", PREFIX + "$KeyGenerator512");<NEW_LINE>addHMACAlias(provider, "SHA3-512", NISTObjectIdentifiers.id_hmacWithSHA3_512);<NEW_LINE>addKMACAlgorithm(provider, "128", PREFIX + "$KMac128", PREFIX + "$KeyGenerator256");<NEW_LINE>addKMACAlgorithm(provider, "256", PREFIX + "$KMac256", PREFIX + "$KeyGenerator512");<NEW_LINE>provider.<MASK><NEW_LINE>provider.addAlgorithm("MessageDigest.TUPLEHASH128-256", PREFIX + "$DigestTupleHash128_256");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.TUPLEHASH256", "TUPLEHASH256-512");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.TUPLEHASH128", "TUPLEHASH128-256");<NEW_LINE>provider.addAlgorithm("MessageDigest.PARALLELHASH256-512", PREFIX + "$DigestParallelHash256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest.PARALLELHASH128-256", PREFIX + "$DigestParallelHash128_256");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.PARALLELHASH256", "PARALLELHASH256-512");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.PARALLELHASH128", "PARALLELHASH128-256");<NEW_LINE>}
addAlgorithm("MessageDigest.TUPLEHASH256-512", PREFIX + "$DigestTupleHash256_512");
1,229,908
public static boolean findStructuralLeftBrace(@Nonnull FileType fileType, @Nonnull HighlighterIterator iterator, @Nonnull CharSequence fileText) {<NEW_LINE>final Stack<IElementType> braceStack = new Stack<IElementType>();<NEW_LINE>final Stack<String> tagNameStack = new Stack<String>();<NEW_LINE>BraceMatcher matcher = getBraceMatcher(fileType, iterator);<NEW_LINE>while (!iterator.atEnd()) {<NEW_LINE>if (isStructuralBraceToken(fileType, iterator, fileText)) {<NEW_LINE>if (isRBraceToken(iterator, fileText, fileType)) {<NEW_LINE>braceStack.push(iterator.getTokenType());<NEW_LINE>tagNameStack.push(getTagName(matcher, fileText, iterator));<NEW_LINE>}<NEW_LINE>if (isLBraceToken(iterator, fileText, fileType)) {<NEW_LINE>if (braceStack.isEmpty())<NEW_LINE>return true;<NEW_LINE>final int group = matcher.<MASK><NEW_LINE>final IElementType topTokenType = braceStack.pop();<NEW_LINE>final IElementType tokenType = iterator.getTokenType();<NEW_LINE>boolean isStrict = isStrictTagMatching(matcher, fileType, group);<NEW_LINE>boolean isCaseSensitive = areTagsCaseSensitive(matcher, fileType, group);<NEW_LINE>String topTagName = null;<NEW_LINE>String tagName = null;<NEW_LINE>if (isStrict) {<NEW_LINE>topTagName = tagNameStack.pop();<NEW_LINE>tagName = getTagName(matcher, fileText, iterator);<NEW_LINE>}<NEW_LINE>if (!isPairBraces(topTokenType, tokenType, fileType) || isStrict && !Comparing.equal(topTagName, tagName, isCaseSensitive)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iterator.retreat();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getBraceTokenGroupId(iterator.getTokenType());
43,433
public final QualifiedNameElementContext qualifiedNameElement() throws RecognitionException {<NEW_LINE>QualifiedNameElementContext _localctx = new QualifiedNameElementContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 104, RULE_qualifiedNameElement);<NEW_LINE>try {<NEW_LINE>setState(787);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 69, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(782);<NEW_LINE>identifier();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(783);<NEW_LINE>match(DEF);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(784);<NEW_LINE>match(IN);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>enterOuterAlt(_localctx, 4);<NEW_LINE>{<NEW_LINE>setState(785);<NEW_LINE>match(AS);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>enterOuterAlt(_localctx, 5);<NEW_LINE>{<NEW_LINE>setState(786);<NEW_LINE>match(TRAIT);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
1,347,843
static ArrayList<Long> buffertimings(List<ImmutableRoaringBitmap> bitmaps, int maxvalue) {<NEW_LINE>long successive_and = 0;<NEW_LINE>long successive_or = 0;<NEW_LINE>long total_or = 0;<NEW_LINE>long start, stop;<NEW_LINE>ArrayList<Long> timings = new ArrayList<Long>();<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (int i = 0; i < bitmaps.size() - 1; ++i) {<NEW_LINE>successive_and += ImmutableRoaringBitmap.and(bitmaps.get(i), bitmaps.get(i + 1)).getCardinality();<NEW_LINE>}<NEW_LINE>// to defeat clever compilers<NEW_LINE>if (successive_and == 0xFFFFFFFF)<NEW_LINE>System.out.println();<NEW_LINE>stop = System.nanoTime();<NEW_LINE>timings.add(stop - start);<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (int i = 0; i < bitmaps.size() - 1; ++i) {<NEW_LINE>successive_or += ImmutableRoaringBitmap.or(bitmaps.get(i), bitmaps.get(i + 1)).getCardinality();<NEW_LINE>}<NEW_LINE>// to defeat clever compilers<NEW_LINE>if (successive_or == 0xFFFFFFFF)<NEW_LINE>System.out.println();<NEW_LINE>stop = System.nanoTime();<NEW_LINE><MASK><NEW_LINE>start = System.nanoTime();<NEW_LINE>total_or = ImmutableRoaringBitmap.or(bitmaps.iterator()).getCardinality();<NEW_LINE>// to defeat clever compilers<NEW_LINE>if (total_or == 0xFFFFFFFF)<NEW_LINE>System.out.println();<NEW_LINE>stop = System.nanoTime();<NEW_LINE>timings.add(stop - start);<NEW_LINE>int quartcount = 0;<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (ImmutableRoaringBitmap rb : bitmaps) {<NEW_LINE>if (rb.contains(maxvalue / 4))<NEW_LINE>++quartcount;<NEW_LINE>if (rb.contains(maxvalue / 2))<NEW_LINE>++quartcount;<NEW_LINE>if (rb.contains(3 * maxvalue / 4))<NEW_LINE>++quartcount;<NEW_LINE>}<NEW_LINE>// to defeat clever compilers<NEW_LINE>if (quartcount == 0)<NEW_LINE>System.out.println();<NEW_LINE>stop = System.nanoTime();<NEW_LINE>timings.add(stop - start);<NEW_LINE>return timings;<NEW_LINE>}
timings.add(stop - start);
1,193,651
public DeleteFileSystemLustreConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteFileSystemLustreConfiguration deleteFileSystemLustreConfiguration = new DeleteFileSystemLustreConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SkipFinalBackup", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteFileSystemLustreConfiguration.setSkipFinalBackup(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FinalBackupTags", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteFileSystemLustreConfiguration.setFinalBackupTags(new ListUnmarshaller<Tag>(TagJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteFileSystemLustreConfiguration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
466,365
public void onContentInfoReceived(HashMap<String, Object> contentInfo) {<NEW_LINE>int blockCount = (int) Double.parseDouble(contentInfo.get("blockCount").toString());<NEW_LINE>int wordCount = (int) Double.parseDouble(contentInfo.get("wordCount").toString());<NEW_LINE>int charCount = (int) Double.parseDouble(contentInfo.get("characterCount").toString());<NEW_LINE>if (getActivity() != null) {<NEW_LINE>getActivity().runOnUiThread(() -> {<NEW_LINE>AlertDialog.Builder builder <MASK><NEW_LINE>builder.setTitle(getString(R.string.dialog_content_info_title));<NEW_LINE>builder.setMessage(getString(R.string.dialog_content_info_body, blockCount, wordCount, charCount));<NEW_LINE>builder.setPositiveButton(getString(R.string.dialog_button_ok), null);<NEW_LINE>builder.show();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
= new MaterialAlertDialogBuilder(getActivity());
1,626,776
void addToBuilder(AbstractTable table, QueryStringBuilder builder, Consumer<BindMarker> onMarker) {<NEW_LINE>Column receiver = lhs().appendToBuilder(table, builder, onMarker);<NEW_LINE>builder.append(predicate().toString());<NEW_LINE>ColumnType type = receiver.type();<NEW_LINE>assert type != null;<NEW_LINE>BindMarker marker;<NEW_LINE>switch(predicate()) {<NEW_LINE>case EQ:<NEW_LINE>if (lhs().isMapAccess()) {<NEW_LINE>marker = markerFor(format("value(%s)", receiver.name()), type);<NEW_LINE>builder.append(marker, value());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// fallthrough on purpose for "normal" EQ<NEW_LINE>case LT:<NEW_LINE>case GT:<NEW_LINE>case LTE:<NEW_LINE>case GTE:<NEW_LINE>case NEQ:<NEW_LINE>marker = markerFor(receiver);<NEW_LINE>builder.append(marker, value());<NEW_LINE>break;<NEW_LINE>case IN:<NEW_LINE>marker = markerFor(format("IN(%s)", receiver.name()), Type.List.of(type));<NEW_LINE>builder.appendInValue(marker, value());<NEW_LINE>break;<NEW_LINE>case CONTAINS:<NEW_LINE>checkArgument(type.isCollection(), "CONTAINS predicate on %s is invalid: CONTAINS can only apply to a collection, " + "but %s is of type %s", receiver.cqlName(), receiver.cqlName(), type.cqlDefinition());<NEW_LINE>ColumnType valueType = type.isMap() ? type.parameters().get(1) : type.parameters().get(0);<NEW_LINE>marker = markerFor(format("value(%s)", receiver.name()), valueType);<NEW_LINE>builder.<MASK><NEW_LINE>break;<NEW_LINE>case CONTAINS_KEY:<NEW_LINE>checkArgument(type.isMap(), "CONTAINS KEY predicate on %s is invalid: CONTAINS KEY can only apply to a map, " + "but %s is of type %s", receiver.cqlName(), receiver.cqlName(), type.cqlDefinition());<NEW_LINE>marker = markerFor(format("key(%s)", receiver.name()), type.parameters().get(0));<NEW_LINE>builder.append(marker, value());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>onMarker.accept(marker);<NEW_LINE>}
append(marker, value());
1,399,287
private DruidScanResponse parseResponse(ArrayNode responses) {<NEW_LINE>String segmentId = "empty";<NEW_LINE>ArrayList<ObjectNode> events = new ArrayList<>();<NEW_LINE>ArrayList<String> columns = new ArrayList<>();<NEW_LINE>if (responses.size() > 0) {<NEW_LINE>ObjectNode firstNode = (ObjectNode) responses.get(0);<NEW_LINE>segmentId = firstNode.get("segmentId").textValue();<NEW_LINE>ArrayNode columnsNode = (ArrayNode) firstNode.get("columns");<NEW_LINE>ArrayNode eventsNode = (ArrayNode) firstNode.get("events");<NEW_LINE>for (int i = 0; i < columnsNode.size(); i++) {<NEW_LINE>String column = columnsNode.get(i).textValue();<NEW_LINE>columns.add(column);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < eventsNode.size(); i++) {<NEW_LINE>ObjectNode eventNode = (ObjectNode) eventsNode.get(i);<NEW_LINE>events.add(eventNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
DruidScanResponse(segmentId, columns, events);
1,352,078
public static void main(String[] unused) throws Exception {<NEW_LINE>LOG.info("TaskExecutor is running..");<NEW_LINE>try (TaskExecutor executor = requireNonNull(createExecutor())) {<NEW_LINE>// If not reusing port, then reserve them up until before the underlying TF process is<NEW_LINE>// launched. See <a href="https://github.com/linkedin/TonY/issues/365">this issue</a> for<NEW_LINE>// details.<NEW_LINE>if (!executor.isTFGrpcReusingPort()) {<NEW_LINE>LOG.info("Releasing reserved RPC port before launching tensorflow process.");<NEW_LINE>executor.releasePort(executor.rpcPort);<NEW_LINE>}<NEW_LINE>if (!executor.isTBServerReusingPort()) {<NEW_LINE>LOG.info("Releasing reserved TB port before launching tensorflow process.");<NEW_LINE>executor.releasePort(executor.tbPort);<NEW_LINE>}<NEW_LINE>CompletableFuture<Integer> childProcessFuture = CompletableFuture.supplyAsync(() -> {<NEW_LINE>try {<NEW_LINE>return taskRuntimeAdapter.run();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Errors on running child process.", e);<NEW_LINE>}<NEW_LINE>return GENERAL_EXIT_CODE;<NEW_LINE>});<NEW_LINE>int exitCode;<NEW_LINE>while (true) {<NEW_LINE>if (executor.markedAsLostConnectionWithAM) {<NEW_LINE>exitCode = GENERAL_EXIT_CODE;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (childProcessFuture.isDone()) {<NEW_LINE>exitCode = childProcessFuture.getNow(GENERAL_EXIT_CODE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// START - worker skew testing:<NEW_LINE>executor.skewAndHangIfTesting();<NEW_LINE>// END - worker skew testing:<NEW_LINE>executor.registerExecutionResult(exitCode, executor.jobName, String<MASK><NEW_LINE>LOG.info("Child process exited with exit code: " + exitCode);<NEW_LINE>if (exitCode == 0) {<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>String errorMsg = executor.getExecutionErrorLog();<NEW_LINE>try {<NEW_LINE>Utils.shutdownThreadPool(executor.scheduledThreadPool);<NEW_LINE>if (!childProcessFuture.isDone()) {<NEW_LINE>childProcessFuture.cancel(true);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.exit(exitCode);<NEW_LINE>}<NEW_LINE>throw new Exception("Execution exit code: " + exitCode + ", error messages: \n" + errorMsg);<NEW_LINE>}<NEW_LINE>}
.valueOf(executor.taskIndex));
1,055,655
public void childEvent(CuratorFramework client, TreeCacheEvent event) throws Exception {<NEW_LINE>if (event == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (data == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String path = data.getPath();<NEW_LINE>if (path == null || path.equals(JobNodePath.ROOT)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TreeCacheEvent.Type type = event.getType();<NEW_LINE>if (type == null || !type.equals(TreeCacheEvent.Type.NODE_ADDED)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String jobName = StringUtils.substringAfterLast(path, "/");<NEW_LINE>String jobClassPath = JobNodePath.getNodeFullPath(jobName, ConfigurationNode.JOB_CLASS);<NEW_LINE>// wait 5 seconds at most until jobClass created.<NEW_LINE>for (int i = 0; i < WAIT_JOBCLASS_ADDED_COUNT; i++) {<NEW_LINE>if (!regCenter.isExisted(jobClassPath)) {<NEW_LINE>Thread.sleep(200L);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LogUtils.info(log, jobName, "new job: {} 's jobClass created event received", jobName);<NEW_LINE>if (!jobNames.contains(jobName)) {<NEW_LINE>if (canInitTheJob(jobName) && initJobScheduler(jobName)) {<NEW_LINE>jobNames.add(jobName);<NEW_LINE>LogUtils.info(log, jobName, "the job {} initialize successfully", jobName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LogUtils.warn(log, jobName, "the job {} is unnecessary to initialize, because it's already existing", jobName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
ChildData data = event.getData();
1,206,900
private void collectInventoryAPINoSee() {<NEW_LINE>BeanUtils.reflections.getTypesAnnotatedWith(Inventory.class).stream().filter(clz -> !Modifier.isStatic(clz.getModifiers())).forEach(clz -> {<NEW_LINE>Inventory inventory = clz.getAnnotation(Inventory.class);<NEW_LINE>if (inventory == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> skip = new ArrayList<>();<NEW_LINE>for (Field field : clz.getDeclaredFields()) {<NEW_LINE>if (field.isAnnotationPresent(APINoSee.class)) {<NEW_LINE>skip.add(field.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!skip.isEmpty()) {<NEW_LINE>apiNoSeeFields.put(<MASK><NEW_LINE>for (Parent parent : inventory.parent()) {<NEW_LINE>inventoryFamilies.compute(parent.inventoryClass().getName(), (k, v) -> {<NEW_LINE>if (v == null) {<NEW_LINE>v = CollectionDSL.list(clz);<NEW_LINE>} else {<NEW_LINE>v.add(clz);<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
clz.getName(), skip);
1,375,233
public void updateButton(AnActionEvent e) {<NEW_LINE>super.updateButton(e);<NEW_LINE>if (!e.getPresentation().isEnabled())<NEW_LINE>return;<NEW_LINE>final JComponent c = getContextComponent();<NEW_LINE>if (c instanceof JTable || c instanceof JList) {<NEW_LINE>final ListSelectionModel model = c instanceof JTable ? ((JTable) c).getSelectionModel() : ((JList) c).getSelectionModel();<NEW_LINE>final int size = c instanceof JTable ? ((JTable) c).getRowCount() : ((JList) c).getModel().getSize();<NEW_LINE>final int min = model.getMinSelectionIndex();<NEW_LINE>final <MASK><NEW_LINE>if ((myButton == Buttons.UP && min < 1) || (myButton == Buttons.DOWN && max == size - 1) || (myButton != Buttons.ADD && size == 0) || (myButton == Buttons.EDIT && (min != max || min == -1))) {<NEW_LINE>e.getPresentation().setEnabled(false);<NEW_LINE>} else {<NEW_LINE>e.getPresentation().setEnabled(isEnabled());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int max = model.getMaxSelectionIndex();
419,314
public static void processEntries(FhirContext theContext, IBaseBundle theBundle, Consumer<ModifiableBundleEntry> theProcessor) {<NEW_LINE>RuntimeResourceDefinition bundleDef = theContext.getResourceDefinition(theBundle);<NEW_LINE>BaseRuntimeChildDefinition entryChildDef = bundleDef.getChildByName("entry");<NEW_LINE>List<IBase> entries = entryChildDef.getAccessor().getValues(theBundle);<NEW_LINE>BaseRuntimeElementCompositeDefinition<?> entryChildContentsDef = (BaseRuntimeElementCompositeDefinition<?<MASK><NEW_LINE>BaseRuntimeChildDefinition fullUrlChildDef = entryChildContentsDef.getChildByName("fullUrl");<NEW_LINE>BaseRuntimeChildDefinition resourceChildDef = entryChildContentsDef.getChildByName("resource");<NEW_LINE>BaseRuntimeChildDefinition requestChildDef = entryChildContentsDef.getChildByName("request");<NEW_LINE>BaseRuntimeElementCompositeDefinition<?> requestChildContentsDef = (BaseRuntimeElementCompositeDefinition<?>) requestChildDef.getChildByName("request");<NEW_LINE>BaseRuntimeChildDefinition requestUrlChildDef = requestChildContentsDef.getChildByName("url");<NEW_LINE>BaseRuntimeChildDefinition requestIfNoneExistChildDef = requestChildContentsDef.getChildByName("ifNoneExist");<NEW_LINE>BaseRuntimeChildDefinition methodChildDef = requestChildContentsDef.getChildByName("method");<NEW_LINE>for (IBase nextEntry : entries) {<NEW_LINE>BundleEntryParts parts = getBundleEntryParts(fullUrlChildDef, resourceChildDef, requestChildDef, requestUrlChildDef, requestIfNoneExistChildDef, methodChildDef, nextEntry);<NEW_LINE>BundleEntryMutator mutator = new BundleEntryMutator(theContext, nextEntry, requestChildDef, requestChildContentsDef, entryChildContentsDef);<NEW_LINE>ModifiableBundleEntry entry = new ModifiableBundleEntry(parts, mutator);<NEW_LINE>theProcessor.accept(entry);<NEW_LINE>}<NEW_LINE>}
>) entryChildDef.getChildByName("entry");
573,803
public String parameterList(List<PositionalParamSpec> positionalParams) {<NEW_LINE>int usageHelpWidth = commandSpec.usageMessage().width();<NEW_LINE>int longOptionsColumnWidth = longOptionsColumnWidth(createDefaultLayout());<NEW_LINE>int descriptionWidth = usageHelpWidth - 1 - longOptionsColumnWidth;<NEW_LINE>TextTable tt = // "*"<NEW_LINE>TextTable.// "*"<NEW_LINE>forColumns(// "*"<NEW_LINE>colorScheme, // "-c"<NEW_LINE>new Column(2, 0, Column.Overflow.TRUNCATE), // ","<NEW_LINE>new Column(0, 0, Column.Overflow.SPAN), // " --create"<NEW_LINE>new Column(0, 0, Column.Overflow.TRUNCATE), // " Creates a ..."<NEW_LINE>new Column(longOptionsColumnWidth, 0, Column.Overflow.SPAN), new Column(descriptionWidth, 4, Column.Overflow.WRAP));<NEW_LINE>tt.setAdjustLineBreaksForWideCJKCharacters(commandSpec.usageMessage().adjustLineBreaksForWideCJKCharacters());<NEW_LINE>Layout layout = new Layout(colorScheme, tt, <MASK><NEW_LINE>return parameterList(positionalParams, layout, parameterLabelRenderer());<NEW_LINE>}
createDefaultOptionRenderer(), createDefaultParameterRenderer());
77,759
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<ModelMap> allModels) {<NEW_LINE>objs = super.postProcessOperationsWithModels(objs, allModels);<NEW_LINE>Map<String, Object> operations = (Map<String, Object>) objs.get("operations");<NEW_LINE>HashMap<String, CodegenModel> modelMaps = new HashMap<>();<NEW_LINE>HashMap<String, Integer> processedModelMaps = new HashMap<>();<NEW_LINE>for (ModelMap modelMap : allModels) {<NEW_LINE>CodegenModel m = modelMap.getModel();<NEW_LINE>modelMaps.put(m.classname, m);<NEW_LINE>}<NEW_LINE>List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");<NEW_LINE>for (CodegenOperation op : operationList) {<NEW_LINE>for (CodegenParameter p : op.allParams) {<NEW_LINE>p.vendorExtensions.put("x-crystal-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.requiredParams) {<NEW_LINE>p.vendorExtensions.put("x-crystal-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.optionalParams) {<NEW_LINE>p.vendorExtensions.put("x-crystal-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.bodyParams) {<NEW_LINE>p.vendorExtensions.put("x-crystal-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.pathParams) {<NEW_LINE>p.vendorExtensions.put("x-crystal-example", constructExampleCode<MASK><NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>}<NEW_LINE>return objs;<NEW_LINE>}
(p, modelMaps, processedModelMaps));
705,045
public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args) throws CompileError {<NEW_LINE>int <MASK><NEW_LINE>if (num != dimension)<NEW_LINE>throw new CompileError(Javac.proceedName + "() with a wrong number of parameters");<NEW_LINE>gen.atMethodArgs(args, new int[num], new int[num], new String[num]);<NEW_LINE>bytecode.addOpcode(opcode);<NEW_LINE>if (opcode == Opcode.ANEWARRAY)<NEW_LINE>bytecode.addIndex(index);<NEW_LINE>else if (opcode == Opcode.NEWARRAY)<NEW_LINE>bytecode.add(index);<NEW_LINE>else /* if (opcode == Opcode.MULTIANEWARRAY) */<NEW_LINE>{<NEW_LINE>bytecode.addIndex(index);<NEW_LINE>bytecode.add(dimension);<NEW_LINE>bytecode.growStack(1 - dimension);<NEW_LINE>}<NEW_LINE>gen.setType(arrayType);<NEW_LINE>}
num = gen.getMethodArgsLength(args);
134,823
public void saveLandmarks(double markerWidth, double markerHeight, List<Point2D_F64> corners, String description, String fileName) {<NEW_LINE>double paperWidth = paper.convertWidth(units);<NEW_LINE>double paperHeight = paper.convertHeight(units);<NEW_LINE>double offsetX = paperWidth / 2.0 - markerWidth / 2.0;<NEW_LINE>double offsetY = paperHeight / 2.0 - markerHeight / 2.0;<NEW_LINE>double unitToPdf = units.conversionTo(Unit.CENTIMETER) * CM_TO_POINTS;<NEW_LINE>try (PrintStream out = new PrintStream(fileName)) {<NEW_LINE>out.println("# " + description);<NEW_LINE>out.println("# Marker landmark locations");<NEW_LINE>out.<MASK><NEW_LINE>out.println("units=" + units.name());<NEW_LINE>out.println("count=" + corners.size());<NEW_LINE>for (int cornerID = 0; cornerID < corners.size(); cornerID++) {<NEW_LINE>Point2D_F64 p = corners.get(cornerID);<NEW_LINE>out.printf("%d %.8f %.8f\n", cornerID, offsetX + p.x / unitToPdf, offsetY + p.y / unitToPdf);<NEW_LINE>}<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
println("paper=" + paper.name);
1,590,787
public List<SuppressionRule> parseSuppressionRules(InputStream inputStream, SuppressionRuleFilter filter) throws SuppressionParseException, SAXException {<NEW_LINE>try (InputStream schemaStream13 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_3);<NEW_LINE>InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2);<NEW_LINE>InputStream schemaStream11 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_1);<NEW_LINE>InputStream schemaStream10 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_0)) {<NEW_LINE>final BOMInputStream bomStream = new BOMInputStream(inputStream);<NEW_LINE>final ByteOrderMark bom = bomStream.getBOM();<NEW_LINE>final String defaultEncoding = StandardCharsets.UTF_8.name();<NEW_LINE>final String charsetName = bom == null ? defaultEncoding : bom.getCharsetName();<NEW_LINE>final SuppressionHandler handler = new SuppressionHandler(filter);<NEW_LINE>final SAXParser saxParser = XmlUtils.buildSecureSaxParser(schemaStream13, schemaStream12, schemaStream11, schemaStream10);<NEW_LINE>final XMLReader xmlReader = saxParser.getXMLReader();<NEW_LINE>xmlReader.setErrorHandler(new SuppressionErrorHandler());<NEW_LINE>xmlReader.setContentHandler(handler);<NEW_LINE>xmlReader.setEntityResolver(new ClassloaderResolver());<NEW_LINE>try (Reader reader = new InputStreamReader(bomStream, charsetName)) {<NEW_LINE>final InputSource in = new InputSource(reader);<NEW_LINE>xmlReader.parse(in);<NEW_LINE>return handler.getSuppressionRules();<NEW_LINE>}<NEW_LINE>} catch (ParserConfigurationException | FileNotFoundException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>if (ex.getMessage().contains("Cannot find the declaration of element 'suppressions'.")) {<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE><MASK><NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>}
LOGGER.debug("", ex);
184,991
JobExecution createJobExecutionFromResultSet(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>Long id = rs.getLong(1);<NEW_LINE>JobExecution jobExecution;<NEW_LINE>JobParameters jobParameters = getJobParameters(id);<NEW_LINE>JobInstance jobInstance = new JobInstance(rs.getLong(10), rs.getString(11));<NEW_LINE>jobExecution = new JobExecution(jobInstance, jobParameters);<NEW_LINE>jobExecution.setId(id);<NEW_LINE>jobExecution.setStartTime<MASK><NEW_LINE>jobExecution.setEndTime(rs.getTimestamp(3));<NEW_LINE>jobExecution.setStatus(BatchStatus.valueOf(rs.getString(4)));<NEW_LINE>jobExecution.setExitStatus(new ExitStatus(rs.getString(5), rs.getString(6)));<NEW_LINE>jobExecution.setCreateTime(rs.getTimestamp(7));<NEW_LINE>jobExecution.setLastUpdated(rs.getTimestamp(8));<NEW_LINE>jobExecution.setVersion(rs.getInt(9));<NEW_LINE>return jobExecution;<NEW_LINE>}
(rs.getTimestamp(2));
424,807
private static void statementTiming() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Connection conn = null;<NEW_LINE>if (s_cType == C_MULTIPLE)<NEW_LINE>conn = DriverManager.getConnection(CONNECTION, UID, PWD);<NEW_LINE>long startStatement = System.currentTimeMillis();<NEW_LINE>Statement stmt = conn.createStatement();<NEW_LINE>// stmt.setFetchSize(s_fetchSize);<NEW_LINE>long startQuery = System.currentTimeMillis();<NEW_LINE>ResultSet rs = stmt.executeQuery(STATEMENT);<NEW_LINE>int i = 0;<NEW_LINE>long startRetrieve = System.currentTimeMillis();<NEW_LINE>while (rs.next()) {<NEW_LINE>rs.getString(1);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>long endRetrieve = System.currentTimeMillis();<NEW_LINE>// System.out.println(i);<NEW_LINE>rs.close();<NEW_LINE>rs = null;<NEW_LINE>long endQuery = System.currentTimeMillis();<NEW_LINE>stmt.close();<NEW_LINE>stmt = null;<NEW_LINE>long endStatement = System.currentTimeMillis();<NEW_LINE>conn.close();<NEW_LINE>conn = null;<NEW_LINE>long endConnection = System.currentTimeMillis();<NEW_LINE>//<NEW_LINE>System.out.println(C_INFO[s_cType] + "Fetch=" + s_fetchSize + " \tConn=" + (startStatement - startConnection) + " \tStmt=" + (startQuery - startStatement) + " \tQuery=" + (startRetrieve - startQuery) + " \tRetrieve=" + (endRetrieve - startRetrieve) + " \tClRs=" + (endQuery - endRetrieve) + " \tClStmt=" + (endStatement - endQuery) + " \tClConn=" + (endConnection - endStatement) + " \t- Total=" + (endConnection - startConnection) + " \tStmt=" + (endStatement - startStatement) + " \tQuery=" + (endQuery - startQuery));<NEW_LINE>} catch (SQLException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
long startConnection = System.currentTimeMillis();
1,847,241
public NotificationEntity patchNotificationsId(Integer id, NotificationsIdBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling patchNotificationsId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/notifications/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<NotificationEntity> localVarReturnType = new GenericType<NotificationEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, <MASK><NEW_LINE>}
localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
397,255
public void validateAndFixProperty(String key, String[] values, String fixValue) {<NEW_LINE>if (values == null || values.length == 0) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String value = getString(key);<NEW_LINE>if (value == null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "validateAndFixProperty", "key wans't found.");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean found = false;<NEW_LINE>for (int i = 0; i < values.length && !found; i++) {<NEW_LINE>if (values[i] == null) {<NEW_LINE>throw new NullPointerException("Illegal value specified.");<NEW_LINE>}<NEW_LINE>if (value.equals(values[i])) {<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "validateAndFixProperty", "Invalid value retrieved: " + value + " replacing with: " + fixValue);<NEW_LINE>}<NEW_LINE>setString(key, fixValue, CustPropSource.DEFAULT);<NEW_LINE>}<NEW_LINE>}
this, "validateAndFixProperty", "Skipping validation for key: " + key);
1,102,206
private void forceDeleteDatafeed(DeleteDatafeedAction.Request request, ClusterState state, ActionListener<AcknowledgedResponse> listener) {<NEW_LINE>ActionListener<Boolean> finalListener = // use clusterService.state() here so that the updated state without the task is available<NEW_LINE>ActionListener.// use clusterService.state() here so that the updated state without the task is available<NEW_LINE>wrap(response -> datafeedManager.deleteDatafeed(request, clusterService.state()<MASK><NEW_LINE>ActionListener<IsolateDatafeedAction.Response> isolateDatafeedHandler = ActionListener.wrap(response -> removeDatafeedTask(request, state, finalListener), listener::onFailure);<NEW_LINE>IsolateDatafeedAction.Request isolateDatafeedRequest = new IsolateDatafeedAction.Request(request.getDatafeedId());<NEW_LINE>executeAsyncWithOrigin(client, ML_ORIGIN, IsolateDatafeedAction.INSTANCE, isolateDatafeedRequest, isolateDatafeedHandler);<NEW_LINE>}
, listener), listener::onFailure);
1,189,036
public okhttp3.Call readNamespacedJobCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE><MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarHeaderParams.put("Content-Type", localVarContentType);
246,281
private static void updateCollectionEndAverages(AdaptiveWeightedAverage costAverage, AdaptivePaddedAverage pauseAverage, ReciprocalLeastSquareFit costEstimator, AdaptiveWeightedAverage intervalSeconds, GCCause cause, long mutatorNanos, long pauseNanos, UnsignedWord sizeBytes) {<NEW_LINE>if (shouldUpdateStats(cause)) {<NEW_LINE>double cost = 0;<NEW_LINE>double mutatorInSeconds = TimeUtils.nanosToSecondsDouble(mutatorNanos);<NEW_LINE>double pauseInSeconds = TimeUtils.nanosToSecondsDouble(pauseNanos);<NEW_LINE>pauseAverage.sample(pauseInSeconds);<NEW_LINE>if (mutatorInSeconds > 0 && pauseInSeconds > 0) {<NEW_LINE>double intervalInSeconds = mutatorInSeconds + pauseInSeconds;<NEW_LINE>cost = pauseInSeconds / intervalInSeconds;<NEW_LINE>costAverage.sample(cost);<NEW_LINE>if (intervalSeconds != null) {<NEW_LINE>intervalSeconds.sample(intervalInSeconds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>costEstimator.sample(UnsignedUtils<MASK><NEW_LINE>}<NEW_LINE>}
.toDouble(sizeBytes), cost);
1,245,531
public ITargetSelector configure(Configure request, String... args) {<NEW_LINE>request.checkArgs(args);<NEW_LINE>switch(request) {<NEW_LINE>case SELECT_MEMBER:<NEW_LINE>if (this.matches.isDefault()) {<NEW_LINE>return new DynamicSelectorDesc(this, Quantifier.SINGLE);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SELECT_INSTRUCTION:<NEW_LINE>if (this.matches.isDefault()) {<NEW_LINE>return new DynamicSelectorDesc(this, Quantifier.ANY);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MOVE:<NEW_LINE>return new DynamicSelectorDesc(this, Type.<MASK><NEW_LINE>case CLEAR_LIMITS:<NEW_LINE>if (this.getMinMatchCount() != 0 || this.getMaxMatchCount() < Integer.MAX_VALUE) {<NEW_LINE>return new DynamicSelectorDesc(this, Quantifier.ANY);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
getObjectType(args[0]));
201,818
private Configuration buildConfig(final String name, final ExecutorService threadPool, final ObjectMapper objectMapper, final Validator validator) {<NEW_LINE>final ClientConfig config = new ClientConfig();<NEW_LINE>for (Object singleton : this.singletons) {<NEW_LINE>config.register(singleton);<NEW_LINE>}<NEW_LINE>for (Class<?> provider : this.providers) {<NEW_LINE>config.register(provider);<NEW_LINE>}<NEW_LINE>config.register(new JacksonFeature(objectMapper));<NEW_LINE>config.register(new HibernateValidationBinder(validator));<NEW_LINE>for (Map.Entry<String, Object> property : this.properties.entrySet()) {<NEW_LINE>config.property(property.getKey(), property.getValue());<NEW_LINE>}<NEW_LINE>config.<MASK><NEW_LINE>if (connectorProvider == null) {<NEW_LINE>final ConfiguredCloseableHttpClient apacheHttpClient = apacheHttpClientBuilder.buildWithDefaultRequestConfiguration(name);<NEW_LINE>config.connectorProvider((client, runtimeConfig) -> createDropwizardApacheConnector(apacheHttpClient));<NEW_LINE>} else {<NEW_LINE>config.connectorProvider(connectorProvider);<NEW_LINE>}<NEW_LINE>return config;<NEW_LINE>}
register(new DropwizardExecutorProvider(threadPool));
869,318
public boolean solvePositionConstraints(final SolverData data) {<NEW_LINE>final Rot qA = pool.popRot();<NEW_LINE>final Rot qB = pool.popRot();<NEW_LINE>final Vec2 rA = pool.popVec2();<NEW_LINE>final Vec2 rB = pool.popVec2();<NEW_LINE>final Vec2 uA = pool.popVec2();<NEW_LINE>final Vec2 uB = pool.popVec2();<NEW_LINE>final Vec2 temp = pool.popVec2();<NEW_LINE>final Vec2 PA = pool.popVec2();<NEW_LINE>final Vec2 PB = pool.popVec2();<NEW_LINE>Vec2 cA = data.positions[m_indexA].c;<NEW_LINE>float aA = data.positions[m_indexA].a;<NEW_LINE>Vec2 cB = data.positions[m_indexB].c;<NEW_LINE>float aB = data.positions[m_indexB].a;<NEW_LINE>qA.set(aA);<NEW_LINE>qB.set(aB);<NEW_LINE>Rot.mulToOutUnsafe(qA, temp.set(m_localAnchorA).subLocal(m_localCenterA), rA);<NEW_LINE>Rot.mulToOutUnsafe(qB, temp.set(m_localAnchorB).subLocal(m_localCenterB), rB);<NEW_LINE>uA.set(cA).addLocal(rA).subLocal(m_groundAnchorA);<NEW_LINE>uB.set(cB).addLocal(rB).subLocal(m_groundAnchorB);<NEW_LINE>float lengthA = uA.length();<NEW_LINE>float lengthB = uB.length();<NEW_LINE>if (lengthA > 10.0f * Settings.linearSlop) {<NEW_LINE>uA.mulLocal(1.0f / lengthA);<NEW_LINE>} else {<NEW_LINE>uA.setZero();<NEW_LINE>}<NEW_LINE>if (lengthB > 10.0f * Settings.linearSlop) {<NEW_LINE>uB.mulLocal(1.0f / lengthB);<NEW_LINE>} else {<NEW_LINE>uB.setZero();<NEW_LINE>}<NEW_LINE>// Compute effective mass.<NEW_LINE>float ruA = Vec2.cross(rA, uA);<NEW_LINE>float ruB = Vec2.cross(rB, uB);<NEW_LINE>float mA = m_invMassA + m_invIA * ruA * ruA;<NEW_LINE>float mB = m_invMassB + m_invIB * ruB * ruB;<NEW_LINE>float mass = mA + m_ratio * m_ratio * mB;<NEW_LINE>if (mass > 0.0f) {<NEW_LINE>mass = 1.0f / mass;<NEW_LINE>}<NEW_LINE>float C = m_constant - lengthA - m_ratio * lengthB;<NEW_LINE>float linearError = MathUtils.abs(C);<NEW_LINE>float impulse = -mass * C;<NEW_LINE>PA.set(uA).mulLocal(-impulse);<NEW_LINE>PB.set(uB).mulLocal(-m_ratio * impulse);<NEW_LINE>cA.x += m_invMassA * PA.x;<NEW_LINE>cA.y += m_invMassA * PA.y;<NEW_LINE>aA += m_invIA * Vec2.cross(rA, PA);<NEW_LINE>cB.x += m_invMassB * PB.x;<NEW_LINE>cB.y += m_invMassB * PB.y;<NEW_LINE>aB += m_invIB * Vec2.cross(rB, PB);<NEW_LINE>// data.positions[m_indexA].c.set(cA);<NEW_LINE>data.positions[m_indexA].a = aA;<NEW_LINE>// data.positions[m_indexB].c.set(cB);<NEW_LINE>data.<MASK><NEW_LINE>pool.pushRot(2);<NEW_LINE>pool.pushVec2(7);<NEW_LINE>return linearError < Settings.linearSlop;<NEW_LINE>}
positions[m_indexB].a = aB;
110,427
private void writeFrontSizeToCSS(int fontSize) {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String css = "";<NEW_LINE>if (fontSize > 0) {<NEW_LINE>// windows<NEW_LINE>int[] delta = new int[] <MASK><NEW_LINE>if (Platform.OS_MACOSX.equals(Platform.getOS()))<NEW_LINE>// mac<NEW_LINE>delta = new int[] { 3, 10, -1 };<NEW_LINE>else if (Platform.OS_LINUX.equals(Platform.getOS()))<NEW_LINE>// linux<NEW_LINE>delta = new int[] { 1, 10, -1 };<NEW_LINE>css = // $NON-NLS-1$<NEW_LINE>String.// $NON-NLS-1$<NEW_LINE>format(// $NON-NLS-1$<NEW_LINE>"* { font-size: %dpx;}%n" + // $NON-NLS-1$<NEW_LINE>".heading1 { font-size: %dpx; }%n" + // $NON-NLS-1$<NEW_LINE>".kpi { font-size: %dpx; }%n" + ".datapoint { font-size: %dpx; }", fontSize, fontSize + delta[0], fontSize + delta[1], fontSize + delta[2]);<NEW_LINE>}<NEW_LINE>Files.writeString(getPathToCustomCSS(), css, StandardOpenOption.TRUNCATE_EXISTING);<NEW_LINE>} catch (IOException e) {<NEW_LINE>PortfolioPlugin.log(e);<NEW_LINE>}<NEW_LINE>}
{ 3, 10, -1 };
903,542
public void updateDiscoveryAnalysisReport(String userId, DiscoveryAnalysisReport updatedReport) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException {<NEW_LINE>final String methodName = "updateDiscoveryAnalysisReport";<NEW_LINE>final String reportParameterName = "updatedReport";<NEW_LINE>final String reportHeaderParameterName = "updatedReport.getElementHeader";<NEW_LINE>final String reportGUIDParameterName = "updatedReport.getGUID()";<NEW_LINE>final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}";<NEW_LINE>invalidParameterHandler.validateUserId(userId, methodName);<NEW_LINE>invalidParameterHandler.validateObject(updatedReport, reportParameterName, methodName);<NEW_LINE>invalidParameterHandler.validateObject(updatedReport.<MASK><NEW_LINE>invalidParameterHandler.validateGUID(updatedReport.getElementHeader().getGUID(), reportGUIDParameterName, methodName);<NEW_LINE>restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + urlTemplate, updatedReport, serverName, userId, updatedReport.getElementHeader().getGUID());<NEW_LINE>}
getElementHeader(), reportHeaderParameterName, methodName);
1,627,762
public static List<TumorNormalPair> extractPossibleTumorNormalPairs(final VCFHeader vcfHeader) {<NEW_LINE>Utils.nonNull(vcfHeader);<NEW_LINE>// First attempt the M2 nomenclature<NEW_LINE>if (vcfHeader.getMetaDataLine(Mutect2Engine.TUMOR_SAMPLE_KEY_IN_VCF_HEADER) != null) {<NEW_LINE>final VCFHeaderLine normalMetaDataLine = vcfHeader.getMetaDataLine(Mutect2Engine.NORMAL_SAMPLE_KEY_IN_VCF_HEADER);<NEW_LINE>return Collections.singletonList(new TumorNormalPair(vcfHeader.getMetaDataLine(Mutect2Engine.TUMOR_SAMPLE_KEY_IN_VCF_HEADER).getValue(), (normalMetaDataLine == null ? NO_NORMAL : normalMetaDataLine.getValue())));<NEW_LINE>}<NEW_LINE>// Then try sample names (e.g. "TUMOR", "NORMAL")<NEW_LINE>final List<String<MASK><NEW_LINE>if (sampleNames.size() == 1) {<NEW_LINE>return Collections.singletonList(new TumorNormalPair(sampleNames.get(0), NO_NORMAL));<NEW_LINE>}<NEW_LINE>if (sampleNames.size() > 0) {<NEW_LINE>final List<String> tumorSamples = sampleNames.stream().filter(s -> TUMOR_SAMPLE_NAME_LIST.contains(s)).collect(Collectors.toList());<NEW_LINE>final List<String> normalSamples = sampleNames.stream().filter(s -> NORMAL_SAMPLE_NAME_LIST.contains(s)).collect(Collectors.toList());<NEW_LINE>return tumorSamples.stream().flatMap(t -> normalSamples.stream().map(n -> new TumorNormalPair(t, n))).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
> sampleNames = vcfHeader.getSampleNamesInOrder();
822,492
public TableConstructorExpressionNode transform(TableConstructorExpressionNode tableConstructorExpressionNode) {<NEW_LINE>Token tableKeyword = formatToken(tableConstructorExpressionNode.tableKeyword(), 1, 0);<NEW_LINE>KeySpecifierNode keySpecifier = formatNode(tableConstructorExpressionNode.keySpecifier().orElse(null), 1, 0);<NEW_LINE>SeparatedNodeList<Node> rows = tableConstructorExpressionNode.rows();<NEW_LINE>int rowTrailingWS = 0, rowTrailingNL = 0;<NEW_LINE>if (rows.size() > 1) {<NEW_LINE>rowTrailingNL++;<NEW_LINE>} else {<NEW_LINE>rowTrailingWS++;<NEW_LINE>}<NEW_LINE>indent();<NEW_LINE>Token openBracket = formatToken(tableConstructorExpressionNode.openBracket(), 0, rowTrailingNL);<NEW_LINE>indent();<NEW_LINE>SeparatedNodeList<Node> mappingConstructors = formatSeparatedNodeList(tableConstructorExpressionNode.rows(), 0, 0, rowTrailingWS, rowTrailingNL, 0, rowTrailingNL);<NEW_LINE>unindent();<NEW_LINE>Token closeBracket = formatToken(tableConstructorExpressionNode.closeBracket(), <MASK><NEW_LINE>unindent();<NEW_LINE>return tableConstructorExpressionNode.modify().withTableKeyword(tableKeyword).withKeySpecifier(keySpecifier).withOpenBracket(openBracket).withRows(mappingConstructors).withCloseBracket(closeBracket).apply();<NEW_LINE>}
env.trailingWS, env.trailingNL);
1,564,951
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.<MASK><NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.setTime(parser.nextDateTime(Parser.DateTimeFormat.HMS_DMY));<NEW_LINE>position.setLatitude(parser.nextCoordinate());<NEW_LINE>position.setLongitude(parser.nextCoordinate());<NEW_LINE>position.setSpeed(parser.nextDouble(0));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.set(Position.KEY_HDOP, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_RSSI, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_CHARGE, parser.nextInt(0) == 2);<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0));<NEW_LINE>position.set(Position.PREFIX_ADC + 1, parser.nextInt(0));<NEW_LINE>position.set(Position.PREFIX_ADC + 2, parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextDouble(0) * 1000);<NEW_LINE>position.set(Position.KEY_INPUT, parser.next());<NEW_LINE>return position;<NEW_LINE>}
setDeviceId(deviceSession.getDeviceId());
475,032
public Request<ListEntitiesForPolicyRequest> marshall(ListEntitiesForPolicyRequest listEntitiesForPolicyRequest) {<NEW_LINE>if (listEntitiesForPolicyRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListEntitiesForPolicyRequest> request = new DefaultRequest<ListEntitiesForPolicyRequest>(listEntitiesForPolicyRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "ListEntitiesForPolicy");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (listEntitiesForPolicyRequest.getPolicyArn() != null) {<NEW_LINE>request.addParameter("PolicyArn", StringUtils.fromString(listEntitiesForPolicyRequest.getPolicyArn()));<NEW_LINE>}<NEW_LINE>if (listEntitiesForPolicyRequest.getEntityFilter() != null) {<NEW_LINE>request.addParameter("EntityFilter", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (listEntitiesForPolicyRequest.getPathPrefix() != null) {<NEW_LINE>request.addParameter("PathPrefix", StringUtils.fromString(listEntitiesForPolicyRequest.getPathPrefix()));<NEW_LINE>}<NEW_LINE>if (listEntitiesForPolicyRequest.getPolicyUsageFilter() != null) {<NEW_LINE>request.addParameter("PolicyUsageFilter", StringUtils.fromString(listEntitiesForPolicyRequest.getPolicyUsageFilter()));<NEW_LINE>}<NEW_LINE>if (listEntitiesForPolicyRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(listEntitiesForPolicyRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (listEntitiesForPolicyRequest.getMaxItems() != null) {<NEW_LINE>request.addParameter("MaxItems", StringUtils.fromInteger(listEntitiesForPolicyRequest.getMaxItems()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(listEntitiesForPolicyRequest.getEntityFilter()));
1,651,869
public boolean processOutgoingWakeupMessage(SerialMessage serialMessage) {<NEW_LINE>// The message is Ok, if we're awake, send it now...<NEW_LINE>if (isAwake) {<NEW_LINE>// We're sending a frame, so we need to stop the timer if it's running<NEW_LINE>resetSleepTimer();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Make sure we never add the WAKE_UP_NO_MORE_INFORMATION message to the queue<NEW_LINE>if (serialMessage.getMessagePayload().length >= 2 && serialMessage.getMessagePayload()[2] == (byte) WAKE_UP_NO_MORE_INFORMATION) {<NEW_LINE>logger.debug("NODE {}: Last MSG not queuing.", this.getNode().getNodeId());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (this.wakeUpQueue.contains(serialMessage)) {<NEW_LINE>logger.debug("NODE {}: Message already on the wake-up queue. Removing original.", this.getNode().getNodeId());<NEW_LINE>this.wakeUpQueue.remove(serialMessage);<NEW_LINE>}<NEW_LINE>logger.debug("NODE {}: Putting message {} in wakeup queue.", this.getNode().getNodeId(), serialMessage.getMessageClass());<NEW_LINE><MASK><NEW_LINE>// This message has been queued - don't send it now...<NEW_LINE>return false;<NEW_LINE>}
this.wakeUpQueue.add(serialMessage);
633,692
public FlowParameters createFromParcel(Parcel in) {<NEW_LINE>String appName = in.readString();<NEW_LINE>List<IdpConfig> providerInfo = in.createTypedArrayList(IdpConfig.CREATOR);<NEW_LINE>IdpConfig defaultProvider = in.readParcelable(IdpConfig.class.getClassLoader());<NEW_LINE>int themeId = in.readInt();<NEW_LINE><MASK><NEW_LINE>String termsOfServiceUrl = in.readString();<NEW_LINE>String privacyPolicyUrl = in.readString();<NEW_LINE>boolean enableCredentials = in.readInt() != 0;<NEW_LINE>boolean enableHints = in.readInt() != 0;<NEW_LINE>boolean enableAnonymousUpgrade = in.readInt() != 0;<NEW_LINE>boolean alwaysShowProviderChoice = in.readInt() != 0;<NEW_LINE>boolean lockOrientation = in.readInt() != 0;<NEW_LINE>String emailLink = in.readString();<NEW_LINE>ActionCodeSettings passwordResetSettings = in.readParcelable(ActionCodeSettings.class.getClassLoader());<NEW_LINE>AuthMethodPickerLayout customLayout = in.readParcelable(AuthMethodPickerLayout.class.getClassLoader());<NEW_LINE>return new FlowParameters(appName, providerInfo, defaultProvider, themeId, logoId, termsOfServiceUrl, privacyPolicyUrl, enableCredentials, enableHints, enableAnonymousUpgrade, alwaysShowProviderChoice, lockOrientation, emailLink, passwordResetSettings, customLayout);<NEW_LINE>}
int logoId = in.readInt();
1,516,782
public static <K> StringBinding stringValueAt(final ObservableMap<K, String> op, final ObservableValue<? extends K> key) {<NEW_LINE>if ((op == null) || (key == null)) {<NEW_LINE>throw new NullPointerException("Operands cannot be null.");<NEW_LINE>}<NEW_LINE>return new StringBinding() {<NEW_LINE><NEW_LINE>{<NEW_LINE>super.bind(op, key);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dispose() {<NEW_LINE>super.unbind(op, key);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected String computeValue() {<NEW_LINE>try {<NEW_LINE>return op.get(key.getValue());<NEW_LINE>} catch (ClassCastException ex) {<NEW_LINE>Logging.getLogger().warning("Exception while evaluating binding", ex);<NEW_LINE>// ignore<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>Logging.getLogger(<MASK><NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ObservableList<?> getDependencies() {<NEW_LINE>return new ImmutableObservableList<Observable>(op, key);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
).warning("Exception while evaluating binding", ex);
606,367
public void testAuthenticateMethodFL_ProtectedServlet1() throws Exception {<NEW_LINE>METHODS = "testMethod=authenticate,logout,login";<NEW_LINE>String url = "http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/formlogin/ProgrammaticAPIServlet?" + METHODS + "&user=" + managerUser + "&password=" + managerPassword;<NEW_LINE>HttpClient client = new DefaultHttpClient();<NEW_LINE>String response = authenticateWithValidAuthDataFL(client, validUser, validPassword, url);<NEW_LINE>// Get servlet output to verify each test<NEW_LINE>String test1 = response.substring(response.indexOf("STARTTEST1")<MASK><NEW_LINE>String test2 = response.substring(response.indexOf("STARTTEST2"), response.indexOf("ENDTEST2"));<NEW_LINE>String test3 = response.substring(response.indexOf("STARTTEST3"), response.indexOf("ENDTEST3"));<NEW_LINE>// TEST1 - check values after 1st authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, validUser, test1, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST2 - check values after logout<NEW_LINE>testHelper.verifyNullValuesAfterLogout(validUser, test2, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST3 - check values after 1st login<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, managerUser, test3, IS_MANAGER_ROLE, NOT_EMPLOYEE_ROLE);<NEW_LINE>List<String> passwordsInTrace = server.findStringsInLogsAndTrace(validPassword);<NEW_LINE>assertEquals("Should not find password we used to initially log in with in the log file", Collections.emptyList(), passwordsInTrace);<NEW_LINE>// N.B. In this case we are not searching for the manager password<NEW_LINE>// because it is being passed in via the request URL. Since the<NEW_LINE>// FormLogin flow will manipulate the request URL for a redirect<NEW_LINE>// and trace that manipulation, we are going to see the manager<NEW_LINE>// password. This is not viewed as a security issue at this time.<NEW_LINE>}
, response.indexOf("ENDTEST1"));
443,958
public void mapSimpleJavaTypesPredefined(Map definedElementMap) {<NEW_LINE>// System.out.println("Hit mapSimpleJavaTypesPredefined");<NEW_LINE>String namespace = getXSDNamespace() + ":";<NEW_LINE>// These guys are already defined in XML Schema. The java<NEW_LINE>// types have 1-to-1 mappings.<NEW_LINE>String[] types = new String[] { "java.lang.String", "String", "java.math.BigDecimal", "java.util.Calendar", "long", "int", "char", "short", "double", "float", "byte", "boolean" };<NEW_LINE>String[] schemaType = new String[] { "string", "string", "decimal", "dateTime", "long", "int", "char", "short", "double", "float", "byte", "boolean" };<NEW_LINE>for (int i = 0; i < types.length; ++i) {<NEW_LINE>ElementExpr def <MASK><NEW_LINE>if (def == null)<NEW_LINE>def = new SimpleType(namespace + schemaType[i], types[i]);<NEW_LINE>definedElementMap.put(types[i], def);<NEW_LINE>}<NEW_LINE>}
= getSchemaTypeDef(schemaType[i]);
214,726
public void onAvailable(Network network) {<NEW_LINE>NetworkInfo networkInfo = connectivityManager.getNetworkInfo(network);<NEW_LINE>LOG.fine(String.format(Locale<MASK><NEW_LINE>if (networkInfo == null || networkInfo.getState() != NetworkInfo.State.CONNECTED) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>broadcastVpnConnectivityChange(OutlinePlugin.TunnelStatus.CONNECTED);<NEW_LINE>updateNotification(OutlinePlugin.TunnelStatus.CONNECTED);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>// Indicate that traffic will be sent over the current active network.<NEW_LINE>// Although setting the underlying network to an available network may not seem like the<NEW_LINE>// correct behavior, this method has been observed only to fire only when a preferred<NEW_LINE>// network becomes available. It will not fire, for example, when the mobile network becomes<NEW_LINE>// available if WiFi is the active network. Additionally, `getActiveNetwork` and<NEW_LINE>// `getActiveNetworkInfo` have been observed to return the underlying network set by us.<NEW_LINE>setUnderlyingNetworks(new Network[] { network });<NEW_LINE>}<NEW_LINE>boolean isUdpSupported = vpnTunnel.updateUDPSupport();<NEW_LINE>LOG.info(String.format("UDP support: %s -> %s", tunnelStore.isUdpSupported(), isUdpSupported));<NEW_LINE>tunnelStore.setIsUdpSupported(isUdpSupported);<NEW_LINE>}
.ROOT, "Network available: %s", networkInfo));
87,297
@TruffleBoundary<NEW_LINE>public Object inet_ntop(int family, byte[] src) throws PosixException {<NEW_LINE>if (family != AF_INET.value && family != AF_INET6.value) {<NEW_LINE>throw posixException(OSErrorEnum.EAFNOSUPPORT);<NEW_LINE>}<NEW_LINE>int len = family <MASK><NEW_LINE>if (src.length < len) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>byte[] bytes = src.length > len ? PythonUtils.arrayCopyOf(src, len) : src;<NEW_LINE>try {<NEW_LINE>InetAddress addr = InetAddress.getByAddress(bytes);<NEW_LINE>if (family == AF_INET6.value && addr instanceof Inet4Address) {<NEW_LINE>return "::ffff:" + addr.getHostAddress();<NEW_LINE>}<NEW_LINE>return addr.getHostAddress();<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>throw shouldNotReachHere();<NEW_LINE>}<NEW_LINE>}
== AF_INET.value ? 4 : 16;
288,402
public void addFeatureDefinition(FeatureDefinition featureDefinition) {<NEW_LINE>for (BuildSpec buildSpec : buildSpecCache.values()) {<NEW_LINE>if (buildSpec.hasFeature(featureDefinition.getId())) {<NEW_LINE>buildSpec.getFeature(featureDefinition.getId()).setDefinition(featureDefinition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (BuildSpec buildSpec : invalidBuildSpecs.values()) {<NEW_LINE>if (buildSpec.hasFeature(featureDefinition.getId())) {<NEW_LINE>buildSpec.getFeature(featureDefinition.getId()).setDefinition(featureDefinition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (invalidFeatureDefinitions.containsKey(featureDefinition.getId())) {<NEW_LINE>// Remove any errors associated with the invalid feature definition before removing it<NEW_LINE>// $NON-NLS-1$<NEW_LINE>errors.remove("feature:" + featureDefinition.getId());<NEW_LINE>invalidFeatureDefinitions.remove(featureDefinition.getId());<NEW_LINE>}<NEW_LINE>featureDefinition.setRuntime(buildInfoCache.getRuntime());<NEW_LINE>featureDefinitionsCache.put(<MASK><NEW_LINE>}
featureDefinition.getId(), featureDefinition);
110,639
private void flushMenuCacheIfNeeded(final Contentlet contentlet, final Contentlet workingContentlet, final boolean isNewContent, final User systemUser) throws DotDataException, DotSecurityException {<NEW_LINE>// both file & page as content might trigger a menu cache flush<NEW_LINE>if (contentlet.isFileAsset() || contentlet.isHTMLPage()) {<NEW_LINE>final Identifier identifier = APILocator.getIdentifierAPI().find(contentlet);<NEW_LINE>final Host host = APILocator.getHostAPI().find(identifier.getHostId(), APILocator.getUserAPI().getSystemUser(), false);<NEW_LINE>final Folder folder = APILocator.getFolderAPI().findFolderByPath(identifier.getParentPath(), host, systemUser, false);<NEW_LINE>final boolean shouldRefresh = (contentlet.isFileAsset() && RefreshMenus.shouldRefreshMenus(APILocator.getFileAssetAPI().fromContentlet(workingContentlet), APILocator.getFileAssetAPI().fromContentlet(contentlet), isNewContent)) || (contentlet.isHTMLPage() && RefreshMenus.shouldRefreshMenus(APILocator.getHTMLPageAssetAPI().fromContentlet(workingContentlet), APILocator.getHTMLPageAssetAPI().fromContentlet(contentlet), isNewContent));<NEW_LINE>if (shouldRefresh) {<NEW_LINE>RefreshMenus.deleteMenu(folder);<NEW_LINE>CacheLocator.getNavToolCache().removeNav(host.getIdentifier(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), folder.getInode());
214,936
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "key", "value" };<NEW_LINE>String epl = "@name('create') create window MyWindowFE#firstevent as MySimpleKeyValueMap;\n" + "insert into MyWindowFE select theString as key, longBoxed as value from SupportBean;\n" + "@name('s0') select irstream key, value as value from MyWindowFE;\n" + "@name('delete') on SupportMarketDataBean as s0 delete from MyWindowFE as s1 where s0.symbol = s1.key;\n";<NEW_LINE>env.compileDeploy(epl).addListener("delete").addListener("s0").addListener("create");<NEW_LINE><MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", 1L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "E1", 1L } });<NEW_LINE>sendSupportBean(env, "E2", 2L);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "E1", 1L } });<NEW_LINE>// delete E2<NEW_LINE>sendMarketBean(env, "E1");<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "E1", 1L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, null);<NEW_LINE>sendSupportBean(env, "E3", 3L);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E3", 3L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "E3", 3L } });<NEW_LINE>// delete E3<NEW_LINE>// no effect<NEW_LINE>sendMarketBean(env, "E2");<NEW_LINE>sendMarketBean(env, "E3");<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "E3", 3L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, null);<NEW_LINE>sendSupportBean(env, "E4", 4L);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E4", 4L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "E4", 4L } });<NEW_LINE>// delete other event<NEW_LINE>sendMarketBean(env, "E1");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendSupportBean(env, "E1", 1L);
1,503,680
public void run() {<NEW_LINE>MessageDialogWithToggle md = new MessageDialogWithToggle(UIUtils.getActiveShell(), Messages.Startup_Notification, null, Messages.Startup_StudioRequiresFirefox, MessageDialog.INFORMATION, new String[] { StringUtil.ellipsify(CoreStrings.BROWSE), download ? Messages.Startup_Download : Messages.Startup_CheckAgain, IDialogConstants.CANCEL_LABEL }, 0, Messages.Startup_DontAskAgain, false);<NEW_LINE>md.setPrefKey(com.aptana.js.debug.ui.internal.IJSDebugUIConstants.PREF_SKIP_FIREFOX_CHECK);<NEW_LINE>md.setPrefStore(JSDebugUIPlugin.getDefault().getPreferenceStore());<NEW_LINE>int returnCode = md.open();<NEW_LINE>switch(returnCode) {<NEW_LINE>case IDialogConstants.INTERNAL_ID:<NEW_LINE>FileDialog fileDialog = new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN);<NEW_LINE>if (Platform.OS_WIN32.equals(Platform.getOS())) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fileDialog.setFilterExtensions(new String[] { "*.exe" });<NEW_LINE>fileDialog.setFilterNames(new String[] { Messages.Startup_ExecutableFiles });<NEW_LINE>}<NEW_LINE>path[<MASK><NEW_LINE>break;<NEW_LINE>case IDialogConstants.INTERNAL_ID + 1:<NEW_LINE>if (download) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>WorkbenchBrowserUtil.launchExternalBrowser("http://www.getfirefox.com");<NEW_LINE>}<NEW_LINE>path[0] = StringUtil.EMPTY;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}
0] = fileDialog.open();
1,118,435
public void handleConnectionException(RegisteredServer server, Throwable throwable, boolean safe) {<NEW_LINE>if (!isActive()) {<NEW_LINE>// If the connection is no longer active, it makes no sense to try and recover it.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (throwable == null) {<NEW_LINE>throw new NullPointerException("throwable");<NEW_LINE>}<NEW_LINE>Throwable wrapped = throwable;<NEW_LINE>if (throwable instanceof CompletionException) {<NEW_LINE>Throwable cause = throwable.getCause();<NEW_LINE>if (cause != null) {<NEW_LINE>wrapped = cause;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Component friendlyError;<NEW_LINE>if (connectedServer != null && connectedServer.getServerInfo().equals(server.getServerInfo())) {<NEW_LINE>friendlyError = Component.translatable("velocity.error.connected-server-error", Component.text(server.getServerInfo().getName()));<NEW_LINE>} else {<NEW_LINE>logger.error("{}: unable to connect to server {}", this, server.getServerInfo().getName(), wrapped);<NEW_LINE>friendlyError = Component.translatable("velocity.error.connecting-server-error", Component.text(server.getServerInfo<MASK><NEW_LINE>}<NEW_LINE>handleConnectionException(server, null, friendlyError.color(NamedTextColor.RED), safe);<NEW_LINE>}
().getName()));
1,384,883
public okhttp3.Call readPodSecurityPolicyCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/policy/v1beta1/podsecuritypolicies/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarHeaderParams.put("Accept", localVarAccept);
784,156
public <B extends Message.Builder> B copyInto(B builder) {<NEW_LINE>Descriptor descriptor = builder.getDescriptorForType();<NEW_LINE>// Handle standard codes.<NEW_LINE>if (!descriptor.getOptions().hasExtension(Annotations.fhirValuesetUrl)) {<NEW_LINE>if (!AnnotationUtils.getStructureDefinitionUrl(builder.getDescriptorForType()).equals(AnnotationUtils.getStructureDefinitionUrl(Code.getDescriptor()))) {<NEW_LINE>throw new IllegalArgumentException("Type " + descriptor.getFullName() + " is not a FHIR code type");<NEW_LINE>}<NEW_LINE>return super.copyInto(builder);<NEW_LINE>}<NEW_LINE>// Handle specialized codes.<NEW_LINE>if (getWrapped().hasId()) {<NEW_LINE>builder.setField(descriptor.findFieldByName("id"), getWrapped().getId());<NEW_LINE>}<NEW_LINE>ExtensionWrapper.fromExtensionsIn(getWrapped()).addToMessage(builder);<NEW_LINE>if (!hasValue()) {<NEW_LINE>// We're done if there is no value to parse.<NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>FieldDescriptor <MASK><NEW_LINE>if (valueField.getType() == FieldDescriptor.Type.STRING) {<NEW_LINE>return (B) builder.setField(valueField, getWrapped().getValue());<NEW_LINE>}<NEW_LINE>if (valueField.getType() != FieldDescriptor.Type.ENUM) {<NEW_LINE>throw new IllegalArgumentException("Invalid target message: " + descriptor.getFullName());<NEW_LINE>}<NEW_LINE>EnumValueDescriptor enumValue = getEnumValueDescriptor(valueField.getEnumType(), getWrapped().getValue());<NEW_LINE>return (B) builder.setField(valueField, enumValue);<NEW_LINE>}
valueField = descriptor.findFieldByName("value");
240,883
@SuppressWarnings("null")<NEW_LINE>public Iterator<? extends Entity> iterator(Event e) {<NEW_LINE>if (isUsingRadius) {<NEW_LINE>assert center != null;<NEW_LINE>Location l = center.getSingle(e);<NEW_LINE>if (l == null)<NEW_LINE>return null;<NEW_LINE>assert radius != null;<NEW_LINE>Number <MASK><NEW_LINE>if (n == null)<NEW_LINE>return null;<NEW_LINE>double d = n.doubleValue();<NEW_LINE>Collection<Entity> es = l.getWorld().getNearbyEntities(l, d, d, d);<NEW_LINE>double radiusSquared = d * d * Skript.EPSILON_MULT;<NEW_LINE>EntityData<?>[] ts = types.getAll(e);<NEW_LINE>return new CheckedIterator<>(es.iterator(), e1 -> {<NEW_LINE>if (e1 == null || e1.getLocation().distanceSquared(l) > radiusSquared)<NEW_LINE>return false;<NEW_LINE>for (EntityData<?> t : ts) {<NEW_LINE>if (t.isInstance(e1))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>if (worlds == null && returnType == Player.class)<NEW_LINE>return super.iterator(e);<NEW_LINE>return new NonNullIterator<Entity>() {<NEW_LINE><NEW_LINE>private World[] ws = worlds == null ? Bukkit.getWorlds().toArray(new World[0]) : worlds.getArray(e);<NEW_LINE><NEW_LINE>private EntityData<?>[] ts = types.getAll(e);<NEW_LINE><NEW_LINE>private int w = -1;<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>private Iterator<? extends Entity> curIter = null;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nullable<NEW_LINE>protected Entity getNext() {<NEW_LINE>while (true) {<NEW_LINE>while (curIter == null || !curIter.hasNext()) {<NEW_LINE>w++;<NEW_LINE>if (w == ws.length)<NEW_LINE>return null;<NEW_LINE>curIter = ws[w].getEntitiesByClass(returnType).iterator();<NEW_LINE>}<NEW_LINE>while (curIter.hasNext()) {<NEW_LINE>Entity current = curIter.next();<NEW_LINE>for (EntityData<?> t : ts) {<NEW_LINE>if (t.isInstance(current))<NEW_LINE>return current;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
n = radius.getSingle(e);
1,022,749
public boolean updateConfig(String group, String serviceId, String config) throws Exception {<NEW_LINE>String appId = environment.getProperty(ApolloConstant.APOLLO_PLUGIN_APP_ID);<NEW_LINE>if (StringUtils.isEmpty(appId)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>String env = environment.getProperty(ApolloConstant.APOLLO_PLUGIN_ENV);<NEW_LINE>if (StringUtils.isEmpty(env)) {<NEW_LINE>throw new DiscoveryException(ApolloConstant.APOLLO_PLUGIN_ENV + " can't be null or empty");<NEW_LINE>}<NEW_LINE>String operator = environment.getProperty(ApolloConstant.APOLLO_OPERATOR);<NEW_LINE>if (StringUtils.isEmpty(operator)) {<NEW_LINE>throw new DiscoveryException(ApolloConstant.APOLLO_OPERATOR + " can't be null or empty");<NEW_LINE>}<NEW_LINE>String cluster = environment.getProperty(ApolloConstant.APOLLO_PLUGIN_CLUSTER, String.class, ApolloConstant.APOLLO_DEFAULT_CLUSTER);<NEW_LINE>String namespace = environment.getProperty(ApolloConstant.APOLLO_PLUGIN_NAMESPACE, String.class, ApolloConstant.APOLLO_DEFAULT_NAMESPACE);<NEW_LINE>Date now = new Date();<NEW_LINE>OpenItemDTO openItemDTO = new OpenItemDTO();<NEW_LINE>openItemDTO.setKey(group + "-" + serviceId);<NEW_LINE>openItemDTO.setValue(config);<NEW_LINE>openItemDTO.setComment("Operated by Nepxion Discovery Console");<NEW_LINE>openItemDTO.setDataChangeCreatedBy(operator);<NEW_LINE>openItemDTO.setDataChangeLastModifiedBy(operator);<NEW_LINE>openItemDTO.setDataChangeCreatedTime(now);<NEW_LINE>openItemDTO.setDataChangeLastModifiedTime(now);<NEW_LINE>apolloOpenApiClient.createOrUpdateItem(appId, env, cluster, namespace, openItemDTO);<NEW_LINE>NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO();<NEW_LINE>namespaceReleaseDTO.setReleaseTitle(new SimpleDateFormat("yyyyMMddHHmmss").format(now) + "-release");<NEW_LINE>namespaceReleaseDTO.setReleasedBy(operator);<NEW_LINE>namespaceReleaseDTO.setReleaseComment("Released by Nepxion Discovery Console");<NEW_LINE>namespaceReleaseDTO.setEmergencyPublish(true);<NEW_LINE>apolloOpenApiClient.publishNamespace(appId, env, cluster, namespace, namespaceReleaseDTO);<NEW_LINE>return true;<NEW_LINE>}
DiscoveryException(ApolloConstant.APOLLO_PLUGIN_APP_ID + " can't be null or empty");
1,481,512
protected Object latestResult(final JsonRpcRequestContext request) {<NEW_LINE>final long headBlockNumber = blockchainQueriesSupplier.get().headBlockNumber();<NEW_LINE>Blockchain chain = blockchainQueriesSupplier.get().getBlockchain();<NEW_LINE>BlockHeader headHeader = chain.getBlockHeader(headBlockNumber).orElse(null);<NEW_LINE><MASK><NEW_LINE>Hash stateRoot = headHeader.getStateRoot();<NEW_LINE>if (blockchainQueriesSupplier.get().getWorldStateArchive().isWorldStateAvailable(stateRoot, block)) {<NEW_LINE>if (this.synchronizer.getSyncStatus().isEmpty()) {<NEW_LINE>// we are already in sync<NEW_LINE>return resultByBlockNumber(request, headBlockNumber);<NEW_LINE>} else {<NEW_LINE>// out of sync, return highest pulled block<NEW_LINE>long headishBlock = this.synchronizer.getSyncStatus().get().getCurrentBlock();<NEW_LINE>return resultByBlockNumber(request, headishBlock);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.trace("no world state available for block {} returning genesis", headBlockNumber);<NEW_LINE>return resultByBlockNumber(request, blockchainQueriesSupplier.get().getBlockchain().getGenesisBlock().getHeader().getNumber());<NEW_LINE>}
Hash block = headHeader.getHash();
1,408,388
public static DescribeUserInfoInChannelResponse unmarshall(DescribeUserInfoInChannelResponse describeUserInfoInChannelResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeUserInfoInChannelResponse.setRequestId(_ctx.stringValue("DescribeUserInfoInChannelResponse.RequestId"));<NEW_LINE>describeUserInfoInChannelResponse.setTimestamp(_ctx.integerValue("DescribeUserInfoInChannelResponse.Timestamp"));<NEW_LINE>describeUserInfoInChannelResponse.setIsInChannel(_ctx.booleanValue("DescribeUserInfoInChannelResponse.IsInChannel"));<NEW_LINE>describeUserInfoInChannelResponse.setIsChannelExist(_ctx.booleanValue("DescribeUserInfoInChannelResponse.IsChannelExist"));<NEW_LINE>List<PropertyItem> property = new ArrayList<PropertyItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeUserInfoInChannelResponse.Property.Length"); i++) {<NEW_LINE>PropertyItem propertyItem = new PropertyItem();<NEW_LINE>propertyItem.setSession(_ctx.stringValue("DescribeUserInfoInChannelResponse.Property[" + i + "].Session"));<NEW_LINE>propertyItem.setRole(_ctx.integerValue("DescribeUserInfoInChannelResponse.Property[" + i + "].Role"));<NEW_LINE>propertyItem.setJoin(_ctx.integerValue<MASK><NEW_LINE>property.add(propertyItem);<NEW_LINE>}<NEW_LINE>describeUserInfoInChannelResponse.setProperty(property);<NEW_LINE>return describeUserInfoInChannelResponse;<NEW_LINE>}
("DescribeUserInfoInChannelResponse.Property[" + i + "].Join"));
231,616
private static void convertBgpProcess(Configuration c, FrrVendorConfiguration vc, FrrConfiguration frr, Warnings w) {<NEW_LINE>BgpProcess bgpProcess = frr.getBgpProcess();<NEW_LINE>if (bgpProcess == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// First pass: only core processes<NEW_LINE>c.getDefaultVrf().setBgpProcess(toBgpProcess(c, frr, DEFAULT_VRF_NAME, bgpProcess.getDefaultVrf()));<NEW_LINE>// We make one VI process per VRF because our current datamodel requires it<NEW_LINE>bgpProcess.getVrfs().forEach((vrfName, bgpVrf) -> c.getVrfs().get(vrfName).setBgpProcess(toBgpProcess(c, frr, vrfName, bgpVrf)));<NEW_LINE>// Create dud processes for other VRFs that use VNIs, so we can have proper RIBs<NEW_LINE>c.getVrfs().forEach((vrfName, vrf) -> {<NEW_LINE>if ((// VRF has some VNI<NEW_LINE>!vrf.getLayer2Vnis().isEmpty() || // process does not already exist<NEW_LINE>!vrf.getLayer3Vnis().isEmpty()) && vrf.getBgpProcess() == null && c.getDefaultVrf().getBgpProcess() != null) {<NEW_LINE>// there is a default BGP proc<NEW_LINE>vrf.setBgpProcess(bgpProcessBuilder().setRouterId(c.getDefaultVrf().getBgpProcess().getRouterId()).setRedistributionPolicy(initDenyAllBgpRedistributionPolicy(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>Iterables.concat(ImmutableSet.of(bgpProcess.getDefaultVrf()), bgpProcess.getVrfs().values()).forEach(bgpVrf -> {<NEW_LINE>bgpVrf.getNeighbors().values().stream().filter(neighbor -> !(neighbor instanceof BgpPeerGroupNeighbor)).forEach(neighbor -> addBgpNeighbor(c, vc, frr, bgpVrf, neighbor, w));<NEW_LINE>});<NEW_LINE>}
c)).build());
1,807,140
private RemoteVersion tryProcessDistance(final HttpURLConnection connection) throws IOException {<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {<NEW_LINE>final JsonObject obj = new Gson().<MASK><NEW_LINE>switch(obj.get("status").getAsString()) {<NEW_LINE>case "identical":<NEW_LINE>{<NEW_LINE>return new RemoteVersion(BranchStatus.IDENTICAL, 0);<NEW_LINE>}<NEW_LINE>case "ahead":<NEW_LINE>{<NEW_LINE>return new RemoteVersion(BranchStatus.AHEAD, 0);<NEW_LINE>}<NEW_LINE>case "behind":<NEW_LINE>{<NEW_LINE>return new RemoteVersion(BranchStatus.BEHIND, obj.get("behind_by").getAsInt());<NEW_LINE>}<NEW_LINE>case "diverged":<NEW_LINE>{<NEW_LINE>return new RemoteVersion(BranchStatus.DIVERGED, obj.get("behind_by").getAsInt());<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>return new RemoteVersion(BranchStatus.UNKNOWN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JsonSyntaxException | NumberFormatException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return new RemoteVersion(BranchStatus.ERROR);<NEW_LINE>}<NEW_LINE>}
fromJson(reader, JsonObject.class);
1,634,978
public final Tuple2<Integer, Double> bestSplitNumerical(int fStart, double mse, double totalSquareSum, double totalSum, double totalWeight) {<NEW_LINE>double bestGain = 0.;<NEW_LINE>int bestSplit = 0;<NEW_LINE>double leftSum = 0.;<NEW_LINE>double leftSquareSum = 0.;<NEW_LINE>double leftWeight = 0.;<NEW_LINE>double rightSum = totalSum;<NEW_LINE>double rightSquareSum = totalSquareSum;<NEW_LINE>double rightWeight = totalWeight;<NEW_LINE>for (int z = 0; z < nBin - 1; ++z) {<NEW_LINE>int binStart = fStart + z * 3;<NEW_LINE>leftSum += minusHist[binStart];<NEW_LINE>leftSquareSum += minusHist[binStart + 1];<NEW_LINE>leftWeight += minusHist[binStart + 2];<NEW_LINE>rightSum -= minusHist[binStart];<NEW_LINE><MASK><NEW_LINE>rightWeight -= minusHist[binStart + 2];<NEW_LINE>if (minSamplesPerLeaf > leftWeight || minSamplesPerLeaf > rightWeight) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>double leftMean = leftSum / leftWeight;<NEW_LINE>double leftMse = leftSquareSum / leftWeight - leftMean * leftMean;<NEW_LINE>double rightMean = rightSum / rightWeight;<NEW_LINE>double rightMse = rightSquareSum / rightWeight - rightMean * rightMean;<NEW_LINE>double curGain = mse - leftWeight / totalWeight * leftMse - rightWeight / totalWeight * rightMse;<NEW_LINE>if (curGain > bestGain) {<NEW_LINE>bestGain = curGain;<NEW_LINE>bestSplit = z;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Tuple2.of(bestSplit, bestGain);<NEW_LINE>}
rightSquareSum -= minusHist[binStart + 1];
1,608,067
public void execute(TransformerImpl transformer) throws TransformerException {<NEW_LINE>boolean found = false;<NEW_LINE>for (ElemTemplateElement childElem = getFirstChildElem(); childElem != null; childElem = childElem.getNextSiblingElem()) {<NEW_LINE>int type = childElem.getXSLToken();<NEW_LINE>if (Constants.ELEMNAME_WHEN == type) {<NEW_LINE>found = true;<NEW_LINE>ElemWhen when = (ElemWhen) childElem;<NEW_LINE>// must be xsl:when<NEW_LINE>XPathContext xctxt = transformer.getXPathContext();<NEW_LINE><MASK><NEW_LINE>// System.err.println("\""+when.getTest().getPatternString()+"\"");<NEW_LINE>// if(when.getTest().getPatternString().equals("COLLECTION/icuser/ictimezone/LITERAL='GMT +13:00 Pacific/Tongatapu'"))<NEW_LINE>// System.err.println("Found COLLECTION/icuser/ictimezone/LITERAL");<NEW_LINE>if (when.getTest().bool(xctxt, sourceNode, when)) {<NEW_LINE>transformer.executeChildTemplates(when, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (Constants.ELEMNAME_OTHERWISE == type) {<NEW_LINE>found = true;<NEW_LINE>// xsl:otherwise<NEW_LINE>transformer.executeChildTemplates(childElem, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found)<NEW_LINE>transformer.getMsgMgr().error(this, XSLTErrorResources.ER_CHOOSE_REQUIRES_WHEN);<NEW_LINE>}
int sourceNode = xctxt.getCurrentNode();
645,475
static ProcStat parseWithSplits(String cat) throws ParseException {<NEW_LINE>ProcStat stat = new ProcStat();<NEW_LINE>if (!TextUtils.isEmpty(cat)) {<NEW_LINE>int index = cat.indexOf(")");<NEW_LINE>if (index <= 0)<NEW_LINE><MASK><NEW_LINE>String prefix = cat.substring(0, index);<NEW_LINE>int indexBgn = prefix.indexOf("(") + "(".length();<NEW_LINE>stat.comm = prefix.substring(indexBgn, index);<NEW_LINE>String suffix = cat.substring(index + ")".length());<NEW_LINE>String[] splits = suffix.split(" ");<NEW_LINE>if (!isNumeric(splits[12])) {<NEW_LINE>throw new ParseException(cat + "\nutime: " + splits[12]);<NEW_LINE>}<NEW_LINE>if (!isNumeric(splits[13])) {<NEW_LINE>throw new ParseException(cat + "\nstime: " + splits[13]);<NEW_LINE>}<NEW_LINE>if (!isNumeric(splits[14])) {<NEW_LINE>throw new ParseException(cat + "\ncutime: " + splits[14]);<NEW_LINE>}<NEW_LINE>if (!isNumeric(splits[15])) {<NEW_LINE>throw new ParseException(cat + "\ncstime: " + splits[15]);<NEW_LINE>}<NEW_LINE>stat.stat = splits[1];<NEW_LINE>stat.utime = MatrixUtil.parseLong(splits[12], 0);<NEW_LINE>stat.stime = MatrixUtil.parseLong(splits[13], 0);<NEW_LINE>stat.cutime = MatrixUtil.parseLong(splits[14], 0);<NEW_LINE>stat.cstime = MatrixUtil.parseLong(splits[15], 0);<NEW_LINE>}<NEW_LINE>return stat;<NEW_LINE>}
throw new IllegalStateException(cat + " has not ')'");
260,226
public void open(Configuration parameters) throws Exception {<NEW_LINE>FieldInfo[] fields = dorisSinkInfo.getFields();<NEW_LINE>int fieldsLength = fields.length;<NEW_LINE>String[] fieldNames = new String[fieldsLength];<NEW_LINE>FormatInfo[] formatInfos = new FormatInfo[fieldsLength];<NEW_LINE>for (int i = 0; i < fieldsLength; ++i) {<NEW_LINE>FieldInfo field = fields[i];<NEW_LINE>fieldNames[<MASK><NEW_LINE>formatInfos[i] = field.getFormatInfo();<NEW_LINE>}<NEW_LINE>DorisSinkOptions dorisSinkOptions = new DorisSinkOptionsBuilder().setFeNodes(dorisSinkInfo.getFenodes()).setUsername(dorisSinkInfo.getUsername()).setPassword(dorisSinkInfo.getPassword()).setTableIdentifier(dorisSinkInfo.getTableIdentifier()).build();<NEW_LINE>// generate DorisOutputFormat<NEW_LINE>outputFormat = new DorisOutputFormat(dorisSinkOptions, fieldNames, formatInfos);<NEW_LINE>RuntimeContext ctx = getRuntimeContext();<NEW_LINE>outputFormat.setRuntimeContext(ctx);<NEW_LINE>outputFormat.open(ctx.getIndexOfThisSubtask(), ctx.getNumberOfParallelSubtasks());<NEW_LINE>}
i] = field.getName();
1,483,891
public void invokePost() {<NEW_LINE>StringEntity stringEntity = new StringEntity(prepareRequest());<NEW_LINE>HttpPost httpPost = new HttpPost("https://reqbin.com/echo/post/json");<NEW_LINE>httpPost.setEntity(stringEntity);<NEW_LINE><MASK><NEW_LINE>httpPost.setHeader("Content-type", "application/json");<NEW_LINE>try (CloseableHttpClient httpClient = HttpClients.createDefault();<NEW_LINE>CloseableHttpResponse response = httpClient.execute(httpPost)) {<NEW_LINE>// Get HttpResponse Status<NEW_LINE>// HTTP/1.1<NEW_LINE>System.out.println("version " + response.getVersion());<NEW_LINE>// 200<NEW_LINE>System.out.println(response.getCode());<NEW_LINE>// OK<NEW_LINE>System.out.println(response.getReasonPhrase());<NEW_LINE>HttpEntity entity = response.getEntity();<NEW_LINE>if (entity != null) {<NEW_LINE>// return it as a String<NEW_LINE>String result = EntityUtils.toString(entity);<NEW_LINE>System.out.println(result);<NEW_LINE>}<NEW_LINE>} catch (ParseException | IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
httpPost.setHeader("Accept", "application/json");
834,586
private void processTimestampSeeks() {<NEW_LINE>Iterator<TopicPartitionOffset> seekIterator = this.seeks.iterator();<NEW_LINE>Map<TopicPartition, Long> timestampSeeks = null;<NEW_LINE>while (seekIterator.hasNext()) {<NEW_LINE>TopicPartitionOffset tpo = seekIterator.next();<NEW_LINE>if (SeekPosition.TIMESTAMP.equals(tpo.getPosition())) {<NEW_LINE>if (timestampSeeks == null) {<NEW_LINE>timestampSeeks = new HashMap<>();<NEW_LINE>}<NEW_LINE>timestampSeeks.put(tpo.getTopicPartition(), tpo.getOffset());<NEW_LINE>seekIterator.remove();<NEW_LINE>traceSeek(tpo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (timestampSeeks != null) {<NEW_LINE>Map<TopicPartition, OffsetAndTimestamp> offsetsForTimes = <MASK><NEW_LINE>offsetsForTimes.forEach((tp, ot) -> {<NEW_LINE>if (ot != null) {<NEW_LINE>this.consumer.seek(tp, ot.offset());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
this.consumer.offsetsForTimes(timestampSeeks);
1,526,618
public void run(RegressionEnvironment env) {<NEW_LINE>env.compileDeploy("@name('s0') select rstream s1.intPrimitive as aID, s2.intPrimitive as bID " + "from SupportBean(theString='a')#length(2) as s1, " + "SupportBean(theString='b')#keepall as s2" + " where s1.intPrimitive = s2.intPrimitive").addListener("s0");<NEW_LINE>sendEvent(env, "a", 1);<NEW_LINE>sendEvent(env, "b", 1);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendEvent(env, "a", 2);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendEvent(env, "a", 3);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>// receive 'a' as new data<NEW_LINE>assertEquals(1, listener.getLastNewData()[<MASK><NEW_LINE>assertEquals(1, listener.getLastNewData()[0].get("bID"));<NEW_LINE>// receive no more old data<NEW_LINE>assertNull(listener.getLastOldData());<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
0].get("aID"));
1,674,342
public void resolveChainedTargets() {<NEW_LINE>final Map<TypeVariable, InferredValue> inferredTypes = new LinkedHashMap<>(this.size());<NEW_LINE>// TODO: we can probably make this a bit more efficient<NEW_LINE>boolean grew = true;<NEW_LINE>while (grew) {<NEW_LINE>grew = false;<NEW_LINE>for (final Map.Entry<TypeVariable, InferredValue> inferred : this.entrySet()) {<NEW_LINE>final TypeVariable target = inferred.getKey();<NEW_LINE>final InferredValue value = inferred.getValue();<NEW_LINE>if (value instanceof InferredType) {<NEW_LINE>inferredTypes.put(target, value);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>final InferredType equivalentType = (InferredType) inferredTypes.get(((InferredTarget) value).target);<NEW_LINE>if (equivalentType != null) {<NEW_LINE>grew = true;<NEW_LINE>final AnnotatedTypeMirror type = equivalentType.type.deepCopy();<NEW_LINE>type.replaceAnnotations(currentTarget.additionalAnnotations);<NEW_LINE>final InferredType newConstraint = new InferredType(type);<NEW_LINE>inferredTypes.put(currentTarget.target, newConstraint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.putAll(inferredTypes);<NEW_LINE>}
final InferredTarget currentTarget = (InferredTarget) value;
1,435,691
private void savePreferences() {<NEW_LINE>// log reply changes.<NEW_LINE>if (!mPrefs.reply().get().equals(mReplyPref.getText().toString())) {<NEW_LINE>// Log old value and new value.<NEW_LINE>mAddLogPresenter.addLog(getString(R.string.settings_changed, mReplyPref.getDialogTitle().toString(), mPrefs.reply().get(), mReplyPref.getText().toString()));<NEW_LINE>}<NEW_LINE>mPrefs.reply().set(mReplyPref.getText().toString());<NEW_LINE>if (mPrefs.enableReplyFrmServer().get() != mEnableReplyFrmServer.isChecked()) {<NEW_LINE>boolean checked = mEnableReplyFrmServer.isChecked() ? true : false;<NEW_LINE>String check = getCheckedStatus(checked);<NEW_LINE>String status = getCheckedStatus(mPrefs.enableReplyFrmServer().get());<NEW_LINE>mAddLogPresenter.addLog(getString(R.string.settings_changed, mEnableReplyFrmServer.getTitle().toString(), status, check));<NEW_LINE>}<NEW_LINE>mPrefs.enableReplyFrmServer().<MASK><NEW_LINE>}
set(mEnableReplyFrmServer.isChecked());
429,490
public void onClickShowAvailableFeedbackWidgets(View v) {<NEW_LINE>Countly.sharedInstance().feedback().getAvailableFeedbackWidgets(new RetrieveFeedbackWidgets() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFinished(List<CountlyFeedbackWidget> retrievedWidgets, String error) {<NEW_LINE>if (error != null) {<NEW_LINE>Toast.makeText(ActivityExampleFeedback.this, "Encountered error while getting a list of available feedback widgets: [" + error + "]", Toast.LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (retrievedWidgets == null) {<NEW_LINE>Toast.makeText(ActivityExampleFeedback.this, "Got a null widget list", <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (CountlyFeedbackWidget widget : retrievedWidgets) {<NEW_LINE>sb.append("[" + widget.widgetId + " " + widget.name + " " + widget.type + "]\n");<NEW_LINE>}<NEW_LINE>Toast.makeText(ActivityExampleFeedback.this, sb.toString(), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Toast.LENGTH_LONG).show();
1,011,004
public void fieldEofResponse(byte[] headerNull, List<byte[]> fieldsNull, List<FieldPacket> fieldPackets, byte[] eofNull, boolean isLeft, @NotNull AbstractService service) {<NEW_LINE>managerSession.setHandlerStart(this);<NEW_LINE>if (terminate.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>if (terminate.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ResultSetHeaderPacket hp = new ResultSetHeaderPacket();<NEW_LINE>hp.setFieldCount(fieldPackets.size());<NEW_LINE>hp.setPacketId(++packetId);<NEW_LINE><MASK><NEW_LINE>buffer = hp.write(buffer, source.getService(), true);<NEW_LINE>for (FieldPacket fp : fieldPackets) {<NEW_LINE>fp.setPacketId(++packetId);<NEW_LINE>buffer = fp.write(buffer, source.getService(), true);<NEW_LINE>}<NEW_LINE>EOFPacket ep = new EOFPacket();<NEW_LINE>ep.setPacketId(++packetId);<NEW_LINE>buffer = ep.write(buffer, source.getService(), true);<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}
FrontendConnection source = managerSession.getSource();
22,214
public List<PropertyCombinations> collapseProperties() {<NEW_LINE>// Collate property values in this map<NEW_LINE>SortedMap<CollapsedPropertyKey, List<String[]>> map = Maps.newTreeMap();<NEW_LINE>BindingProperty[] propertyKeys = getOrderedProperties();<NEW_LINE>// Loop over all possible property value permutations<NEW_LINE>for (Iterator<String[]> it = iterator(); it.hasNext(); ) {<NEW_LINE>String[<MASK><NEW_LINE>assert propertyValues.length == propertyKeys.length;<NEW_LINE>BindingProperties bindingProperties = new BindingProperties(propertyKeys, propertyValues, ConfigurationProperties.EMPTY);<NEW_LINE>CollapsedPropertyKey key = new CollapsedPropertyKey(bindingProperties);<NEW_LINE>List<String[]> list = map.get(key);<NEW_LINE>if (list == null) {<NEW_LINE>list = Lists.newArrayList();<NEW_LINE>map.put(key, list);<NEW_LINE>}<NEW_LINE>list.add(propertyValues);<NEW_LINE>}<NEW_LINE>// Return the collated values<NEW_LINE>List<PropertyCombinations> toReturn = new ArrayList<PropertyCombinations>(map.size());<NEW_LINE>for (List<String[]> list : map.values()) {<NEW_LINE>toReturn.add(new PropertyCombinations(this, list));<NEW_LINE>}<NEW_LINE>return toReturn;<NEW_LINE>}
] propertyValues = it.next();
486,797
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {<NEW_LINE>if (!matcher.matches(tree, state)) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>Description.Builder description = buildDescription(tree);<NEW_LINE>MethodSymbol sym = ASTHelpers.getSymbol(tree);<NEW_LINE>description.setMessage(String.format("Because of spurious wakeups, %s must always be called in a loop", sym));<NEW_LINE>// If this looks like the "Wait until a condition becomes true" case from the wiki content,<NEW_LINE>// rewrite the enclosing if to a while. Other fixes are too complicated to construct<NEW_LINE>// mechanically, so we provide detailed instructions in the wiki content.<NEW_LINE>if (!waitMethodWithTimeout.matches(tree, state)) {<NEW_LINE>JCIf enclosingIf = ASTHelpers.findEnclosingNode(state.getPath().getParentPath(), JCIf.class);<NEW_LINE>if (enclosingIf != null && enclosingIf.getElseStatement() == null) {<NEW_LINE>CharSequence ifSource = state.getSourceForNode(enclosingIf);<NEW_LINE>if (ifSource == null) {<NEW_LINE>// Source isn't available, so we can't construct a fix<NEW_LINE>return description.build();<NEW_LINE>}<NEW_LINE>String replacement = ifSource.toString().replaceFirst("if", "while");<NEW_LINE>return description.addFix(SuggestedFix.replace(enclosingIf<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return description.build();<NEW_LINE>}
, replacement)).build();
294,432
protected void layoutChildren() {<NEW_LINE>super.layoutChildren();<NEW_LINE>switch(dayView.getHoursLayoutStrategy()) {<NEW_LINE>case FIXED_HOUR_COUNT:<NEW_LINE>double height = getHeight();<NEW_LINE><MASK><NEW_LINE>// height must be at least 1px<NEW_LINE>dayView.setHourHeight(Math.max(1, height / visibleHours));<NEW_LINE>break;<NEW_LINE>case FIXED_HOUR_HEIGHT:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Insets insets = getInsets();<NEW_LINE>final double ph = dayView.prefHeight(-1);<NEW_LINE>dayView.resizeRelocate(snapPosition(insets.getLeft()), snapPosition(insets.getTop()), snapSize(getWidth() - insets.getLeft() - insets.getRight()), snapSize(Math.max(ph, getHeight() - insets.getTop() - insets.getBottom())));<NEW_LINE>switch(dayView.getHoursLayoutStrategy()) {<NEW_LINE>case FIXED_HOUR_COUNT:<NEW_LINE>if (cachedStartTime != null) {<NEW_LINE>dayView.setTranslateY(-ViewHelper.getTimeLocation(dayView, cachedStartTime, true));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FIXED_HOUR_HEIGHT:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (dayView.getTranslateY() + dayView.getHeight() < getHeight() - insets.getTop() - insets.getBottom()) {<NEW_LINE>dayView.setTranslateY(getMaxTranslateY(insets));<NEW_LINE>}<NEW_LINE>}
int visibleHours = dayView.getVisibleHours();
1,532,476
final UpdateTriggerResult executeUpdateTrigger(UpdateTriggerRequest updateTriggerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateTriggerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateTriggerRequest> request = null;<NEW_LINE>Response<UpdateTriggerResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateTriggerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateTriggerRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateTrigger");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateTriggerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateTriggerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
340,365
private void initThreadCount() {<NEW_LINE>int availableProcessors = Runtime.getRuntime().availableProcessors();<NEW_LINE>Integer[] fileIngestThreadCountChoices;<NEW_LINE>if (availableProcessors >= 16) {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1, 2, 4, 6, 8, 12, 16 };<NEW_LINE>} else if (availableProcessors >= 12 && availableProcessors <= 15) {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1, 2, 4, 6, 8, 12 };<NEW_LINE>} else if (availableProcessors >= 8 && availableProcessors <= 11) {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1, 2, 4, 6, 8 };<NEW_LINE>} else if (availableProcessors >= 6 && availableProcessors <= 7) {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1, 2, 4, 6 };<NEW_LINE>} else if (availableProcessors >= 4 && availableProcessors <= 5) {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1, 2, 4 };<NEW_LINE>} else if (availableProcessors >= 2 && availableProcessors <= 3) {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1, 2 };<NEW_LINE>} else {<NEW_LINE>fileIngestThreadCountChoices = new Integer[] { 1 };<NEW_LINE>}<NEW_LINE>numberOfFileIngestThreadsComboBox.setModel(new DefaultComboBoxModel<>(fileIngestThreadCountChoices));<NEW_LINE>numberOfFileIngestThreadsComboBox.<MASK><NEW_LINE>}
setSelectedItem(UserPreferences.numberOfFileIngestThreads());
1,046,239
private void calculateRatios(LiquidConduit conduit) {<NEW_LINE>ConduitTank tank = conduit.getTank();<NEW_LINE>int totalAmount = tank.getFluidAmount();<NEW_LINE>int upCapacity = 0;<NEW_LINE>if (conduit.containsConduitConnection(EnumFacing.UP) || conduit.containsExternalConnection(EnumFacing.UP)) {<NEW_LINE>upCapacity = LiquidConduit.VOLUME_PER_CONNECTION;<NEW_LINE>}<NEW_LINE>int downCapacity = 0;<NEW_LINE>if (conduit.containsConduitConnection(EnumFacing.DOWN) || conduit.containsExternalConnection(EnumFacing.DOWN)) {<NEW_LINE>downCapacity = LiquidConduit.VOLUME_PER_CONNECTION;<NEW_LINE>}<NEW_LINE>int flatCapacity = tank.getCapacity() - upCapacity - downCapacity;<NEW_LINE>int usedCapacity = 0;<NEW_LINE>if (downCapacity > 0) {<NEW_LINE>int inDown = <MASK><NEW_LINE>usedCapacity += inDown;<NEW_LINE>downRatio = (float) inDown / downCapacity;<NEW_LINE>}<NEW_LINE>if (flatCapacity > 0 && usedCapacity < totalAmount) {<NEW_LINE>int inFlat = Math.min(flatCapacity, totalAmount - usedCapacity);<NEW_LINE>usedCapacity += inFlat;<NEW_LINE>flatRatio = (float) inFlat / flatCapacity;<NEW_LINE>} else {<NEW_LINE>flatRatio = 0;<NEW_LINE>}<NEW_LINE>if (upCapacity > 0 && usedCapacity < totalAmount) {<NEW_LINE>int inUp = Math.min(upCapacity, totalAmount - usedCapacity);<NEW_LINE>upRatio = (float) inUp / upCapacity;<NEW_LINE>} else {<NEW_LINE>upRatio = 0;<NEW_LINE>}<NEW_LINE>}
Math.min(totalAmount, downCapacity);
547,131
private static void runAssertionAllCombinations(RegressionEnvironment env, String field, AtomicInteger milestone) {<NEW_LINE>String[] methods = "getMinuteOfHour,getMonthOfYear,getDayOfMonth,getDayOfWeek,getDayOfYear,getEra,gethourOfDay,getmillisOfSecond,getsecondOfMinute,getweekyear,getyear".split(",");<NEW_LINE>StringWriter epl = new StringWriter();<NEW_LINE>epl.append("@name('s0') select ");<NEW_LINE>int count = 0;<NEW_LINE>String delimiter = "";<NEW_LINE>for (String method : methods) {<NEW_LINE>epl.append(delimiter).append(field).append(".").append(method).append("() ").append("c").append(<MASK><NEW_LINE>delimiter = ",";<NEW_LINE>}<NEW_LINE>epl.append(" from SupportDateTime");<NEW_LINE>env.compileDeployAddListenerMile(epl.toString(), "s0", milestone.getAndIncrement());<NEW_LINE>SupportDateTime sdt = SupportDateTime.make("2002-05-30T09:01:02.003");<NEW_LINE>sdt.getCaldate().set(Calendar.MILLISECOND, 3);<NEW_LINE>env.sendEventBean(sdt);<NEW_LINE>boolean java8date = field.equals("zoneddate") || field.equals("localdate");<NEW_LINE>env.assertPropsNew("s0", "c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10".split(","), new Object[] { 1, java8date ? 5 : 4, 30, java8date ? THURSDAY : 5, 150, 1, 9, 3, 2, 22, 2002 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
Integer.toString(count++));
611,679
public static int deepHashCode(Object[] a) {<NEW_LINE>if (a == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int hash = 0xA5A537FC;<NEW_LINE>for (int i = 0; i < a.length; ++i) {<NEW_LINE>Object el = a[i];<NEW_LINE>int h;<NEW_LINE>if (a[i] instanceof boolean[]) {<NEW_LINE>h = hashCode((boolean[]) el);<NEW_LINE>} else if (a[i] instanceof byte[]) {<NEW_LINE>h = hashCode((byte[]) el);<NEW_LINE>} else if (a[i] instanceof short[]) {<NEW_LINE>h = hashCode((short[]) el);<NEW_LINE>} else if (a[i] instanceof char[]) {<NEW_LINE>h = hashCode((char[]) el);<NEW_LINE>} else if (a[i] instanceof int[]) {<NEW_LINE>h = hashCode((int[]) el);<NEW_LINE>} else if (a[i] instanceof long[]) {<NEW_LINE>h = hashCode((long[]) el);<NEW_LINE>} else if (a[i] instanceof float[]) {<NEW_LINE>h = hashCode((float[]) el);<NEW_LINE>} else if (a[i] instanceof double[]) {<NEW_LINE>h = hashCode((double[]) el);<NEW_LINE>} else if (a[i] instanceof Object[]) {<NEW_LINE>h = deepHashCode<MASK><NEW_LINE>} else {<NEW_LINE>h = TObjects.hashCode(el) ^ 0x1F7A58E0;<NEW_LINE>}<NEW_LINE>hash = TInteger.rotateLeft(h, 4) ^ TInteger.rotateRight(h, 7) ^ TInteger.rotateLeft(hash, 13);<NEW_LINE>}<NEW_LINE>return hash;<NEW_LINE>}
((Object[]) el);
123,870
private String startContainer(final String image, final Optional<String> dockerVersion) throws InterruptedException, DockerException {<NEW_LINE>// Get container image info<NEW_LINE>final ImageInfo imageInfo = docker.inspectImage(image);<NEW_LINE>if (imageInfo == null) {<NEW_LINE>throw new HeliosRuntimeException("docker inspect image returned null on image " + image);<NEW_LINE>}<NEW_LINE>// Create container<NEW_LINE>final HostConfig hostConfig = config.hostConfig(dockerVersion);<NEW_LINE>final ContainerConfig containerConfig = config.containerConfig(imageInfo, dockerVersion).toBuilder().hostConfig(hostConfig).build();<NEW_LINE>listener.creating();<NEW_LINE>final ContainerCreation container = docker.createContainer(containerConfig, containerName);<NEW_LINE>log.info(<MASK><NEW_LINE>listener.created(container.id());<NEW_LINE>// Start container<NEW_LINE>log.info("starting container: {}: {} {}", config, container.id(), hostConfig);<NEW_LINE>listener.starting();<NEW_LINE>docker.startContainer(container.id());<NEW_LINE>log.info("started container: {}: {}", config, container.id());<NEW_LINE>listener.started();<NEW_LINE>return container.id();<NEW_LINE>}
"created container: {}: {}, {}", config, container, containerConfig);
571,785
private void scheduleAlarm(long timeOut) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "scheduleAlarm", "timeOut=" + timeOut + " started=" + started + " expiryAlarm=" + expiryAlarm);<NEW_LINE>// NB PM27294 You cannot decrease the the timeOut if an alarm is already scheduled.<NEW_LINE>// This is OK for the expirer as the timeout does not change once Expirer is started.<NEW_LINE>expiryAlarmLock.readLock().lock();<NEW_LINE>// If there is no alarm already scheduled create a new alarm.<NEW_LINE>if (started.get() && expiryAlarm == null) {<NEW_LINE>// Upgrade to write lock.<NEW_LINE>expiryAlarmLock.readLock().unlock();<NEW_LINE>expiryAlarmLock<MASK><NEW_LINE>try {<NEW_LINE>if (started.get() && expiryAlarm == null) {<NEW_LINE>expiryAlarm = AlarmManager.createNonDeferrable(timeOut, this);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// Unlock write, still hold read<NEW_LINE>expiryAlarmLock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>expiryAlarmLock.readLock().unlock();<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "scheduleAlarm", "started=" + started + " expiryAlarm=" + expiryAlarm);<NEW_LINE>}
.writeLock().lock();
1,519,622
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create expression int js:abc(p1, p2) [p1*p2*10]", path);<NEW_LINE>env.compileDeploy("@public create expression int js:abc(p1) [p1*10]", path);<NEW_LINE>String epl = "@name('s0') select abc(intPrimitive, doublePrimitive) as c0, abc(intPrimitive) as c1 from SupportBean";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>env.sendEventBean(makeBean("E1", 10, 3.5));<NEW_LINE>env.assertPropsNew("s0", "c0,c1".split(","), new Object[] { 350, 100 });<NEW_LINE>env.undeployAll();<NEW_LINE>// test SODA<NEW_LINE>String eplExpr = "@name('expr') @public create expression somescript(i1) ['a']";<NEW_LINE>EPStatementObjectModel modelExpr = env.eplToModel(eplExpr);<NEW_LINE>assertEquals(eplExpr, modelExpr.toEPL());<NEW_LINE>env.compileDeploy(modelExpr, path);<NEW_LINE>env.assertStatement("expr", statement -> assertEquals(eplExpr, statement.getProperty(StatementProperty.EPL)));<NEW_LINE>String eplSelect = "@name('select') select somescript(1) from SupportBean";<NEW_LINE>EPStatementObjectModel modelSelect = env.eplToModel(eplSelect);<NEW_LINE>assertEquals(<MASK><NEW_LINE>env.compileDeploy(modelSelect, path);<NEW_LINE>env.assertStatement("select", statement -> assertEquals(eplSelect, statement.getProperty(StatementProperty.EPL)));<NEW_LINE>env.undeployAll();<NEW_LINE>}
eplSelect, modelSelect.toEPL());
663,941
public void startElement(StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException {<NEW_LINE>super.startElement(handler, uri, localName, rawName, attributes);<NEW_LINE>try {<NEW_LINE>int stylesheetType = handler.getStylesheetType();<NEW_LINE>Stylesheet stylesheet;<NEW_LINE>if (stylesheetType == StylesheetHandler.STYPE_ROOT) {<NEW_LINE>try {<NEW_LINE>stylesheet = getStylesheetRoot(handler);<NEW_LINE>} catch (TransformerConfigurationException tfe) {<NEW_LINE>throw new TransformerException(tfe);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Stylesheet parent = handler.getStylesheet();<NEW_LINE>if (stylesheetType == StylesheetHandler.STYPE_IMPORT) {<NEW_LINE>StylesheetComposed sc = new StylesheetComposed(parent);<NEW_LINE>parent.setImport(sc);<NEW_LINE>stylesheet = sc;<NEW_LINE>} else {<NEW_LINE>stylesheet = new Stylesheet(parent);<NEW_LINE>parent.setInclude(stylesheet);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stylesheet.setDOMBackPointer(handler.getOriginatingNode());<NEW_LINE>stylesheet.setLocaterInfo(handler.getLocator());<NEW_LINE>stylesheet.setPrefixes(handler.getNamespaceSupport());<NEW_LINE>handler.pushStylesheet(stylesheet);<NEW_LINE>setPropertiesFromAttributes(handler, rawName, <MASK><NEW_LINE>handler.pushElemTemplateElement(handler.getStylesheet());<NEW_LINE>} catch (TransformerException te) {<NEW_LINE>throw new org.xml.sax.SAXException(te);<NEW_LINE>}<NEW_LINE>}
attributes, handler.getStylesheet());
288,005
protected boolean readIntoBuffer(int minLength) {<NEW_LINE>if (bufferSpaceLeft() < minLength) {<NEW_LINE>// current buffer cannot hold the data requested;<NEW_LINE>// need to make it larger<NEW_LINE>increaseBufferSize(minLength + currentlyInBuffer());<NEW_LINE>} else if (buf.length - writePos < minLength) {<NEW_LINE>// create a contiguous space for the new data<NEW_LINE>compact();<NEW_LINE>}<NEW_LINE>// Now we have a buffer that can hold at least minLength new data points<NEW_LINE>int readSum = 0;<NEW_LINE>// read blocks:<NEW_LINE>while (readSum < minLength && p < datagrams.length) {<NEW_LINE>if (q >= datagrams[p].length) {<NEW_LINE>p++;<NEW_LINE>q = 0;<NEW_LINE>} else {<NEW_LINE>Datagram next = datagrams[p][q];<NEW_LINE>int length = (int) next.getDuration();<NEW_LINE>// System.out.println("Unit duration = " + String.valueOf(length));<NEW_LINE>if (buf.length < writePos + length) {<NEW_LINE>increaseBufferSize(writePos + length);<NEW_LINE>}<NEW_LINE>int read = readDatagram(next, buf, writePos);<NEW_LINE>if (q == 0 && p > 0 && rightContexts[p - 1] != null) {<NEW_LINE>// overlap-add situation<NEW_LINE>// window the data that we have just read with the left half of a HANN window:<NEW_LINE>new DynamicTwoHalvesWindow(Window.HANNING).applyInlineLeftHalf(buf, writePos, read);<NEW_LINE>// and overlap-add the previous right context, windowed with the right half of a HANN window:<NEW_LINE>double[] context = new double[(int) rightContexts[p - 1].getDuration()];<NEW_LINE>readDatagram(rightContexts[p - 1], context, 0);<NEW_LINE>new DynamicTwoHalvesWindow(Window.HANNING).applyInlineRightHalf(<MASK><NEW_LINE>for (int i = 0, iMax = Math.min(read, context.length); i < iMax; i++) {<NEW_LINE>buf[writePos + i] += context[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writePos += read;<NEW_LINE>readSum += read;<NEW_LINE>totalRead += read;<NEW_LINE>q++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dataProcessor != null) {<NEW_LINE>dataProcessor.applyInline(buf, writePos - readSum, readSum);<NEW_LINE>}<NEW_LINE>return readSum >= minLength;<NEW_LINE>}
context, 0, context.length);
122,545
public static // raw_text | magic_comment | comment | environment | pseudocode_block | math_environment | COMMAND_IFNEXTCHAR | group | OPEN_PAREN | CLOSE_PAREN | parameter_text | COMMA | EQUALS | OPEN_BRACKET | CLOSE_BRACKET | BACKSLASH | OPEN_ANGLE_BRACKET | CLOSE_ANGLE_BRACKET<NEW_LINE>boolean required_param_content(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "required_param_content"))<NEW_LINE>return false;<NEW_LINE>boolean r;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, REQUIRED_PARAM_CONTENT, "<required param content>");<NEW_LINE>r = raw_text(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = magic_comment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = comment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = environment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = pseudocode_block(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = math_environment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE><MASK><NEW_LINE>if (!r)<NEW_LINE>r = group(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, OPEN_PAREN);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, CLOSE_PAREN);<NEW_LINE>if (!r)<NEW_LINE>r = parameter_text(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, COMMA);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, EQUALS);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, OPEN_BRACKET);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, CLOSE_BRACKET);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, BACKSLASH);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, OPEN_ANGLE_BRACKET);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, CLOSE_ANGLE_BRACKET);<NEW_LINE>exit_section_(b, l, m, r, false, null);<NEW_LINE>return r;<NEW_LINE>}
r = consumeToken(b, COMMAND_IFNEXTCHAR);
512,093
public Void call(ShiftParams param) {<NEW_LINE>// we make the shifts atomic, as otherwise listeners to<NEW_LINE>// the items / indices lists get a lot of intermediate<NEW_LINE>// noise. They eventually get the summary event fired<NEW_LINE>// from within shiftSelection, so this is ok.<NEW_LINE>startAtomic();<NEW_LINE>final int clearIndex = param.getClearIndex();<NEW_LINE>final int setIndex = param.getSetIndex();<NEW_LINE>TablePosition<S, ?> oldTP = null;<NEW_LINE>if (clearIndex > -1) {<NEW_LINE>for (int i = 0; i < selectedCellsMap.size(); i++) {<NEW_LINE>TablePosition<S, ?> <MASK><NEW_LINE>if (tp.getRow() == clearIndex) {<NEW_LINE>oldTP = tp;<NEW_LINE>selectedCellsMap.remove(tp);<NEW_LINE>} else if (tp.getRow() == setIndex && !param.isSelected()) {<NEW_LINE>selectedCellsMap.remove(tp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldTP != null && param.isSelected()) {<NEW_LINE>TablePosition<S, ?> newTP = new TablePosition<>(tableView, param.getSetIndex(), oldTP.getTableColumn());<NEW_LINE>selectedCellsMap.add(newTP);<NEW_LINE>}<NEW_LINE>stopAtomic();<NEW_LINE>return null;<NEW_LINE>}
tp = selectedCellsMap.get(i);
835,371
/* (non-Javadoc)<NEW_LINE>* @see com.webank.weid.rpc.CredentialPojoService#verify()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ResponseData<Boolean> verify(String issuerWeId, String weIdPublicKeyId, CredentialPojo credential) {<NEW_LINE>if (credential == null) {<NEW_LINE>logger.error("[verify] The input credential is invalid.");<NEW_LINE>return new ResponseData<>(false, ErrorCode.ILLEGAL_INPUT);<NEW_LINE>}<NEW_LINE>if (isZkpCredential(credential)) {<NEW_LINE>return verifyZkpCredential(credential);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (!StringUtils.equals(issuerWeId, issuerId)) {<NEW_LINE>logger.error("[verify] The input issuer weid is not match the credential's.");<NEW_LINE>return new ResponseData<Boolean>(false, ErrorCode.CREDENTIAL_ISSUER_MISMATCH);<NEW_LINE>}<NEW_LINE>if (CredentialPojoUtils.isLiteCredential(credential)) {<NEW_LINE>return verifyLiteCredential(credential, null, weIdPublicKeyId);<NEW_LINE>}<NEW_LINE>ErrorCode errorCode = verifyContent(credential, null, false, weIdPublicKeyId);<NEW_LINE>if (errorCode.getCode() != ErrorCode.SUCCESS.getCode()) {<NEW_LINE>logger.error("[verify] credential verify failed. error message :{}", errorCode);<NEW_LINE>return new ResponseData<Boolean>(false, errorCode);<NEW_LINE>}<NEW_LINE>return new ResponseData<Boolean>(true, ErrorCode.SUCCESS);<NEW_LINE>}
String issuerId = credential.getIssuer();
1,610,545
public void marshall(AwsAutoScalingAutoScalingGroupDetails awsAutoScalingAutoScalingGroupDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsAutoScalingAutoScalingGroupDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsAutoScalingAutoScalingGroupDetails.getLaunchConfigurationName(), LAUNCHCONFIGURATIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsAutoScalingAutoScalingGroupDetails.getHealthCheckType(), HEALTHCHECKTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsAutoScalingAutoScalingGroupDetails.getHealthCheckGracePeriod(), HEALTHCHECKGRACEPERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsAutoScalingAutoScalingGroupDetails.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsAutoScalingAutoScalingGroupDetails.getMixedInstancesPolicy(), MIXEDINSTANCESPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsAutoScalingAutoScalingGroupDetails.getAvailabilityZones(), AVAILABILITYZONES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
awsAutoScalingAutoScalingGroupDetails.getLoadBalancerNames(), LOADBALANCERNAMES_BINDING);
1,678,795
public Change createChange(IProgressMonitor monitor) throws CoreException {<NEW_LINE>try {<NEW_LINE>final TextChange[] changes = fChangeManager.getAllChanges();<NEW_LINE>final List<TextChange> list = new ArrayList<>(changes.length);<NEW_LINE>list.addAll<MASK><NEW_LINE>String project = null;<NEW_LINE>IJavaProject javaProject = fMethod.getJavaProject();<NEW_LINE>if (javaProject != null) {<NEW_LINE>project = javaProject.getElementName();<NEW_LINE>}<NEW_LINE>int flags = JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE;<NEW_LINE>try {<NEW_LINE>if (!Flags.isPrivate(fMethod.getFlags())) {<NEW_LINE>flags |= RefactoringDescriptor.MULTI_CHANGE;<NEW_LINE>}<NEW_LINE>} catch (JavaModelException exception) {<NEW_LINE>JavaLanguageServerPlugin.log(exception);<NEW_LINE>}<NEW_LINE>final IType declaring = fMethod.getDeclaringType();<NEW_LINE>try {<NEW_LINE>if (declaring.isAnonymous() || declaring.isLocal()) {<NEW_LINE>flags |= JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;<NEW_LINE>}<NEW_LINE>} catch (JavaModelException exception) {<NEW_LINE>JavaLanguageServerPlugin.log(exception);<NEW_LINE>}<NEW_LINE>// final String description= Messages.format(RefactoringCoreMessages.RenameMethodProcessor_descriptor_description_short, BasicElementLabels.getJavaElementName(fMethod.getElementName()));<NEW_LINE>// Messages.format(RefactoringCoreMessages.RenameMethodProcessor_descriptor_description, new String[] { JavaElementLabels.getTextLabel(fMethod, JavaElementLabels.ALL_FULLY_QUALIFIED), BasicElementLabels.getJavaElementName(getNewElementName())});<NEW_LINE>final String header = "";<NEW_LINE>// final String comment= new JDTRefactoringDescriptorComment(project, this, header).asString();<NEW_LINE>final RenameJavaElementDescriptor descriptor = RefactoringSignatureDescriptorFactory.createRenameJavaElementDescriptor(IJavaRefactorings.RENAME_METHOD);<NEW_LINE>descriptor.setProject(project);<NEW_LINE>// descriptor.setDescription(description);<NEW_LINE>// descriptor.setComment(comment);<NEW_LINE>descriptor.setFlags(flags);<NEW_LINE>descriptor.setJavaElement(fMethod);<NEW_LINE>descriptor.setNewName(getNewElementName());<NEW_LINE>descriptor.setUpdateReferences(fUpdateReferences);<NEW_LINE>descriptor.setKeepOriginal(fDelegateUpdating);<NEW_LINE>descriptor.setDeprecateDelegate(fDelegateDeprecation);<NEW_LINE>return new DynamicValidationRefactoringChange(descriptor, RefactoringCoreMessages.RenameMethodProcessor_change_name, list.toArray(new Change[list.size()]));<NEW_LINE>} finally {<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>}
(Arrays.asList(changes));
8,986
@GET<NEW_LINE>public ImmutableList<AutomationSecretResponse> readSecrets(@Auth AutomationClient automationClient, @QueryParam("name") String name) {<NEW_LINE>ImmutableList.Builder<AutomationSecretResponse> responseBuilder = ImmutableList.builder();<NEW_LINE>if (name != null) {<NEW_LINE>Optional<Secret> optionalSecret = secretController.getSecretByName(name);<NEW_LINE>if (!optionalSecret.isPresent()) {<NEW_LINE>throw new NotFoundException("Secret not found.");<NEW_LINE>}<NEW_LINE>Secret secret = optionalSecret.get();<NEW_LINE>ImmutableList<Group> groups = ImmutableList.copyOf(aclDAO.getGroupsFor(secret));<NEW_LINE>responseBuilder.add(AutomationSecretResponse.fromSecret(secret, groups));<NEW_LINE>} else {<NEW_LINE>List<SanitizedSecret> secrets = <MASK><NEW_LINE>for (SanitizedSecret sanitizedSecret : secrets) {<NEW_LINE>Secret secret = secretController.getSecretById(sanitizedSecret.id()).orElseThrow(() -> new IllegalStateException(format("Cannot find record related to %s", sanitizedSecret)));<NEW_LINE>ImmutableList<Group> groups = ImmutableList.copyOf(aclDAO.getGroupsFor(secret));<NEW_LINE>responseBuilder.add(AutomationSecretResponse.fromSecret(secret, groups));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return responseBuilder.build();<NEW_LINE>}
secretController.getSanitizedSecrets(null, null);
221,021
private void copyAsRyde() throws IOException {<NEW_LINE>// TODO(b/217772483): consider guarding this action with a lock and check if there is work.<NEW_LINE>// Not urgent since file writes on GCS are atomic.<NEW_LINE>Optional<Cursor> cursor = transactIfJpaTm(() -> tm().loadByKeyIfPresent(Cursor.createVKey(BRDA, tld)));<NEW_LINE>DateTime brdaCursorTime = getCursorTimeOrStartOfTime(cursor);<NEW_LINE>if (isBeforeOrAt(brdaCursorTime, watermark)) {<NEW_LINE>throw new NoContentException(String.format("Waiting on RdeStagingAction for TLD %s to copy BRDA deposit for %s to GCS; " + "last BRDA staging completion was before %s", tld, watermark, brdaCursorTime));<NEW_LINE>}<NEW_LINE>int revision = RdeRevision.getCurrentRevision(tld, watermark, THIN).orElseThrow(() -> new IllegalStateException("RdeRevision was not set on generated deposit"));<NEW_LINE>String nameWithoutPrefix = RdeNamingUtils.makeRydeFilename(tld, watermark, THIN, 1, revision);<NEW_LINE>String name = prefix.orElse("") + nameWithoutPrefix;<NEW_LINE>BlobId xmlFilename = BlobId.of(stagingBucket, name + ".xml.ghostryde");<NEW_LINE>BlobId xmlLengthFilename = BlobId.of(stagingBucket, name + ".xml.length");<NEW_LINE>BlobId rydeFile = BlobId.of(brdaBucket, nameWithoutPrefix + ".ryde");<NEW_LINE>BlobId sigFile = BlobId.of(brdaBucket, nameWithoutPrefix + ".sig");<NEW_LINE>long xmlLength = readXmlLength(xmlLengthFilename);<NEW_LINE>logger.atInfo().log("Writing files '%s' and '%s'.", rydeFile, sigFile);<NEW_LINE>try (InputStream <MASK><NEW_LINE>InputStream ghostrydeDecoder = Ghostryde.decoder(gcsInput, stagingDecryptionKey);<NEW_LINE>OutputStream rydeOut = gcsUtils.openOutputStream(rydeFile);<NEW_LINE>OutputStream sigOut = gcsUtils.openOutputStream(sigFile);<NEW_LINE>RydeEncoder rydeEncoder = new RydeEncoder.Builder().setRydeOutput(rydeOut, receiverKey).setSignatureOutput(sigOut, signingKey).setFileMetadata(nameWithoutPrefix, xmlLength, watermark).build()) {<NEW_LINE>ByteStreams.copy(ghostrydeDecoder, rydeEncoder);<NEW_LINE>}<NEW_LINE>}
gcsInput = gcsUtils.openInputStream(xmlFilename);
1,360,865
final AssociateProactiveEngagementDetailsResult executeAssociateProactiveEngagementDetails(AssociateProactiveEngagementDetailsRequest associateProactiveEngagementDetailsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateProactiveEngagementDetailsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateProactiveEngagementDetailsRequest> request = null;<NEW_LINE>Response<AssociateProactiveEngagementDetailsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateProactiveEngagementDetailsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateProactiveEngagementDetailsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateProactiveEngagementDetails");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateProactiveEngagementDetailsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateProactiveEngagementDetailsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,131,702
private Optional<Pair<CaptureBindingPatternNode, String>> findCaptureBindingPattern(Node matchedNode, CodeActionContext context) {<NEW_LINE>Optional<Symbol> symbol = context.currentSemanticModel().flatMap(semanticModel -> semanticModel.symbol(matchedNode));<NEW_LINE>if (symbol.isEmpty() || context.currentSyntaxTree().isEmpty() || !SymbolUtil.isListener(symbol.get())) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Optional<NonTerminalNode> foundNode;<NEW_LINE>String uri;<NEW_LINE>if (matchedNode.kind() == SyntaxKind.QUALIFIED_NAME_REFERENCE) {<NEW_LINE>// Todo: we need a proper API to get the syntax tree node.<NEW_LINE>Optional<Project> project = context.workspace().project(context.filePath());<NEW_LINE>Optional<Location> location = symbol.get().getLocation();<NEW_LINE>if (location.isEmpty() || project.isEmpty() || project.get().kind() != ProjectKind.BUILD_PROJECT || symbol.get().getModule().isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Path filePath = project.get().sourceRoot().resolve("modules").resolve(symbol.get().getModule().get().id().modulePrefix()).resolve(location.get().<MASK><NEW_LINE>Optional<SyntaxTree> syntaxTree = context.workspace().syntaxTree(filePath);<NEW_LINE>if (syntaxTree.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>foundNode = CommonUtil.findNode(symbol.get(), syntaxTree.get());<NEW_LINE>uri = filePath.toUri().toString();<NEW_LINE>} else {<NEW_LINE>foundNode = CommonUtil.findNode(symbol.get(), context.currentSyntaxTree().get());<NEW_LINE>uri = context.fileUri();<NEW_LINE>}<NEW_LINE>if (foundNode.isEmpty() || foundNode.get().kind() != SyntaxKind.CAPTURE_BINDING_PATTERN) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(Pair.of((CaptureBindingPatternNode) foundNode.get(), uri));<NEW_LINE>}
lineRange().filePath());
1,129,532
public ThirdPartyFirewallFirewallPolicy unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ThirdPartyFirewallFirewallPolicy thirdPartyFirewallFirewallPolicy = new ThirdPartyFirewallFirewallPolicy();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("FirewallPolicyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thirdPartyFirewallFirewallPolicy.setFirewallPolicyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FirewallPolicyName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thirdPartyFirewallFirewallPolicy.setFirewallPolicyName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return thirdPartyFirewallFirewallPolicy;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
687,004
private static List<Type> findParametersRecursively(Type type, DotName target, Set<DotName> visitedTypes, IndexView index) {<NEW_LINE>DotName name = type.name();<NEW_LINE>// cache results first<NEW_LINE>if (!visitedTypes.add(name)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// always end at Object<NEW_LINE>if (DOTNAME_OBJECT.equals(name)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final ClassInfo inputClassInfo = fetchFromIndex(name, index);<NEW_LINE>// look at the current type<NEW_LINE>if (target.equals(name)) {<NEW_LINE>Type thisType = getType(inputClassInfo, index);<NEW_LINE>if (thisType.kind() == Kind.CLASS)<NEW_LINE>return Collections.emptyList();<NEW_LINE>else<NEW_LINE>return thisType.asParameterizedType().arguments();<NEW_LINE>}<NEW_LINE>// superclasses first<NEW_LINE>Type superClassType = inputClassInfo.superClassType();<NEW_LINE>List<Type> superResult = findParametersRecursively(superClassType, target, visitedTypes, index);<NEW_LINE>if (superResult != null) {<NEW_LINE>// map any returned type parameters to our type arguments on the way down<NEW_LINE>return mapTypeArguments(superClassType, superResult, index);<NEW_LINE>}<NEW_LINE>// interfaces second<NEW_LINE>for (Type interfaceType : inputClassInfo.interfaceTypes()) {<NEW_LINE>List<Type> ret = findParametersRecursively(<MASK><NEW_LINE>if (ret != null) {<NEW_LINE>// map any returned type parameters to our type arguments on the way down<NEW_LINE>return mapTypeArguments(interfaceType, ret, index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// not found<NEW_LINE>return null;<NEW_LINE>}
interfaceType, target, visitedTypes, index);
1,071,213
private ResultQuery<Record6<String, String, String, String, String, Integer>> keys(String constraintType) {<NEW_LINE>return create().select(inline(null, VARCHAR).as("catalog"), inline(null, VARCHAR).as("schema"), RDB$RELATION_CONSTRAINTS.RDB$RELATION_NAME.trim().as(RDB$RELATION_CONSTRAINTS.RDB$RELATION_NAME), RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME.trim().as(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME), RDB$INDEX_SEGMENTS.RDB$FIELD_NAME.trim().as(RDB$INDEX_SEGMENTS.RDB$FIELD_NAME), RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION.coerce(INTEGER)).from(RDB$RELATION_CONSTRAINTS).join(RDB$INDEX_SEGMENTS).on(RDB$INDEX_SEGMENTS.RDB$INDEX_NAME.eq(RDB$RELATION_CONSTRAINTS.RDB$INDEX_NAME)).where(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_TYPE.eq(inline(constraintType))).orderBy(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME.asc(), <MASK><NEW_LINE>}
RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION.asc());
756,477
protected Key doJwkRemote(String kid, String x5t, String use, boolean useSystemPropertiesForHttpClientConnections, JwkKeyType keyType) throws KeyStoreException {<NEW_LINE>String jsonString = null;<NEW_LINE>locationUsed = jwkEndpointUrl;<NEW_LINE>if (locationUsed == null) {<NEW_LINE>locationUsed = keyLocation;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// TODO - validate url<NEW_LINE>SSLSocketFactory sslSocketFactory = null;<NEW_LINE>if (locationUsed != null && locationUsed.toLowerCase().startsWith("https")) {<NEW_LINE>sslSocketFactory = getSSLSocketFactory(locationUsed, sslConfigurationName, sslSupport);<NEW_LINE>}<NEW_LINE>HttpClient client = createHTTPClient(sslSocketFactory, locationUsed, hostNameVerificationEnabled, useSystemPropertiesForHttpClientConnections);<NEW_LINE>jsonString = getHTTPRequestAsString(client, locationUsed);<NEW_LINE>boolean bJwk = parseJwk(jsonString, null, jwkSet, sigAlg);<NEW_LINE>if (!bJwk) {<NEW_LINE>// can not get back any JWK from OP<NEW_LINE>// since getJwkLocal will be called later and NO key exception<NEW_LINE>// will be handled in the parent callers<NEW_LINE>// debug here only<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "No JWK can be found through '" + locationUsed + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (KeyStoreException e) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Fail to retrieve remote key: ", e.getCause());<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>// could be ignored<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Fail to retrieve remote key: ", e.getCause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getJwkFromJWKSet(locationUsed, kid, <MASK><NEW_LINE>}
x5t, use, jsonString, keyType);
1,012,611
@SchedulerSupport(SchedulerSupport.NONE)<NEW_LINE>public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Maybe<R> zip(@NonNull MaybeSource<? extends T1> source1, @NonNull MaybeSource<? extends T2> source2, @NonNull MaybeSource<? extends T3> source3, @NonNull MaybeSource<? extends T4> source4, @NonNull Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> zipper) {<NEW_LINE>Objects.requireNonNull(source1, "source1 is null");<NEW_LINE>Objects.requireNonNull(source2, "source2 is null");<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(source4, "source4 is null");<NEW_LINE>Objects.requireNonNull(zipper, "zipper is null");<NEW_LINE>return zipArray(Functions.toFunction(zipper), source1, source2, source3, source4);<NEW_LINE>}
Objects.requireNonNull(source3, "source3 is null");
360,347
public void serialize(final ODocument document, final BytesContainer bytes) {<NEW_LINE>serializeClass(document, bytes);<NEW_LINE>final Collection<Entry<String, ODocumentEntry>> fields = fetchEntries(document);<NEW_LINE>OVarIntSerializer.write(bytes, fields.size());<NEW_LINE>for (Entry<String, ODocumentEntry> entry : fields) {<NEW_LINE>ODocumentEntry docEntry = entry.getValue();<NEW_LINE>writeString(bytes, entry.getKey());<NEW_LINE>final Object value = docEntry.value;<NEW_LINE>if (value != null) {<NEW_LINE>final OType type = getFieldType(docEntry);<NEW_LINE>if (type == null) {<NEW_LINE>throw new OSerializationException("Impossible serialize value of type " + value.getClass() + " with the Result binary serializer");<NEW_LINE>}<NEW_LINE>writeOType(bytes, bytes.alloc(1), type);<NEW_LINE>serializeValue(bytes, value, type, getLinkedType(document, type, entry.getKey()));<NEW_LINE>} else {<NEW_LINE>writeOType(bytes, bytes<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.alloc(1), null);
261,252
public static void filterNonClientNodesIfNeeded(Settings settings, Log log) {<NEW_LINE>if (!settings.getNodesClientOnly()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RestClient bootstrap = new RestClient(settings);<NEW_LINE>try {<NEW_LINE>String message = "Client-only routing specified but no client nodes with HTTP-enabled available";<NEW_LINE>List<NodeInfo> clientNodes = bootstrap.getHttpClientNodes();<NEW_LINE>if (clientNodes.isEmpty()) {<NEW_LINE>throw new EsHadoopIllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Found client nodes %s", clientNodes));<NEW_LINE>}<NEW_LINE>List<String> toRetain = new ArrayList<String<MASK><NEW_LINE>for (NodeInfo node : clientNodes) {<NEW_LINE>toRetain.add(node.getPublishAddress());<NEW_LINE>}<NEW_LINE>List<String> ddNodes = SettingsUtils.discoveredOrDeclaredNodes(settings);<NEW_LINE>// remove non-client nodes<NEW_LINE>ddNodes.retainAll(toRetain);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Filtered discovered only nodes %s to client-only %s", SettingsUtils.discoveredOrDeclaredNodes(settings), ddNodes));<NEW_LINE>}<NEW_LINE>if (ddNodes.isEmpty()) {<NEW_LINE>if (settings.getNodesDiscovery()) {<NEW_LINE>message += String.format("; looks like the client nodes discovered have been removed; is the cluster in a stable state? %s", clientNodes);<NEW_LINE>} else {<NEW_LINE>message += String.format("; node discovery is disabled and none of nodes specified fit the criterion %s", SettingsUtils.discoveredOrDeclaredNodes(settings));<NEW_LINE>}<NEW_LINE>throw new EsHadoopIllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>SettingsUtils.setDiscoveredNodes(settings, ddNodes);<NEW_LINE>} finally {<NEW_LINE>bootstrap.close();<NEW_LINE>}<NEW_LINE>}
>(clientNodes.size());
925,789
public void cellPaint(GC gc, TableCellSWT cell) {<NEW_LINE>DownloadManager dm = (DownloadManager) cell.getDataSource();<NEW_LINE>List<Color> colors = new ArrayList<>();<NEW_LINE>if (dm != null) {<NEW_LINE>List<Tag> tags = tag_manager.getTagsForTaggable(TagType.TT_DOWNLOAD_MANUAL, dm);<NEW_LINE>for (Tag tag : tags) {<NEW_LINE>int[<MASK><NEW_LINE>if (rgb != null && rgb.length == 3 && (show_default_colours || !tag.isColorDefault())) {<NEW_LINE>Color color = ColorCache.getColor(gc.getDevice(), rgb);<NEW_LINE>if (color != null) {<NEW_LINE>colors.add(color);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int num_colors = colors.size();<NEW_LINE>if (num_colors > 0) {<NEW_LINE>Rectangle bounds = cell.getBounds();<NEW_LINE>bounds.x += 1;<NEW_LINE>bounds.y += 1;<NEW_LINE>bounds.width -= 1;<NEW_LINE>bounds.height -= 1;<NEW_LINE>if (num_colors == 1) {<NEW_LINE>gc.setBackground(colors.get(0));<NEW_LINE>gc.fillRectangle(bounds);<NEW_LINE>} else {<NEW_LINE>int width = bounds.width;<NEW_LINE>int chunk = width / num_colors;<NEW_LINE>if (chunk == 0) {<NEW_LINE>chunk = 1;<NEW_LINE>}<NEW_LINE>bounds.width = chunk;<NEW_LINE>for (int i = 0; i < num_colors; i++) {<NEW_LINE>if (i == num_colors - 1) {<NEW_LINE>int rem = width - (chunk * (num_colors - 1));<NEW_LINE>if (rem > 0) {<NEW_LINE>bounds.width = rem;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gc.setBackground(colors.get(i));<NEW_LINE>gc.fillRectangle(bounds);<NEW_LINE>bounds.x += chunk;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] rgb = tag.getColor();
994,066
public void scrollToNode(@Nullable final N node, final boolean centered) {<NEW_LINE>if (node != null) {<NEW_LINE><MASK><NEW_LINE>if (nodeBounds != null) {<NEW_LINE>if (node.getParent() != null) {<NEW_LINE>final int indent = (getUI().getLeftChildIndent() + getUI().getRightChildIndent()) * 2;<NEW_LINE>nodeBounds.x -= indent;<NEW_LINE>nodeBounds.width += indent;<NEW_LINE>}<NEW_LINE>final Dimension visibleBounds = getVisibleRect().getSize();<NEW_LINE>if (nodeBounds.width > visibleBounds.width) {<NEW_LINE>nodeBounds.width = visibleBounds.width;<NEW_LINE>}<NEW_LINE>if (centered) {<NEW_LINE>nodeBounds.y = nodeBounds.y + nodeBounds.height / 2 - visibleBounds.height / 2;<NEW_LINE>nodeBounds.height = visibleBounds.height;<NEW_LINE>}<NEW_LINE>scrollRectToVisible(nodeBounds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
final Rectangle nodeBounds = getNodeBounds(node);