idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
477,142
public static InputStream openForReading(Form form, ScopedFile file) throws IOException {<NEW_LINE>switch(file.getScope()) {<NEW_LINE>case Asset:<NEW_LINE>return form.openAsset(file.getFileName());<NEW_LINE>case App:<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {<NEW_LINE>return new FileInputStream(new File(Environment.getExternalStorageDirectory(), file.getFileName()));<NEW_LINE>}<NEW_LINE>return new FileInputStream(new File(form.getExternalFilesDir(""), file.getFileName()));<NEW_LINE>case Cache:<NEW_LINE>return new FileInputStream(new File(URI.create(form.getCachePath(file.getFileName()))));<NEW_LINE>case Legacy:<NEW_LINE>return new FileInputStream(new File(Environment.getExternalStorageDirectory(), file.getFileName()));<NEW_LINE>case Private:<NEW_LINE>return new FileInputStream(new File(URI.create(form.getPrivatePath(file.getFileName()))));<NEW_LINE>case Shared:<NEW_LINE>String[] parts = file.getFileName().split("/", 2);<NEW_LINE>Uri contentUri = getContentUriForPath(parts[0]);<NEW_LINE>String[] projection = new String[] { MediaStore.Files.FileColumns._ID, MediaStore.Files.FileColumns.DISPLAY_NAME };<NEW_LINE>Cursor cursor = null;<NEW_LINE>try {<NEW_LINE>cursor = form.getContentResolver().query(contentUri, projection, MediaStore.Files.FileColumns.DISPLAY_NAME + " = ?", new String[] { parts[1] }, null);<NEW_LINE>int idColumn = cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns._ID);<NEW_LINE>if (cursor.moveToFirst()) {<NEW_LINE>long id = cursor.getLong(idColumn);<NEW_LINE>Uri targetUri = <MASK><NEW_LINE>return form.getContentResolver().openInputStream(targetUri);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(LOG_TAG, cursor);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new IOException("Unsupported file scope: " + file.getScope());<NEW_LINE>}
ContentUris.withAppendedId(contentUri, id);
1,558,068
public boolean visualizationKeyLocksStatus(ModStatusKeyLocks pchkInput, Command cmd, Item item, EventPublisher eventPublisher) {<NEW_LINE>// We are actually not meant to visualize anything.<NEW_LINE>// But (just in case) someone is really lazy in doing the item-definitions, we try to be helpful by implementing<NEW_LINE>// some ON/OFF logic.<NEW_LINE>if (pchkInput.getLogicalSourceAddr().equals(this.addr) && item.getAcceptedDataTypes().contains(OnOffType.class)) {<NEW_LINE>for (int i = 0; i < 8; ++i) {<NEW_LINE>if (this.states[i] == LcnDefs.KeyLockStateModifier.ON || this.states[i] == LcnDefs.KeyLockStateModifier.OFF) {<NEW_LINE>State reportedState = pchkInput.getState(this.tableId, i) ? OnOffType.ON : OnOffType.OFF;<NEW_LINE>// Only update if the state we are bound to is equal to the reported one.<NEW_LINE>if ((this.states[i] == LcnDefs.KeyLockStateModifier.ON ? OnOffType.ON : OnOffType.OFF) == reportedState) {<NEW_LINE>eventPublisher.postUpdate(<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
item.getName(), reportedState);
386,802
protected AttackResult injectableQuery(String query) {<NEW_LINE>try (Connection connection = dataSource.getConnection()) {<NEW_LINE>try (Statement statement = connection.createStatement(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY)) {<NEW_LINE>statement.executeUpdate(query);<NEW_LINE>connection.commit();<NEW_LINE>ResultSet results = statement.executeQuery("SELECT phone from employees;");<NEW_LINE>StringBuffer output = new StringBuffer();<NEW_LINE>// user completes lesson if column phone exists<NEW_LINE>if (results.first()) {<NEW_LINE>output.append("<span class='feedback-positive'>" + query + "</span>");<NEW_LINE>return success(this).output(output.toString()).build();<NEW_LINE>} else {<NEW_LINE>return failed(this).output(output.<MASK><NEW_LINE>}<NEW_LINE>} catch (SQLException sqle) {<NEW_LINE>return failed(this).output(sqle.getMessage()).build();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return failed(this).output(this.getClass().getName() + " : " + e.getMessage()).build();<NEW_LINE>}<NEW_LINE>}
toString()).build();
594,887
public void display(boolean verbose, PrintWriter pw) {<NEW_LINE>super.display(verbose, pw);<NEW_LINE>if (doCatLevelEval) {<NEW_LINE>final NumberFormat nf = new DecimalFormat("0.00");<NEW_LINE>final Set<String> cats = Generics.newHashSet();<NEW_LINE>final Random rand = new Random();<NEW_LINE>cats.addAll(precisions.keySet());<NEW_LINE>cats.addAll(recalls.keySet());<NEW_LINE>Map<Double, String> f1Map = new TreeMap<>();<NEW_LINE>for (String cat : cats) {<NEW_LINE>double pnum2 = pnums2.getCount(cat);<NEW_LINE>double rnum2 = rnums2.getCount(cat);<NEW_LINE>double prec = precisions2.getCount(cat) / pnum2;<NEW_LINE>double rec = recalls2.getCount(cat) / rnum2;<NEW_LINE>double f1 = 2.0 / (1.0 / prec + 1.0 / rec);<NEW_LINE>if (Double.valueOf(f1).equals(Double.NaN))<NEW_LINE>f1 = -1.0;<NEW_LINE>if (f1Map.containsKey(f1))<NEW_LINE>f1Map.put(f1 + (rand.nextDouble() / 1000.0), cat);<NEW_LINE>else<NEW_LINE>f1Map.put(f1, cat);<NEW_LINE>}<NEW_LINE>pw.println("============================================================");<NEW_LINE>pw.println("Tagging Performance by Category -- final statistics");<NEW_LINE>pw.println("============================================================");<NEW_LINE>for (String cat : f1Map.values()) {<NEW_LINE>double pnum2 = pnums2.getCount(cat);<NEW_LINE>double rnum2 = rnums2.getCount(cat);<NEW_LINE>double prec = precisions2.getCount(cat) / pnum2;<NEW_LINE>prec *= 100.0;<NEW_LINE>double rec = <MASK><NEW_LINE>rec *= 100.0;<NEW_LINE>double f1 = 2.0 / (1.0 / prec + 1.0 / rec);<NEW_LINE>double oovRate = (lex == null) ? -1.0 : percentOOV.getCount(cat) / percentOOV2.getCount(cat);<NEW_LINE>pw.println(cat + "\tLP: " + ((pnum2 == 0.0) ? " N/A" : nf.format(prec)) + "\tguessed: " + (int) pnum2 + "\tLR: " + ((rnum2 == 0.0) ? " N/A" : nf.format(rec)) + "\tgold: " + (int) rnum2 + "\tF1: " + ((pnum2 == 0.0 || rnum2 == 0.0) ? " N/A" : nf.format(f1)) + "\tOOV: " + ((lex == null) ? " N/A" : nf.format(oovRate)));<NEW_LINE>}<NEW_LINE>pw.println("============================================================");<NEW_LINE>}<NEW_LINE>}
recalls2.getCount(cat) / rnum2;
520,486
public void serialize(StringBuilder builder) {<NEW_LINE>builder.append(mType).append("\n");<NEW_LINE>builder.append(mDeviceType).append("\n");<NEW_LINE>builder.append(mDeviceOS).append("\n");<NEW_LINE>builder.append(mAlias).append("\n");<NEW_LINE>// a network can't be saved in a session file<NEW_LINE>if (mType == Type.NETWORK) {<NEW_LINE>return;<NEW_LINE>} else if (mType == Type.ENDPOINT) {<NEW_LINE>mEndpoint.serialize(builder);<NEW_LINE>} else if (mType == Type.REMOTE) {<NEW_LINE>builder.append(mHostname).append("\n");<NEW_LINE>}<NEW_LINE>synchronized (mPorts) {<NEW_LINE>builder.append(mPorts.size<MASK><NEW_LINE>for (Port p : mPorts) {<NEW_LINE>builder.append(p.getProtocol().toString());<NEW_LINE>builder.append("|");<NEW_LINE>builder.append(p.getNumber());<NEW_LINE>builder.append("|");<NEW_LINE>if (p.haveService())<NEW_LINE>builder.append(p.getService());<NEW_LINE>builder.append("|");<NEW_LINE>if (p.haveVersion())<NEW_LINE>builder.append(p.getVersion());<NEW_LINE>builder.append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
()).append("\n");
1,042,873
boolean removeRunningTask(String taskId) {<NEW_LINE>final ActiveTask removed = runningTasks.remove(taskId);<NEW_LINE>if (removed != null) {<NEW_LINE>final <MASK><NEW_LINE>final TaskGroupUsage usage = taskGroupUsages.get(task.taskGroupName());<NEW_LINE>if (usage == null)<NEW_LINE>logger.warn("Unexpected to not find usage for task group " + task.taskGroupName() + " to unqueueTask usage of task " + task.getId());<NEW_LINE>else<NEW_LINE>usage.subtractUsage(task);<NEW_LINE>if (usageTrackedQueue != null && removed.getTaskRequest() instanceof QueuableTask)<NEW_LINE>try {<NEW_LINE>final QueuableTask queuableTask = (QueuableTask) removed.getTaskRequest();<NEW_LINE>usageTrackedQueue.removeTask(queuableTask.getId(), queuableTask.getQAttributes());<NEW_LINE>} catch (TaskQueueException e) {<NEW_LINE>// We don't expect this to happen since we call this only outside scheduling iteration<NEW_LINE>logger.warn("Unexpected: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return removed != null;<NEW_LINE>}
TaskRequest task = removed.getTaskRequest();
873,611
final DescribeParameterGroupsResult executeDescribeParameterGroups(DescribeParameterGroupsRequest describeParameterGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeParameterGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeParameterGroupsRequest> request = null;<NEW_LINE>Response<DescribeParameterGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeParameterGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeParameterGroupsRequest));<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, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeParameterGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeParameterGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new DescribeParameterGroupsResultJsonUnmarshaller());
1,083,359
private void save(@NonNull final WFActivity wfActivity, final HashMap<WFActivityId, I_AD_WF_Activity> existingActivityRecords) {<NEW_LINE>I_AD_WF_Activity record = wfActivity.getId() != null ? existingActivityRecords.get(wfActivity.getId()) : null;<NEW_LINE>if (record == null && wfActivity.getId() != null) {<NEW_LINE>record = InterfaceWrapperHelper.loadOutOfTrx(wfActivity.getId(), I_AD_WF_Activity.class);<NEW_LINE>}<NEW_LINE>if (record == null) {<NEW_LINE>record = InterfaceWrapperHelper.newInstanceOutOfTrx(I_AD_WF_Activity.class);<NEW_LINE>}<NEW_LINE>// record.setAD_Org_ID();<NEW_LINE>record.setAD_WF_Process_ID(wfActivity.getWfProcessId().getRepoId());<NEW_LINE>record.setAD_Workflow_ID(wfActivity.getContext().getWorkflow().getId().getRepoId());<NEW_LINE>record.setAD_WF_Node_ID(wfActivity.getNode().getId().getRepoId());<NEW_LINE>record.setPriority(wfActivity.getPriority());<NEW_LINE>record.setWFState(wfActivity.getState().getCode());<NEW_LINE>record.setProcessed(wfActivity.isProcessed());<NEW_LINE>record.setAD_Table_ID(wfActivity.getDocumentRef().getAD_Table_ID());<NEW_LINE>record.setRecord_ID(wfActivity.getDocumentRef().getRecord_ID());<NEW_LINE>record.setEndWaitTime(TimeUtil.asTimestamp(wfActivity.getEndWaitTime()));<NEW_LINE>record.setTextMsg(wfActivity.getTextMsg());<NEW_LINE>record.setAD_Issue_ID(AdIssueId.toRepoId<MASK><NEW_LINE>record.setAD_WF_Responsible_ID(wfActivity.getWFResponsibleId().getRepoId());<NEW_LINE>record.setAD_User_ID(UserId.toRepoId(wfActivity.getUserId()));<NEW_LINE>//<NEW_LINE>InterfaceWrapperHelper.save(record);<NEW_LINE>final WFActivityId id = WFActivityId.ofRepoId(record.getAD_WF_Activity_ID());<NEW_LINE>wfActivity.setId(id);<NEW_LINE>existingActivityRecords.put(id, record);<NEW_LINE>}
(wfActivity.getIssueId()));
996,188
public void analyze(Program program, MethodReference methodReference) {<NEW_LINE>InstructionEscapeVisitor visitor = new InstructionEscapeVisitor(program.variableCount());<NEW_LINE>for (int i = 0; i <= methodReference.parameterCount(); ++i) {<NEW_LINE>visitor.escapingVars[i] = true;<NEW_LINE>}<NEW_LINE>for (BasicBlock block : program.getBasicBlocks()) {<NEW_LINE>for (Instruction insn : block) {<NEW_LINE>insn.acceptVisitor(visitor);<NEW_LINE>}<NEW_LINE>if (block.getExceptionVariable() != null) {<NEW_LINE>visitor.escapingVars[block.getExceptionVariable().getIndex()] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>definitionClasses = visitor.definitionClasses.pack(program.variableCount());<NEW_LINE>escapingVars = new boolean[program.variableCount()];<NEW_LINE>fieldTypes = visitor.fieldTypes;<NEW_LINE>for (int i = 0; i < program.variableCount(); ++i) {<NEW_LINE>if (visitor.escapingVars[i]) {<NEW_LINE>escapingVars[definitionClasses[i]] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>analyzePhis(<MASK><NEW_LINE>propagateFields(program, visitor.fields);<NEW_LINE>fields = packFields(visitor.fields);<NEW_LINE>}
program, methodReference.getDescriptor());
354,082
public void testMultipleObtrude() throws Exception {<NEW_LINE>BlockableIncrementFunction increment = new BlockableIncrementFunction("testMultipleObtrude", null, null);<NEW_LINE>CompletableFuture<Integer> cf1 = defaultManagedExecutor.supplyAsync(() -> 80);<NEW_LINE>cf1.obtrudeValue(90);<NEW_LINE>CompletableFuture<Integer> cf2 = cf1.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(91), cf2.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertTrue(cf2.isDone());<NEW_LINE>assertFalse(cf1.isCompletedExceptionally());<NEW_LINE>assertFalse(cf2.isCompletedExceptionally());<NEW_LINE>assertFalse(cf1.isCancelled());<NEW_LINE>assertFalse(cf2.isCancelled());<NEW_LINE>cf1.obtrudeValue(100);<NEW_LINE>CompletableFuture<Integer> cf3 = cf1.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(101), cf3.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertTrue(cf3.isDone());<NEW_LINE>assertFalse(cf1.isCompletedExceptionally());<NEW_LINE>assertFalse(cf3.isCompletedExceptionally());<NEW_LINE>assertFalse(cf1.isCancelled());<NEW_LINE><MASK><NEW_LINE>cf1.obtrudeException(new IllegalAccessException("Intentionally raising exception for test."));<NEW_LINE>CompletableFuture<Integer> cf4 = cf1.thenApplyAsync(increment);<NEW_LINE>try {<NEW_LINE>Integer i = cf4.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>throw new Exception("Should fail after result obtruded with an exception. Instead: " + i);<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (!(x.getCause() instanceof IllegalAccessException) || !"Intentionally raising exception for test.".equals(x.getCause().getMessage()))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertTrue(cf4.isDone());<NEW_LINE>assertTrue(cf1.isCompletedExceptionally());<NEW_LINE>assertFalse(cf3.isCompletedExceptionally());<NEW_LINE>assertTrue(cf4.isCompletedExceptionally());<NEW_LINE>assertFalse(cf1.isCancelled());<NEW_LINE>assertFalse(cf4.isCancelled());<NEW_LINE>cf3.obtrudeValue(110);<NEW_LINE>CompletableFuture<Integer> cf5 = cf3.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(111), cf5.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>cf4.obtrudeException(new CancellationException());<NEW_LINE>assertTrue(cf4.isCancelled());<NEW_LINE>cf4.obtrudeValue(120);<NEW_LINE>assertEquals(Integer.valueOf(120), cf4.getNow(121));<NEW_LINE>}
assertFalse(cf3.isCancelled());
867,134
public GetParametersForImportResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetParametersForImportResult getParametersForImportResult = new GetParametersForImportResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("KeyId")) {<NEW_LINE>getParametersForImportResult.setKeyId(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("ImportToken")) {<NEW_LINE>getParametersForImportResult.setImportToken(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("PublicKey")) {<NEW_LINE>getParametersForImportResult.setPublicKey(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ParametersValidTo")) {<NEW_LINE>getParametersForImportResult.setParametersValidTo(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getParametersForImportResult;<NEW_LINE>}
().unmarshall(context));
414,585
public void unbindEIP() throws Exception {<NEW_LINE>InstanceInfo myInfo = applicationInfoManager.getInfo();<NEW_LINE>String myPublicIP = null;<NEW_LINE>if (myInfo != null && myInfo.getDataCenterInfo().getName() == Name.Amazon) {<NEW_LINE>myPublicIP = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.publicIpv4);<NEW_LINE>if (myPublicIP == null) {<NEW_LINE>logger.info("Instance is not associated with an EIP. Will not try to unbind");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>AmazonEC2 ec2Service = getEC2Service();<NEW_LINE>DescribeAddressesRequest describeAddressRequest = new DescribeAddressesRequest().withPublicIps(myPublicIP);<NEW_LINE>DescribeAddressesResult result = ec2Service.describeAddresses(describeAddressRequest);<NEW_LINE>if ((result.getAddresses() != null) && (!result.getAddresses().isEmpty())) {<NEW_LINE>Address eipAddress = result.getAddresses().get(0);<NEW_LINE>DisassociateAddressRequest dissociateRequest = new DisassociateAddressRequest();<NEW_LINE><MASK><NEW_LINE>if ("vpc".equals(domain)) {<NEW_LINE>dissociateRequest.setAssociationId(eipAddress.getAssociationId());<NEW_LINE>} else {<NEW_LINE>dissociateRequest.setPublicIp(eipAddress.getPublicIp());<NEW_LINE>}<NEW_LINE>ec2Service.disassociateAddress(dissociateRequest);<NEW_LINE>logger.info("Dissociated the EIP {} from this instance", myPublicIP);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new RuntimeException("Cannot dissociate address from this instance", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String domain = eipAddress.getDomain();
1,644,394
public RelationshipResponse isRelationshipKnown(String serverName, String userId, String guid) {<NEW_LINE>final String methodName = "isRelationshipKnown";<NEW_LINE><MASK><NEW_LINE>RelationshipResponse response = new RelationshipResponse();<NEW_LINE>try {<NEW_LINE>OMRSMetadataCollection metadataCollection = validateRepository(userId, serverName, methodName);<NEW_LINE>response.setRelationship(metadataCollection.isRelationshipKnown(userId, guid));<NEW_LINE>} catch (RepositoryErrorException error) {<NEW_LINE>captureRepositoryErrorException(response, error);<NEW_LINE>} catch (UserNotAuthorizedException error) {<NEW_LINE>captureUserNotAuthorizedException(response, error);<NEW_LINE>} catch (InvalidParameterException error) {<NEW_LINE>captureInvalidParameterException(response, error);<NEW_LINE>} catch (Exception error) {<NEW_LINE>captureGenericException(response, error, userId, serverName, methodName);<NEW_LINE>}<NEW_LINE>log.debug("Returning from method: " + methodName + " with response: " + response.toString());<NEW_LINE>return response;<NEW_LINE>}
log.debug("Calling method: " + methodName);
1,133,349
protected void renderContent(Graphics g) {<NEW_LINE>int imgW = image.getWidth();<NEW_LINE>int imgH = image.getHeight();<NEW_LINE>ResourceFactory factory = g.getResourceFactory();<NEW_LINE>int maxSize = maxSizeWrapper(factory);<NEW_LINE>if (imgW <= maxSize && imgH <= maxSize) {<NEW_LINE>Texture texture = factory.getCachedTexture(image, Texture.WrapMode.CLAMP_TO_EDGE);<NEW_LINE>if (coords == null) {<NEW_LINE>g.drawTexture(texture, x, y, x + w, y + h, <MASK><NEW_LINE>} else {<NEW_LINE>coords.draw(texture, g, x, y);<NEW_LINE>}<NEW_LINE>texture.unlock();<NEW_LINE>} else {<NEW_LINE>if (compoundImage == null)<NEW_LINE>compoundImage = new CachingCompoundImage(image, maxSize);<NEW_LINE>// coords is null iff there was no viewport specified, but<NEW_LINE>// MegaCoords needs a non-null Coords so we create a dummy one<NEW_LINE>if (coords == null)<NEW_LINE>coords = new Coords(w, h, new ViewPort(0, 0, imgW, imgH));<NEW_LINE>if (compoundCoords == null)<NEW_LINE>compoundCoords = new CompoundCoords(compoundImage, coords);<NEW_LINE>compoundCoords.draw(g, compoundImage, x, y);<NEW_LINE>}<NEW_LINE>}
0, 0, imgW, imgH);
533,730
protected DataViewComponent createComponent() {<NEW_LINE>// Data area for master view:<NEW_LINE>JEditorPane generalDataArea = new JEditorPane();<NEW_LINE>generalDataArea.setBorder(BorderFactory.createEmptyBorder(14, 8, 14, 8));<NEW_LINE>// Panel, which we'll reuse in all four of our detail views for this sample:<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>// Master view:<NEW_LINE>DataViewComponent.MasterView masterView = new DataViewComponent.MasterView("Hello World Overview", null, generalDataArea);<NEW_LINE>// Configuration of master view:<NEW_LINE>DataViewComponent.MasterViewConfiguration masterConfiguration = new DataViewComponent.MasterViewConfiguration(false);<NEW_LINE>// Add the master view and configuration view to the component:<NEW_LINE>dvc <MASK><NEW_LINE>// Add detail views to the component:<NEW_LINE>dvc.addDetailsView(new DataViewComponent.DetailsView("Hello World Details 1", null, 10, panel, null), DataViewComponent.TOP_LEFT);<NEW_LINE>return dvc;<NEW_LINE>}
= new DataViewComponent(masterView, masterConfiguration);
702,643
private List<PartitionUpdate> computePartitionUpdatesForMissingBuckets(ConnectorSession session, HiveWritableTableHandle handle, Table table, boolean isCreateTable, List<PartitionUpdate> partitionUpdates) {<NEW_LINE>ImmutableList.Builder<PartitionUpdate> partitionUpdatesForMissingBucketsBuilder = ImmutableList.builder();<NEW_LINE>HiveStorageFormat storageFormat = table.getPartitionColumns().isEmpty() ? handle.getTableStorageFormat<MASK><NEW_LINE>for (PartitionUpdate partitionUpdate : partitionUpdates) {<NEW_LINE>int bucketCount = handle.getBucketProperty().get().getBucketCount();<NEW_LINE>List<String> fileNamesForMissingBuckets = computeFileNamesForMissingBuckets(session, storageFormat, partitionUpdate.getTargetPath(), bucketCount, isCreateTable && handle.isTransactional(), partitionUpdate);<NEW_LINE>partitionUpdatesForMissingBucketsBuilder.add(new PartitionUpdate(partitionUpdate.getName(), partitionUpdate.getUpdateMode(), partitionUpdate.getWritePath(), partitionUpdate.getTargetPath(), fileNamesForMissingBuckets, 0, 0, 0));<NEW_LINE>}<NEW_LINE>return partitionUpdatesForMissingBucketsBuilder.build();<NEW_LINE>}
() : handle.getPartitionStorageFormat();
389,580
public static byte[] calculateSSLMac(byte[] input, byte[] macWriteSecret, MacAlgorithm macAlgorithm) {<NEW_LINE>final byte[] pad1 = SSLUtils.getPad1(macAlgorithm);<NEW_LINE>final byte[] pad2 = SSLUtils.getPad2(macAlgorithm);<NEW_LINE>try {<NEW_LINE>final String hashName = getHashAlgorithm(macAlgorithm);<NEW_LINE>final MessageDigest hashFunction = MessageDigest.getInstance(hashName);<NEW_LINE>final byte[] innerInput = ArrayConverter.concatenate(macWriteSecret, pad1, input);<NEW_LINE>final byte[] innerHash = hashFunction.digest(innerInput);<NEW_LINE>final byte[] outerInput = ArrayConverter.<MASK><NEW_LINE>final byte[] outerHash = hashFunction.digest(outerInput);<NEW_LINE>return outerHash;<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new IllegalArgumentException(ILLEGAL_MAC_ALGORITHM.format(macAlgorithm.getJavaName()));<NEW_LINE>}<NEW_LINE>}
concatenate(macWriteSecret, pad2, innerHash);
322,242
public List<ExtractResult> extract(String input, LocalDateTime reference) {<NEW_LINE>List<Token> tokens = new ArrayList<>();<NEW_LINE>tokens.addAll(matchSimpleCases(input));<NEW_LINE>List<ExtractResult> simpleCasesResults = Token.mergeAllTokens(<MASK><NEW_LINE>List<ExtractResult> ordinalExtractions = config.getOrdinalExtractor().extract(input);<NEW_LINE>tokens.addAll(mergeTwoTimePoints(input, reference));<NEW_LINE>tokens.addAll(matchDuration(input, reference));<NEW_LINE>tokens.addAll(singleTimePointWithPatterns(input, ordinalExtractions, reference));<NEW_LINE>tokens.addAll(matchComplexCases(input, simpleCasesResults, reference));<NEW_LINE>tokens.addAll(matchYearPeriod(input, reference));<NEW_LINE>tokens.addAll(matchOrdinalNumberWithCenturySuffix(input, ordinalExtractions));<NEW_LINE>return Token.mergeAllTokens(tokens, input, getExtractorName());<NEW_LINE>}
tokens, input, getExtractorName());
921,267
protected void initColumnAndType() {<NEW_LINE>columns.put(COLUMN_NAME, new ColumnMeta(COLUMN_NAME, "varchar(32)", false, true));<NEW_LINE>columnsType.put(COLUMN_NAME, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_POOL_SIZE, new ColumnMeta(COLUMN_POOL_SIZE, "int(11)", false));<NEW_LINE>columnsType.put(COLUMN_POOL_SIZE, Fields.FIELD_TYPE_LONG);<NEW_LINE>columns.put(COLUMN_CORE_POOL_SIZE, new ColumnMeta(COLUMN_CORE_POOL_SIZE, "int(11)", false));<NEW_LINE>columnsType.put(COLUMN_CORE_POOL_SIZE, Fields.FIELD_TYPE_LONG);<NEW_LINE>columns.put(COLUMN_ACTIVE_COUNT, new ColumnMeta<MASK><NEW_LINE>columnsType.put(COLUMN_ACTIVE_COUNT, Fields.FIELD_TYPE_LONG);<NEW_LINE>columns.put(COLUMN_WAITING_TASK_COUNT, new ColumnMeta(COLUMN_WAITING_TASK_COUNT, "int(11)", false));<NEW_LINE>columnsType.put(COLUMN_WAITING_TASK_COUNT, Fields.FIELD_TYPE_LONG);<NEW_LINE>}
(COLUMN_ACTIVE_COUNT, "int(11)", false));
212,736
public void testObservableRxInvoker_postCbReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>cb.readTimeout(TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(ObservableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Observable<Response> observable = builder.rx(ObservableRxInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testObservableRxInvoker_postCbReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println(<MASK><NEW_LINE>c.close();<NEW_LINE>}
"testObservableRxInvoker_postCbReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);
1,395,898
public TableOperations temp(TableMetadata uncommittedMetadata) {<NEW_LINE>return new TableOperations() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TableMetadata current() {<NEW_LINE>return uncommittedMetadata;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TableMetadata refresh() {<NEW_LINE>throw new UnsupportedOperationException("Cannot call refresh on temporary table operations");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void commit(TableMetadata base, TableMetadata metadata) {<NEW_LINE>throw new UnsupportedOperationException("Cannot call commit on temporary table operations");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String metadataFileLocation(String fileName) {<NEW_LINE>return RESTTableOperations.metadataFileLocation(uncommittedMetadata, fileName);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LocationProvider locationProvider() {<NEW_LINE>return LocationProviders.locationsFor(uncommittedMetadata.location(), uncommittedMetadata.properties());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileIO io() {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public EncryptionManager encryption() {<NEW_LINE>return RESTTableOperations.this.encryption();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long newSnapshotId() {<NEW_LINE>return RESTTableOperations.this.newSnapshotId();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
return RESTTableOperations.this.io();
1,813,760
public void execute(@Param("pipelineId") Long pipelineId, Context context) throws Exception {<NEW_LINE>Channel channel = channelService.findByPipelineId(pipelineId);<NEW_LINE>RealtimeThroughputCondition condition1 = new RealtimeThroughputCondition();<NEW_LINE>RealtimeThroughputCondition condition2 = new RealtimeThroughputCondition();<NEW_LINE>ThroughputCondition condition11 = new ThroughputCondition();<NEW_LINE>ThroughputCondition condition22 = new ThroughputCondition();<NEW_LINE>List<AnalysisType> analysisType = new ArrayList<AnalysisType>();<NEW_LINE>analysisType.add(AnalysisType.ONE_MINUTE);<NEW_LINE>analysisType.add(AnalysisType.FIVE_MINUTE);<NEW_LINE>analysisType.add(AnalysisType.FIFTEEN_MINUTE);<NEW_LINE>condition1.setPipelineId(pipelineId);<NEW_LINE>condition1.setAnalysisType(analysisType);<NEW_LINE>condition1.setType(ThroughputType.FILE);<NEW_LINE>condition2.setPipelineId(pipelineId);<NEW_LINE>condition2.setAnalysisType(analysisType);<NEW_LINE>condition2.setType(ThroughputType.ROW);<NEW_LINE>condition11.setPipelineId(pipelineId);<NEW_LINE><MASK><NEW_LINE>condition22.setPipelineId(pipelineId);<NEW_LINE>condition22.setType(ThroughputType.ROW);<NEW_LINE>Map<AnalysisType, ThroughputInfo> throughputInfos1 = throughputStatService.listRealtimeThroughput(condition1);<NEW_LINE>Map<AnalysisType, ThroughputInfo> throughputInfos2 = throughputStatService.listRealtimeThroughput(condition2);<NEW_LINE>ThroughputStat throughputStat1 = throughputStatService.findThroughputStatByPipelineId(condition11);<NEW_LINE>ThroughputStat throughputStat2 = throughputStatService.findThroughputStatByPipelineId(condition22);<NEW_LINE>context.put("throughputInfos1", throughputInfos1);<NEW_LINE>context.put("throughputInfos2", throughputInfos2);<NEW_LINE>context.put("channel", channel);<NEW_LINE>context.put("pipelineId", pipelineId);<NEW_LINE>context.put("throughputStat1", throughputStat1);<NEW_LINE>context.put("throughputStat2", throughputStat2);<NEW_LINE>context.put("one", AnalysisType.ONE_MINUTE);<NEW_LINE>context.put("five", AnalysisType.FIVE_MINUTE);<NEW_LINE>context.put("fifteen", AnalysisType.FIFTEEN_MINUTE);<NEW_LINE>}
condition11.setType(ThroughputType.FILE);
1,515,212
private ImmutableListMultimap<TableRecordReference, I_C_Location> extractLocationRecords(@NonNull final ImmutableListMultimap<TableRecordReference, LocationId> locationIds) {<NEW_LINE>final ImmutableListMultimap.Builder<TableRecordReference, I_C_Location> recordRef2LocationRecords = ImmutableListMultimap.builder();<NEW_LINE>if (locationIds.isEmpty()) {<NEW_LINE>// don't bother the database<NEW_LINE>return recordRef2LocationRecords.build();<NEW_LINE>}<NEW_LINE>final ImmutableList<LocationId> allLocationIds = locationIds.entries().stream().map(Entry::getValue).collect(ImmutableList.toImmutableList());<NEW_LINE>final List<I_C_Location> locationRecords = // .addOnlyActiveRecordsFilter() we also deal with records' "inactive" flag, at least in the REST-API; therefore we here also need to load inactive C_Locations<NEW_LINE>Services.get(IQueryBL.class).createQueryBuilder(I_C_Location.class).addInArrayFilter(I_C_Location.COLUMN_C_Location_ID, allLocationIds).create().list();<NEW_LINE>final ImmutableMap<Integer, I_C_Location> repoId2LocationRecord = Maps.uniqueIndex(locationRecords, I_C_Location::getC_Location_ID);<NEW_LINE>for (final Entry<TableRecordReference, LocationId> recordRefAndLocationId : locationIds.entries()) {<NEW_LINE>final I_C_Location locationRecord = repoId2LocationRecord.get(recordRefAndLocationId.<MASK><NEW_LINE>recordRef2LocationRecords.put(recordRefAndLocationId.getKey(), locationRecord);<NEW_LINE>}<NEW_LINE>return recordRef2LocationRecords.build();<NEW_LINE>}
getValue().getRepoId());
391,385
private Object convertForJdbc(Type<?> parent, Column column, Object value, SQLDialect dialect) {<NEW_LINE>if (column.getValueType().equals(ValueType.TIME) && (Time.class).isAssignableFrom(value.getClass())) {<NEW_LINE>return dialect<MASK><NEW_LINE>}<NEW_LINE>if (value.getClass().isEnum()) {<NEW_LINE>Enumerated enumerated = metadataDictionary.getAttributeOrRelationAnnotation(parent, Enumerated.class, column.getName());<NEW_LINE>if (enumerated != null && enumerated.value().equals(EnumType.ORDINAL)) {<NEW_LINE>return ((Enum) value).ordinal();<NEW_LINE>} else {<NEW_LINE>return value.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((column.getValueType().equals(ValueType.TEXT) && column.getValues() != null && column.getValues().isEmpty() == false)) {<NEW_LINE>Enumerated enumerated = metadataDictionary.getAttributeOrRelationAnnotation(parent, Enumerated.class, column.getName());<NEW_LINE>if (enumerated != null && enumerated.value().equals(EnumType.ORDINAL)) {<NEW_LINE>String[] enumValues = column.getValues().toArray(new String[0]);<NEW_LINE>for (int idx = 0; idx < column.getValues().size(); idx++) {<NEW_LINE>if (enumValues[idx].equals(value)) {<NEW_LINE>return idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalStateException(String.format("Invalid value %s for column %s", value, column.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
.translateTimeToJDBC((Time) value);
24,399
public static void mergePullRequest(final GitRepository repo, final IGithubPullRequest pr) {<NEW_LINE>// Pop up a dialog allowing user to set commit msg and toggle if they want to delete the branch<NEW_LINE>MergePullRequestDialog prDialog = new MergePullRequestDialog(UIUtils.getActiveShell(), pr);<NEW_LINE>if (prDialog.open() != Window.OK) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final boolean deleteBranch = prDialog.deleteBranch();<NEW_LINE>Job job = new Job("Merging pull request...") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>// Do the merge<NEW_LINE>IStatus status = pr.merge(msg, monitor);<NEW_LINE>if (!status.isOK()) {<NEW_LINE>return status;<NEW_LINE>}<NEW_LINE>// delete the branch if the PR merged OK<NEW_LINE>if (deleteBranch) {<NEW_LINE>// TODO Delete the branch locally too?<NEW_LINE>// FIXME This assumes the remote for github is origin! We should probably be able to associate back<NEW_LINE>// and forth between github repos the remote name/URL pair!<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IStatus deleteStatus = repo.push(GitRepository.ORIGIN, ":" + pr.getHeadRef());<NEW_LINE>// IStatus deleteStatus = repo.deleteBranch(pr.getHeadRef());<NEW_LINE>if (!deleteStatus.isOK()) {<NEW_LINE>return deleteStatus;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Ok we closed a PR, let's show a popup/toast to let user know and let them click it to open it.<NEW_LINE>URL url = null;<NEW_LINE>try {<NEW_LINE>url = pr.getHTMLURL();<NEW_LINE>} catch (MalformedURLException e1) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e1);<NEW_LINE>}<NEW_LINE>final String prURL = (url == null) ? StringUtil.EMPTY : url.toString();<NEW_LINE>UIUtils.getDisplay().asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>HyperlinkInfoPopupDialog toolTip = new HyperlinkInfoPopupDialog(UIUtils.getActiveShell(), "Pull Request Merged", MessageFormat.format("Successfully merged and closed pull request <a href=\"{0}\">#{1}</a>.", prURL, pr.getNumber()), new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>viewPullRequest(pr);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>toolTip.open();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>job.setUser(true);<NEW_LINE>job.schedule();<NEW_LINE>}
String msg = prDialog.getCommitMessage();
1,127,969
final GetStreamingDistributionResult executeGetStreamingDistribution(GetStreamingDistributionRequest getStreamingDistributionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getStreamingDistributionRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetStreamingDistributionRequest> request = null;<NEW_LINE>Response<GetStreamingDistributionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetStreamingDistributionRequestMarshaller().marshall(super.beforeMarshalling(getStreamingDistributionRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetStreamingDistribution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetStreamingDistributionResult> responseHandler = new StaxResponseHandler<GetStreamingDistributionResult>(new GetStreamingDistributionResultStaxUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,099,896
private HoldingContainer visitBooleanOr(BooleanOperator op, ClassGenerator<?> generator) {<NEW_LINE>HoldingContainer out = generator.declare(op.getMajorType());<NEW_LINE>JLabel label = generator.getEvalBlockLabel("OrOP");<NEW_LINE>JBlock eval = generator.createInnerEvalBlock();<NEW_LINE>// enter into nested block.<NEW_LINE>generator.nestEvalBlock(eval);<NEW_LINE>HoldingContainer arg = null;<NEW_LINE>JExpression e = null;<NEW_LINE>// value of boolean "or" when one side is null<NEW_LINE>// p q p and q<NEW_LINE>// true null true<NEW_LINE>// false null null<NEW_LINE>// null true true<NEW_LINE>// null false null<NEW_LINE>// null null null<NEW_LINE>for (LogicalExpression expr : op.args()) {<NEW_LINE>arg = <MASK><NEW_LINE>JBlock earlyExit = null;<NEW_LINE>if (arg.isOptional()) {<NEW_LINE>earlyExit = eval._if(arg.getIsSet().eq(JExpr.lit(1)).cand(arg.getValue().eq(JExpr.lit(1))))._then();<NEW_LINE>if (e == null) {<NEW_LINE>e = arg.getIsSet();<NEW_LINE>} else {<NEW_LINE>e = e.mul(arg.getIsSet());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>earlyExit = eval._if(arg.getValue().eq(JExpr.lit(1)))._then();<NEW_LINE>}<NEW_LINE>if (out.isOptional()) {<NEW_LINE>earlyExit.assign(out.getIsSet(), JExpr.lit(1));<NEW_LINE>}<NEW_LINE>earlyExit.assign(out.getValue(), JExpr.lit(1));<NEW_LINE>earlyExit._break(label);<NEW_LINE>}<NEW_LINE>if (out.isOptional()) {<NEW_LINE>assert (e != null);<NEW_LINE>JConditional notSetJC = eval._if(e.eq(JExpr.lit(0)));<NEW_LINE>notSetJC._then().assign(out.getIsSet(), JExpr.lit(0));<NEW_LINE>JBlock setBlock = notSetJC._else().block();<NEW_LINE>setBlock.assign(out.getIsSet(), JExpr.lit(1));<NEW_LINE>setBlock.assign(out.getValue(), JExpr.lit(0));<NEW_LINE>} else {<NEW_LINE>assert (e == null);<NEW_LINE>eval.assign(out.getValue(), JExpr.lit(0));<NEW_LINE>}<NEW_LINE>// exit from nested block.<NEW_LINE>generator.unNestEvalBlock();<NEW_LINE>return out;<NEW_LINE>}
expr.accept(this, generator);
1,349,659
public Motor findMotor(Type type, String manufacturer, String designation, double diameter, double length, String digest, WarningSet warnings) {<NEW_LINE>log.debug("type " + type + ", manufacturer " + manufacturer + ", designation " + designation + ", diameter " + diameter + ", length " + length + ", digest " + digest + ", warnings " + warnings);<NEW_LINE>if (designation == null) {<NEW_LINE>warnings.add(Warning.fromString("No motor specified, ignoring."));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<? extends Motor> motors;<NEW_LINE>motors = Application.getMotorSetDatabase().findMotors(digest, type, manufacturer, designation, diameter, length);<NEW_LINE>// No motors<NEW_LINE>if (motors.size() == 0) {<NEW_LINE>return handleMissingMotor(type, manufacturer, designation, diameter, length, digest, warnings);<NEW_LINE>}<NEW_LINE>// One motor<NEW_LINE>if (motors.size() == 1) {<NEW_LINE>Motor m = motors.get(0);<NEW_LINE>log.debug(<MASK><NEW_LINE>if (digest != null && !digest.equals(m.getDigest())) {<NEW_LINE>String str = "Motor with designation '" + designation + "'";<NEW_LINE>if (manufacturer != null)<NEW_LINE>str += " for manufacturer '" + manufacturer + "'";<NEW_LINE>str += " has differing thrust curve than the original.";<NEW_LINE>warnings.add(str);<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE>// Multiple motors, check digest for which one to use<NEW_LINE>if (digest != null) {<NEW_LINE>// Check for motor with correct digest<NEW_LINE>for (Motor m : motors) {<NEW_LINE>if (digest.equals(m.getDigest())) {<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String str = "Motor with designation '" + designation + "'";<NEW_LINE>if (manufacturer != null)<NEW_LINE>str += " for manufacturer '" + manufacturer + "'";<NEW_LINE>str += " has differing thrust curve than the original.";<NEW_LINE>warnings.add(str);<NEW_LINE>} else {<NEW_LINE>String str = "Multiple motors with designation '" + designation + "'";<NEW_LINE>if (manufacturer != null)<NEW_LINE>str += " for manufacturer '" + manufacturer + "'";<NEW_LINE>str += " found, one chosen arbitrarily.";<NEW_LINE>warnings.add(str);<NEW_LINE>}<NEW_LINE>return motors.get(0);<NEW_LINE>}
"motor is " + m.getDesignation());
1,852,196
public void onLink_BankStatement_IDChangedResetAmounts(@NonNull final I_C_BankStatementLine bsl) {<NEW_LINE>final BankStatementLineId linkedBankStatementLineId = BankStatementLineId.ofRepoIdOrNull(bsl.getLink_BankStatementLine_ID());<NEW_LINE>if (linkedBankStatementLineId == null) {<NEW_LINE>bsl.setCurrencyRate(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final I_C_BankStatementLine <MASK><NEW_LINE>final BigDecimal trxAmtFrom = bslFrom.getTrxAmt();<NEW_LINE>final CurrencyId trxAmtFromCurrencyId = CurrencyId.ofRepoId(bslFrom.getC_Currency_ID());<NEW_LINE>final CurrencyId trxAmtCurrencyId = CurrencyId.ofRepoId(bsl.getC_Currency_ID());<NEW_LINE>final CurrencyConversionContext currencyConversionCtx = currencyConversionBL.createCurrencyConversionContext(TimeUtil.asLocalDate(bsl.getValutaDate()), ConversionTypeMethod.Spot, ClientId.ofRepoId(bsl.getAD_Client_ID()), OrgId.ofRepoId(bsl.getAD_Org_ID()));<NEW_LINE>final CurrencyRate currencyRate = currencyConversionBL.getCurrencyRate(currencyConversionCtx, trxAmtFromCurrencyId, trxAmtCurrencyId);<NEW_LINE>final BigDecimal trxAmt = currencyRate.convertAmount(trxAmtFrom).negate();<NEW_LINE>// bsl.setStmtAmt(trxAmt); // never touch the statement amount after the line was created<NEW_LINE>bsl.setTrxAmt(trxAmt);<NEW_LINE>bsl.setCurrencyRate(currencyRate.getConversionRate());<NEW_LINE>bsl.setChargeAmt(BigDecimal.ZERO);<NEW_LINE>}
bslFrom = bankStatementBL.getLineById(linkedBankStatementLineId);
1,367,418
public ListUsersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListUsersResult listUsersResult = new ListUsersResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<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 listUsersResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("ServerId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersResult.setServerId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Users", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersResult.setUsers(new ListUnmarshaller<ListedUser>(ListedUserJsonUnmarshaller.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 listUsersResult;<NEW_LINE>}
class).unmarshall(context));
1,333,422
public String edit(@PathVariable String id, @RequestParam(required = false) String title, @RequestParam(required = false) String body, @RequestParam(required = false) String tags, @RequestParam(required = false) String location, @RequestParam(required = false) String latlng, @RequestParam(required = false) String space, HttpServletRequest req, HttpServletResponse res, Model model) {<NEW_LINE>Post showPost = pc.read(id);<NEW_LINE>Profile authUser = utils.getAuthUser(req);<NEW_LINE>if (!utils.canEdit(showPost, authUser) || showPost == null) {<NEW_LINE>model.addAttribute("post", showPost);<NEW_LINE>if (utils.isAjaxRequest(req)) {<NEW_LINE>res.setStatus(400);<NEW_LINE>return "blank";<NEW_LINE>} else {<NEW_LINE>// + "/edit-post-12345" ?<NEW_LINE>return "redirect:" + req.getRequestURI();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean <MASK><NEW_LINE>Set<String> addedTags = new HashSet<>();<NEW_LINE>Post beforeUpdate = null;<NEW_LINE>try {<NEW_LINE>beforeUpdate = (Post) BeanUtils.cloneBean(showPost);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error(null, ex);<NEW_LINE>}<NEW_LINE>// body can be blank<NEW_LINE>showPost.setBody(body);<NEW_LINE>showPost.setLocation(location);<NEW_LINE>showPost.setAuthor(authUser);<NEW_LINE>if (isQuestion) {<NEW_LINE>if (StringUtils.length(title) > 2) {<NEW_LINE>showPost.setTitle(title);<NEW_LINE>}<NEW_LINE>addedTags = updateTags(showPost, tags);<NEW_LINE>updateSpaces(showPost, authUser, space, req);<NEW_LINE>}<NEW_LINE>// note: update only happens if something has changed<NEW_LINE>if (!showPost.equals(beforeUpdate)) {<NEW_LINE>// create revision manually<NEW_LINE>if (showPost.hasUpdatedContent(beforeUpdate)) {<NEW_LINE>Revision.createRevisionFromPost(showPost, false);<NEW_LINE>}<NEW_LINE>updatePost(showPost, authUser);<NEW_LINE>updateLocation(showPost, authUser, location, latlng);<NEW_LINE>utils.addBadgeOnceAndUpdate(authUser, Badge.EDITOR, true);<NEW_LINE>utils.sendUpdatedFavTagsNotifications(showPost, new ArrayList<>(addedTags), req);<NEW_LINE>}<NEW_LINE>model.addAttribute("post", showPost);<NEW_LINE>if (utils.isAjaxRequest(req)) {<NEW_LINE>res.setStatus(200);<NEW_LINE>res.setContentType("application/json");<NEW_LINE>try {<NEW_LINE>res.getWriter().println("{\"url\":\"" + getPostLink(showPost) + "\"}");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>return "blank";<NEW_LINE>} else {<NEW_LINE>return "redirect:" + showPost.getPostLink(false, false);<NEW_LINE>}<NEW_LINE>}
isQuestion = !showPost.isReply();
1,352,071
public static // '[' expression '||' lc_exprs ']'<NEW_LINE>boolean list_comprehension(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "list_comprehension"))<NEW_LINE>return false;<NEW_LINE>if (!nextTokenIs(b, "<expression>", ERL_BRACKET_LEFT))<NEW_LINE>return false;<NEW_LINE>boolean r;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ERL_LIST_COMPREHENSION, "<expression>");<NEW_LINE>r = consumeToken(b, ERL_BRACKET_LEFT);<NEW_LINE>r = r && expression(b, l + 1, -1);<NEW_LINE>r = r && consumeToken(b, ERL_OR_OR);<NEW_LINE>r = r && lc_exprs(b, l + 1);<NEW_LINE>r = <MASK><NEW_LINE>exit_section_(b, l, m, r, false, null);<NEW_LINE>return r;<NEW_LINE>}
r && consumeToken(b, ERL_BRACKET_RIGHT);
403,438
byte[] treehash(byte[] skSeed, int s, int z, byte[] pkSeed, ADRS adrsParam) {<NEW_LINE><MASK><NEW_LINE>LinkedList<NodeEntry> stack = new LinkedList<NodeEntry>();<NEW_LINE>if (s % (1 << z) != 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (int idx = 0; idx < (1 << z); idx++) {<NEW_LINE>adrs.setType(ADRS.WOTS_HASH);<NEW_LINE>adrs.setKeyPairAddress(s + idx);<NEW_LINE>byte[] node = wots.pkGen(skSeed, pkSeed, adrs);<NEW_LINE>adrs.setType(ADRS.TREE);<NEW_LINE>adrs.setTreeHeight(1);<NEW_LINE>adrs.setTreeIndex(s + idx);<NEW_LINE>// while ( Top node on Stack has same height as node )<NEW_LINE>while (!stack.isEmpty() && ((NodeEntry) stack.get(0)).nodeHeight == adrs.getTreeHeight()) {<NEW_LINE>adrs.setTreeIndex((adrs.getTreeIndex() - 1) / 2);<NEW_LINE>NodeEntry current = ((NodeEntry) stack.remove(0));<NEW_LINE>node = engine.H(pkSeed, adrs, current.nodeValue, node);<NEW_LINE>// topmost node is now one layer higher<NEW_LINE>adrs.setTreeHeight(adrs.getTreeHeight() + 1);<NEW_LINE>}<NEW_LINE>stack.add(0, new NodeEntry(node, adrs.getTreeHeight()));<NEW_LINE>}<NEW_LINE>return ((NodeEntry) stack.get(0)).nodeValue;<NEW_LINE>}
ADRS adrs = new ADRS(adrsParam);
333,448
private JPanel initMltParamsPanel() {<NEW_LINE>JPanel panel = new JPanel(<MASK><NEW_LINE>panel.setOpaque(false);<NEW_LINE>JPanel maxDocFreq = new JPanel(new FlowLayout(FlowLayout.LEADING));<NEW_LINE>maxDocFreq.setOpaque(false);<NEW_LINE>maxDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("search_mlt.label.max_doc_freq")));<NEW_LINE>maxDocFreqFTF.setColumns(10);<NEW_LINE>maxDocFreqFTF.setValue(config.getMaxDocFreq());<NEW_LINE>maxDocFreq.add(maxDocFreqFTF);<NEW_LINE>maxDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required")));<NEW_LINE>panel.add(maxDocFreq);<NEW_LINE>JPanel minDocFreq = new JPanel(new FlowLayout(FlowLayout.LEADING));<NEW_LINE>minDocFreq.setOpaque(false);<NEW_LINE>minDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("search_mlt.label.min_doc_freq")));<NEW_LINE>minDocFreqFTF.setColumns(5);<NEW_LINE>minDocFreqFTF.setValue(config.getMinDocFreq());<NEW_LINE>minDocFreq.add(minDocFreqFTF);<NEW_LINE>minDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required")));<NEW_LINE>panel.add(minDocFreq);<NEW_LINE>JPanel minTermFreq = new JPanel(new FlowLayout(FlowLayout.LEADING));<NEW_LINE>minTermFreq.setOpaque(false);<NEW_LINE>minTermFreq.add(new JLabel(MessageUtils.getLocalizedMessage("serach_mlt.label.min_term_freq")));<NEW_LINE>minTermFreqFTF.setColumns(5);<NEW_LINE>minTermFreqFTF.setValue(config.getMinTermFreq());<NEW_LINE>minTermFreq.add(minTermFreqFTF);<NEW_LINE>minTermFreq.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required")));<NEW_LINE>panel.add(minTermFreq);<NEW_LINE>return panel;<NEW_LINE>}
new GridLayout(3, 1));
695,265
public void read(org.apache.thrift.protocol.TProtocol prot, FetchResult struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(4);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.resultType = com.facebook.buck.artifact_cache.thrift.FetchResultType.<MASK><NEW_LINE>struct.setResultTypeIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.metadata = new ArtifactMetadata();<NEW_LINE>struct.metadata.read(iprot);<NEW_LINE>struct.setMetadataIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.debugInfo = new FetchDebugInfo();<NEW_LINE>struct.debugInfo.read(iprot);<NEW_LINE>struct.setDebugInfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.payload = iprot.readBinary();<NEW_LINE>struct.setPayloadIsSet(true);<NEW_LINE>}<NEW_LINE>}
findByValue(iprot.readI32());
1,848,236
public void hrefReference(String target, int line) {<NEW_LINE>// System.out.println(document+":"+line+": href to "+target);<NEW_LINE>// recursively check the target document unless non-file ref<NEW_LINE>if (fileProtocolURL(target)) {<NEW_LINE>// prune off any #name reference on end of file<NEW_LINE>int pound = target.indexOf('#');<NEW_LINE>String path = target;<NEW_LINE>if (pound != -1) {<NEW_LINE>// rip off #name on end, leave file<NEW_LINE>path = target.substring(0, pound);<NEW_LINE>if (path.length() == 0) {<NEW_LINE>// ref to name in this file<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// first check existence on disk<NEW_LINE>File f = new <MASK><NEW_LINE>if (!f.exists()) {<NEW_LINE>error("Reference to missing file " + path, line);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check the case<NEW_LINE>checkLinkRules(path, line);<NEW_LINE>try {<NEW_LINE>// Link is ok, now follow the link<NEW_LINE>LinkChecker chk = new LinkChecker(directory + separator + path);<NEW_LINE>chk.doCheck();<NEW_LINE>} catch (IOException io) {<NEW_LINE>error("Document does not exist: " + target, line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
File(directory + separator + path);
378,414
void renderDetails(Node node) {<NEW_LINE>String name = node.getNodeName();<NEW_LINE>if (name.equals("parameters")) {<NEW_LINE>assembly.append('\n').append(indentation(this.indentLevel)).append("Parameters:\n");<NEW_LINE>indentLevel += 4;<NEW_LINE>DomUtilities.traverseChildren(node, this::renderParameter, Node.ELEMENT_NODE);<NEW_LINE>indentLevel -= 4;<NEW_LINE>} else if (name.equals("throws")) {<NEW_LINE>assembly.append('\n').append(indentation(this.indentLevel)).append("Raises:\n");<NEW_LINE>indentLevel += 4;<NEW_LINE>DomUtilities.traverseChildren(node, this::renderThrow, Node.ELEMENT_NODE);<NEW_LINE>indentLevel -= 4;<NEW_LINE>} else if (SECTIONS.containsKey(name)) {<NEW_LINE>String title = SECTIONS.get(name);<NEW_LINE>if (title == null)<NEW_LINE>return;<NEW_LINE>assembly.append('\n').append(indentation(this.indentLevel)).append<MASK><NEW_LINE>indentLevel += 4;<NEW_LINE>renderText(node, true, true);<NEW_LINE>indentLevel -= 4;<NEW_LINE>} else {<NEW_LINE>System.err.println("Need renderer for section " + name);<NEW_LINE>}<NEW_LINE>}
(title).append('\n');
163,139
public ApolloOpenApiClient openApiClient() {<NEW_LINE>String portalUrl = environment.getProperty(ApolloConstant.APOLLO_PORTAL_URL);<NEW_LINE>if (StringUtils.isEmpty(portalUrl)) {<NEW_LINE>throw new DiscoveryException(ApolloConstant.APOLLO_PORTAL_URL + " can't be null or empty");<NEW_LINE>}<NEW_LINE>String token = environment.getProperty(ApolloConstant.APOLLO_TOKEN);<NEW_LINE>if (StringUtils.isEmpty(token)) {<NEW_LINE>throw new DiscoveryException(ApolloConstant.APOLLO_TOKEN + " can't be null or empty");<NEW_LINE>}<NEW_LINE>int connectTimeout = environment.getProperty(ApolloConstant.APOLLO_CONNECT_TIMEOUT, <MASK><NEW_LINE>int readTimeout = environment.getProperty(ApolloConstant.APOLLO_READ_TIMEOUT, Integer.class, ApolloConstant.DEFAULT_READ_TIMEOUT);<NEW_LINE>return ApolloOpenApiClient.newBuilder().withPortalUrl(portalUrl).withToken(token).withConnectTimeout(connectTimeout).withReadTimeout(readTimeout).build();<NEW_LINE>}
Integer.class, ApolloConstant.DEFAULT_CONNECT_TIMEOUT);
983,080
public static Map<String, Set<Integer>> markDropped(final Collection<Geocache> caches) {<NEW_LINE>final SQLiteStatement remove = PreparedStatement.REMOVE_FROM_ALL_LISTS.getStatement();<NEW_LINE>final Map<String, Set<Integer>> oldLists = new HashMap<>();<NEW_LINE>database.beginTransaction();<NEW_LINE>try {<NEW_LINE>final Set<String> geocodes = new HashSet<<MASK><NEW_LINE>for (final Geocache cache : caches) {<NEW_LINE>oldLists.put(cache.getGeocode(), loadLists(cache.getGeocode()));<NEW_LINE>remove.bindString(1, cache.getGeocode());<NEW_LINE>remove.execute();<NEW_LINE>geocodes.add(cache.getGeocode());<NEW_LINE>cache.getLists().clear();<NEW_LINE>}<NEW_LINE>clearVisitDate(geocodes);<NEW_LINE>clearLogsOffline(caches);<NEW_LINE>database.setTransactionSuccessful();<NEW_LINE>} finally {<NEW_LINE>database.endTransaction();<NEW_LINE>}<NEW_LINE>return oldLists;<NEW_LINE>}
>(caches.size());
1,145,195
public DeleteOrganizationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteOrganizationResult deleteOrganizationResult = new DeleteOrganizationResult();<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 deleteOrganizationResult;<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("OrganizationId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteOrganizationResult.setOrganizationId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("State", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteOrganizationResult.setState(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 deleteOrganizationResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
208,350
static DecoderResult decode(byte[] bytes, int mode) throws FormatException {<NEW_LINE>StringBuilder result = new StringBuilder(144);<NEW_LINE>switch(mode) {<NEW_LINE>case 2:<NEW_LINE>case 3:<NEW_LINE>String postcode;<NEW_LINE>if (mode == 2) {<NEW_LINE>int pc = getPostCode2(bytes);<NEW_LINE>int ps2Length = getPostCode2Length(bytes);<NEW_LINE>if (ps2Length > 10) {<NEW_LINE>throw FormatException.getFormatInstance();<NEW_LINE>}<NEW_LINE>NumberFormat df = new DecimalFormat("0000000000".substring(0, ps2Length));<NEW_LINE>postcode = df.format(pc);<NEW_LINE>} else {<NEW_LINE>postcode = getPostCode3(bytes);<NEW_LINE>}<NEW_LINE>NumberFormat threeDigits = new DecimalFormat("000");<NEW_LINE>String country = threeDigits.format(getCountry(bytes));<NEW_LINE>String service = threeDigits<MASK><NEW_LINE>result.append(getMessage(bytes, 10, 84));<NEW_LINE>if (result.toString().startsWith("[)>" + RS + "01" + GS)) {<NEW_LINE>result.insert(9, postcode + GS + country + GS + service + GS);<NEW_LINE>} else {<NEW_LINE>result.insert(0, postcode + GS + country + GS + service + GS);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>result.append(getMessage(bytes, 1, 93));<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>result.append(getMessage(bytes, 1, 77));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return new DecoderResult(bytes, result.toString(), null, String.valueOf(mode));<NEW_LINE>}
.format(getServiceClass(bytes));
738,387
public PublicAccessBlockConfiguration unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>PublicAccessBlockConfiguration publicAccessBlockConfiguration = new PublicAccessBlockConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return publicAccessBlockConfiguration;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("BlockPublicAcls", targetDepth)) {<NEW_LINE>publicAccessBlockConfiguration.setBlockPublicAcls(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("IgnorePublicAcls", targetDepth)) {<NEW_LINE>publicAccessBlockConfiguration.setIgnorePublicAcls(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("BlockPublicPolicy", targetDepth)) {<NEW_LINE>publicAccessBlockConfiguration.setBlockPublicPolicy(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("RestrictPublicBuckets", targetDepth)) {<NEW_LINE>publicAccessBlockConfiguration.setRestrictPublicBuckets(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return publicAccessBlockConfiguration;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
1,457,367
public StubRunnerOptionsBuilder withOptions(StubRunnerOptions options) {<NEW_LINE>this.minPortValue = options.minPortValue;<NEW_LINE>this.maxPortValue = options.maxPortValue;<NEW_LINE>this.stubRepositoryRoot = options.stubRepositoryRoot;<NEW_LINE>this.stubsMode = options.stubsMode;<NEW_LINE>this.stubsClassifier = options.stubsClassifier;<NEW_LINE>this.username = options.username;<NEW_LINE>this.password = options.password;<NEW_LINE>this.stubRunnerProxyOptions = options.getStubRunnerProxyOptions();<NEW_LINE>this.stubsPerConsumer = options.isStubsPerConsumer();<NEW_LINE>this.consumerName = options.getConsumerName();<NEW_LINE>this.mappingsOutputFolder = options.getMappingsOutputFolder();<NEW_LINE>this.stubConfigurations = options.dependencies != null ? options.dependencies : new ArrayList<>();<NEW_LINE>this.stubIdsToPortMapping = options.stubIdsToPortMapping != null ? options.<MASK><NEW_LINE>this.deleteStubsAfterTest = options.isDeleteStubsAfterTest();<NEW_LINE>this.generateStubs = options.isGenerateStubs();<NEW_LINE>this.failOnNoStubs = options.isFailOnNoStubs();<NEW_LINE>this.properties = options.getProperties();<NEW_LINE>this.httpServerStubConfigurer = options.getHttpServerStubConfigurer();<NEW_LINE>this.serverId = options.getServerId();<NEW_LINE>return this;<NEW_LINE>}
stubIdsToPortMapping : new LinkedHashMap<>();
1,703,191
public Node visit(final ForStmt n, final A arg) {<NEW_LINE>final List<Expression> init = n.getInit();<NEW_LINE>if (init != null) {<NEW_LINE>for (int i = 0; i < init.size(); i++) {<NEW_LINE>init.set(i, (Expression) init.get(i)<MASK><NEW_LINE>}<NEW_LINE>removeNulls(init);<NEW_LINE>}<NEW_LINE>if (n.getCompare() != null) {<NEW_LINE>n.setCompare((Expression) n.getCompare().accept(this, arg));<NEW_LINE>}<NEW_LINE>final List<Expression> update = n.getUpdate();<NEW_LINE>if (update != null) {<NEW_LINE>for (int i = 0; i < update.size(); i++) {<NEW_LINE>update.set(i, (Expression) update.get(i).accept(this, arg));<NEW_LINE>}<NEW_LINE>removeNulls(update);<NEW_LINE>}<NEW_LINE>n.setBody((Statement) n.getBody().accept(this, arg));<NEW_LINE>return n;<NEW_LINE>}
.accept(this, arg));
1,771,802
final GetResourcePolicyResult executeGetResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getResourcePolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetResourcePolicyRequest> request = null;<NEW_LINE>Response<GetResourcePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetResourcePolicyRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Migration Hub Refactor Spaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetResourcePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetResourcePolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetResourcePolicyResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(getResourcePolicyRequest));
906,213
/* non Java-doc<NEW_LINE>* @see IRefactoring#createChange(IProgressMonitor)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public Change createChange(IProgressMonitor pm) throws CoreException {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>final String NN = "";<NEW_LINE>if (pm == null) {<NEW_LINE>pm = new NullProgressMonitor();<NEW_LINE>}<NEW_LINE>pm.beginTask(NN, 2);<NEW_LINE>try {<NEW_LINE>final CompilationUnitChange result = new CompilationUnitChange(getName(), fCUnit);<NEW_LINE>if (fLeaveDirty) {<NEW_LINE>result.setSaveMode(TextFileChange.LEAVE_DIRTY);<NEW_LINE>}<NEW_LINE>MultiTextEdit root = new MultiTextEdit();<NEW_LINE>result.setEdit(root);<NEW_LINE>fRewriter = ASTRewrite.create(fAnalyzer.getEnclosingBodyDeclaration().getAST());<NEW_LINE>fRewriter.setTargetSourceRangeComputer(new SelectionAwareSourceRangeComputer(fAnalyzer.getSelectedNodes(), fCUnit.getBuffer(), fSelection.getOffset(), fSelection.getLength()));<NEW_LINE>fImportRewrite = CodeStyleConfiguration.createImportRewrite(fRootNode, true);<NEW_LINE>fLinkedProposalModel = new LinkedProposalModelCore();<NEW_LINE>fScope = CodeScopeBuilder.perform(fAnalyzer.getEnclosingBodyDeclaration(), fSelection).findScope(fSelection.getOffset(), fSelection.getLength());<NEW_LINE>fScope.setCursor(fSelection.getOffset());<NEW_LINE>fSelectedNodes = fAnalyzer.getSelectedNodes();<NEW_LINE>createTryCatchStatement(fCUnit.getBuffer(), fCUnit.findRecommendedLineSeparator());<NEW_LINE>if (fImportRewrite.hasRecordedChanges()) {<NEW_LINE>TextEdit edit = fImportRewrite.rewriteImports(null);<NEW_LINE>root.addChild(edit);<NEW_LINE>result.addTextEditGroup(new TextEditGroup(NN, new TextEdit[] { edit }));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>root.addChild(change);<NEW_LINE>result.addTextEditGroup(new TextEditGroup(NN, new TextEdit[] { change }));<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>pm.done();<NEW_LINE>}<NEW_LINE>}
TextEdit change = fRewriter.rewriteAST();
1,046,289
public void unregisterClient(final Client client, final IAsyncResultHandler<Void> handler) {<NEW_LINE>try {<NEW_LINE>final Client lclient = lookupClient(client.getOrganizationId(), client.getClientId(), client.getVersion());<NEW_LINE>final String id = getClientId(lclient);<NEW_LINE>DeleteRequest deleteRequest = new DeleteRequest(getIndexPrefix() + EsConstants.INDEX_CLIENTS).id(id).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);<NEW_LINE>DeleteResponse response = getClient().delete(deleteRequest, RequestOptions.DEFAULT);<NEW_LINE>if (response.status().equals(RestStatus.OK)) {<NEW_LINE>handler.handle(AsyncResultImpl.<MASK><NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>handler.handle(AsyncResultImpl.create(new ApiNotFoundException(Messages.i18n.format("EsRegistry.ClientNotFound"))));<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>handler.handle(AsyncResultImpl.create(new PublishingException(Messages.i18n.format("EsRegistry.ErrorUnregisteringClient"), e), Void.class));<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>handler.handle(AsyncResultImpl.create(e));<NEW_LINE>}<NEW_LINE>}
create((Void) null));
154,195
public Builder mergeFrom(com.alibaba.otter.node.etl.model.protobuf.BatchProto.FileBatch other) {<NEW_LINE>if (other == com.alibaba.otter.node.etl.model.protobuf.BatchProto.FileBatch.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasIdentity()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (filesBuilder_ == null) {<NEW_LINE>if (!other.files_.isEmpty()) {<NEW_LINE>if (files_.isEmpty()) {<NEW_LINE>files_ = other.files_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureFilesIsMutable();<NEW_LINE>files_.addAll(other.files_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.files_.isEmpty()) {<NEW_LINE>if (filesBuilder_.isEmpty()) {<NEW_LINE>filesBuilder_.dispose();<NEW_LINE>filesBuilder_ = null;<NEW_LINE>files_ = other.files_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>filesBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getFilesFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>filesBuilder_.addAllMessages(other.files_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>}
mergeIdentity(other.getIdentity());
156,030
public void run(Optional<Pair<String, String>> basicAuth, Predicate<Properties> authenticator, Consumer<FinishedRequest> callback, FileHandler homepage, boolean https, AtomicBoolean live) {<NEW_LINE>try {<NEW_LINE>if (https) {<NEW_LINE>// 0 is the default 'backlog'<NEW_LINE>server = addSSLContext(HttpsServer.create(new InetSocketAddress(serverPort), 0));<NEW_LINE>} else {<NEW_LINE>// 0 is the default 'backlog'<NEW_LINE>server = HttpServer.create(new InetSocketAddress(serverPort), 0);<NEW_LINE>}<NEW_LINE>String contextRoot = uriContext;<NEW_LINE>if (contextRoot.isEmpty()) {<NEW_LINE>contextRoot = "/";<NEW_LINE>}<NEW_LINE>withAuth(server.createContext(contextRoot, new CoreNLPHandler(defaultProps, authenticator, <MASK><NEW_LINE>withAuth(server.createContext(uriContext + "/tokensregex", new TokensRegexHandler(authenticator, callback)), basicAuth);<NEW_LINE>withAuth(server.createContext(uriContext + "/semgrex", new SemgrexHandler(authenticator, callback)), basicAuth);<NEW_LINE>withAuth(server.createContext(uriContext + "/tregex", new TregexHandler(authenticator, callback)), basicAuth);<NEW_LINE>withAuth(server.createContext(uriContext + "/corenlp-brat.js", new FileHandler("edu/stanford/nlp/pipeline/demo/corenlp-brat.js", "application/javascript")), basicAuth);<NEW_LINE>withAuth(server.createContext(uriContext + "/corenlp-brat.cs", new FileHandler("edu/stanford/nlp/pipeline/demo/corenlp-brat.css", "text/css")), basicAuth);<NEW_LINE>withAuth(server.createContext(uriContext + "/corenlp-parseviewer.js", new FileHandler("edu/stanford/nlp/pipeline/demo/corenlp-parseviewer.js", "application/javascript")), basicAuth);<NEW_LINE>withAuth(server.createContext(uriContext + "/ping", new PingHandler()), Optional.empty());<NEW_LINE>withAuth(server.createContext(uriContext + "/shutdown", new ShutdownHandler()), basicAuth);<NEW_LINE>if (this.serverPort == this.statusPort) {<NEW_LINE>withAuth(server.createContext(uriContext + "/live", new LiveHandler()), Optional.empty());<NEW_LINE>withAuth(server.createContext(uriContext + "/ready", new ReadyHandler(live)), Optional.empty());<NEW_LINE>}<NEW_LINE>server.setExecutor(serverExecutor);<NEW_LINE>server.start();<NEW_LINE>live.set(true);<NEW_LINE>log("StanfordCoreNLPServer listening at " + server.getAddress());<NEW_LINE>} catch (IOException e) {<NEW_LINE>warn(e);<NEW_LINE>}<NEW_LINE>}
callback, homepage)), basicAuth);
208,203
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) {<NEW_LINE><MASK><NEW_LINE>Assert.notNull(messages, "'messages' must not be null");<NEW_LINE>Object mgm = doRetrieve(this.groupPrefix + groupId);<NEW_LINE>if (mgm != null) {<NEW_LINE>Assert.isInstanceOf(MessageGroupMetadata.class, mgm);<NEW_LINE>MessageGroupMetadata messageGroupMetadata = (MessageGroupMetadata) mgm;<NEW_LINE>List<UUID> ids = messages.stream().map(messageToRemove -> messageToRemove.getHeaders().getId()).collect(Collectors.toList());<NEW_LINE>messageGroupMetadata.removeAll(ids);<NEW_LINE>List<Object> messageIds = ids.stream().map(id -> this.messagePrefix + id).collect(Collectors.toList());<NEW_LINE>doRemoveAll(messageIds);<NEW_LINE>messageGroupMetadata.setLastModified(System.currentTimeMillis());<NEW_LINE>doStore(this.groupPrefix + groupId, messageGroupMetadata);<NEW_LINE>}<NEW_LINE>}
Assert.notNull(groupId, GROUP_ID_MUST_NOT_BE_NULL);
1,485,886
public static void main(String[] args) throws Exception {<NEW_LINE>// Set root classloader to current classpath<NEW_LINE>ClassLoader root = Thread.currentThread().getContextClassLoader();<NEW_LINE>// Get classpath for function instance<NEW_LINE>String functionInstanceClasspath = System.getProperty(FUNCTIONS_INSTANCE_CLASSPATH);<NEW_LINE>if (functionInstanceClasspath == null) {<NEW_LINE>throw new IllegalArgumentException("Property " + FUNCTIONS_INSTANCE_CLASSPATH + " is not set!");<NEW_LINE>}<NEW_LINE>List<File> files = new LinkedList<>();<NEW_LINE>for (String entry : functionInstanceClasspath.split(":")) {<NEW_LINE>if (isBlank(entry)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// replace any asterisks i.e. wildcards as they don't work with url classloader<NEW_LINE>File f = new File(entry<MASK><NEW_LINE>if (f.exists()) {<NEW_LINE>if (f.isDirectory()) {<NEW_LINE>files.addAll(Arrays.asList(f.listFiles()));<NEW_LINE>} else {<NEW_LINE>files.add(new File(entry));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println(String.format("[WARN] %s on functions instance classpath does not exist", f.getAbsolutePath()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClassLoader functionInstanceClsLoader = loadJar(root, files.toArray(new File[files.size()]));<NEW_LINE>System.out.println("Using function root classloader: " + root);<NEW_LINE>System.out.println("Using function instance classloader: " + functionInstanceClsLoader);<NEW_LINE>// use the function instance classloader to create org.apache.pulsar.functions.runtime.JavaInstanceStarter<NEW_LINE>Object main = createInstance("org.apache.pulsar.functions.runtime.JavaInstanceStarter", functionInstanceClsLoader);<NEW_LINE>// Invoke start method of JavaInstanceStarter to start the function instance code<NEW_LINE>Method method = main.getClass().getDeclaredMethod("start", String[].class, ClassLoader.class, ClassLoader.class);<NEW_LINE>System.out.println("Starting function instance...");<NEW_LINE>method.invoke(main, args, functionInstanceClsLoader, root);<NEW_LINE>}
.replace("*", ""));
371,818
public static void main(final String[] args) {<NEW_LINE>final Option<Integer> o1 = some(7);<NEW_LINE>final Option<Integer> o2 = none();<NEW_LINE>final Option<Integer> o3 = some(8);<NEW_LINE>final Option<Integer> <MASK><NEW_LINE>final Option<Integer> o5 = o2.filter(even);<NEW_LINE>final Option<Integer> o6 = o3.filter(even);<NEW_LINE>F<Integer, Boolean> f = i -> i % 2 == 0;<NEW_LINE>final Option<Integer> o7 = o4.filter(f);<NEW_LINE>final Option<Integer> o8 = o5.filter(f);<NEW_LINE>final Option<Integer> o9 = o6.filter(i -> i % 2 == 0);<NEW_LINE>// None<NEW_LINE>optionShow(intShow).println(o7);<NEW_LINE>// None<NEW_LINE>optionShow(intShow).println(o8);<NEW_LINE>// Some(8)<NEW_LINE>optionShow(intShow).println(o9);<NEW_LINE>}
o4 = o1.filter(even);
1,843,395
protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {<NEW_LINE>BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(AlgorithmProvidedShardingRuleConfiguration.class);<NEW_LINE>factory.addPropertyValue<MASK><NEW_LINE>factory.addPropertyValue("autoTables", parseAutoTableRulesConfiguration(element));<NEW_LINE>factory.addPropertyValue("bindingTableGroups", parseBindingTablesConfiguration(element));<NEW_LINE>factory.addPropertyValue("broadcastTables", parseBroadcastTables(element));<NEW_LINE>setDefaultDatabaseShardingStrategyRef(element, factory);<NEW_LINE>setDefaultTableShardingStrategyRef(element, factory);<NEW_LINE>setDefaultKeyGenerateStrategyRef(element, factory);<NEW_LINE>setDefaultShardingColumn(element, factory);<NEW_LINE>factory.addPropertyValue("shardingAlgorithms", ShardingSphereAlgorithmBeanRegistry.getAlgorithmBeanReferences(parserContext, ShardingAlgorithmFactoryBean.class));<NEW_LINE>factory.addPropertyValue("keyGenerators", ShardingSphereAlgorithmBeanRegistry.getAlgorithmBeanReferences(parserContext, KeyGenerateAlgorithmFactoryBean.class));<NEW_LINE>return factory.getBeanDefinition();<NEW_LINE>}
("tables", parseTableRulesConfiguration(element));
1,628,363
public WorkflowExecutionCancelRequestedEventAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes = new WorkflowExecutionCancelRequestedEventAttributes();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<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("externalWorkflowExecution", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>workflowExecutionCancelRequestedEventAttributes.setExternalWorkflowExecution(WorkflowExecutionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("externalInitiatedEventId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>workflowExecutionCancelRequestedEventAttributes.setExternalInitiatedEventId(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("cause", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>workflowExecutionCancelRequestedEventAttributes.setCause(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 workflowExecutionCancelRequestedEventAttributes;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
683,040
protected void initChannel(NioSocketChannel ch) throws Exception {<NEW_LINE>if (_sslContext != null) {<NEW_LINE>ch.pipeline().addLast(SessionResumptionSslHandler.PIPELINE_SESSION_RESUMPTION_HANDLER, new SessionResumptionSslHandler(_sslContext<MASK><NEW_LINE>}<NEW_LINE>ch.pipeline().addLast("codec", new HttpClientCodec(4096, _maxHeaderSize, _maxChunkSize));<NEW_LINE>ch.pipeline().addLast("dechunker", new HttpObjectAggregator(_maxResponseSize));<NEW_LINE>ch.pipeline().addLast("rapiCodec", new RAPClientCodec());<NEW_LINE>// the response handler catches the exceptions thrown by other layers. By consequence no handlers that throw exceptions<NEW_LINE>// should be after this one, otherwise the exception won't be caught and managed by R2<NEW_LINE>ch.pipeline().addLast("responseHandler", _responseHandler);<NEW_LINE>ch.pipeline().addLast("channelManager", _handler);<NEW_LINE>}
, _sslParameters, _enableSSLSessionResumption, _sslSessionTimeout));
1,442,906
private Method resolveFactoryMethod(BeanDefinition beanDefinition, List<ResolvableType> valueTypes) {<NEW_LINE>if (beanDefinition instanceof RootBeanDefinition) {<NEW_LINE>RootBeanDefinition rootBeanDefinition = (RootBeanDefinition) beanDefinition;<NEW_LINE>Method resolvedFactoryMethod = rootBeanDefinition.getResolvedFactoryMethod();<NEW_LINE>if (resolvedFactoryMethod != null) {<NEW_LINE>return resolvedFactoryMethod;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String factoryMethodName = beanDefinition.getFactoryMethodName();<NEW_LINE>if (factoryMethodName != null) {<NEW_LINE>List<Method> methods = new ArrayList<>();<NEW_LINE>Class<?> beanClass = getBeanClass(beanDefinition);<NEW_LINE>if (beanClass == null) {<NEW_LINE>throw new IllegalStateException("Failed to determine bean class of " + beanDefinition);<NEW_LINE>}<NEW_LINE>ReflectionUtils.doWithMethods(beanClass, methods::add, (method) -> isFactoryMethodCandidate<MASK><NEW_LINE>if (methods.size() >= 1) {<NEW_LINE>Function<Method, List<ResolvableType>> parameterTypesFactory = (method) -> {<NEW_LINE>List<ResolvableType> types = new ArrayList<>();<NEW_LINE>for (int i = 0; i < method.getParameterCount(); i++) {<NEW_LINE>types.add(ResolvableType.forMethodParameter(method, i));<NEW_LINE>}<NEW_LINE>return types;<NEW_LINE>};<NEW_LINE>return (Method) resolveFactoryMethod(methods, parameterTypesFactory, valueTypes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
(beanClass, method, factoryMethodName));
1,014,994
protected void parseMaterials(ModelData model, JsonValue json, String materialDir) {<NEW_LINE>JsonValue materials = json.get("materials");<NEW_LINE>if (materials == null) {<NEW_LINE>// we should probably create some default material in this case<NEW_LINE>} else {<NEW_LINE>model.materials.ensureCapacity(materials.size);<NEW_LINE>for (JsonValue material = materials.child; material != null; material = material.next) {<NEW_LINE>ModelMaterial jsonMaterial = new ModelMaterial();<NEW_LINE>String id = material.getString("id", null);<NEW_LINE>if (id == null)<NEW_LINE>throw new GdxRuntimeException("Material needs an id.");<NEW_LINE>jsonMaterial.id = id;<NEW_LINE>// Read material colors<NEW_LINE>final JsonValue diffuse = material.get("diffuse");<NEW_LINE>if (diffuse != null)<NEW_LINE>jsonMaterial.diffuse = parseColor(diffuse);<NEW_LINE>final JsonValue ambient = material.get("ambient");<NEW_LINE>if (ambient != null)<NEW_LINE>jsonMaterial.ambient = parseColor(ambient);<NEW_LINE>final JsonValue emissive = material.get("emissive");<NEW_LINE>if (emissive != null)<NEW_LINE>jsonMaterial.emissive = parseColor(emissive);<NEW_LINE>final JsonValue specular = material.get("specular");<NEW_LINE>if (specular != null)<NEW_LINE>jsonMaterial.specular = parseColor(specular);<NEW_LINE>final JsonValue reflection = material.get("reflection");<NEW_LINE>if (reflection != null)<NEW_LINE>jsonMaterial.reflection = parseColor(reflection);<NEW_LINE>// Read shininess<NEW_LINE>jsonMaterial.shininess = material.getFloat("shininess", 0.0f);<NEW_LINE>// Read opacity<NEW_LINE>jsonMaterial.opacity = <MASK><NEW_LINE>// Read textures<NEW_LINE>JsonValue textures = material.get("textures");<NEW_LINE>if (textures != null) {<NEW_LINE>for (JsonValue texture = textures.child; texture != null; texture = texture.next) {<NEW_LINE>ModelTexture jsonTexture = new ModelTexture();<NEW_LINE>String textureId = texture.getString("id", null);<NEW_LINE>if (textureId == null)<NEW_LINE>throw new GdxRuntimeException("Texture has no id.");<NEW_LINE>jsonTexture.id = textureId;<NEW_LINE>String fileName = texture.getString("filename", null);<NEW_LINE>if (fileName == null)<NEW_LINE>throw new GdxRuntimeException("Texture needs filename.");<NEW_LINE>jsonTexture.fileName = materialDir + (materialDir.length() == 0 || materialDir.endsWith("/") ? "" : "/") + fileName;<NEW_LINE>jsonTexture.uvTranslation = readVector2(texture.get("uvTranslation"), 0f, 0f);<NEW_LINE>jsonTexture.uvScaling = readVector2(texture.get("uvScaling"), 1f, 1f);<NEW_LINE>String textureType = texture.getString("type", null);<NEW_LINE>if (textureType == null)<NEW_LINE>throw new GdxRuntimeException("Texture needs type.");<NEW_LINE>jsonTexture.usage = parseTextureUsage(textureType);<NEW_LINE>if (jsonMaterial.textures == null)<NEW_LINE>jsonMaterial.textures = new Array<ModelTexture>();<NEW_LINE>jsonMaterial.textures.add(jsonTexture);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>model.materials.add(jsonMaterial);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
material.getFloat("opacity", 1.0f);
1,402,709
public static GetInstanceStateResponse unmarshall(GetInstanceStateResponse getInstanceStateResponse, UnmarshallerContext context) {<NEW_LINE>getInstanceStateResponse.setRequestId(context.stringValue("GetInstanceStateResponse.RequestId"));<NEW_LINE>getInstanceStateResponse.setSuccess(context.booleanValue("GetInstanceStateResponse.Success"));<NEW_LINE>getInstanceStateResponse.setCode(context.stringValue("GetInstanceStateResponse.Code"));<NEW_LINE>getInstanceStateResponse.setMessage(context.stringValue("GetInstanceStateResponse.Message"));<NEW_LINE>getInstanceStateResponse.setHttpStatusCode<MASK><NEW_LINE>RealTimeInstanceState realTimeInstanceState = new RealTimeInstanceState();<NEW_LINE>List<AgentStateCount> agentStateDistributions = new ArrayList<AgentStateCount>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetInstanceStateResponse.RealTimeInstanceState.AgentStateDistributions.Length"); i++) {<NEW_LINE>AgentStateCount agentStateCount = new AgentStateCount();<NEW_LINE>agentStateCount.setState(context.stringValue("GetInstanceStateResponse.RealTimeInstanceState.AgentStateDistributions[" + i + "].State"));<NEW_LINE>agentStateCount.setCount(context.longValue("GetInstanceStateResponse.RealTimeInstanceState.AgentStateDistributions[" + i + "].Count"));<NEW_LINE>agentStateDistributions.add(agentStateCount);<NEW_LINE>}<NEW_LINE>realTimeInstanceState.setAgentStateDistributions(agentStateDistributions);<NEW_LINE>getInstanceStateResponse.setRealTimeInstanceState(realTimeInstanceState);<NEW_LINE>return getInstanceStateResponse;<NEW_LINE>}
(context.integerValue("GetInstanceStateResponse.HttpStatusCode"));
340,502
Map<Index, IndexMetadata> findNewDanglingIndices(final Metadata metadata) {<NEW_LINE>final Set<String> excludeIndexPathIds = new HashSet<>(metadata.indices().size() + danglingIndices.size());<NEW_LINE>for (ObjectCursor<IndexMetadata> cursor : metadata.indices().values()) {<NEW_LINE>excludeIndexPathIds.add(cursor.value.getIndex().getUUID());<NEW_LINE>}<NEW_LINE>excludeIndexPathIds.addAll(danglingIndices.keySet().stream().map(Index::getUUID).collect(Collectors.toList()));<NEW_LINE>try {<NEW_LINE>final List<IndexMetadata> indexMetadataList = metaStateService.loadIndicesStates(excludeIndexPathIds::contains);<NEW_LINE>Map<Index, IndexMetadata> newIndices = new HashMap<>(indexMetadataList.size());<NEW_LINE>final <MASK><NEW_LINE>for (IndexMetadata indexMetadata : indexMetadataList) {<NEW_LINE>if (metadata.hasIndex(indexMetadata.getIndex())) {<NEW_LINE>LOGGER.warn("[{}] can not be imported as a dangling index, as index with same name already exists in cluster metadata", indexMetadata.getIndex());<NEW_LINE>} else if (graveyard.containsIndex(indexMetadata.getIndex())) {<NEW_LINE>LOGGER.warn("[{}] can not be imported as a dangling index, as an index with the same name and UUID exist in the " + "index tombstones. This situation is likely caused by copying over the data directory for an index " + "that was previously deleted.", indexMetadata.getIndex());<NEW_LINE>} else {<NEW_LINE>LOGGER.info("[{}] dangling index exists on local file system, but not in cluster metadata, " + "auto import to cluster state", indexMetadata.getIndex());<NEW_LINE>newIndices.put(indexMetadata.getIndex(), indexMetadata);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newIndices;<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("failed to list dangling indices", e);<NEW_LINE>return emptyMap();<NEW_LINE>}<NEW_LINE>}
IndexGraveyard graveyard = metadata.indexGraveyard();
797,854
final DescribeClustersResult executeDescribeClusters(DescribeClustersRequest describeClustersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeClustersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeClustersRequest> request = null;<NEW_LINE>Response<DescribeClustersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeClustersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeClustersRequest));<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, "MemoryDB");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeClustersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeClustersResultJsonUnmarshaller());<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>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeClusters");
1,262,271
private ClassificationDef addServerPurposeClassification() {<NEW_LINE>final String guid = "78f68757-600f-4e8e-843b-00e77cdee37c";<NEW_LINE>final String name = "ServerPurpose";<NEW_LINE>final String description = "Adds more detail about the purpose of a deployed instance of IT infrastructure.";<NEW_LINE>final String descriptionGUID = null;<NEW_LINE>final List<TypeDefLink> linkedToEntities = new ArrayList<>();<NEW_LINE>linkedToEntities.add(this.archiveBuilder.getEntityDef("ITInfrastructure"));<NEW_LINE>ClassificationDef classificationDef = archiveHelper.getClassificationDef(guid, name, null, description, descriptionGUID, linkedToEntities, false);<NEW_LINE>List<TypeDefAttribute> <MASK><NEW_LINE>TypeDefAttribute property;<NEW_LINE>final String attribute1Name = "deployedImplementationType";<NEW_LINE>final String attribute1Description = "Type of software deployed - such as product name.";<NEW_LINE>final String attribute1DescriptionGUID = null;<NEW_LINE>property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, attribute1DescriptionGUID);<NEW_LINE>properties.add(property);<NEW_LINE>classificationDef.setPropertiesDefinition(properties);<NEW_LINE>return classificationDef;<NEW_LINE>}
properties = new ArrayList<>();
470,389
private static List<String> naiveParse(String name) {<NEW_LINE>// Only break on namespace delimiters that are found at templateLevel == 0.<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>int templateLevel = 0;<NEW_LINE>int parenthesesLevel = 0;<NEW_LINE>int startIndex = 0;<NEW_LINE>for (int i = 0; i < name.length(); ++i) {<NEW_LINE>if ((name.charAt(i) == ':') && (i != name.length() - 1) && (name.charAt(i + 1) == ':')) {<NEW_LINE>if ((templateLevel == 0) && (parenthesesLevel == 0)) {<NEW_LINE>// could be 0 if i == 0.<NEW_LINE>int endIndex = i;<NEW_LINE>if (endIndex > startIndex) {<NEW_LINE>list.add(name.substring(startIndex, endIndex));<NEW_LINE>startIndex = i + 2;<NEW_LINE>// Only increment one, because the loop also has an increment.<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (name.charAt(i) == '<') {<NEW_LINE>++templateLevel;<NEW_LINE>} else if (name.charAt(i) == '>') {<NEW_LINE>--templateLevel;<NEW_LINE>} else if (name.charAt(i) == '(') {<NEW_LINE>++parenthesesLevel;<NEW_LINE>} else if (name.charAt(i) == ')') {<NEW_LINE>--parenthesesLevel;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((templateLevel != 0) || (parenthesesLevel != 0)) {<NEW_LINE>// Revert to no checking template level<NEW_LINE>startIndex = 0;<NEW_LINE>list = new ArrayList<>();<NEW_LINE>for (int i = 0; i < name.length(); ++i) {<NEW_LINE>if ((name.charAt(i) == ':') && (i != name.length() - 1) && name.charAt(i + 1) == ':') {<NEW_LINE>// could be 0 if i == 0.<NEW_LINE>int endIndex = i;<NEW_LINE>if (endIndex > startIndex) {<NEW_LINE>list.add(name<MASK><NEW_LINE>startIndex = i + 2;<NEW_LINE>// Only increment one, because the loop also has an increment.<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>list.add(name.substring(startIndex, name.length()));<NEW_LINE>return list;<NEW_LINE>}
.substring(startIndex, endIndex));
714,790
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static java.util.List<com.sun.jdi.ReferenceType> classesByName0(com.sun.jdi.VirtualMachine a, java.lang.String b) {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.VirtualMachine", "classesByName", "JDI CALL: com.sun.jdi.VirtualMachine({0}).classesByName({1})", new Object[] { a, b });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>java.util.List<com.sun.jdi.ReferenceType> ret;<NEW_LINE>ret = a.classesByName(b);<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.<MASK><NEW_LINE>return java.util.Collections.emptyList();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return java.util.Collections.emptyList();<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.VirtualMachine", "classesByName", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jpda.JDIExceptionReporter.report(ex);
1,471,451
public WFCMessage.ChannelInfo toProtoChannelInfo() {<NEW_LINE>WFCMessage.ChannelInfo.Builder builder = WFCMessage.ChannelInfo.newBuilder().setOwner(owner);<NEW_LINE>if (!StringUtil.isNullOrEmpty(name))<NEW_LINE>builder = builder.setName(name);<NEW_LINE>if (!StringUtil.isNullOrEmpty(targetId))<NEW_LINE>builder = builder.setTargetId(targetId);<NEW_LINE>if (!StringUtil.isNullOrEmpty(callback))<NEW_LINE>builder = builder.setCallback(callback);<NEW_LINE>if (!StringUtil.isNullOrEmpty(portrait))<NEW_LINE>builder = builder.setPortrait(portrait);<NEW_LINE><MASK><NEW_LINE>if (!StringUtil.isNullOrEmpty(secret))<NEW_LINE>builder = builder.setSecret(secret);<NEW_LINE>if (!StringUtil.isNullOrEmpty(desc))<NEW_LINE>builder = builder.setDesc(desc);<NEW_LINE>builder = builder.setStatus(state);<NEW_LINE>if (!StringUtil.isNullOrEmpty(extra))<NEW_LINE>builder = builder.setExtra(extra);<NEW_LINE>if (!StringUtil.isNullOrEmpty(name))<NEW_LINE>builder = builder.setUpdateDt(updateDt);<NEW_LINE>else<NEW_LINE>builder = builder.setUpdateDt(System.currentTimeMillis());<NEW_LINE>return builder.build();<NEW_LINE>}
builder = builder.setAutomatic(auto);
1,401,836
public String convert(final String hostname) {<NEW_LINE>if (!PreferencesFactory.get().getBoolean("connection.hostname.idn")) {<NEW_LINE>return StringUtils.strip(hostname);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(hostname)) {<NEW_LINE>try {<NEW_LINE>// Convenience function that implements the IDNToASCII operation as defined in<NEW_LINE>// the IDNA RFC. This operation is done on complete domain names, e.g: "www.example.com".<NEW_LINE>// It is important to note that this operation can fail. If it fails, then the input<NEW_LINE>// domain name cannot be used as an Internationalized Domain Name and the application<NEW_LINE>// should have methods defined to deal with the failure.<NEW_LINE>// IDNA.DEFAULT Use default options, i.e., do not process unassigned code points<NEW_LINE>// and do not use STD3 ASCII rules If unassigned code points are found<NEW_LINE>// the operation fails with ParseException<NEW_LINE>final String idn = IDN.toASCII(StringUtils.strip(hostname));<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>if (!StringUtils.equals(StringUtils.strip(hostname), idn)) {<NEW_LINE>log.debug(String.format("IDN hostname for %s is %s", hostname, idn));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(idn)) {<NEW_LINE>return idn;<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>log.warn(String.format<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StringUtils.strip(hostname);<NEW_LINE>}
("Failed to convert hostname %s to IDNA", hostname), e);
197,444
private static void resetParameters(Size size) {<NEW_LINE>Camera.<MASK><NEW_LINE>int maxPreviewFrameRate = 0;<NEW_LINE>int bestPreviewFrameRate = 0;<NEW_LINE>int maxPreviewFpsRangeUpperBound = 0;<NEW_LINE>int[] bestPreviewFpsRange = null;<NEW_LINE>for (int format : cameraParams.getSupportedPreviewFormats()) {<NEW_LINE>Log.d("minko", "available format: " + format);<NEW_LINE>}<NEW_LINE>for (int fps : cameraParams.getSupportedPreviewFrameRates()) {<NEW_LINE>Log.d("minko", "available fps: " + fps);<NEW_LINE>if (fps > maxPreviewFrameRate)<NEW_LINE>maxPreviewFrameRate = fps;<NEW_LINE>}<NEW_LINE>for (int[] fpsRange : cameraParams.getSupportedPreviewFpsRange()) {<NEW_LINE>Log.d("minko", "available fps range: " + fpsRange[0] + ", " + fpsRange[1]);<NEW_LINE>if (fpsRange[1] > maxPreviewFpsRangeUpperBound) {<NEW_LINE>maxPreviewFpsRangeUpperBound = fpsRange[1];<NEW_LINE>bestPreviewFpsRange = fpsRange;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for (Camera.Area focusArea : cameraParams.getFocusAreas())<NEW_LINE>// {<NEW_LINE>// Log.d("minko", "focus area: " + focusArea.rect.left + ", " + focusArea.rect.top + "//, " + focusArea.rect.right + ", " + focusArea.rect.bottom);<NEW_LINE>// }<NEW_LINE>bestPreviewFrameRate = maxPreviewFrameRate;<NEW_LINE>cameraParams.setPreviewFormat(_srcFormat);<NEW_LINE>cameraParams.setPreviewFpsRange(bestPreviewFpsRange[0], bestPreviewFpsRange[1]);<NEW_LINE>cameraParams.setPreviewFrameRate(bestPreviewFrameRate);<NEW_LINE>cameraParams.setRecordingHint(true);<NEW_LINE>cameraParams.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);<NEW_LINE>cameraParams.setPreviewSize(size.x, size.y);<NEW_LINE>cameraParams.setZoom(0);<NEW_LINE>_camera.setParameters(cameraParams);<NEW_LINE>}
Parameters cameraParams = _camera.getParameters();
710,204
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);<NEW_LINE>if (geo.hasPointOut() == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Point2D p2 = getP2(stringBounder);<NEW_LINE>final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();<NEW_LINE>final Direction originalDirection = Direction.leftOrRight(p1, p2);<NEW_LINE>final double x1 = p1.getX();<NEW_LINE>final double x2 = p2.getX();<NEW_LINE>final Point2D mp1a = translate1.getTranslated(p1);<NEW_LINE>final Point2D mp2b = translate2.getTranslated(p2);<NEW_LINE>final Direction newDirection = Direction.leftOrRight(mp1a, mp2b);<NEW_LINE>final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft();<NEW_LINE>if (originalDirection == newDirection) {<NEW_LINE>final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;<NEW_LINE>final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY());<NEW_LINE>final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED);<NEW_LINE>final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;<NEW_LINE>snake.addPoint(mp1a);<NEW_LINE>snake.addPoint(mp1a.getX(), middle);<NEW_LINE>snake.addPoint(mp2bc.getX(), middle);<NEW_LINE>snake.addPoint(mp2bc);<NEW_LINE>ug.draw(snake);<NEW_LINE>final Snake small = Snake.create(skinParam(), myArrowColor, arrow).withMerge(MergeStrategy.LIMITED);<NEW_LINE>small.addPoint(mp2bc);<NEW_LINE>small.addPoint(mp2bc.getX(), mp2b.getY());<NEW_LINE>small.addPoint(mp2b);<NEW_LINE>ug.draw(small);<NEW_LINE>} else {<NEW_LINE>final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;<NEW_LINE>final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);<NEW_LINE>final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED);<NEW_LINE>snake.addPoint(mp1a);<NEW_LINE>snake.addPoint(mp1a.getX(), mp2bb.getY());<NEW_LINE>snake.addPoint(mp2bb);<NEW_LINE>ug.draw(snake);<NEW_LINE>final Snake small = Snake.create(skinParam(), myArrowColor, arrow<MASK><NEW_LINE>small.addPoint(mp2bb);<NEW_LINE>small.addPoint(mp2bb.getX(), mp2b.getY());<NEW_LINE>small.addPoint(mp2b);<NEW_LINE>ug.draw(small);<NEW_LINE>}<NEW_LINE>}
).withMerge(MergeStrategy.LIMITED);
87,180
/* Undo GlassFish configuration and post-installation setups.*/<NEW_LINE>public void unconfigureGlassfish() {<NEW_LINE>// Try to stop domain.<NEW_LINE>stopDomain();<NEW_LINE>LOGGER.log(Level.INFO, Msg<MASK><NEW_LINE>try {<NEW_LINE>// Cleanup list includes both windows and non-windows files.<NEW_LINE>// FileUtils does check for the file before deleting.<NEW_LINE>String[] dirList = { productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "domains", productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "modules", productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "nodes", productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "lib" };<NEW_LINE>for (int i = 0; i < dirList.length; i++) {<NEW_LINE>LOGGER.log(Level.FINEST, dirList[i]);<NEW_LINE>org.glassfish.installer.util.FileUtils.deleteDirectory(new File(dirList[i]));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.log(Level.FINEST, e.getMessage() + "\n");<NEW_LINE>}<NEW_LINE>}
.get("CLEANINGUP_DIRECTORIES", null));
1,246,550
public boolean startActivitySafely(View v, Intent intent, @Nullable ItemInfo item) {<NEW_LINE>if (mIsSafeModeEnabled && !PackageManagerHelper.isSystemApp(this, intent)) {<NEW_LINE>Toast.makeText(this, R.string.safemode_shortcut_error, Toast.LENGTH_SHORT).show();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Bundle optsBundle = (v != null) ? getActivityLaunchOptions(v, item).toBundle() : null;<NEW_LINE>UserHandle user = item == null ? null : item.user;<NEW_LINE>// Prepare intent<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>if (v != null) {<NEW_LINE>intent<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean isShortcut = (item instanceof WorkspaceItemInfo) && (item.itemType == Favorites.ITEM_TYPE_SHORTCUT || item.itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT) && !((WorkspaceItemInfo) item).isPromise();<NEW_LINE>if (isShortcut) {<NEW_LINE>// Shortcuts need some special checks due to legacy reasons.<NEW_LINE>startShortcutIntentSafely(intent, optsBundle, item);<NEW_LINE>} else if (user == null || user.equals(Process.myUserHandle())) {<NEW_LINE>// Could be launching some bookkeeping activity<NEW_LINE>startActivity(intent, optsBundle);<NEW_LINE>} else {<NEW_LINE>getSystemService(LauncherApps.class).startMainActivity(intent.getComponent(), user, intent.getSourceBounds(), optsBundle);<NEW_LINE>}<NEW_LINE>if (item != null) {<NEW_LINE>InstanceId instanceId = new InstanceIdSequence().newInstanceId();<NEW_LINE>logAppLaunch(item, instanceId);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (NullPointerException | ActivityNotFoundException | SecurityException e) {<NEW_LINE>Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();<NEW_LINE>Log.e(TAG, "Unable to launch. tag=" + item + " intent=" + intent, e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.setSourceBounds(getViewBounds(v));
388,392
public void commitJscCrashAlarmMonitor(final String type, final WXErrorCode errorCode, String errMsg, String instanceId, String url, Map<String, String> extInfo) {<NEW_LINE>if (TextUtils.isEmpty(type) || errorCode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.d("ReportCrash", " commitJscCrashAlarmMonitor errMsg " + errMsg);<NEW_LINE>String method = "callReportCrash";<NEW_LINE>String exception = "weex core process crash and restart exception";<NEW_LINE>Map<String, String> extParams = new <MASK><NEW_LINE>extParams.put("jscCrashStack", errMsg);<NEW_LINE>if (null != extInfo) {<NEW_LINE>extParams.putAll(extInfo);<NEW_LINE>}<NEW_LINE>IWXJSExceptionAdapter adapter = WXSDKManager.getInstance().getIWXJSExceptionAdapter();<NEW_LINE>if (adapter != null) {<NEW_LINE>WXJSExceptionInfo jsException = new WXJSExceptionInfo(instanceId, url, errorCode, method, exception, extParams);<NEW_LINE>adapter.onJSException(jsException);<NEW_LINE>// if (WXEnvironment.isApkDebugable()) {<NEW_LINE>WXLogUtils.e(jsException.toString());<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>}
HashMap<String, String>();
1,499,473
/*<NEW_LINE>* Recursively match until the sequence is satisfied. Otherwise return. Recurse down intermediate nodes<NEW_LINE>* such as RelSubset/HepRelVertex.<NEW_LINE>*/<NEW_LINE>private void findRelSequenceInternal(Class[] classes, int idx, RelNode rel, List<RelNode> matchingRels) {<NEW_LINE>if (rel instanceof HepRelVertex) {<NEW_LINE>findRelSequenceInternal(classes, idx, ((HepRelVertex) rel).getCurrentRel(), matchingRels);<NEW_LINE>} else if (rel instanceof RelSubset) {<NEW_LINE>if (((RelSubset) rel).getBest() != null) {<NEW_LINE>findRelSequenceInternal(classes, idx, ((RelSubset) rel).getBest(), matchingRels);<NEW_LINE>} else {<NEW_LINE>findRelSequenceInternal(classes, idx, ((RelSubset) rel<MASK><NEW_LINE>}<NEW_LINE>} else if (classes[idx].isInstance(rel)) {<NEW_LINE>matchingRels.add(rel);<NEW_LINE>if (idx + 1 < classes.length && rel.getInputs().size() > 0) {<NEW_LINE>findRelSequenceInternal(classes, idx + 1, rel.getInput(0), matchingRels);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>String sequence, matchingSequence;<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>for (int i = 0; i < classes.length; i++) {<NEW_LINE>if (i == classes.length - 1) {<NEW_LINE>sb.append(classes[i].getCanonicalName().toString());<NEW_LINE>} else {<NEW_LINE>sb.append(classes[i].getCanonicalName().toString() + "->");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sequence = sb.toString();<NEW_LINE>sb.delete(0, sb.length());<NEW_LINE>for (int i = 0; i < matchingRels.size(); i++) {<NEW_LINE>if (i == matchingRels.size() - 1) {<NEW_LINE>sb.append(matchingRels.get(i).getClass().getCanonicalName().toString());<NEW_LINE>} else {<NEW_LINE>sb.append(matchingRels.get(i).getClass().getCanonicalName().toString() + "->");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matchingSequence = sb.toString();<NEW_LINE>logger.debug("FindRelSequence: ABORT: Unexpected Rel={}, After={}, CurSeq={}", rel.getClass().getCanonicalName().toString(), matchingSequence, sequence);<NEW_LINE>}<NEW_LINE>matchingRels.clear();<NEW_LINE>}<NEW_LINE>}
).getOriginal(), matchingRels);
1,432,015
protected Set<Long> requestIndex(List<int[]> data) throws Exception {<NEW_LINE>long startTimeConsumption = System.nanoTime();<NEW_LINE>LOG.info("taskId: {}, localId: {}", getPatitionId(), getRuntimeContext().getIndexOfThisSubtask());<NEW_LINE>LOG.info("taskId: {}, negInputSize: {}", getPatitionId(), data.size());<NEW_LINE>if (null != this.contextParams) {<NEW_LINE>Long[] seeds = this.contextParams.get(ApsContext.SEEDS);<NEW_LINE>Long[] nsPool = this.contextParams.getLongArray("negBound");<NEW_LINE>final boolean metapathMode = params.getBoolOrDefault("metapathMode", false);<NEW_LINE>long[] groupIdxStarts = null;<NEW_LINE>if (metapathMode) {<NEW_LINE>groupIdxStarts = ArrayUtils.toPrimitive(this.contextParams.getLongArray("groupIdxes"));<NEW_LINE>}<NEW_LINE>int vocSize = this.contextParams.<MASK><NEW_LINE>long seed = seeds[getPatitionId()];<NEW_LINE>int threadNum = params.getIntegerOrDefault("threadNum", 8);<NEW_LINE>Thread[] thread = new Thread[threadNum];<NEW_LINE>Set<Long>[] output = new Set[threadNum];<NEW_LINE>DistributedInfo distributedInfo = new DefaultDistributedInfo();<NEW_LINE>for (int i = 0; i < threadNum; ++i) {<NEW_LINE>int start = (int) distributedInfo.startPos(i, threadNum, data.size());<NEW_LINE>int end = (int) distributedInfo.localRowCnt(i, threadNum, data.size()) + start;<NEW_LINE>LOG.info("taskId: {}, negStart: {}, end: {}", getPatitionId(), start, end);<NEW_LINE>output[i] = new HashSet<>();<NEW_LINE>thread[i] = new NegSampleRunner(vocSize, nsPool, params, seed + i, data.subList(start, end), output[i], null, groupIdxStarts);<NEW_LINE>thread[i].start();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < threadNum; ++i) {<NEW_LINE>thread[i].join();<NEW_LINE>}<NEW_LINE>Set<Long> outputMerger = new HashSet<>();<NEW_LINE>for (int i = 0; i < threadNum; ++i) {<NEW_LINE>outputMerger.addAll(output[i]);<NEW_LINE>}<NEW_LINE>LOG.info("taskId: {}, negOutputSize: {}", getPatitionId(), outputMerger.size());<NEW_LINE>long endTimeConsumption = System.nanoTime();<NEW_LINE>LOG.info("taskId: {}, negTime: {}", getPatitionId(), (endTimeConsumption - startTimeConsumption) / 1000000.0);<NEW_LINE>return outputMerger;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>}
getLong("vocSize").intValue();
1,312,211
public boolean hasNext() {<NEW_LINE>if (!open)<NEW_LINE>return false;<NEW_LINE>if (cur != null)<NEW_LINE>return true;<NEW_LINE>if (!src.hasNext()) {<NEW_LINE>close();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final IBindingSet[] nxt = src.next();<NEW_LINE>this.cur = nxt.getClass().getComponentType() == IBindingSet.class ? nxt <MASK><NEW_LINE>// try {<NEW_LINE>for (int i = 0; i < nxt.length; i++) {<NEW_LINE>final IBindingSet bset = nxt[i];<NEW_LINE>// Wrap the binding set.<NEW_LINE>cur[i] = bset instanceof ContextBindingSet ? bset : new ContextBindingSet(context, bset);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>// } catch (ArrayStoreException ex) {<NEW_LINE>//<NEW_LINE>// /*<NEW_LINE>// * Note: This could be used to locate array store exceptions arising<NEW_LINE>// * from a ListBindingSet[] or other concrete array type. Remove once<NEW_LINE>// * I track down the sources of a non-IBindingSet[]. The problem can<NEW_LINE>// * of course be worked around by allocating a new IBindingSet[] into<NEW_LINE>// * which the ContextBindingSets will be copied.<NEW_LINE>// *<NEW_LINE>// * Likely causes are users of java.lang.reflect.Array.newInstance().<NEW_LINE>// * Whenever possible, code should either an explicit component type<NEW_LINE>// * for dynamically allocated arrays or use the component type of the<NEW_LINE>// * source array (when there is one).<NEW_LINE>// */<NEW_LINE>// throw new RuntimeException("cur[" + nxt.length + "]=" + nxt<NEW_LINE>// + ", src=" + src, ex);<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>}
: new IBindingSet[nxt.length];
908,237
private void loadContent() {<NEW_LINE>new RefreshBlobTask(repo, sha, this) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess(Blob blob) throws Exception {<NEW_LINE>super.onSuccess(blob);<NEW_LINE>ViewUtils.setGone(loadingBar, true);<NEW_LINE>ViewUtils.setGone(codeView, false);<NEW_LINE>editor.setSource(path, blob);<NEW_LINE>CommitFileViewActivity.this.blob = blob;<NEW_LINE>if (markdownItem != null)<NEW_LINE>markdownItem.setEnabled(true);<NEW_LINE>if (isMarkdownFile && PreferenceUtils.getCodePreferences(CommitFileViewActivity.this).getBoolean(RENDER_MARKDOWN, true))<NEW_LINE>loadMarkdown();<NEW_LINE>else {<NEW_LINE>ViewUtils.setGone(loadingBar, true);<NEW_LINE>ViewUtils.setGone(codeView, false);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onException(Exception e) throws RuntimeException {<NEW_LINE>super.onException(e);<NEW_LINE>Log.d(TAG, "Loading commit file contents failed", e);<NEW_LINE>ViewUtils.setGone(loadingBar, true);<NEW_LINE>ViewUtils.setGone(codeView, false);<NEW_LINE>ToastUtils.show(CommitFileViewActivity.this, e, R.string.error_file_load);<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}
editor.setSource(path, blob);
465,986
private Mono<PagedResponse<CustomIpPrefixInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)).<PagedResponse<CustomIpPrefixInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,258,682
protected void visit(PositionAssertion assertion) {<NEW_LINE>switch(assertion.type) {<NEW_LINE>case CARET:<NEW_LINE>if (isForward()) {<NEW_LINE>assertion.getParent().setHasCaret();<NEW_LINE>if (assertion.getParent().getMinPath() > 0) {<NEW_LINE>assertion.markAsDead();<NEW_LINE>assertion.getParent().markAsDead();<NEW_LINE>} else {<NEW_LINE>ast.getReachableCarets().add(assertion);<NEW_LINE>assertion.getParent().setStartsWithCaret();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DOLLAR:<NEW_LINE>if (isReverse()) {<NEW_LINE>assertion.getParent().setHasDollar();<NEW_LINE>if (assertion.getParent().getMinPath() > 0) {<NEW_LINE>assertion.markAsDead();<NEW_LINE>assertion.getParent().markAsDead();<NEW_LINE>} else {<NEW_LINE>ast.getReachableDollars().add(assertion);<NEW_LINE>assertion<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>assertion.setMinPath(assertion.getParent().getMinPath());<NEW_LINE>assertion.setMaxPath(assertion.getParent().getMaxPath());<NEW_LINE>}
.getParent().setEndsWithDollar();
1,332,903
public void document(int docID, StoredFieldVisitor visitor) throws IOException {<NEW_LINE>List<IndexableField> fields = document.getFields().stream().filter(f -> f.fieldType().stored()).toList();<NEW_LINE>for (IndexableField field : fields) {<NEW_LINE>FieldInfo fieldInfo = fieldInfo(field.name());<NEW_LINE>if (visitor.needsField(fieldInfo) != StoredFieldVisitor.Status.YES) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (field.numericValue() != null) {<NEW_LINE>Number v = field.numericValue();<NEW_LINE>if (v instanceof Integer) {<NEW_LINE>visitor.intField(fieldInfo, v.intValue());<NEW_LINE>} else if (v instanceof Long) {<NEW_LINE>visitor.longField(fieldInfo, v.longValue());<NEW_LINE>} else if (v instanceof Float) {<NEW_LINE>visitor.floatField(fieldInfo, v.floatValue());<NEW_LINE>} else if (v instanceof Double) {<NEW_LINE>visitor.doubleField(fieldInfo, v.doubleValue());<NEW_LINE>}<NEW_LINE>} else if (field.stringValue() != null) {<NEW_LINE>visitor.stringField(fieldInfo, field.stringValue());<NEW_LINE>} else if (field.binaryValue() != null) {<NEW_LINE>// We can't just pass field.binaryValue().bytes here as there may be offset/length<NEW_LINE>// considerations<NEW_LINE>byte[] data = new byte[<MASK><NEW_LINE>System.arraycopy(field.binaryValue().bytes, field.binaryValue().offset, data, 0, data.length);<NEW_LINE>visitor.binaryField(fieldInfo, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
field.binaryValue().length];
791,390
public Set<Integer> updateQuote(short siteId, Serializable id, CmsContentParameters contentParameters, CmsModel cmsModel, CmsCategory category, CmsContentAttribute attribute) {<NEW_LINE>CmsContent entity = getEntity(id);<NEW_LINE>Set<Integer> categoryIds = new HashSet<>();<NEW_LINE>if (null != entity) {<NEW_LINE>for (CmsContent quote : getListByQuoteId(siteId, entity.getId())) {<NEW_LINE>if (null != contentParameters.getContentIds() && contentParameters.getContentIds().contains(quote.getId())) {<NEW_LINE>quote.setUrl(entity.getUrl());<NEW_LINE>quote.setTitle(entity.getTitle());<NEW_LINE>quote.setDescription(entity.getDescription());<NEW_LINE>quote.setAuthor(entity.getAuthor());<NEW_LINE>quote.setCover(entity.getCover());<NEW_LINE>quote.setEditor(entity.getEditor());<NEW_LINE>quote.<MASK><NEW_LINE>quote.setStatus(entity.getStatus());<NEW_LINE>quote.setCheckUserId(entity.getCheckUserId());<NEW_LINE>quote.setCheckDate(entity.getCheckDate());<NEW_LINE>quote.setPublishDate(entity.getPublishDate());<NEW_LINE>quote.setHasStatic(entity.isHasStatic());<NEW_LINE>quote.setHasFiles(entity.isHasFiles());<NEW_LINE>quote.setHasImages(entity.isHasImages());<NEW_LINE>} else {<NEW_LINE>delete(quote.getId());<NEW_LINE>categoryIds.add(quote.getCategoryId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return categoryIds;<NEW_LINE>}
setExpiryDate(entity.getExpiryDate());
1,616,428
private static void addExtensionMetaFromAllFiles(File targetDirectory, List<String> runtimeClasspathElements, Log logger, boolean includeOrigin, List<NamespaceMetaData> namespaceMetaDataList) throws MojoFailureException, MalformedURLException {<NEW_LINE>List<File> jarFiles = new ArrayList<>();<NEW_LINE>listOfJarFiles(targetDirectory.getAbsolutePath(), jarFiles);<NEW_LINE>// +1 to include the module's target folder<NEW_LINE>int urlCount = runtimeClasspathElements.size() + jarFiles.size() + 1;<NEW_LINE>// Creating a list of URLs with all project dependencies<NEW_LINE>URL[] urls = new URL[urlCount];<NEW_LINE>int index = 0;<NEW_LINE>for (; index < runtimeClasspathElements.size(); index++) {<NEW_LINE>try {<NEW_LINE>urls[index] = new File(runtimeClasspathElements.get(index)).toURI().toURL();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new MojoFailureException("Unable to access project dependency: " + runtimeClasspathElements.get(index), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int j = 0; index < urlCount - 1; index++, j++) {<NEW_LINE>try {<NEW_LINE>urls[index] = jarFiles.get(j).toURI().toURL();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new MojoFailureException("Unable to access project dependency: " + runtimeClasspathElements<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Adding the generated classes to the class loader<NEW_LINE>urls[urlCount - 1] = targetDirectory.toURI().toURL();<NEW_LINE>ClassLoader urlClassLoader = AccessController.doPrivileged((PrivilegedAction<ClassLoader>) () -> new URLClassLoader(urls, Thread.currentThread().getContextClassLoader()));<NEW_LINE>Iterable<Class<?>> extensions = ClassIndex.getAnnotated(Extension.class, urlClassLoader);<NEW_LINE>for (Class extension : extensions) {<NEW_LINE>addExtensionMetaDataIntoNamespaceList(namespaceMetaDataList, extension, logger, includeOrigin);<NEW_LINE>}<NEW_LINE>}
.get(index), e);
348,706
private void processMultiplatformLibrary(final String infrastructureFolder) {<NEW_LINE>commonJvmMultiplatformSupportingFiles(infrastructureFolder);<NEW_LINE>additionalProperties.put(MULTIPLATFORM, true);<NEW_LINE>setDateLibrary(DateLibrary.STRING.value);<NEW_LINE>setRequestDateConverter(RequestDateConverter.TO_STRING.value);<NEW_LINE>// multiplatform default includes<NEW_LINE>defaultIncludes.add("io.ktor.client.request.forms.InputProvider");<NEW_LINE>defaultIncludes.add(packageName + ".infrastructure.Base64ByteArray");<NEW_LINE>defaultIncludes.add(packageName + ".infrastructure.OctetByteArray");<NEW_LINE>// multiplatform type mapping<NEW_LINE>typeMapping.put("number", "kotlin.Double");<NEW_LINE>typeMapping.put("file", "OctetByteArray");<NEW_LINE>typeMapping.put("binary", "OctetByteArray");<NEW_LINE>typeMapping.put("ByteArray", "Base64ByteArray");<NEW_LINE>// kotlin.Any not serializable<NEW_LINE>typeMapping.put("object", "kotlin.String");<NEW_LINE>// multiplatform import mapping<NEW_LINE>importMapping.put("BigDecimal", "kotlin.Double");<NEW_LINE>importMapping.put("UUID", "kotlin.String");<NEW_LINE>importMapping.put("URI", "kotlin.String");<NEW_LINE>importMapping.put("InputProvider", "io.ktor.client.request.forms.InputProvider");<NEW_LINE>importMapping.put("File", packageName + ".infrastructure.OctetByteArray");<NEW_LINE>importMapping.put("Timestamp", "kotlin.String");<NEW_LINE>importMapping.put("LocalDateTime", "kotlin.String");<NEW_LINE>importMapping.put("LocalDate", "kotlin.String");<NEW_LINE>importMapping.put("LocalTime", "kotlin.String");<NEW_LINE>importMapping.put("Base64ByteArray", packageName + ".infrastructure.Base64ByteArray");<NEW_LINE>importMapping.put("OctetByteArray", packageName + ".infrastructure.OctetByteArray");<NEW_LINE>// multiplatform specific supporting files<NEW_LINE>supportingFiles.add(new SupportingFile("infrastructure/Base64ByteArray.kt.mustache", infrastructureFolder, "Base64ByteArray.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("infrastructure/Bytes.kt.mustache", infrastructureFolder, "Bytes.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("infrastructure/HttpResponse.kt.mustache", infrastructureFolder, "HttpResponse.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("infrastructure/OctetByteArray.kt.mustache", infrastructureFolder, "OctetByteArray.kt"));<NEW_LINE>// multiplatform specific auth<NEW_LINE>supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.kt.mustache", authFolder, "ApiKeyAuth.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.kt.mustache", authFolder, "HttpBasicAuth.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("auth/HttpBearerAuth.kt.mustache", authFolder, "HttpBearerAuth.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("auth/OAuth.kt.mustache", authFolder, "OAuth.kt"));<NEW_LINE>// multiplatform specific testing files<NEW_LINE>supportingFiles.add(new SupportingFile("commonTest/Coroutine.kt.mustache", "src/commonTest/kotlin/util", "Coroutine.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("iosTest/Coroutine.kt.mustache", "src/iosTest/kotlin/util", "Coroutine.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("jsTest/Coroutine.kt.mustache", "src/jsTest/kotlin/util", "Coroutine.kt"));<NEW_LINE>supportingFiles.add(new SupportingFile("jvmTest/Coroutine.kt.mustache", "src/jvmTest/kotlin/util", "Coroutine.kt"));<NEW_LINE>}
("auth/Authentication.kt.mustache", authFolder, "Authentication.kt"));
993,410
private static void newSparseElementToElements(HtmlElementTables.HtmlElementNames en, JsonObject obj, String fieldName, SourceLineWriter src) {<NEW_LINE>List<int[]> arrs = Lists.newArrayList();<NEW_LINE>for (String elname : obj.keySet()) {<NEW_LINE>int ei = en.getElementNameIndex(elname);<NEW_LINE>ImmutableSet.Builder<String> names = ImmutableSet.builder();<NEW_LINE>JsonArray arr = obj.getJsonArray(elname);<NEW_LINE>for (int i = 0, n = arr.size(); i < n; ++i) {<NEW_LINE>names.add(arr.getString(i));<NEW_LINE>}<NEW_LINE>ImmutableSet<String> iset = names.build();<NEW_LINE>int[] vals = new int[iset.size()];<NEW_LINE>int i = 0;<NEW_LINE>for (String name : iset) {<NEW_LINE>vals[i++] = en.getElementNameIndex(name);<NEW_LINE>}<NEW_LINE>Preconditions.checkState(vals.length == i);<NEW_LINE>Arrays.sort(vals);<NEW_LINE>int[] ints = new int[vals.length + 1];<NEW_LINE>ints[0] = ei;<NEW_LINE>System.arraycopy(vals, 0, ints, 1, vals.length);<NEW_LINE>arrs.add(ints);<NEW_LINE>}<NEW_LINE>Collections.sort(arrs, new Comparator<int[]>() {<NEW_LINE><NEW_LINE>public int compare(int[] a, int[] b) {<NEW_LINE>return Integer.compare(a[0], b[0]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int[][] arr = arrs.toArray(new int[arrs<MASK><NEW_LINE>src.lines("HtmlElementTables.SparseElementToElements " + fieldName + " = new HtmlElementTables.SparseElementToElements(");<NEW_LINE>src.write(arr);<NEW_LINE>src.line(");");<NEW_LINE>}
.size()][]);
142,089
public void customize(MutableProjectDescription description) {<NEW_LINE>String javaVersion = description.getLanguage().jvmVersion();<NEW_LINE>if (UNSUPPORTED_VERSIONS.contains(javaVersion)) {<NEW_LINE>updateTo(description, "1.8");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>springNativeHandler().accept(description);<NEW_LINE>Integer javaGeneration = determineJavaGeneration(javaVersion);<NEW_LINE>if (javaGeneration == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// Spring Boot 3 requires Java 17<NEW_LINE>if (javaGeneration < 17 && SPRING_BOOT_3_0_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "17");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// 13 support only as of Gradle 6<NEW_LINE>if (javaGeneration == 13 && description.getBuildSystem() instanceof GradleBuildSystem && !GRADLE_6.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>// 15 support only as of 2.2.11<NEW_LINE>if (javaGeneration == 15 && !SPRING_BOOT_2_3_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>if (javaGeneration == 16) {<NEW_LINE>// Full Support as of Spring Boot 2.5 only.<NEW_LINE>// 16 support as of Kotlin 1.5<NEW_LINE>if (description.getLanguage() instanceof KotlinLanguage && !SPRING_BOOT_2_5_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>// 16 support as of Gradle 7<NEW_LINE>if (description.getBuildSystem() instanceof GradleBuildSystem && !SPRING_BOOT_2_5_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>// Groovy 3 only available as of 2.5<NEW_LINE>if (description.getLanguage() instanceof GroovyLanguage && !SPRING_BOOT_2_5_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>// 16 support only as of 2.4.4<NEW_LINE>if (!SPRING_BOOT_2_4_4_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (javaGeneration == 17) {<NEW_LINE>// Java 17 support as of Spring Boot 2.5.5<NEW_LINE>if (!SPRING_BOOT_2_5_5_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>// Kotlin 1.6 only<NEW_LINE>if (description.getLanguage() instanceof KotlinLanguage && !SPRING_BOOT_2_6_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (javaGeneration == 18) {<NEW_LINE>// Java 17 support as of Spring Boot 2.5.11<NEW_LINE>if (!SPRING_BOOT_2_5_11_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "17");<NEW_LINE>}<NEW_LINE>// Kotlin support to be determined<NEW_LINE>if (description.getLanguage() instanceof KotlinLanguage) {<NEW_LINE>if (!SPRING_BOOT_2_6_0_OR_LATER.match(platformVersion)) {<NEW_LINE>updateTo(description, "11");<NEW_LINE>} else {<NEW_LINE>updateTo(description, "17");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Version platformVersion = description.getPlatformVersion();
407,958
public boolean invokeCommand(String command, List cargs) {<NEW_LINE>if (command.startsWith("\\"))<NEW_LINE><MASK><NEW_LINE>else if (aliases.containsKey(command)) {<NEW_LINE>List list = br.parseCommandLine(aliases.getProperty(command));<NEW_LINE>String newCommand = list.remove(0).toString().toLowerCase();<NEW_LINE>list.addAll(cargs);<NEW_LINE>return invokeCommand(newCommand, list);<NEW_LINE>}<NEW_LINE>if (commands.containsKey(command)) {<NEW_LINE>IConsoleCommand cmd = (IConsoleCommand) commands.get(command);<NEW_LINE>try {<NEW_LINE>if (cargs == null)<NEW_LINE>cargs = new ArrayList();<NEW_LINE>cmd.execute(command, this, cargs);<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>out.println("> Invoking Command '" + command + "' failed. Exception: " + Debug.getNestedExceptionMessage(e) + "; " + Debug.getCompressedStackTrace(e, 0, 5, false));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>return false;<NEW_LINE>}
command = command.substring(1);
982,006
public void createStream(StreamConfig request, StreamObserver<CreateStreamStatus> responseObserver) {<NEW_LINE>String scope = request.getStreamInfo().getScope();<NEW_LINE>String stream = request.getStreamInfo().getStream();<NEW_LINE>RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(<MASK><NEW_LINE>log.info(requestTag.getRequestId(), "createStream called for stream {}/{}.", scope, stream);<NEW_LINE>StreamAuthParams streamAuthParams = new StreamAuthParams(scope, stream, this.isRGStreamWritesWithReadPermEnabled);<NEW_LINE>AuthHandler.Permissions requiredPermission = streamAuthParams.requiredPermissionForWrites();<NEW_LINE>log.debug(requestTag.getRequestId(), "Creating stream : requiredPermission is [{}], for scope [{}] and stream [{}]", requiredPermission, scope, stream);<NEW_LINE>authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorizationAndCreateToken(authorizationResource.ofStreamsInScope(scope), requiredPermission), delegationToken -> controllerService.createStream(scope, stream, ModelHelper.encode(request), System.currentTimeMillis(), requestTag.getRequestId()), responseObserver, requestTag);<NEW_LINE>}
), CREATE_STREAM, scope, stream);
1,293,596
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static void addInstanceFilter(com.sun.jdi.request.MethodEntryRequest a, com.sun.jdi.ObjectReference b) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.request.MethodEntryRequest", "addInstanceFilter", "JDI CALL: com.sun.jdi.request.MethodEntryRequest({0}).addInstanceFilter({1})", new Object[] { a, b });<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>a.addInstanceFilter(b);<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.<MASK><NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.request.MethodEntryRequest", "addInstanceFilter", org.netbeans.modules.debugger.jpda.JDIExceptionReporter.RET_VOID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jpda.jdi.InternalExceptionWrapper(ex);
1,296,126
public static void main(String[] args) {<NEW_LINE>Scanner scan <MASK><NEW_LINE>printIntro();<NEW_LINE>int[] usedWords = new int[50];<NEW_LINE>int roundNumber = 1;<NEW_LINE>int totalWords = words.size();<NEW_LINE>boolean continueGame = false;<NEW_LINE>do {<NEW_LINE>if (roundNumber > totalWords) {<NEW_LINE>System.out.println("\nYOU DID ALL THE WORDS!!");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int randomWordIndex;<NEW_LINE>do {<NEW_LINE>randomWordIndex = ((int) (totalWords * Math.random())) + 1;<NEW_LINE>} while (usedWords[randomWordIndex] == 1);<NEW_LINE>usedWords[randomWordIndex] = 1;<NEW_LINE>boolean youWon = playRound(scan, words.get(randomWordIndex - 1));<NEW_LINE>if (!youWon) {<NEW_LINE>System.out.print("\nYOU MISSED THAT ONE. DO YOU WANT ANOTHER WORD? ");<NEW_LINE>} else {<NEW_LINE>System.out.print("\nWANT ANOTHER WORD? ");<NEW_LINE>}<NEW_LINE>final String anotherWordChoice = scan.next();<NEW_LINE>if (anotherWordChoice.toUpperCase().equals("YES") || anotherWordChoice.toUpperCase().equals("Y")) {<NEW_LINE>continueGame = true;<NEW_LINE>}<NEW_LINE>roundNumber++;<NEW_LINE>} while (continueGame);<NEW_LINE>System.out.println("\nIT'S BEEN FUN! BYE FOR NOW.");<NEW_LINE>}
= new Scanner(System.in);
1,205,874
public void marshall(MergePullRequestBySquashRequest mergePullRequestBySquashRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (mergePullRequestBySquashRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getPullRequestId(), PULLREQUESTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getSourceCommitId(), SOURCECOMMITID_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getConflictDetailLevel(), CONFLICTDETAILLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getConflictResolutionStrategy(), CONFLICTRESOLUTIONSTRATEGY_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getCommitMessage(), COMMITMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getAuthorName(), AUTHORNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getEmail(), EMAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getKeepEmptyFolders(), KEEPEMPTYFOLDERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(mergePullRequestBySquashRequest.getConflictResolution(), CONFLICTRESOLUTION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
mergePullRequestBySquashRequest.getRepositoryName(), REPOSITORYNAME_BINDING);
598,421
private void genInterfaceMethodDecl(StringBuilder sb, Method mi, Class ifaceType) {<NEW_LINE>if (mi.isDefault() || Modifier.isStatic(mi.getModifiers())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mi.getAnnotation(ExtensionMethod.class) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StructuralTypeProxyGenerator.isObjectMethod(mi)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ActualName anno = mi.getAnnotation(ActualName.class);<NEW_LINE>String actualName = anno == null ? "null" : "\"" <MASK><NEW_LINE>Class returnType = mi.getReturnType();<NEW_LINE>sb.append(" public ")./*append( getTypeVarList( mi ) ).append( ' ' ).*/<NEW_LINE>append(returnType.getCanonicalName()).append(' ').append(mi.getName()).append("(");<NEW_LINE>Class[] params = mi.getParameterTypes();<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>Class pi = params[i];<NEW_LINE>sb.append(pi.getCanonicalName()).append(" p").append(i);<NEW_LINE>}<NEW_LINE>sb.append(") {\n").append(returnType == void.class ? " " : " return ").append(maybeCastReturnType(returnType));<NEW_LINE>// ## todo: maybe we need to explicitly parameterize if the method is generic for some cases?<NEW_LINE>if (returnType != void.class) {<NEW_LINE>sb.append(RuntimeMethods.class.getTypeName()).append(".coerce(");<NEW_LINE>}<NEW_LINE>handleCall(sb, mi, ifaceType, actualName, params);<NEW_LINE>if (returnType != void.class) {<NEW_LINE>sb.append(", ").append(mi.getReturnType().getCanonicalName()).append(".class);\n");<NEW_LINE>} else {<NEW_LINE>sb.append(";\n");<NEW_LINE>}<NEW_LINE>sb.append(" }\n");<NEW_LINE>}
+ anno.value() + "\"";
1,530,604
public void close(EndReason reason, boolean definitelyClosed, Long kmsDisconnectionTime) {<NEW_LINE>log.debug(<MASK><NEW_LINE>if (isClosed()) {<NEW_LINE>log.warn("PARTICIPANT {}: Already closed", this.getParticipantPublicId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.closed = definitelyClosed;<NEW_LINE>Iterator<Entry<String, SubscriberEndpoint>> it = subscribers.entrySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>final Entry<String, SubscriberEndpoint> entry = it.next();<NEW_LINE>final String remoteParticipantName = entry.getKey();<NEW_LINE>final SubscriberEndpoint subscriber = entry.getValue();<NEW_LINE>it.remove();<NEW_LINE>if (subscriber != null && subscriber.getEndpoint() != null) {<NEW_LINE>try {<NEW_LINE>releaseSubscriberEndpoint(remoteParticipantName, (KurentoParticipant) this.session.getParticipantByPublicId(remoteParticipantName), subscriber, reason, false);<NEW_LINE>log.debug("PARTICIPANT {}: Released subscriber endpoint to {}", this.getParticipantPublicId(), remoteParticipantName);<NEW_LINE>} catch (JsonRpcException e) {<NEW_LINE>log.error("Error releasing subscriber endpoint of participant {}: {}", this.participantPublicId, e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warn("PARTICIPANT {}: Trying to close subscriber endpoint to {}. " + "But the endpoint was never instantiated.", this.getParticipantPublicId(), remoteParticipantName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (publisher != null && publisher.getEndpoint() != null) {<NEW_LINE>releasePublisherEndpoint(reason, kmsDisconnectionTime);<NEW_LINE>}<NEW_LINE>}
"PARTICIPANT {}: Closing user", this.getParticipantPublicId());
837,283
public void addElements(XmlElement parentElement) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>XmlElement answer = new XmlElement("update");<NEW_LINE>answer.addAttribute(new // $NON-NLS-1$<NEW_LINE>Attribute(// $NON-NLS-1$<NEW_LINE>"id", introspectedTable.getUpdateByExampleSelectiveStatementId()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>answer.addAttribute(new Attribute("parameterType", "map"));<NEW_LINE>context.getCommentGenerator().addComment(answer);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append("update ");<NEW_LINE>sb.append(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime());<NEW_LINE>answer.addElement(new TextElement(sb.toString()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>XmlElement dynamicElement = new XmlElement("set");<NEW_LINE>answer.addElement(dynamicElement);<NEW_LINE>for (IntrospectedColumn introspectedColumn : ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getAllColumns())) {<NEW_LINE>sb.setLength(0);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(introspectedColumn.getJavaProperty("row."));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" != null");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>XmlElement isNotNullElement = new XmlElement("if");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>isNotNullElement.addAttribute(new Attribute("test", sb.toString()));<NEW_LINE>dynamicElement.addElement(isNotNullElement);<NEW_LINE>sb.setLength(0);<NEW_LINE>sb.append<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" = ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, "row."));<NEW_LINE>sb.append(',');<NEW_LINE>isNotNullElement.addElement(new TextElement(sb.toString()));<NEW_LINE>}<NEW_LINE>answer.addElement(getUpdateByExampleIncludeElement());<NEW_LINE>if (context.getPlugins().sqlMapUpdateByExampleSelectiveElementGenerated(answer, introspectedTable)) {<NEW_LINE>parentElement.addElement(answer);<NEW_LINE>}<NEW_LINE>}
(MyBatis3FormattingUtilities.getAliasedEscapedColumnName(introspectedColumn));
1,040,883
public static QueryHotlineSessionResponse unmarshall(QueryHotlineSessionResponse queryHotlineSessionResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryHotlineSessionResponse.setRequestId(_ctx.stringValue("QueryHotlineSessionResponse.RequestId"));<NEW_LINE>queryHotlineSessionResponse.setMessage(_ctx.stringValue("QueryHotlineSessionResponse.Message"));<NEW_LINE>queryHotlineSessionResponse.setCode(_ctx.stringValue("QueryHotlineSessionResponse.Code"));<NEW_LINE>queryHotlineSessionResponse.setSuccess(_ctx.booleanValue("QueryHotlineSessionResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryHotlineSessionResponse.Data.PageSize"));<NEW_LINE>data.setPageNumber<MASK><NEW_LINE>data.setTotalCount(_ctx.integerValue("QueryHotlineSessionResponse.Data.TotalCount"));<NEW_LINE>List<CallDetailRecordItem> callDetailRecord = new ArrayList<CallDetailRecordItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryHotlineSessionResponse.Data.CallDetailRecord.Length"); i++) {<NEW_LINE>CallDetailRecordItem callDetailRecordItem = new CallDetailRecordItem();<NEW_LINE>callDetailRecordItem.setCallResult(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallResult"));<NEW_LINE>callDetailRecordItem.setServicerName(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].ServicerName"));<NEW_LINE>callDetailRecordItem.setOutQueueTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].OutQueueTime"));<NEW_LINE>callDetailRecordItem.setCallContinueTime(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallContinueTime"));<NEW_LINE>callDetailRecordItem.setCreateTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CreateTime"));<NEW_LINE>callDetailRecordItem.setPickUpTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].PickUpTime"));<NEW_LINE>callDetailRecordItem.setRingContinueTime(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].RingContinueTime"));<NEW_LINE>callDetailRecordItem.setCalledNumber(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CalledNumber"));<NEW_LINE>callDetailRecordItem.setServicerId(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].ServicerId"));<NEW_LINE>callDetailRecordItem.setHangUpTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].HangUpTime"));<NEW_LINE>callDetailRecordItem.setEvaluationLevel(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].EvaluationLevel"));<NEW_LINE>callDetailRecordItem.setHangUpRole(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].HangUpRole"));<NEW_LINE>callDetailRecordItem.setMemberName(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].MemberName"));<NEW_LINE>callDetailRecordItem.setEvaluationScore(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].EvaluationScore"));<NEW_LINE>callDetailRecordItem.setAcid(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].Acid"));<NEW_LINE>callDetailRecordItem.setRingStartTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].RingStartTime"));<NEW_LINE>callDetailRecordItem.setCallType(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallType"));<NEW_LINE>callDetailRecordItem.setGroupName(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].GroupName"));<NEW_LINE>callDetailRecordItem.setGroupId(_ctx.longValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].GroupId"));<NEW_LINE>callDetailRecordItem.setRingEndTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].RingEndTime"));<NEW_LINE>callDetailRecordItem.setInQueueTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].InQueueTime"));<NEW_LINE>callDetailRecordItem.setCallingNumber(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallingNumber"));<NEW_LINE>callDetailRecordItem.setMemberId(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].MemberId"));<NEW_LINE>callDetailRecordItem.setQueueUpContinueTime(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].QueueUpContinueTime"));<NEW_LINE>callDetailRecord.add(callDetailRecordItem);<NEW_LINE>}<NEW_LINE>data.setCallDetailRecord(callDetailRecord);<NEW_LINE>queryHotlineSessionResponse.setData(data);<NEW_LINE>return queryHotlineSessionResponse;<NEW_LINE>}
(_ctx.integerValue("QueryHotlineSessionResponse.Data.PageNumber"));
904,208
public List<UserWithOrganizations> findAllUsers(String username) {<NEW_LINE>List<Organization> organizations = findUserOrganizations(username);<NEW_LINE>Predicate<Collection<?>> isNotEmpty = ks -> !ks.isEmpty();<NEW_LINE>return Optional.of(organizations).filter(isNotEmpty).flatMap(org -> {<NEW_LINE>Map<Integer, List<UserOrganization>> usersAndOrganizations = userOrganizationRepository.findByOrganizationIdsOrderByUserId(organizations.stream().map(Organization::getId).collect(toList())).stream().collect(Collectors.groupingBy(UserOrganization::getUserId));<NEW_LINE>return Optional.of(usersAndOrganizations.keySet()).filter(isNotEmpty).map(ks -> userRepository.findByIds(ks).stream().map(u -> {<NEW_LINE>List<UserOrganization> userOrganizations = usersAndOrganizations.get(u.getId());<NEW_LINE>List<Organization> filteredOrganizations = organizations.stream().filter(o -> userOrganizations.stream().anyMatch(uo -> uo.getOrganizationId() == o.getId())<MASK><NEW_LINE>List<Role> roles = authorityRepository.findRoles(u.getUsername()).stream().map(Role::fromRoleName).collect(toList());<NEW_LINE>return new UserWithOrganizations(u, filteredOrganizations, roles);<NEW_LINE>}).collect(toList()));<NEW_LINE>}).orElseGet(Collections::emptyList);<NEW_LINE>}
).collect(toList());
469,788
private Map<AccessPath, Set<AccessPath>> computeGlobalAliases(SootMethod method) {<NEW_LINE>Map<AccessPath, Set<AccessPath>> res = new HashMap<AccessPath, Set<AccessPath>>();<NEW_LINE>// Find the aliases<NEW_LINE>for (Unit u : method.getActiveBody().getUnits()) {<NEW_LINE>if (!(u instanceof AssignStmt))<NEW_LINE>continue;<NEW_LINE>final AssignStmt assign = (AssignStmt) u;<NEW_LINE>// Aliases can only be generated on the heap<NEW_LINE>if (!(assign.getLeftOp() instanceof FieldRef && (assign.getRightOp() instanceof FieldRef || assign.getRightOp() instanceof Local)))<NEW_LINE>if (!(assign.getRightOp() instanceof FieldRef && (assign.getLeftOp() instanceof FieldRef || assign.getLeftOp() instanceof Local)))<NEW_LINE>continue;<NEW_LINE>final AccessPath apLeft = manager.getAccessPathFactory().createAccessPath(assign.getLeftOp(), true);<NEW_LINE>final AccessPath apRight = manager.getAccessPathFactory().createAccessPath(assign.getRightOp(), true);<NEW_LINE>Set<AccessPath> <MASK><NEW_LINE>if (mapLeft == null) {<NEW_LINE>mapLeft = new HashSet<AccessPath>();<NEW_LINE>res.put(apLeft, mapLeft);<NEW_LINE>}<NEW_LINE>mapLeft.add(apRight);<NEW_LINE>Set<AccessPath> mapRight = res.get(apRight);<NEW_LINE>if (mapRight == null) {<NEW_LINE>mapRight = new HashSet<AccessPath>();<NEW_LINE>res.put(apRight, mapRight);<NEW_LINE>}<NEW_LINE>mapRight.add(apLeft);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
mapLeft = res.get(apLeft);
1,483,984
public DataSet<Tuple2<int[], Integer>> run() {<NEW_LINE>DataSet<Tuple2<Integer, int[]>> partitionedSequence = partitionSequence(sequences, itemCounts);<NEW_LINE>final int maxLength = maxPatternLength;<NEW_LINE>return partitionedSequence.partitionCustom(new Partitioner<Integer>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 5960751544160966750L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int partition(Integer key, int numPartitions) {<NEW_LINE>return key % numPartitions;<NEW_LINE>}<NEW_LINE>}, 0).mapPartition(new RichMapPartitionFunction<Tuple2<Integer, int[]>, Tuple2<int[], Integer>>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -3876003522636592081L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mapPartition(Iterable<Tuple2<Integer, int[]>> values, Collector<Tuple2<int[], Integer>> out) throws Exception {<NEW_LINE>List<Long> bc1 = getRuntimeContext().getBroadcastVariable("minSupportCnt");<NEW_LINE>List<Tuple2<Integer, Integer>> bc2 = getRuntimeContext().getBroadcastVariable("itemCounts");<NEW_LINE>int parallelism = getRuntimeContext().getNumberOfParallelSubtasks();<NEW_LINE>int taskId = getRuntimeContext().getIndexOfThisSubtask();<NEW_LINE>long minSuppCnt = bc1.get(0);<NEW_LINE>List<int[]> allSeq = new ArrayList<>();<NEW_LINE>values.forEach(t -> allSeq.add(t.f1));<NEW_LINE>List<Postfix> initialPostfixes = new ArrayList<<MASK><NEW_LINE>for (int i = 0; i < allSeq.size(); i++) {<NEW_LINE>initialPostfixes.add(new Postfix(i));<NEW_LINE>}<NEW_LINE>bc2.forEach(itemCount -> {<NEW_LINE>int item = itemCount.f0;<NEW_LINE>if (item % parallelism == taskId) {<NEW_LINE>generateFreqPattern(allSeq, initialPostfixes, item, minSuppCnt, maxLength, out);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}).withBroadcastSet(this.minSupportCnt, "minSupportCnt").withBroadcastSet(this.itemCounts, "itemCounts").name("generate_freq_pattern");<NEW_LINE>}
>(allSeq.size());
1,264,802
public static void main(String[] args) throws SQLException, IOException {<NEW_LINE>// Retrieve user credentials from environment variables.<NEW_LINE>// They are set in the Pod from a Secret in src/main/k8s/app.yaml<NEW_LINE>OracleDataSource ds = new OracleDataSource();<NEW_LINE>ds.setURL(System.getenv("url"));<NEW_LINE>ds.setUser(System.getenv("user"));<NEW_LINE>ds.setPassword(System.getenv("password"));<NEW_LINE>// Validate and log connection<NEW_LINE>OracleConnection connection = (OracleConnection) ds.getConnection();<NEW_LINE>System.out.println("Retrieving connections: " + connection.isValid(0));<NEW_LINE>System.out.println("Database version: " + connection.getMetaData().getDatabaseMajorVersion() + "." + connection.getMetaData().getDatabaseMinorVersion());<NEW_LINE>// Start an HttpServer listening on port 8080 to send database status.<NEW_LINE>HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);<NEW_LINE>server.createContext("/", (httpExchange) -> {<NEW_LINE>try (OracleConnection conn = (OracleConnection) ds.getConnection();<NEW_LINE>Statement stmt = conn.createStatement()) {<NEW_LINE>// Database message: version and sysdate<NEW_LINE>ResultSet <MASK><NEW_LINE>rs.next();<NEW_LINE>String message = "{\"database-version\": \"" + conn.getMetaData().getDatabaseMajorVersion() + "." + conn.getMetaData().getDatabaseMinorVersion() + "\", \"database-sysdate\": \"" + rs.getString(1) + "\"}";<NEW_LINE>System.out.println(message);<NEW_LINE>// Send message, status and flush<NEW_LINE>httpExchange.sendResponseHeaders(HttpsURLConnection.HTTP_OK, message.length());<NEW_LINE>OutputStream os = httpExchange.getResponseBody();<NEW_LINE>os.write(message.getBytes());<NEW_LINE>os.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>server.setExecutor(null);<NEW_LINE>server.start();<NEW_LINE>}
rs = stmt.executeQuery("select SYSDATE from dual");
863,679
protected Object doQuery(Object[] objs) {<NEW_LINE>try {<NEW_LINE>if (objs == null || objs.length < 1) {<NEW_LINE>throw new Exception("chardet paramSize error!");<NEW_LINE>}<NEW_LINE>String str = null;<NEW_LINE>String encodeName = null;<NEW_LINE>if (objs.length >= 2 && objs[1] instanceof String) {<NEW_LINE>encodeName = <MASK><NEW_LINE>} else {<NEW_LINE>Charset charset = Charset.defaultCharset();<NEW_LINE>encodeName = charset.displayName();<NEW_LINE>}<NEW_LINE>// decode<NEW_LINE>if (objs[0] instanceof byte[]) {<NEW_LINE>byte[] bt = (byte[]) objs[0];<NEW_LINE>if (encodeName.equalsIgnoreCase("unicodeescape") || encodeName.equalsIgnoreCase("unicode escape") || encodeName.equalsIgnoreCase("unicode-escape")) {<NEW_LINE>str = utf_unescape(new String(bt));<NEW_LINE>} else {<NEW_LINE>str = new String(bt, encodeName);<NEW_LINE>}<NEW_LINE>return str;<NEW_LINE>} else {<NEW_LINE>// encode<NEW_LINE>if (objs[0] instanceof String) {<NEW_LINE>str = objs[0].toString();<NEW_LINE>byte[] rawbyte = null;<NEW_LINE>if (encodeName.equalsIgnoreCase("unicodeescape") || encodeName.equalsIgnoreCase("unicode escape") || encodeName.equalsIgnoreCase("unicode-escape")) {<NEW_LINE>str = utf_escape(str);<NEW_LINE>rawbyte = str.getBytes();<NEW_LINE>} else {<NEW_LINE>rawbyte = str.getBytes(encodeName);<NEW_LINE>}<NEW_LINE>return rawbyte;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
objs[1].toString();
586,585
public static List<Unfolding> findUnfoldings(List<Integer> caseFolded) {<NEW_LINE>List<RubyCaseUnfoldingTrie> states = new ArrayList<>();<NEW_LINE>List<RubyCaseUnfoldingTrie> nextStates = new ArrayList<>();<NEW_LINE>List<Unfolding> unfoldings = new ArrayList<>();<NEW_LINE>for (int i = 0; i < caseFolded.size(); i++) {<NEW_LINE>int codepoint = caseFolded.get(i);<NEW_LINE>states.add(RubyCaseUnfoldingTrie.CASE_UNFOLD);<NEW_LINE>for (RubyCaseUnfoldingTrie state : states) {<NEW_LINE>if (state.hasChildAt(codepoint)) {<NEW_LINE>RubyCaseUnfoldingTrie newState = state.getChildAt(codepoint);<NEW_LINE>nextStates.add(newState);<NEW_LINE>for (int unfoldedCodepoint : newState.getCodepoints()) {<NEW_LINE>unfoldings.add(new Unfolding(i + 1 - newState.getDepth(), newState.getDepth(), unfoldedCodepoint));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<RubyCaseUnfoldingTrie> statesTmp = states;<NEW_LINE>states = nextStates;<NEW_LINE>nextStates = statesTmp;<NEW_LINE>nextStates.clear();<NEW_LINE>}<NEW_LINE>unfoldings.sort(Comparator.comparingInt(Unfolding::getStart).thenComparing(Comparator.comparingInt(Unfolding::<MASK><NEW_LINE>return unfoldings;<NEW_LINE>}
getLength).reversed()));
1,344,523
public AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>> flatExtracting(String fieldOrPropertyName) {<NEW_LINE>List<Object> extractedValues = newArrayList();<NEW_LINE>List<?> extractedGroups = FieldsOrPropertiesExtractor.extract<MASK><NEW_LINE>for (Object group : extractedGroups) {<NEW_LINE>// expecting group to be an iterable or an array<NEW_LINE>if (isArray(group)) {<NEW_LINE>int size = Array.getLength(group);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>extractedValues.add(Array.get(group, i));<NEW_LINE>}<NEW_LINE>} else if (group instanceof Iterable) {<NEW_LINE>Iterable<?> iterable = (Iterable<?>) group;<NEW_LINE>for (Object value : iterable) {<NEW_LINE>extractedValues.add(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>CommonErrors.wrongElementTypeForFlatExtracting(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newListAssertInstanceForMethodsChangingElementType(extractedValues);<NEW_LINE>}
(actual, byName(fieldOrPropertyName));
1,145,282
protected Validator createClassicValidator() throws javax.servlet.jsp.JspException {<NEW_LINE>FacesContext facesContext = FacesContext.getCurrentInstance();<NEW_LINE><MASK><NEW_LINE>if (null != _binding) {<NEW_LINE>Object validator;<NEW_LINE>try {<NEW_LINE>validator = _binding.getValue(elContext);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JspException("Error while creating the Validator", e);<NEW_LINE>}<NEW_LINE>if (validator instanceof Validator) {<NEW_LINE>return (Validator) validator;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Application application = facesContext.getApplication();<NEW_LINE>Validator validator = null;<NEW_LINE>try {<NEW_LINE>// first check if an ValidatorId was set by a method<NEW_LINE>if (null != _validatorIdString) {<NEW_LINE>validator = application.createValidator(_validatorIdString);<NEW_LINE>} else if (null != _validatorId) {<NEW_LINE>String validatorId = (String) _validatorId.getValue(elContext);<NEW_LINE>validator = application.createValidator(validatorId);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JspException("Error while creating the Validator", e);<NEW_LINE>}<NEW_LINE>if (null != validator) {<NEW_LINE>if (null != _binding) {<NEW_LINE>_binding.setValue(elContext, validator);<NEW_LINE>}<NEW_LINE>return validator;<NEW_LINE>}<NEW_LINE>throw new JspException("validatorId and/or binding must be specified");<NEW_LINE>}
ELContext elContext = facesContext.getELContext();
1,170,282
private void addToHeap(MinHeap heap, Object obj, Expression exp, Context ctx) {<NEW_LINE>if (obj instanceof Sequence) {<NEW_LINE>ComputeStack stack = ctx.getComputeStack();<NEW_LINE>try {<NEW_LINE>Sequence seq = (Sequence) obj;<NEW_LINE>Sequence.Current current = seq.new Current();<NEW_LINE>stack.push(current);<NEW_LINE>for (int i = 1, len = seq.length(); i <= len; ++i) {<NEW_LINE>current.setCurrent(i);<NEW_LINE>Object val = exp.calculate(ctx);<NEW_LINE>if (val != null) {<NEW_LINE>Object[<MASK><NEW_LINE>vals[0] = exp.calculate(ctx);<NEW_LINE>vals[1] = current.getCurrent();<NEW_LINE>heap.insert(vals);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>} else if (obj instanceof Record) {<NEW_LINE>if (isCurrent) {<NEW_LINE>Object val = exp.calculate(ctx);<NEW_LINE>if (val != null) {<NEW_LINE>Object[] vals = new Object[2];<NEW_LINE>vals[0] = val;<NEW_LINE>vals[1] = obj;<NEW_LINE>heap.insert(vals);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ComputeStack stack = ctx.getComputeStack();<NEW_LINE>try {<NEW_LINE>stack.push((Record) obj);<NEW_LINE>Object val = exp.calculate(ctx);<NEW_LINE>if (val != null) {<NEW_LINE>Object[] vals = new Object[2];<NEW_LINE>vals[0] = val;<NEW_LINE>vals[1] = obj;<NEW_LINE>heap.insert(vals);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (obj != null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("top" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>}
] vals = new Object[2];