idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
343,355 | protected void addInterceptorsToConnectionProperties(Properties lowLevel, String dalInterceptor) {<NEW_LINE>if (StringUtils.isTrimmedEmpty(dalInterceptor)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>String[] properties = connectionProperties.split(CONNECTION_PROPERTIES_SEPARATOR);<NEW_LINE>boolean added = false;<NEW_LINE>for (int index = 0; index < properties.length; index++) {<NEW_LINE>if (properties[index].trim().startsWith(STATEMENT_INTERCEPTORS_KEY)) {<NEW_LINE>added = true;<NEW_LINE>if (properties[index].trim().endsWith(DEFAULT_STATEMENT_INTERCEPTORS_VALUE)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String[] keyAndValue = properties[index].trim().split(CONNECTION_PROPERTIES_KEY_VALUE_SEPARATOR);<NEW_LINE>if (keyAndValue.length < 2) {<NEW_LINE>properties[index] = String.format(STATEMENT_INTERCEPTORS_VALUE_FORMAT1, dalInterceptor.trim());<NEW_LINE>} else {<NEW_LINE>properties[index] = String.format(STATEMENT_INTERCEPTORS_VALUE_FORMAT1, moveOrAddDefaultInterceptorToLast(keyAndValue[1], dalInterceptor.trim()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!added) {<NEW_LINE>connectionProperties += String.format(STATEMENT_INTERCEPTORS_VALUE_FORMAT2, dalInterceptor.trim());<NEW_LINE>} else {<NEW_LINE>connectionProperties = String.join(CONNECTION_PROPERTIES_SEPARATOR, properties);<NEW_LINE>}<NEW_LINE>lowLevel.setProperty(CONNECTIONPROPERTIES, connectionProperties);<NEW_LINE>} | connectionProperties = lowLevel.getProperty(CONNECTIONPROPERTIES); |
985,281 | private void parseBytes(byte[] weightBytes) {<NEW_LINE>float weight = Converters.<MASK><NEW_LINE>float fat = Converters.fromUnsignedInt16Be(weightBytes, 6) / 10.0f;<NEW_LINE>float bone = (weightBytes[8] & 0xFF) / 10.0f;<NEW_LINE>float muscle = Converters.fromUnsignedInt16Be(weightBytes, 9) / 10.0f;<NEW_LINE>float visceralFat = weightBytes[11] & 0xFF;<NEW_LINE>float water = Converters.fromUnsignedInt16Be(weightBytes, 12) / 10.0f;<NEW_LINE>float bmr = Converters.fromUnsignedInt16Be(weightBytes, 14);<NEW_LINE>// weightBytes[16] is an (optional, ignored) "physiological age" in some scale variants.<NEW_LINE>ScaleMeasurement scaleBtData = new ScaleMeasurement();<NEW_LINE>final ScaleUser selectedUser = OpenScale.getInstance().getSelectedScaleUser();<NEW_LINE>scaleBtData.setWeight(Converters.toKilogram(weight, selectedUser.getScaleUnit()));<NEW_LINE>scaleBtData.setFat(fat);<NEW_LINE>scaleBtData.setMuscle(muscle);<NEW_LINE>scaleBtData.setWater(water);<NEW_LINE>scaleBtData.setBone(bone);<NEW_LINE>scaleBtData.setVisceralFat(visceralFat);<NEW_LINE>addScaleMeasurement(scaleBtData);<NEW_LINE>} | fromUnsignedInt16Be(weightBytes, 4) / 10.0f; |
1,816,858 | public static DescribeBackupMachineStatusResponse unmarshall(DescribeBackupMachineStatusResponse describeBackupMachineStatusResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupMachineStatusResponse.setRequestId(_ctx.stringValue("DescribeBackupMachineStatusResponse.RequestId"));<NEW_LINE>BackupMachineStatus backupMachineStatus = new BackupMachineStatus();<NEW_LINE>backupMachineStatus.setUuid(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.Uuid"));<NEW_LINE>backupMachineStatus.setClientStatus(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ClientStatus"));<NEW_LINE>backupMachineStatus.setSavedBackupCount(_ctx.integerValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.SavedBackupCount"));<NEW_LINE>backupMachineStatus.setErrorCode(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorCode"));<NEW_LINE>backupMachineStatus.setClientId(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ClientId"));<NEW_LINE>backupMachineStatus.setClientVersion(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ClientVersion"));<NEW_LINE>backupMachineStatus.setVaultId(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.VaultId"));<NEW_LINE>backupMachineStatus.setStatus(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.Status"));<NEW_LINE>backupMachineStatus.setRegionId(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.RegionId"));<NEW_LINE>backupMachineStatus.setInstanceId(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.InstanceId"));<NEW_LINE>backupMachineStatus.setRequestId(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.RequestId"));<NEW_LINE>backupMachineStatus.setJobs(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.Jobs"));<NEW_LINE>List<BackupErrorMsg> errorList = new ArrayList<BackupErrorMsg>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList.Length"); i++) {<NEW_LINE>BackupErrorMsg backupErrorMsg = new BackupErrorMsg();<NEW_LINE>backupErrorMsg.setKey(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].Key"));<NEW_LINE>backupErrorMsg.setPath(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].Path"));<NEW_LINE>backupErrorMsg.setErrorStatus(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorStatus"));<NEW_LINE>backupErrorMsg.setErrorCode(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorCode"));<NEW_LINE>backupErrorMsg.setErrorType(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorType"));<NEW_LINE>backupErrorMsg.setErrorMsg(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorMsg"));<NEW_LINE>backupErrorMsg.setErrorTime(_ctx.longValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorTime"));<NEW_LINE>backupErrorMsg.setErrorFile(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorFile"));<NEW_LINE>backupErrorMsg.setErrorFileUrl(_ctx.stringValue("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].ErrorFileUrl"));<NEW_LINE>backupErrorMsg.setRequestId(_ctx.stringValue<MASK><NEW_LINE>errorList.add(backupErrorMsg);<NEW_LINE>}<NEW_LINE>backupMachineStatus.setErrorList(errorList);<NEW_LINE>describeBackupMachineStatusResponse.setBackupMachineStatus(backupMachineStatus);<NEW_LINE>return describeBackupMachineStatusResponse;<NEW_LINE>} | ("DescribeBackupMachineStatusResponse.BackupMachineStatus.ErrorList[" + i + "].RequestId")); |
1,176,142 | private static Trigger newTrigger(final JobKey key, final ScheduledValue value) {<NEW_LINE>// almost there<NEW_LINE>TriggerBuilder builder;<NEW_LINE>if (value.cron != null) {<NEW_LINE>// cron<NEW_LINE>builder = TriggerBuilder.newTrigger().withSchedule(misfire(value.misfire, CronScheduleBuilder.cronSchedule(value.cron))).withDescription(cron(value.cron)).withIdentity(TriggerKey.triggerKey(key.getName(), key.getGroup()));<NEW_LINE>} else {<NEW_LINE>SimpleScheduleBuilder sb = SimpleScheduleBuilder.simpleSchedule().withIntervalInMilliseconds(value.interval);<NEW_LINE>if (value.repeat > 0) {<NEW_LINE>sb = sb.withRepeatCount<MASK><NEW_LINE>} else {<NEW_LINE>sb = sb.repeatForever();<NEW_LINE>}<NEW_LINE>builder = TriggerBuilder.newTrigger().withSchedule(misfire(value.misfire, sb)).withIdentity(TriggerKey.triggerKey(key.getName() + "Trigger", key.getGroup())).forJob(key).withDescription(interval(value.interval, (int) value.repeat));<NEW_LINE>if (value.delay > 0) {<NEW_LINE>builder.startAt(new Date(System.currentTimeMillis() + value.delay));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value.calendar != null) {<NEW_LINE>builder.modifiedByCalendar(value.calendar.trim());<NEW_LINE>}<NEW_LINE>return builder.withPriority(value.priority).build();<NEW_LINE>} | ((int) value.repeat); |
1,705,740 | public void run(final CompilationController parameter) throws IOException {<NEW_LINE>parameter.toPhase(Phase.RESOLVED);<NEW_LINE>if (cancel.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JavaSource javaSource = parameter.getJavaSource();<NEW_LINE>Pair<Map<String, List<Element>>, Map<String, List<Element>>> result = new ComputeImports(parameter).computeCandidates(Collections.singleton(ident));<NEW_LINE>List<Element> candidates = result.a.get(ident);<NEW_LINE>// If the identifier is already imported, in scope, or does<NEW_LINE>// not correspond to an importable element, then there will<NEW_LINE>// not be any candidates.<NEW_LINE>if (candidates == null) {<NEW_LINE>Toolkit.getDefaultToolkit().beep();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<TypeElement> priviledged = ElementFilter.typesIn(candidates);<NEW_LINE>if (priviledged == null) {<NEW_LINE>// not found?<NEW_LINE>Toolkit<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<TypeElement> denied = new ArrayList<TypeElement>(ElementFilter.typesIn(result.b.get(ident)));<NEW_LINE>denied.removeAll(priviledged);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>ImportClassPanel panel = new ImportClassPanel(priviledged, denied, font, javaSource, position, target);<NEW_LINE>PopupUtil.showPopup(panel, "", where.x, where.y, true, carretRectangle.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .getDefaultToolkit().beep(); |
1,739,705 | protected Optional<PushOffsetRange> handleContinuationToken(final Optional<PushOffsetRange> offsetRangeOptional, final boolean isSourceNode, final boolean alosEnabled) {<NEW_LINE>if (!offsetRangeOptional.isPresent()) {<NEW_LINE>return offsetRangeOptional;<NEW_LINE>}<NEW_LINE>final PushOffsetRange offsetRange = offsetRangeOptional.get();<NEW_LINE>final PushOffsetVector currentOffsets = offsetsTracker.getOffsets().copy();<NEW_LINE>Preconditions.checkState(offsetRange.getStartOffsets().isPresent());<NEW_LINE>final PushOffsetVector startOffsets = currentOffsets.mergeCopy(offsetRange.getStartOffsets().get());<NEW_LINE>final PushOffsetVector endOffsets = currentOffsets.<MASK><NEW_LINE>final PushOffsetRange updatedToken = new PushOffsetRange(Optional.of(startOffsets), endOffsets);<NEW_LINE>if (alosEnabled && isSourceNode && !offsetRange.getStartOffsets().get().lessThanOrEqualTo(currentOffsets)) {<NEW_LINE>LOG.warn("{}: Found a gap in offsets for {} node {} and id {}: start: {}, current: {}", thisHostName, name(), node, queryId, offsetRange.getStartOffsets(), offsetsTracker.getOffsets());<NEW_LINE>callback.completeExceptionally(new GapFoundException());<NEW_LINE>close();<NEW_LINE>return Optional.empty();<NEW_LINE>} else {<NEW_LINE>LOG.debug("{}: Before update with {} current offsets {} and {}", thisHostName, name(), offsetsTracker.getOffsetRange(), new PushOffsetVector());<NEW_LINE>offsetsTracker.updateFromToken(offsetRange.getEndOffsets());<NEW_LINE>LOG.debug("{}: Updated {} with {} to have current offsets {}", thisHostName, name(), offsetRange, offsetsTracker.getOffsetRange());<NEW_LINE>}<NEW_LINE>return Optional.of(updatedToken);<NEW_LINE>} | mergeCopy(offsetRange.getEndOffsets()); |
426,623 | public void initReader() throws IOException {<NEW_LINE>try {<NEW_LINE>Configuration conf = WorkerContext.get().getConf();<NEW_LINE>String inputFormatClassName = conf.get(AngelConf.ANGEL_INPUTFORMAT_CLASS, AngelConf.DEFAULT_ANGEL_INPUTFORMAT_CLASS);<NEW_LINE>Class<? extends org.apache.hadoop.mapred.InputFormat> inputFormatClass = (Class<? extends org.apache.hadoop.mapred.InputFormat>) Class.forName(inputFormatClassName);<NEW_LINE>org.apache.hadoop.mapred.InputFormat inputFormat = ReflectionUtils.newInstance(<MASK><NEW_LINE>org.apache.hadoop.mapred.RecordReader<KEY, VALUE> recordReader = inputFormat.getRecordReader(split, new JobConf(conf), Reporter.NULL);<NEW_LINE>setReader(new DFSReaderOldAPI(recordReader));<NEW_LINE>} catch (Exception x) {<NEW_LINE>LOG.error("init reader error ", x);<NEW_LINE>throw new IOException(x);<NEW_LINE>}<NEW_LINE>} | inputFormatClass, new JobConf(conf)); |
1,057,815 | public StartCelebrityRecognitionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartCelebrityRecognitionResult startCelebrityRecognitionResult = new StartCelebrityRecognitionResult();<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 startCelebrityRecognitionResult;<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("JobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startCelebrityRecognitionResult.setJobId(context.getUnmarshaller(String.<MASK><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 startCelebrityRecognitionResult;<NEW_LINE>} | class).unmarshall(context)); |
1,547,111 | public DescribeMovingAddressesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeMovingAddressesResult describeMovingAddressesResult = new DescribeMovingAddressesResult();<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 == XmlPullParser.END_DOCUMENT)<NEW_LINE>return describeMovingAddressesResult;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("movingAddressStatusSet/item", targetDepth)) {<NEW_LINE>describeMovingAddressesResult.getMovingAddressStatuses().add(MovingAddressStatusStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeMovingAddressesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeMovingAddressesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int xmlEvent = context.nextEvent(); |
145,712 | public void run() {<NEW_LINE>testResultsContainer.setVisibility(View.VISIBLE);<NEW_LINE>ImageView ivImage = testResultsContainer.findViewById(R.id.icon);<NEW_LINE>TextView tvTitle = testResultsContainer.findViewById(R.id.title);<NEW_LINE>TextView tvDescription = testResultsContainer.<MASK><NEW_LINE>if (resultOk) {<NEW_LINE>ivImage.setImageDrawable(getContentIcon(R.drawable.ic_action_gdirections_dark));<NEW_LINE>tvTitle.setText(getString(R.string.shared_string_ok));<NEW_LINE>} else {<NEW_LINE>ivImage.setImageDrawable(getContentIcon(R.drawable.ic_action_alert));<NEW_LINE>tvTitle.setText(String.format(getString(R.string.message_server_error), message));<NEW_LINE>}<NEW_LINE>tvDescription.setText(location.getName());<NEW_LINE>scrollView.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>scrollView.scrollTo(0, scrollView.getChildAt(0).getBottom());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.description); |
574,437 | public void marshall(Contact contact, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (contact == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(contact.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getInitialContactId(), INITIALCONTACTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getPreviousContactId(), PREVIOUSCONTACTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getInitiationMethod(), INITIATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getChannel(), CHANNEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getQueueInfo(), QUEUEINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getAgentInfo(), AGENTINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getInitiationTimestamp(), INITIATIONTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(contact.getLastUpdateTimestamp(), LASTUPDATETIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(contact.getScheduledTimestamp(), SCHEDULEDTIMESTAMP_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | contact.getDisconnectTimestamp(), DISCONNECTTIMESTAMP_BINDING); |
1,558,479 | final ModifyVpcEndpointResult executeModifyVpcEndpoint(ModifyVpcEndpointRequest modifyVpcEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyVpcEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyVpcEndpointRequest> request = null;<NEW_LINE>Response<ModifyVpcEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyVpcEndpointRequestMarshaller().marshall(super.beforeMarshalling(modifyVpcEndpointRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyVpcEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyVpcEndpointResult> responseHandler = new StaxResponseHandler<ModifyVpcEndpointResult>(new ModifyVpcEndpointResultStaxUnmarshaller());<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.SERVICE_ID, "EC2"); |
580,513 | private List<?> fetchDuplicatedRecordIds(Class<? extends Model> modelClass, String concatedFields, String subQuery, String filter) {<NEW_LINE><MASK><NEW_LINE>StringBuilder queryBuilder = new StringBuilder("SELECT self.id FROM ");<NEW_LINE>queryBuilder.append(modelClass.getSimpleName() + " self");<NEW_LINE>queryBuilder.append(" WHERE ");<NEW_LINE>queryBuilder.append(concatedFields);<NEW_LINE>queryBuilder.append(" IN ");<NEW_LINE>queryBuilder.append("(" + subQuery + ")");<NEW_LINE>if (filter != null) {<NEW_LINE>queryBuilder.append(" AND " + filter);<NEW_LINE>}<NEW_LINE>Filter securityFilter = getJpaSecurityFilter(modelClass);<NEW_LINE>Object[] params = new Object[] {};<NEW_LINE>if (securityFilter != null) {<NEW_LINE>queryBuilder.append(" AND (" + securityFilter.getQuery() + ")");<NEW_LINE>log.debug("JPA filter query: {}", securityFilter.getQuery());<NEW_LINE>params = securityFilter.getParams().toArray();<NEW_LINE>log.debug("JPA filter params: {}", securityFilter.getParams());<NEW_LINE>}<NEW_LINE>String query = queryBuilder.toString();<NEW_LINE>log.debug("Final query prepared: {}", query);<NEW_LINE>Query finalQuery = JPA.em().createQuery(query);<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>finalQuery.setParameter(i, params[i]);<NEW_LINE>}<NEW_LINE>return finalQuery.getResultList();<NEW_LINE>} | log.debug("Fetch duplicated records for: {}", modelClass); |
445,066 | private void applyState(InetAddress endpoint, ApplicationState state, VersionedValue value, EndpointState epState) {<NEW_LINE>switch(state) {<NEW_LINE>case RELEASE_VERSION:<NEW_LINE>updatePeer(endpoint, value.value, StargatePeerInfo::setReleaseVersion);<NEW_LINE>break;<NEW_LINE>case DC:<NEW_LINE>updatePeer(endpoint, value.value, StargatePeerInfo::setDataCenter);<NEW_LINE>break;<NEW_LINE>case RACK:<NEW_LINE>updatePeer(endpoint, value.value, StargatePeerInfo::setRack);<NEW_LINE>break;<NEW_LINE>case NATIVE_TRANSPORT_ADDRESS:<NEW_LINE>try {<NEW_LINE>updatePeer(endpoint, InetAddress.getByName(value.value), StargatePeerInfo::setNativeAddress);<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NATIVE_TRANSPORT_PORT:<NEW_LINE>updatePeer(endpoint, Integer.parseInt(value.value), StargatePeerInfo::setNativePort);<NEW_LINE>break;<NEW_LINE>case NATIVE_TRANSPORT_PORT_SSL:<NEW_LINE>updatePeer(endpoint, Integer.parseInt(value<MASK><NEW_LINE>break;<NEW_LINE>case STORAGE_PORT:<NEW_LINE>updatePeer(endpoint, Integer.parseInt(value.value), StargatePeerInfo::setStoragePort);<NEW_LINE>break;<NEW_LINE>case STORAGE_PORT_SSL:<NEW_LINE>updatePeer(endpoint, Integer.parseInt(value.value), StargatePeerInfo::setStoragePortSsl);<NEW_LINE>break;<NEW_LINE>case JMX_PORT:<NEW_LINE>updatePeer(endpoint, Integer.parseInt(value.value), StargatePeerInfo::setJmxPort);<NEW_LINE>break;<NEW_LINE>case HOST_ID:<NEW_LINE>updatePeer(endpoint, UUID.fromString(value.value), StargatePeerInfo::setHostId);<NEW_LINE>break;<NEW_LINE>case NATIVE_TRANSPORT_READY:<NEW_LINE>notifyRpcChange(endpoint, epState.isRpcReady());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>} | .value), StargatePeerInfo::setNativePortSsl); |
1,009,257 | public Request<ListUserHierarchyGroupsRequest> marshall(ListUserHierarchyGroupsRequest listUserHierarchyGroupsRequest) {<NEW_LINE>if (listUserHierarchyGroupsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListUserHierarchyGroupsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListUserHierarchyGroupsRequest> request = new DefaultRequest<ListUserHierarchyGroupsRequest>(listUserHierarchyGroupsRequest, "AmazonConnect");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/user-hierarchy-groups-summary/{InstanceId}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (listUserHierarchyGroupsRequest.getInstanceId() == null) ? "" : StringUtils.fromString(listUserHierarchyGroupsRequest.getInstanceId()));<NEW_LINE>if (listUserHierarchyGroupsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("nextToken", StringUtils.fromString(listUserHierarchyGroupsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (listUserHierarchyGroupsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("maxResults", StringUtils.fromInteger(listUserHierarchyGroupsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addHeader("Content-Type", "application/x-amz-json-1.1"); |
879,767 | private void _softDeleteDataMetadata(final String userId, @Nullable final List<String> uris) {<NEW_LINE>if (uris != null && !uris.isEmpty()) {<NEW_LINE>final List<String> paramVariables = uris.stream().map(s -> "?").collect(Collectors.toList());<NEW_LINE>final String[] aUris = uris.toArray(new String[0]);<NEW_LINE>final String paramString = Joiner.on(",").skipNulls().join(paramVariables);<NEW_LINE>final List<Long> ids = jdbcTemplate.query(String.format(SQL.GET_DATA_METADATA_IDS, paramString), aUris, (rs, rowNum) -> rs.getLong("id"));<NEW_LINE>if (!ids.isEmpty()) {<NEW_LINE>final List<String> idParamVariables = ids.stream().map(s -> "?").collect(Collectors.toList());<NEW_LINE>final Long[] aIds = ids.<MASK><NEW_LINE>final String idParamString = Joiner.on(",").skipNulls().join(idParamVariables);<NEW_LINE>final List<Long> dupIds = jdbcTemplate.query(String.format(SQL.GET_DATA_METADATA_DELETE_BY_IDS, idParamString), aIds, (rs, rowNum) -> rs.getLong("id"));<NEW_LINE>if (!dupIds.isEmpty()) {<NEW_LINE>ids.removeAll(dupIds);<NEW_LINE>}<NEW_LINE>final List<Object[]> deleteDataMetadatas = Lists.newArrayList();<NEW_LINE>ids.forEach(id -> deleteDataMetadatas.add(new Object[] { id, userId }));<NEW_LINE>final int[] colTypes = { Types.BIGINT, Types.VARCHAR };<NEW_LINE>jdbcTemplate.batchUpdate(SQL.SOFT_DELETE_DATA_METADATA, deleteDataMetadatas, colTypes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toArray(new Long[0]); |
1,741,183 | public Object visitFunctionDef(FunctionDef node) throws Exception {<NEW_LINE>String name = getName(node.getInternalName());<NEW_LINE>setline(node);<NEW_LINE>ScopeInfo scope = module.getScopeInfo(node);<NEW_LINE>// NOTE: this is attached to the constructed PyFunction, so it cannot be nulled out<NEW_LINE>// with freeArray, unlike other usages of makeArray here<NEW_LINE>int defaults = makeArray(scope.ac.getDefaults());<NEW_LINE>code.new_(p(PyFunction.class));<NEW_LINE>code.dup();<NEW_LINE>loadFrame();<NEW_LINE>code.getfield(p(PyFrame.class), "f_globals", ci(PyObject.class));<NEW_LINE>code.aload(defaults);<NEW_LINE>code.freeLocal(defaults);<NEW_LINE>scope.setup_closure();<NEW_LINE>scope.dump();<NEW_LINE>module.codeConstant(new Suite(node, node.getInternalBody()), name, true, className, false, false, node.getLineno(), scope, cflags).get(code);<NEW_LINE>Str docStr = getDocStr(node.getInternalBody());<NEW_LINE>if (docStr != null) {<NEW_LINE>visit(docStr);<NEW_LINE>} else {<NEW_LINE>code.aconst_null();<NEW_LINE>}<NEW_LINE>if (!makeClosure(scope)) {<NEW_LINE>code.invokespecial(p(PyFunction.class), "<init>", sig(Void.TYPE, PyObject.class, PyObject[].class, PyCode.class, PyObject.class));<NEW_LINE>} else {<NEW_LINE>code.invokespecial(p(PyFunction.class), "<init>", sig(Void.TYPE, PyObject.class, PyObject[].class, PyCode.class, PyObject.class<MASK><NEW_LINE>}<NEW_LINE>applyDecorators(node.getInternalDecorator_list());<NEW_LINE>set(new Name(node, node.getInternalName(), expr_contextType.Store));<NEW_LINE>return null;<NEW_LINE>} | , PyObject[].class)); |
1,761,426 | private JComponent createRestartNotificationDetails() {<NEW_LINE>JPanel res = new JPanel(new BorderLayout(10, 10));<NEW_LINE>res.setOpaque(false);<NEW_LINE>// NOI18N<NEW_LINE>JLabel lbl = new JLabel(NbBundle.getMessage<MASK><NEW_LINE>lbl.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));<NEW_LINE>res.add(lbl, BorderLayout.CENTER);<NEW_LINE>// NOI18N<NEW_LINE>final JCheckBox checkEditorColors = new JCheckBox(NbBundle.getMessage(LafPanel.class, "Hint_ChangeEditorColors"));<NEW_LINE>if (isChangeEditorColorsPossible()) {<NEW_LINE>checkEditorColors.setSelected(true);<NEW_LINE>checkEditorColors.setOpaque(false);<NEW_LINE>res.add(checkEditorColors, BorderLayout.SOUTH);<NEW_LINE>}<NEW_LINE>lbl.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>if (null != restartNotification) {<NEW_LINE>restartNotification.clear();<NEW_LINE>restartNotification = null;<NEW_LINE>}<NEW_LINE>if (checkEditorColors.isSelected()) {<NEW_LINE>switchEditorColorsProfile();<NEW_LINE>}<NEW_LINE>LifecycleManager.getDefault().markForRestart();<NEW_LINE>LifecycleManager.getDefault().exit();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return res;<NEW_LINE>} | (LafPanel.class, "Descr_Restart")); |
1,374,623 | public StepExecutionResult execute(ExecutionContext context) {<NEW_LINE>try {<NEW_LINE>// Get module to classes map in sorted order for build determinism and testing<NEW_LINE>ProguardTranslatorFactory translatorFactory = ProguardTranslatorFactory.create(filesystem, proguardFullConfigFile, proguardMappingFile, skipProguard);<NEW_LINE>TreeMultimap<MASK><NEW_LINE>if (shouldIncludeClasses) {<NEW_LINE>ImmutableMultimap<APKModule, String> moduleToClassesMap = APKModuleGraph.getAPKModuleToClassesMap(apkModuleToJarPathMap, translatorFactory.createObfuscationFunction(), filesystem);<NEW_LINE>orderedModuleToClassesMap = sortModuleToStringsMultimap(moduleToClassesMap);<NEW_LINE>}<NEW_LINE>TreeMultimap<APKModule, String> orderedModuleToTargetsMap = TreeMultimap.create((left, right) -> left.getName().compareTo(right.getName()), Ordering.natural());<NEW_LINE>for (APKModule module : apkModuleGraph.getAPKModules()) {<NEW_LINE>for (BuildTarget target : apkModuleGraph.getBuildTargets(module)) {<NEW_LINE>orderedModuleToTargetsMap.put(module, target.getFullyQualifiedName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TreeMultimap<APKModule, String> orderedModuleToLibrariesMap = TreeMultimap.create(Comparator.comparing(APKModule::getName), Ordering.natural());<NEW_LINE>if (apkModuleToNativeLibraryMap.isPresent()) {<NEW_LINE>orderedModuleToLibrariesMap.putAll(apkModuleToNativeLibraryMap.get());<NEW_LINE>}<NEW_LINE>// Module to module deps map is already sorted<NEW_LINE>SortedMap<APKModule, ? extends SortedSet<APKModule>> moduleToDepsMap = apkModuleGraph.toOutgoingEdgesMap();<NEW_LINE>// Write metadata lines to output<NEW_LINE>LinkedList<String> metadataLines = new LinkedList<>();<NEW_LINE>if (orderedModuleToClassesMap != null) {<NEW_LINE>metadataLines.add(CLASS_SECTION_HEADER);<NEW_LINE>writeModuleToStringsMultimap(orderedModuleToClassesMap, metadataLines);<NEW_LINE>}<NEW_LINE>metadataLines.add(TARGETS_SECTION_HEADER);<NEW_LINE>writeModuleToStringsMultimap(orderedModuleToTargetsMap, metadataLines);<NEW_LINE>metadataLines.add(DEPS_SECTION_HEADER);<NEW_LINE>writeModuleToModulesMap(moduleToDepsMap, metadataLines);<NEW_LINE>// Add libraries metadata<NEW_LINE>if (apkModuleToNativeLibraryMap.isPresent()) {<NEW_LINE>metadataLines.add(LIBRARIES_SECTION_HEADER);<NEW_LINE>writeModuleToStringsMultimap(orderedModuleToLibrariesMap, metadataLines);<NEW_LINE>}<NEW_LINE>filesystem.writeLinesToPath(metadataLines, metadataOutput);<NEW_LINE>return StepExecutionResults.SUCCESS;<NEW_LINE>} catch (IOException e) {<NEW_LINE>context.logError(e, "There was an error running WriteAppModuleMetadataStep.");<NEW_LINE>return StepExecutionResults.ERROR;<NEW_LINE>}<NEW_LINE>} | <APKModule, String> orderedModuleToClassesMap = null; |
104,630 | public static ApiVersion parse(String apiVersion) {<NEW_LINE>Matcher matcher = matcher(apiVersion);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>short major = parseShort(matcher.group(1));<NEW_LINE>Stability stability;<NEW_LINE>short minor;<NEW_LINE>String alphaBeta = matcher.group(3);<NEW_LINE>if (matcher.groupCount() > 1 && alphaBeta != null) {<NEW_LINE>if ("alpha".equals(alphaBeta)) {<NEW_LINE>stability = Stability.ALPHA;<NEW_LINE>} else if ("beta".equals(alphaBeta)) {<NEW_LINE>stability = Stability.BETA;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(alphaBeta);<NEW_LINE>}<NEW_LINE>minor = parseShort(matcher.group(4));<NEW_LINE>} else {<NEW_LINE>stability = Stability.STABLE;<NEW_LINE>minor = 0;<NEW_LINE>}<NEW_LINE>return new ApiVersion(major, stability, minor);<NEW_LINE>} | throw new IllegalArgumentException("Invalid version " + apiVersion); |
1,146,936 | public void init(String rule) {<NEW_LINE>try {<NEW_LINE>if (rule == null || rule.trim().length() == 0) {<NEW_LINE>throw new IllegalArgumentException("Illegal route rule!");<NEW_LINE>}<NEW_LINE>rule = rule.replace("consumer.", "").replace("provider.", "");<NEW_LINE>int <MASK><NEW_LINE>String whenRule = i < 0 ? null : rule.substring(0, i).trim();<NEW_LINE>String thenRule = i < 0 ? rule.trim() : rule.substring(i + 2).trim();<NEW_LINE>Map<String, MatchPair> when = StringUtils.isBlank(whenRule) || "true".equals(whenRule) ? new HashMap<String, MatchPair>() : parseRule(whenRule);<NEW_LINE>Map<String, MatchPair> then = StringUtils.isBlank(thenRule) || "false".equals(thenRule) ? null : parseRule(thenRule);<NEW_LINE>// NOTE: It should be determined on the business level whether the `When condition` can be empty or not.<NEW_LINE>this.whenCondition = when;<NEW_LINE>this.thenCondition = then;<NEW_LINE>} catch (ParseException e) {<NEW_LINE>throw new IllegalStateException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | i = rule.indexOf("=>"); |
492,045 | private Collection<? extends CompletionProposal> findComponentNames(CodeCompletionContext ccContext) {<NEW_LINE>FileObject fo = ccContext.getParserResult().getSnapshot().getSource().getFileObject();<NEW_LINE>if (fo == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>Project project = FileOwnerQuery.getOwner(fo);<NEW_LINE>if (project == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>Collection<CompletionProposal> result = new ArrayList<>();<NEW_LINE>AngularJsIndex angularIndex = null;<NEW_LINE>try {<NEW_LINE>angularIndex = AngularJsIndex.get(project);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>if (angularIndex != null) {<NEW_LINE>Collection<String> components = angularIndex.getComponents(<MASK><NEW_LINE>for (String component : components) {<NEW_LINE>int anchor = ccContext.getCaretOffset() - ccContext.getPrefix().length();<NEW_LINE>AngularJsElement element = new AngularJsElement(component, ElementKind.METHOD);<NEW_LINE>result.add(new AngularJsCompletionItem.AngularFOCompletionItem(element, anchor, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ccContext.getPrefix(), false); |
997,884 | public void serialize(final SiteView siteView, final JsonGenerator jsonGenerator, final SerializerProvider serializers) throws IOException {<NEW_LINE>final Map<String, Object> map = new HashMap<>();<NEW_LINE>map.<MASK><NEW_LINE>map.put("name", siteView.name);<NEW_LINE>map.put("configured", siteView.configured);<NEW_LINE>if (null != siteView.secrets) {<NEW_LINE>map.put("secrets", siteView.secrets);<NEW_LINE>}<NEW_LINE>if (null != siteView.secretsWithWarnings) {<NEW_LINE>map.put("secretsWithWarnings", siteView.secretsWithWarnings);<NEW_LINE>}<NEW_LINE>ViewUtil.currentSite(siteView.id);<NEW_LINE>final String json = mapper.writeValueAsString(map);<NEW_LINE>final String interpolatedJson = ViewUtil.interpolateValues(json);<NEW_LINE>ViewUtil.currentSite(null);<NEW_LINE>jsonGenerator.writeRawValue(interpolatedJson);<NEW_LINE>} | put("id", siteView.id); |
997,989 | public List<I_M_ReceiptSchedule_Alloc> createReceiptScheduleAllocations(final List<? extends I_M_ReceiptSchedule> receiptSchedules, @NonNull final I_M_InOutLine receiptLine) {<NEW_LINE>Check.assumeNotEmpty(receiptSchedules, "receipt schedules not empty");<NEW_LINE>StockQtyAndUOMQty qtyToAllocateRemaining = Services.get(IInOutBL.class).getStockQtyAndCatchQty(receiptLine);<NEW_LINE>if (qtyToAllocateRemaining.signum() == 0) {<NEW_LINE>// Receipt Line with ZERO qty???<NEW_LINE>// could be, but we will skip the allocations because there is nothing to allocate<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Iterate receipt schedules and try to allocate on them as much as possible<NEW_LINE>final List<I_M_ReceiptSchedule_Alloc> allocs = new ArrayList<>();<NEW_LINE>final List<Integer> orderLineIds = new ArrayList<>();<NEW_LINE>I_M_ReceiptSchedule lastReceiptSchedule = null;<NEW_LINE>for (final I_M_ReceiptSchedule rs : receiptSchedules) {<NEW_LINE>// Do we still have something to allocate?<NEW_LINE>if (qtyToAllocateRemaining.signum() == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Calculate how much we can allocate on current receipt schedule<NEW_LINE>// i.e. try Remaining Qty To Allocate, but not more then how much is open on this receipt schedule<NEW_LINE>// how much we can maximum allocate on this receipt schedule<NEW_LINE><MASK><NEW_LINE>final StockQtyAndUOMQty rsQtyToAllocate = qtyToAllocateRemaining.min(rsQtyOpen);<NEW_LINE>if (rsQtyToAllocate.signum() == 0) {<NEW_LINE>//<NEW_LINE>// Remember our last receipt schedule<NEW_LINE>// This will be needed in case of over delivery<NEW_LINE>lastReceiptSchedule = rs;<NEW_LINE>// nothing to allocate on this receipt schedule<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create allocation<NEW_LINE>final I_M_ReceiptSchedule_Alloc rsa = createReceiptScheduleAlloc(rs, receiptLine, rsQtyToAllocate);<NEW_LINE>allocs.add(rsa);<NEW_LINE>//<NEW_LINE>// Update Remaining Qty To Allocate<NEW_LINE>qtyToAllocateRemaining = qtyToAllocateRemaining.subtract(rsQtyToAllocate);<NEW_LINE>//<NEW_LINE>// Remember receipt schedule's order line<NEW_LINE>final int orderLineId = rs.getC_OrderLine_ID();<NEW_LINE>if (orderLineId > 0 && !orderLineIds.contains(orderLineId)) {<NEW_LINE>orderLineIds.add(orderLineId);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Remember our last receipt schedule<NEW_LINE>lastReceiptSchedule = rs;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Case: after iterating all receipt schedules it seems we could not allocate everything<NEW_LINE>// => we allocate remaining qty to last receipt scheduler, no matter if open qty is smaller (over delivery)<NEW_LINE>if (qtyToAllocateRemaining.signum() != 0) {<NEW_LINE>final I_M_ReceiptSchedule_Alloc rsa = createReceiptScheduleAlloc(lastReceiptSchedule, receiptLine, qtyToAllocateRemaining);<NEW_LINE>allocs.add(rsa);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Update Receipt Line's link to Order Line<NEW_LINE>// (only if there was one and only one order line involved)<NEW_LINE>if (orderLineIds.size() == 1) {<NEW_LINE>receiptLine.setC_OrderLine_ID(orderLineIds.get(0));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Return created allocations<NEW_LINE>return allocs;<NEW_LINE>} | final StockQtyAndUOMQty rsQtyOpen = getQtyToMove(rs); |
129,804 | public final SkyValue evaluateSkyKeyForExecutionSetup(final ExtendedEventHandler eventHandler, final SkyKey key) throws EnvironmentalExecException, InterruptedException {<NEW_LINE>synchronized (valueLookupLock) {<NEW_LINE>// We evaluate in keepGoing mode because in the case that the graph does not store its<NEW_LINE>// edges, nokeepGoing builds are not allowed, whereas keepGoing builds are always<NEW_LINE>// permitted.<NEW_LINE>EvaluationResult<?> result = evaluate(ImmutableList.of(key), true, ResourceUsage.getAvailableProcessors(), eventHandler);<NEW_LINE>if (!result.hasError()) {<NEW_LINE>return Preconditions.checkNotNull(result.get(key), "%s %s", result, key);<NEW_LINE>}<NEW_LINE>ErrorInfo errorInfo = Preconditions.checkNotNull(result.getError(key), "%s %s", key, result);<NEW_LINE>Throwables.propagateIfPossible(errorInfo.getException(), EnvironmentalExecException.class);<NEW_LINE>if (errorInfo.getException() != null) {<NEW_LINE>throw new IllegalStateException(errorInfo.getException());<NEW_LINE>}<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} | IllegalStateException(errorInfo.toString()); |
1,127,581 | public Registry registerEnum(EnumIO<?> eio, int id) {<NEW_LINE>if (id < 1)<NEW_LINE>throw new IllegalArgumentException("enum ids start at 1.");<NEW_LINE>if (id >= strategy.enumIdStart)<NEW_LINE>throw new IllegalArgumentException("enum ids must be lesser than " + strategy.enumIdStart);<NEW_LINE>else if (strategy.enums.get(id) != null) {<NEW_LINE>throw new IllegalArgumentException("Duplicate id registration: " + id + " (" + eio.enumClass.getName() + ")");<NEW_LINE>}<NEW_LINE>RuntimeEnumIO reio = new RuntimeEnumIO();<NEW_LINE>reio.id = id;<NEW_LINE>reio.eio = eio;<NEW_LINE>strategy.enums.set(id, reio);<NEW_LINE>// just in case<NEW_LINE>if (strategy.enumMapping.put(eio.enumClass, reio) != null)<NEW_LINE>throw new <MASK><NEW_LINE>return this;<NEW_LINE>} | IllegalArgumentException("Duplicate registration for: " + eio.enumClass); |
398,955 | private void addAccessibilityDescriptions(Component wizPanel) {<NEW_LINE>final ResourceBundle bundle = NbBundle.getBundle(SimpleTestStepLocation.class);<NEW_LINE>// NOI18N<NEW_LINE>tfClassToTest.// NOI18N<NEW_LINE>setToolTipText(bundle.getString("SimpleTest.classToTest.toolTip"));<NEW_LINE>// NOI18N<NEW_LINE>tfClassToTest.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleName(bundle.getString("SimpleTest.classToTest.AN"));<NEW_LINE>// NOI18N<NEW_LINE>tfClassToTest.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleDescription(bundle.getString("SimpleTest.classToTest.AD"));<NEW_LINE>// NOI18N<NEW_LINE>btnBrowse.// NOI18N<NEW_LINE>setToolTipText(bundle.getString("SimpleTest.btnBrowse.toolTip"));<NEW_LINE>// NOI18N<NEW_LINE>btnBrowse.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleName(bundle.getString("SimpleTest.btnBrowse.AN"));<NEW_LINE>// NOI18N<NEW_LINE>btnBrowse.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleDescription(bundle.getString("SimpleTest.btnBrowse.AD"));<NEW_LINE>// NOI18N<NEW_LINE>cboxLocation.// NOI18N<NEW_LINE>setToolTipText(bundle.getString("SimpleTest.location.toolTip"));<NEW_LINE>// NOI18N<NEW_LINE>cboxLocation.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleName(bundle.getString("SimpleTest.location.AN"));<NEW_LINE>// NOI18N<NEW_LINE>cboxLocation.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleDescription(bundle.getString("SimpleTest.location.AD"));<NEW_LINE>// NOI18N<NEW_LINE>wizPanel.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleDescription<MASK><NEW_LINE>} | (bundle.getString("SimpleTest.AD")); |
100,192 | public void onMatch(RelOptRuleCall call) {<NEW_LINE>Project project = call.rel(0);<NEW_LINE>assert RexOver.containsOver(project.getProjects(), null);<NEW_LINE>final <MASK><NEW_LINE>final RexProgram program = RexProgram.create(input.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder());<NEW_LINE>// temporary LogicalCalc, never registered<NEW_LINE>final LogicalCalc calc = LogicalCalc.create(input, program);<NEW_LINE>final CalcRelSplitter transform = new WindowedAggRelSplitter(calc, call.builder()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected RelNode handle(RelNode rel) {<NEW_LINE>if (!(rel instanceof LogicalCalc)) {<NEW_LINE>return rel;<NEW_LINE>}<NEW_LINE>final LogicalCalc calc = (LogicalCalc) rel;<NEW_LINE>final RexProgram program = calc.getProgram();<NEW_LINE>relBuilder.push(calc.getInput());<NEW_LINE>if (program.getCondition() != null) {<NEW_LINE>relBuilder.filter(program.expandLocalRef(program.getCondition()));<NEW_LINE>}<NEW_LINE>if (!program.projectsOnlyIdentity()) {<NEW_LINE>relBuilder.project(Lists.transform(program.getProjectList(), new Function<RexLocalRef, RexNode>() {<NEW_LINE><NEW_LINE>public RexNode apply(RexLocalRef a0) {<NEW_LINE>return program.expandLocalRef(a0);<NEW_LINE>}<NEW_LINE>}), calc.getRowType().getFieldNames());<NEW_LINE>}<NEW_LINE>return relBuilder.build();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>RelNode newRel = transform.execute();<NEW_LINE>call.transformTo(newRel);<NEW_LINE>} | RelNode input = project.getInput(); |
1,042,617 | private boolean removeKeyFromIndexInternal(final OAtomicOperation atomicOperation, final int indexId, final Object key) throws OInvalidIndexEngineIdException {<NEW_LINE>try {<NEW_LINE>checkIndexId(indexId);<NEW_LINE>final OBaseIndexEngine engine = indexEngines.get(indexId);<NEW_LINE>if (engine.getEngineAPIVersion() == OIndexEngine.VERSION) {<NEW_LINE>return ((OIndexEngine) engine).remove(atomicOperation, key);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (!v1IndexEngine.isMultiValue()) {<NEW_LINE>return ((OSingleValueIndexEngine) engine).remove(atomicOperation, key);<NEW_LINE>} else {<NEW_LINE>throw new OStorageException("To remove entry from multi-value index not only key but value also should be provided");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw OException.wrapException(new OStorageException("Error during removal of entry with key " + key + " from index "), e);<NEW_LINE>}<NEW_LINE>} | final OV1IndexEngine v1IndexEngine = (OV1IndexEngine) engine; |
1,150,803 | final DescribeRecordResult executeDescribeRecord(DescribeRecordRequest describeRecordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRecordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRecordRequest> request = null;<NEW_LINE>Response<DescribeRecordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRecordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRecordRequest));<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, "Service Catalog");<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<DescribeRecordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRecordResultJsonUnmarshaller());<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, "DescribeRecord"); |
742,120 | private Expr castToSlot(SlotDescriptor slotDesc, Expr expr) throws AnalysisException {<NEW_LINE>Type dstType = slotDesc.getType();<NEW_LINE>Type srcType = expr.getType();<NEW_LINE>if (dstType.isBoolean() && srcType.isVarchar()) {<NEW_LINE>// there is no cast VARCHAR to BOOLEAN function<NEW_LINE>// so we cast VARCHAR to TINYINT first, then cast TINYINT to BOOLEAN<NEW_LINE>return new CastExpr(Type.BOOLEAN, new CastExpr<MASK><NEW_LINE>} else if (dstType.isScalarType()) {<NEW_LINE>if (useVectorized && (dstType.isBitmapType() || dstType.isHllType()) && srcType.isVarchar()) {<NEW_LINE>// there is no cast VARCHAR to BITMAP|HLL function,<NEW_LINE>// bitmap and hll data will be converted from varchar in be push.<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>return dstType.getPrimitiveType() != srcType.getPrimitiveType() ? expr.castTo(dstType) : expr;<NEW_LINE>} else {<NEW_LINE>throw new AnalysisException("Spark-Load does not support complex types yet");<NEW_LINE>}<NEW_LINE>} | (Type.TINYINT, expr)); |
267,882 | public Map<String, Integer> outgoingReferencesByHostName(final String srcHostName) {<NEW_LINE>Set<String> srcHostHashes = this.hostName2HostHashes(srcHostName);<NEW_LINE>final Map<String, Integer> targetHashesToCount = new HashMap<String, Integer>();<NEW_LINE>for (String srcHostHash : srcHostHashes) {<NEW_LINE>final WebStructureGraph.StructureEntry sr = this.outgoingReferences(srcHostHash);<NEW_LINE>if (sr != null) {<NEW_LINE>for (java.util.Map.Entry<String, Integer> ref : sr.references.entrySet()) {<NEW_LINE>Integer refsNb = targetHashesToCount.<MASK><NEW_LINE>if (refsNb != null) {<NEW_LINE>if (ref.getValue() != null) {<NEW_LINE>refsNb += ref.getValue();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ref.getValue() != null) {<NEW_LINE>refsNb = ref.getValue();<NEW_LINE>} else {<NEW_LINE>refsNb = Integer.valueOf(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>targetHashesToCount.put(ref.getKey(), refsNb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targetHashesToCount;<NEW_LINE>} | get(ref.getKey()); |
1,100,209 | public RecommendationSet unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RecommendationSet recommendationSet = new RecommendationSet();<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 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("strategy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationSet.setStrategy(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("targetDestination", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationSet.setTargetDestination(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("transformationTool", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationSet.setTransformationTool(TransformationToolJsonUnmarshaller.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 recommendationSet;<NEW_LINE>} | class).unmarshall(context)); |
1,120,081 | public IQuery<I_MD_Candidate_ATP_QueryResult> createDBQueryForStockQuery(@NonNull final AvailableToPromiseQuery query) {<NEW_LINE>final IQueryBuilder<I_MD_Candidate_ATP_QueryResult> queryBuilder = createDBQueryForStockQueryBuilder(query);<NEW_LINE>final IQuery<I_MD_Candidate_ATP_QueryResult> dbQuery = queryBuilder.setOption(IQueryBuilder.OPTION_Explode_OR_Joins_To_SQL_Unions).create();<NEW_LINE>if (isRealSqlQuery()) {<NEW_LINE>Check.assume(dbQuery instanceof TypedSqlQuery, "If we are not in unit test mode, then our query has to be an sql query; query={}", dbQuery);<NEW_LINE>final TypedSqlQuery<I_MD_Candidate_ATP_QueryResult> sqlDbQuery = (TypedSqlQuery<I_MD_Candidate_ATP_QueryResult>) dbQuery;<NEW_LINE>final String dateString = DB.<MASK><NEW_LINE>sqlDbQuery.setSqlFrom("de_metas_material.retrieve_atp_at_date(" + dateString + ")");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>return dbQuery;<NEW_LINE>} | TO_DATE(query.getDate()); |
1,108,247 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);<NEW_LINE>// Second argument is the default to use if the preference can't be found<NEW_LINE>int savedVersionCode = prefs.getInt(WELCOME_VERSION_CODE_SHOWN_PREF, 0);<NEW_LINE>int appVersionCode = 0;<NEW_LINE>try {<NEW_LINE>appVersionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;<NEW_LINE>} catch (NameNotFoundException nnfe) {<NEW_LINE>Log.w(TAG, "Exception getting appVersionCode : " + nnfe);<NEW_LINE>}<NEW_LINE>final Intent intent = new Intent(this, MainActivity.class);<NEW_LINE>final Activity activity = this;<NEW_LINE>if (appVersionCode == savedVersionCode) {<NEW_LINE>activity.startActivity(intent);<NEW_LINE>activity.finish();<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "Starting welcome page");<NEW_LINE>setContentView(R.layout.welcome);<NEW_LINE>// Increase the margin on the image to account for the translucent status bar.<NEW_LINE>ImageView welcomeImage = (ImageView) findViewById(R.id.welcome_image);<NEW_LINE>LayoutParams layoutParams = <MASK><NEW_LINE>layoutParams.topMargin = layoutParams.topMargin + MainActivity.getStatusBarHeight(this);<NEW_LINE>welcomeImage.setLayoutParams(layoutParams);<NEW_LINE>Button button = (Button) findViewById(R.id.welcome_button);<NEW_LINE>button.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>activity.startActivity(intent);<NEW_LINE>activity.finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SharedPreferences.Editor editor = prefs.edit();<NEW_LINE>editor.putInt(WELCOME_VERSION_CODE_SHOWN_PREF, appVersionCode);<NEW_LINE>editor.apply();<NEW_LINE>}<NEW_LINE>} | (LayoutParams) welcomeImage.getLayoutParams(); |
831,720 | public List<AnnotatedTypeParameterBounds> typeVariablesFromUse(AnnotatedDeclaredType type, TypeElement element) {<NEW_LINE>AnnotatedDeclaredType generic = getAnnotatedType(element);<NEW_LINE>List<AnnotatedTypeMirror<MASK><NEW_LINE>List<AnnotatedTypeMirror> tvars = generic.getTypeArguments();<NEW_LINE>assert targs.size() == tvars.size() : "Mismatch in type argument size between " + type + " and " + generic;<NEW_LINE>// System.err.printf("TVFU%n type: %s%n generic: %s%n", type, generic);<NEW_LINE>Map<TypeVariable, AnnotatedTypeMirror> typeParamToTypeArg = new HashMap<>();<NEW_LINE>AnnotatedDeclaredType enclosing = type;<NEW_LINE>while (enclosing != null) {<NEW_LINE>List<AnnotatedTypeMirror> enclosingTArgs = enclosing.getTypeArguments();<NEW_LINE>AnnotatedDeclaredType declaredType = getAnnotatedType((TypeElement) enclosing.getUnderlyingType().asElement());<NEW_LINE>List<AnnotatedTypeMirror> enclosingTVars = declaredType.getTypeArguments();<NEW_LINE>for (int i = 0; i < enclosingTArgs.size(); i++) {<NEW_LINE>AnnotatedTypeVariable enclosingTVar = (AnnotatedTypeVariable) enclosingTVars.get(i);<NEW_LINE>typeParamToTypeArg.put(enclosingTVar.getUnderlyingType(), enclosingTArgs.get(i));<NEW_LINE>}<NEW_LINE>enclosing = enclosing.getEnclosingType();<NEW_LINE>}<NEW_LINE>List<AnnotatedTypeParameterBounds> res = new ArrayList<>(tvars.size());<NEW_LINE>for (AnnotatedTypeMirror atm : tvars) {<NEW_LINE>AnnotatedTypeVariable atv = (AnnotatedTypeVariable) atm;<NEW_LINE>AnnotatedTypeMirror upper = typeVarSubstitutor.substitute(typeParamToTypeArg, atv.getUpperBound());<NEW_LINE>AnnotatedTypeMirror lower = typeVarSubstitutor.substitute(typeParamToTypeArg, atv.getLowerBound());<NEW_LINE>res.add(new AnnotatedTypeParameterBounds(upper, lower));<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | > targs = type.getTypeArguments(); |
1,182,578 | public void reduce(final IntWritable key, final Iterator<Text> values, OutputCollector<IntWritable, Text> output, final Reporter reporter) throws IOException {<NEW_LINE>// save vector<NEW_LINE>ArrayList<VectorElem<Integer>> vectorArr = null;<NEW_LINE>// save blocks<NEW_LINE>ArrayList<ArrayList<BlockElem<Integer>>> blockArr = new ArrayList<ArrayList<BlockElem<Integer>>>();<NEW_LINE>// save block rows(integer)<NEW_LINE>ArrayList<Integer> blockRowArr = new ArrayList<Integer>();<NEW_LINE>while (values.hasNext()) {<NEW_LINE>// vector: key=BLOCKID, value= (IN-BLOCK-INDEX VALUE)s<NEW_LINE>// edge: key=BLOCK-COLID BLOCK-ROWID, value=(IN-BLOCK-COL IN-BLOCK-ROW VALUE)s<NEW_LINE>String line_text = values.next().toString();<NEW_LINE>final String[] line = line_text.split("\t");<NEW_LINE>if (line.length == 1) {<NEW_LINE>// vector : VALUE<NEW_LINE>vectorArr = GIMV.parseVectorVal(line_text.substring(3), Integer.class);<NEW_LINE>} else {<NEW_LINE>// edge : BLOCK-ROWID VALUE<NEW_LINE>blockArr.add(GIMV.parseBlockVal(line[1], Integer.class));<NEW_LINE>int block_row = Integer.parseInt(line[0]);<NEW_LINE>blockRowArr.add(block_row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int blockCount = blockArr.size();<NEW_LINE>if (// || blockCount == 0 ) // missing vector or block.<NEW_LINE>vectorArr == null)<NEW_LINE>return;<NEW_LINE>// output 'self' block to check convergence<NEW_LINE>output.collect(key, GIMV.formatVectorElemOutput("msi", vectorArr));<NEW_LINE>// For every matrix block, join it with vector and output partial results<NEW_LINE>Iterator<ArrayList<BlockElem<Integer>><MASK><NEW_LINE>Iterator<Integer> blockRowIter = blockRowArr.iterator();<NEW_LINE>while (blockArrIter.hasNext()) {<NEW_LINE>ArrayList<BlockElem<Integer>> cur_block = blockArrIter.next();<NEW_LINE>int cur_block_row = blockRowIter.next();<NEW_LINE>ArrayList<VectorElem<Integer>> cur_mult_result = null;<NEW_LINE>if (key.get() == cur_block_row && recursive_diagmult == 1) {<NEW_LINE>// do recursive multiplication<NEW_LINE>ArrayList<VectorElem<Integer>> tempVectorArr = vectorArr;<NEW_LINE>for (int i = 0; i < block_width; i++) {<NEW_LINE>cur_mult_result = GIMV.minBlockVector(cur_block, tempVectorArr, block_width, 1);<NEW_LINE>if (cur_mult_result == null || GIMV.compareVectors(tempVectorArr, cur_mult_result) == 0)<NEW_LINE>break;<NEW_LINE>tempVectorArr = cur_mult_result;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cur_mult_result = GIMV.minBlockVector(cur_block, vectorArr, block_width, 0);<NEW_LINE>}<NEW_LINE>Text output_vector = GIMV.formatVectorElemOutput("moi", cur_mult_result);<NEW_LINE>if (output_vector.toString().length() > 0)<NEW_LINE>output.collect(new IntWritable(cur_block_row), output_vector);<NEW_LINE>}<NEW_LINE>} | > blockArrIter = blockArr.iterator(); |
13,726 | private TransactionReport queryHourlyReportsByDuration(String name, String domain, Date start, Date endDate) throws DalException {<NEW_LINE>long startTime = start.getTime();<NEW_LINE><MASK><NEW_LINE>double duration = (endTime - startTime) * 1.0 / TimeHelper.ONE_DAY;<NEW_LINE>HistoryTransactionReportMerger dailyMerger = new HistoryTransactionReportMerger(new TransactionReport(domain)).setDuration(duration);<NEW_LINE>TransactionReportHourlyGraphCreator graphCreator = new TransactionReportHourlyGraphCreator(dailyMerger.getTransactionReport(), 10);<NEW_LINE>for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {<NEW_LINE>TransactionReport report = m_reportService.queryReport(domain, new Date(startTime), new Date(startTime + TimeHelper.ONE_HOUR));<NEW_LINE>graphCreator.createGraph(report);<NEW_LINE>report.accept(dailyMerger);<NEW_LINE>}<NEW_LINE>TransactionReport dailyreport = dailyMerger.getTransactionReport();<NEW_LINE>Date date = dailyreport.getStartTime();<NEW_LINE>Date end = new Date(TaskHelper.tomorrowZero(date).getTime() - 1000);<NEW_LINE>dailyreport.setStartTime(TaskHelper.todayZero(date));<NEW_LINE>dailyreport.setEndTime(end);<NEW_LINE>new TransactionReportCountFilter(m_serverConfigManager.getMaxTypeThreshold(), m_atomicMessageConfigManager.getMaxNameThreshold(domain), m_serverConfigManager.getTypeNameLengthLimit()).visitTransactionReport(dailyreport);<NEW_LINE>return dailyreport;<NEW_LINE>} | long endTime = endDate.getTime(); |
719,297 | public void timeoutMethod(Timer t) {<NEW_LINE>svLogger.info("--> Entered " + CLASS_NAME + ".timeoutMethod");<NEW_LINE>try {<NEW_LINE>svLogger.info("--> Timer t = " + t);<NEW_LINE>String infoKey = (String) t.getInfo();<NEW_LINE>svLogger.info("--> infoKey = " + infoKey);<NEW_LINE>TimerData td = <MASK><NEW_LINE>svLogger.info("--> svIntEventMap = " + TimerData.svIntEventMap);<NEW_LINE>svLogger.info("--> td = " + td);<NEW_LINE>String eventTag = "::" + this + ".timeoutMethod:" + t.getInfo();<NEW_LINE>svLogger.info("--> eventTag = " + eventTag);<NEW_LINE>TimerData.addIntEvent(t, eventTag);<NEW_LINE>td.setIsFired(true);<NEW_LINE>svTimerLatch.countDown();<NEW_LINE>} finally {<NEW_LINE>svLogger.info("<-- Exiting " + CLASS_NAME + ".timeoutMethod");<NEW_LINE>}<NEW_LINE>} | TimerData.svIntEventMap.get(infoKey); |
1,797,181 | private void updateTabs(Node selectedNode, List<Integer> supportedIndices, int preferredIndex) {<NEW_LINE>// Deferring becoming a listener to the tabbed pane until this point<NEW_LINE>// eliminates handling a superfluous stateChanged event during construction.<NEW_LINE>if (listeningToTabbedPane == false) {<NEW_LINE>jTabbedPane1.addChangeListener(this);<NEW_LINE>listeningToTabbedPane = true;<NEW_LINE>}<NEW_LINE>for (Integer index : supportedIndices) {<NEW_LINE>jTabbedPane1.setEnabledAt(index, true);<NEW_LINE>}<NEW_LINE>// let the user decide if we should stay with the current viewer<NEW_LINE>int tabIndex = UserPreferences.keepPreferredContentViewer() ? jTabbedPane1.getSelectedIndex() : preferredIndex;<NEW_LINE>UpdateWrapper <MASK><NEW_LINE>// this is really only needed if no tabs were enabled<NEW_LINE>if (jTabbedPane1.isEnabledAt(tabIndex) == false) {<NEW_LINE>dcv.resetComponent();<NEW_LINE>} else {<NEW_LINE>dcv.setNode(selectedNode);<NEW_LINE>}<NEW_LINE>// set the tab to the one the user wants, then set that viewer's node.<NEW_LINE>jTabbedPane1.setSelectedIndex(tabIndex);<NEW_LINE>jTabbedPane1.getSelectedComponent().repaint();<NEW_LINE>} | dcv = viewers.get(tabIndex); |
1,275,460 | public Collection<MetadataChangeProposal> apply(@Nonnull final TagUpdateInput tagUpdate, @Nonnull final Urn actor) {<NEW_LINE>final Collection<MetadataChangeProposal> proposals <MASK><NEW_LINE>final UpdateMappingHelper updateMappingHelper = new UpdateMappingHelper(TAG_ENTITY_NAME);<NEW_LINE>final AuditStamp auditStamp = new AuditStamp();<NEW_LINE>auditStamp.setActor(actor, SetMode.IGNORE_NULL);<NEW_LINE>auditStamp.setTime(System.currentTimeMillis());<NEW_LINE>// Creator is the owner.<NEW_LINE>final Ownership ownership = new Ownership();<NEW_LINE>final Owner owner = new Owner();<NEW_LINE>owner.setOwner(actor);<NEW_LINE>owner.setType(OwnershipType.NONE);<NEW_LINE>owner.setSource(new OwnershipSource().setType(OwnershipSourceType.SERVICE));<NEW_LINE>ownership.setOwners(new OwnerArray(owner));<NEW_LINE>ownership.setLastModified(auditStamp);<NEW_LINE>proposals.add(updateMappingHelper.aspectToProposal(ownership, OWNERSHIP_ASPECT_NAME));<NEW_LINE>if (tagUpdate.getName() != null || tagUpdate.getDescription() != null) {<NEW_LINE>TagProperties tagProperties = new TagProperties();<NEW_LINE>tagProperties.setName(tagUpdate.getName());<NEW_LINE>tagProperties.setDescription(tagUpdate.getDescription());<NEW_LINE>proposals.add(updateMappingHelper.aspectToProposal(tagProperties, TAG_PROPERTIES_ASPECT_NAME));<NEW_LINE>}<NEW_LINE>return proposals;<NEW_LINE>} | = new ArrayList<>(2); |
1,358,610 | public static PointDouble draw(DrawHandler drawHandler, String[] textLines, double width, PointDouble topLeft, Collection<Line1D> slopeNotPermittedAreas) {<NEW_LINE>boolean splitIsNecessary = false;<NEW_LINE>double textWidth = width - getStaticWidthPadding();<NEW_LINE>for (String l : textLines) {<NEW_LINE>if (TextSplitter.splitStringAlgorithm(l, textWidth, drawHandler).length > 1) {<NEW_LINE>splitIsNecessary = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>double height = <MASK><NEW_LINE>// if no split is needed we can reduce the width of the title to the width of the largest line<NEW_LINE>if (!splitIsNecessary) {<NEW_LINE>textWidth = 0;<NEW_LINE>for (String l : textLines) {<NEW_LINE>textWidth = Math.max(textWidth, drawHandler.textWidth(l));<NEW_LINE>}<NEW_LINE>textWidth += drawHandler.textWidth("n");<NEW_LINE>}<NEW_LINE>TextSplitter.drawText(drawHandler, textLines, topLeft.x + HEADER_TEXT_X_PADDING, topLeft.y, textWidth, height, AlignHorizontal.LEFT, AlignVertical.CENTER);<NEW_LINE>LineType oldLt = drawHandler.getLineType();<NEW_LINE>drawHandler.setLineType(LineType.SOLID);<NEW_LINE>double slopeStartX = topLeft.x + textWidth + HEADER_TEXT_X_PADDING * 2;<NEW_LINE>double slopeEndX = slopeStartX + HEADER_PENTAGON_SLOPE_WIDTH;<NEW_LINE>// based on the slope widht and the Lifeline gaps and the fact that the execution specification<NEW_LINE>// is very small on the left side it should be enough to jump once<NEW_LINE>for (Line1D line : slopeNotPermittedAreas) {<NEW_LINE>if (line.getLow() > slopeEndX) {<NEW_LINE>break;<NEW_LINE>} else if (line.isIntersecting(new Line1D(slopeStartX, slopeEndX))) {<NEW_LINE>slopeStartX = line.getHigh();<NEW_LINE>slopeEndX = slopeStartX + HEADER_PENTAGON_SLOPE_WIDTH;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>drawHandler.drawLines(new PointDouble[] { new PointDouble(topLeft.x, topLeft.y + height), new PointDouble(slopeStartX, topLeft.y + height), new PointDouble(slopeEndX, topLeft.y + height * (1 - HEADER_PENTAGON_SLOPE_HEIGHT_PERCENTAGE)), new PointDouble(slopeEndX, topLeft.y) });<NEW_LINE>drawHandler.setLineType(oldLt);<NEW_LINE>return new PointDouble(slopeEndX - topLeft.x, height);<NEW_LINE>} | getHeight(drawHandler, textLines, width); |
1,347,394 | protected void executeExpression(ProcessInstance processInstance, ProcessDefinition procDefToMigrateTo, String preUpgradeJavaDelegateExpression, CommandContext commandContext) {<NEW_LINE>Expression expression = CommandContextUtil.getProcessEngineConfiguration(commandContext).getExpressionManager().createExpression(preUpgradeJavaDelegateExpression);<NEW_LINE>Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, (VariableContainer) processInstance, Collections.emptyList());<NEW_LINE>if (delegate instanceof ActivityBehavior) {<NEW_LINE>CommandContextUtil.getProcessEngineConfiguration(commandContext).getDelegateInterceptor().handleInvocation(new ActivityBehaviorInvocation((ActivityBehavior) delegate, (ExecutionEntityImpl) processInstance));<NEW_LINE>} else if (delegate instanceof JavaDelegate) {<NEW_LINE>CommandContextUtil.getProcessEngineConfiguration(commandContext).getDelegateInterceptor().handleInvocation(new JavaDelegateInvocation((JavaDelegate) <MASK><NEW_LINE>} else {<NEW_LINE>throw new FlowableIllegalArgumentException("Delegate expression " + expression + " did neither resolve to an implementation of " + ActivityBehavior.class + " nor " + JavaDelegate.class);<NEW_LINE>}<NEW_LINE>} | delegate, (ExecutionEntityImpl) processInstance)); |
787,916 | private VolumeSnapshotGroupVO createGroup(CreateVolumesSnapshotReply r) {<NEW_LINE>List<VolumeSnapshotGroupRefVO> refs = new ArrayList<>();<NEW_LINE>VolumeSnapshotGroupVO group = new VolumeSnapshotGroupVO();<NEW_LINE>if (msg.getResourceUuid() != null) {<NEW_LINE>group.setUuid(msg.getResourceUuid());<NEW_LINE>} else {<NEW_LINE>group.setUuid(getUuid());<NEW_LINE>}<NEW_LINE>group.setSnapshotCount(cmsg.getVolumeSnapshotJobs().size());<NEW_LINE>group.setName(msg.getName());<NEW_LINE>group.setDescription(msg.getDescription());<NEW_LINE>group.setVmInstanceUuid(vm.getUuid());<NEW_LINE>group.setAccountUuid(msg.getSession().getAccountUuid());<NEW_LINE>for (VolumeSnapshotInventory inv : r.getInventories()) {<NEW_LINE>VolumeSnapshotGroupRefVO ref = new VolumeSnapshotGroupRefVO();<NEW_LINE>ref.setVolumeUuid(inv.getVolumeUuid());<NEW_LINE>ref.setVolumeName(vols.get(inv.getVolumeUuid()).getName());<NEW_LINE>ref.<MASK><NEW_LINE>ref.setVolumeSnapshotGroupUuid(group.getUuid());<NEW_LINE>ref.setVolumeSnapshotUuid(inv.getUuid());<NEW_LINE>ref.setVolumeSnapshotName(inv.getName());<NEW_LINE>ref.setVolumeSnapshotInstallPath(inv.getPrimaryStorageInstallPath());<NEW_LINE>ref.setDeviceId(vols.get(inv.getVolumeUuid()).getDeviceId());<NEW_LINE>refs.add(ref);<NEW_LINE>}<NEW_LINE>dbf.persist(group);<NEW_LINE>dbf.persistCollection(refs);<NEW_LINE>return group;<NEW_LINE>} | setVolumeType(inv.getVolumeType()); |
80,220 | private void outputChangeLogTableCreationScript(Liquibase liquibase, final Writer exportWriter) throws DatabaseException {<NEW_LINE>Database database = liquibase.getDatabase();<NEW_LINE>ExecutorService executorService = Scope.getCurrentScope().getSingleton(ExecutorService.class);<NEW_LINE>Executor oldTemplate = executorService.getExecutor(LiquibaseConstants.JDBC_EXECUTOR, database);<NEW_LINE>LoggingExecutor loggingExecutor = new LoggingExecutor(executorService.getExecutor(LiquibaseConstants.JDBC_EXECUTOR, database), exportWriter, database);<NEW_LINE>executorService.setExecutor(LiquibaseConstants.JDBC_EXECUTOR, database, loggingExecutor);<NEW_LINE>loggingExecutor.comment("*********************************************************************");<NEW_LINE>loggingExecutor.comment("* Keycloak database creation script - apply this script to empty DB *");<NEW_LINE>loggingExecutor.comment("*********************************************************************" + StreamUtil.getLineSeparator());<NEW_LINE>loggingExecutor.execute(new CreateDatabaseChangeLogTableStatement());<NEW_LINE>// DatabaseChangeLogLockTable is created before this code is executed and recreated if it does not exist automatically<NEW_LINE>// in org.keycloak.connections.jpa.updater.liquibase.lock.CustomLockService.init() called indirectly from<NEW_LINE>// KeycloakApplication constructor (search for waitForLock() call). Hence it is not included in the creation script.<NEW_LINE>loggingExecutor.comment(<MASK><NEW_LINE>executorService.setExecutor(LiquibaseConstants.JDBC_EXECUTOR, database, oldTemplate);<NEW_LINE>} | "*********************************************************************" + StreamUtil.getLineSeparator()); |
979,877 | public List<Either<String, MarkedString>> computeHover(int line, int column, IProgressMonitor monitor) {<NEW_LINE>List<Either<String, MarkedString>> res = new LinkedList<>();<NEW_LINE>try {<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return cancelled(res);<NEW_LINE>}<NEW_LINE>IJavaElement[] elements = JDTUtils.findElementsAtSelection(unit, line, column, this.preferenceManager, monitor);<NEW_LINE>if (elements == null || elements.length == 0 || monitor.isCanceled()) {<NEW_LINE>return cancelled(res);<NEW_LINE>}<NEW_LINE>IJavaElement curr = null;<NEW_LINE>if (elements.length != 1) {<NEW_LINE>// they could be package fragments.<NEW_LINE>// We need to select the one that matches the package fragment of the current unit<NEW_LINE>IPackageFragment packageFragment = (IPackageFragment) unit.getParent();<NEW_LINE>IJavaElement found = Stream.of(elements).filter(e -> e.equals(packageFragment)).findFirst().orElse(null);<NEW_LINE>if (found == null) {<NEW_LINE>// this would be a binary package fragment<NEW_LINE>curr = elements[0];<NEW_LINE>} else {<NEW_LINE>curr = found;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>curr = elements[0];<NEW_LINE>}<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return cancelled(res);<NEW_LINE>}<NEW_LINE>if (JDTEnvironmentUtils.isSyntaxServer() || isResolved(curr, monitor)) {<NEW_LINE>IBuffer buffer = curr.getOpenable().getBuffer();<NEW_LINE>if (buffer == null && curr instanceof BinaryMember) {<NEW_LINE>IClassFile classFile = ((BinaryMember) curr).getClassFile();<NEW_LINE>if (classFile != null) {<NEW_LINE>Optional<IBuildSupport> bs = JavaLanguageServerPlugin.getProjectsManager().getBuildSupport(curr.getJavaProject().getProject());<NEW_LINE>if (bs.isPresent()) {<NEW_LINE>bs.get(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return cancelled(res);<NEW_LINE>}<NEW_LINE>MarkedString signature = computeSignature(curr);<NEW_LINE>if (signature != null) {<NEW_LINE>res.add(Either.forRight(signature));<NEW_LINE>}<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return cancelled(res);<NEW_LINE>}<NEW_LINE>MarkedString javadoc = computeJavadoc(curr);<NEW_LINE>if (javadoc != null && javadoc.getValue() != null && !javadoc.getValue().isBlank()) {<NEW_LINE>res.add(Either.forLeft(javadoc.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Error computing hover", e);<NEW_LINE>}<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return cancelled(res);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | ).discoverSource(classFile, monitor); |
367,116 | final DescribeConnectorResult executeDescribeConnector(DescribeConnectorRequest describeConnectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConnectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConnectorRequest> request = null;<NEW_LINE>Response<DescribeConnectorResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeConnectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConnectorRequest));<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, "Appflow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConnector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConnectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConnectorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
49,833 | // // test ////<NEW_LINE>public static void main(String[] args) {<NEW_LINE>String domain = "/home/gv/fsa/automata/us_main_20041002_20041008";<NEW_LINE>ConceptNet cn = new ConceptNet(domain);<NEW_LINE>System.out.println("Loading ConceptNet domain " + domain + ": " + cn.isOk());<NEW_LINE>int idx = cn.lookup("new york");<NEW_LINE>System.out.println(" lookup(\"new york\") -> " + idx);<NEW_LINE>System.out.println(" lookup(" + idx + ") -> " + cn.lookup(idx) + "(" + cn.score(idx) + "," + cn.strength(idx) + ")");<NEW_LINE>System.out.println(" extensions(" + cn.numExt(idx) + "):");<NEW_LINE>for (int i = 0; i < 5 && i < cn.numExt(idx); i++) {<NEW_LINE>System.out.println(" " + cn.lookup(cn.ext(idx, i)) + "," + cn.extFrq(idx, i));<NEW_LINE>}<NEW_LINE>if (5 < cn.numExt(idx)) {<NEW_LINE>System.out.println(" ...");<NEW_LINE>}<NEW_LINE>System.out.println(" associations(" + cn.numAssoc(idx) + "):");<NEW_LINE>for (int i = 0; i < 5 && i < cn.numAssoc(idx); i++) {<NEW_LINE>System.out.println(" " + cn.lookup(cn.assoc(idx, i)) + "," + cn.assocFrq(idx, i));<NEW_LINE>}<NEW_LINE>if (5 < cn.numAssoc(idx)) {<NEW_LINE>System.out.println(" ...");<NEW_LINE>}<NEW_LINE>System.out.println(" categories(" + cn.numCat(idx) + "):");<NEW_LINE>for (int i = 0; i < 5 && i < cn.numCat(idx); i++) {<NEW_LINE>System.out.println(" " + cn.catName(cn.<MASK><NEW_LINE>}<NEW_LINE>if (5 < cn.numCat(idx)) {<NEW_LINE>System.out.println(" ...");<NEW_LINE>}<NEW_LINE>} | cat(idx, i))); |
777,791 | public CodegenExpression codegen(EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenExpressionField resultTypeMember = codegenClassScope.addFieldUnshared(true, ObjectArrayEventType.EPTYPE, cast(ObjectArrayEventType.EPTYPE, EventTypeUtility.resolveTypeCodegen(resultEventType, EPStatementInitServices.REF)));<NEW_LINE>ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(EPTypePremade.MAP.getEPType(), EnumToMapScalar.class, scope, codegenClassScope<MASK><NEW_LINE>boolean hasIndex = numParameters >= 2;<NEW_LINE>boolean hasSize = numParameters >= 3;<NEW_LINE>CodegenBlock block = methodNode.getBlock().ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty")).blockReturn(staticMethod(Collections.class, "emptyMap"));<NEW_LINE>block.declareVar(EPTypePremade.MAP.getEPType(), "map", newInstance(EPTypePremade.HASHMAP.getEPType())).declareVar(ObjectArrayEventBean.EPTYPE, "resultEvent", newInstance(ObjectArrayEventBean.EPTYPE, newArrayByLength(EPTypePremade.OBJECT.getEPType(), constant(numParameters)), resultTypeMember)).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda()), ref("resultEvent")).declareVar(EPTypePremade.OBJECTARRAY.getEPType(), "props", exprDotMethod(ref("resultEvent"), "getProperties"));<NEW_LINE>if (hasIndex) {<NEW_LINE>block.declareVar(EPTypePremade.INTEGERPRIMITIVE.getEPType(), "count", constant(-1));<NEW_LINE>}<NEW_LINE>if (hasSize) {<NEW_LINE>block.assignArrayElement(ref("props"), constant(2), exprDotMethod(REF_ENUMCOLL, "size"));<NEW_LINE>}<NEW_LINE>CodegenBlock forEach = block.forEach(EPTypePremade.OBJECT.getEPType(), "next", EnumForgeCodegenNames.REF_ENUMCOLL).assignArrayElement("props", constant(0), ref("next"));<NEW_LINE>if (hasIndex) {<NEW_LINE>forEach.incrementRef("count").assignArrayElement("props", constant(1), ref("count"));<NEW_LINE>}<NEW_LINE>forEach.declareVar(EPTypePremade.OBJECT.getEPType(), "key", innerExpression.evaluateCodegen(EPTypePremade.OBJECT.getEPType(), methodNode, scope, codegenClassScope)).declareVar(EPTypePremade.OBJECT.getEPType(), "value", secondExpression.evaluateCodegen(EPTypePremade.OBJECT.getEPType(), methodNode, scope, codegenClassScope)).expression(exprDotMethod(ref("map"), "put", ref("key"), ref("value")));<NEW_LINE>block.methodReturn(ref("map"));<NEW_LINE>return localMethod(methodNode, premade.getEps(), premade.getEnumcoll(), premade.getIsNewData(), premade.getExprCtx());<NEW_LINE>} | ).addParam(EnumForgeCodegenNames.PARAMSCOLLOBJ); |
35,643 | public Artifact declareDirectory(String filename, Object sibling) throws EvalException {<NEW_LINE>context.checkMutable("actions.declare_directory");<NEW_LINE>RuleContext ruleContext = getRuleContext();<NEW_LINE>PathFragment fragment;<NEW_LINE>if (Starlark.NONE.equals(sibling)) {<NEW_LINE>fragment = ruleContext.getPackageDirectory().getRelative(PathFragment.create(filename));<NEW_LINE>} else {<NEW_LINE>PathFragment original = ((Artifact) sibling).getOutputDirRelativePath(getSemantics().getBool(EXPERIMENTAL_SIBLING_REPOSITORY_LAYOUT));<NEW_LINE>fragment = original.replaceName(filename);<NEW_LINE>}<NEW_LINE>if (!fragment.startsWith(ruleContext.getPackageDirectory())) {<NEW_LINE>throw Starlark.errorf("the output directory '%s' is not under package directory '%s' for target '%s'", fragment, ruleContext.getPackageDirectory(), ruleContext.getLabel());<NEW_LINE>}<NEW_LINE>Artifact result = ruleContext.<MASK><NEW_LINE>if (!result.isTreeArtifact()) {<NEW_LINE>throw Starlark.errorf("'%s' has already been declared as a regular file, not directory.", filename);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | getTreeArtifact(fragment, newFileRoot()); |
998,024 | int resetForMethodEntry0(@SlashedClassName String className, Method m) {<NEW_LINE>methodName = m.getName();<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println(" --- ");<NEW_LINE>}<NEW_LINE>String signature = m.getSignature();<NEW_LINE>stack.clear();<NEW_LINE>lvValues.clear();<NEW_LINE>top = false;<NEW_LINE>encountedTop = false;<NEW_LINE>backwardsBranch = false;<NEW_LINE>clearJumpInfoChangedByBackwardsBranch();<NEW_LINE>clearJumpInfoChangedByNewTarget();<NEW_LINE>setReachOnlyByBranch(false);<NEW_LINE>seenTransferOfControl = false;<NEW_LINE>exceptionHandlers.clear();<NEW_LINE>Code code = m.getCode();<NEW_LINE>if (code != null) {<NEW_LINE>CodeException[] exceptionTable = code.getExceptionTable();<NEW_LINE>if (exceptionTable != null) {<NEW_LINE>for (CodeException ex : exceptionTable) {<NEW_LINE>exceptionHandlers.set(ex.getHandlerPC());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println(" --- " + className + " " + m.getName() + " " + signature);<NEW_LINE>}<NEW_LINE>Type[] argTypes = Type.getArgumentTypes(signature);<NEW_LINE>int reg = 0;<NEW_LINE>if (!m.isStatic()) {<NEW_LINE>Item it = Item.initialArgument("L" + className + ";", reg);<NEW_LINE>setLVValue(reg, it);<NEW_LINE>reg += it.getSize();<NEW_LINE>}<NEW_LINE>for (Type argType : argTypes) {<NEW_LINE>Item it = Item.initialArgument(<MASK><NEW_LINE>setLVValue(reg, it);<NEW_LINE>reg += it.getSize();<NEW_LINE>}<NEW_LINE>return reg;<NEW_LINE>} | argType.getSignature(), reg); |
212,426 | void drawRect(Rect r, Paint paint) {<NEW_LINE>if (bufferedImage == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int[] pixels = ((DataBufferInt) bufferedImage.getRaster().getDataBuffer()).getData();<NEW_LINE>Rect toDraw = new Rect(max(0, r.left), max(0, r.top), min(getWidth(), r.right), min(getHeight(), r.bottom));<NEW_LINE>if (toDraw.left == 0 && toDraw.top == 0 && toDraw.right == getWidth()) {<NEW_LINE>Arrays.fill(pixels, 0, getWidth() * toDraw.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int y = toDraw.top; y < toDraw.bottom; y++) {<NEW_LINE>Arrays.fill(pixels, y * getWidth() + toDraw.left, y * getWidth() + toDraw.right, paint.getColor());<NEW_LINE>}<NEW_LINE>} | bottom, paint.getColor()); |
815,317 | private static InputFile createFile(@Nonnull DiffContent content, @Nonnull FileNameInfo fileName) throws IOException {<NEW_LINE>if (content instanceof EmptyContent) {<NEW_LINE>return new TempInputFile(createFile(new byte[0], fileName));<NEW_LINE>} else if (content instanceof FileContent) {<NEW_LINE>VirtualFile file = ((FileContent) content).getFile();<NEW_LINE>Document document = FileDocumentManager.getInstance().getCachedDocument(file);<NEW_LINE>if (document != null) {<NEW_LINE>FileDocumentManager.getInstance().saveDocument(document);<NEW_LINE>}<NEW_LINE>if (file.isInLocalFileSystem()) {<NEW_LINE>return new LocalInputFile(file);<NEW_LINE>}<NEW_LINE>return new TempInputFile(createTempFile(file, fileName));<NEW_LINE>} else if (content instanceof DocumentContent) {<NEW_LINE>return new TempInputFile(createTempFile((DocumentContent) content, fileName));<NEW_LINE>} else if (content instanceof DirectoryContent) {<NEW_LINE>VirtualFile file = ((<MASK><NEW_LINE>if (file.isInLocalFileSystem()) {<NEW_LINE>return new LocalInputFile(file);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(content.toString());<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(content.toString());<NEW_LINE>} | DirectoryContent) content).getFile(); |
836,869 | public ASTNode visitCreateTableAsSelectClause(final CreateTableAsSelectClauseContext ctx) {<NEW_LINE>SQLServerCreateTableStatement result = new SQLServerCreateTableStatement();<NEW_LINE>if (null != ctx.createTableAsSelect()) {<NEW_LINE>result.setTable((SimpleTableSegment) visit(ctx.createTableAsSelect().tableName()));<NEW_LINE>result.setSelectStatement((SQLServerSelectStatement) visit(ctx.createTableAsSelect().select()));<NEW_LINE>if (null != ctx.createTableAsSelect().columnNames()) {<NEW_LINE>CollectionValue<ColumnSegment> columnSegments = (CollectionValue<ColumnSegment>) visit(ctx.createTableAsSelect().columnNames());<NEW_LINE>for (ColumnSegment each : columnSegments.getValue()) {<NEW_LINE>result.getColumns().add(each);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.setTable((SimpleTableSegment) visit(ctx.createRemoteTableAsSelect().tableName()));<NEW_LINE>result.setSelectStatement((SQLServerSelectStatement) visit(ctx.createRemoteTableAsSelect<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ().select())); |
128,882 | private HttpClient createHttpClient() {<NEW_LINE>SslContextFactory sslContextFactory = null;<NEW_LINE>try {<NEW_LINE>sslContextFactory = new RestletSslContextFactory(org.restlet.engine.ssl.SslUtils.getSslContextFactory(this));<NEW_LINE>} catch (Exception e) {<NEW_LINE>getLogger().log(Level.WARNING, "Unable to create the SSL context factory.", e);<NEW_LINE>}<NEW_LINE>HttpClient httpClient = new HttpClient(sslContextFactory);<NEW_LINE><MASK><NEW_LINE>httpClient.setBindAddress(getBindAddress());<NEW_LINE>httpClient.setConnectTimeout(getConnectTimeout());<NEW_LINE>CookieStore cookieStore = getCookieStore();<NEW_LINE>if (cookieStore != null) {<NEW_LINE>httpClient.setCookieStore(cookieStore);<NEW_LINE>}<NEW_LINE>httpClient.setDispatchIO(isDispatchIO());<NEW_LINE>httpClient.setExecutor(getExecutor());<NEW_LINE>httpClient.setFollowRedirects(isFollowRedirects());<NEW_LINE>httpClient.setIdleTimeout(getIdleTimeout());<NEW_LINE>httpClient.setMaxConnectionsPerDestination(getMaxConnectionsPerDestination());<NEW_LINE>httpClient.setMaxRedirects(getMaxRedirects());<NEW_LINE>httpClient.setMaxRequestsQueuedPerDestination(getMaxRequestsQueuedPerDestination());<NEW_LINE>httpClient.setRequestBufferSize(getRequestBufferSize());<NEW_LINE>httpClient.setResponseBufferSize(getResponseBufferSize());<NEW_LINE>httpClient.setScheduler(getScheduler());<NEW_LINE>httpClient.setStopTimeout(getStopTimeout());<NEW_LINE>httpClient.setStrictEventOrdering(isStrictEventOrdering());<NEW_LINE>httpClient.setTCPNoDelay(isTcpNoDelay());<NEW_LINE>String userAgentField = getUserAgentField();<NEW_LINE>if (userAgentField != null) {<NEW_LINE>httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, userAgentField));<NEW_LINE>}<NEW_LINE>return httpClient;<NEW_LINE>} | httpClient.setAddressResolutionTimeout(getAddressResolutionTimeout()); |
1,752,241 | /* Build call for throttlingPoliciesCustomPost */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesCustomPostCall(CustomRule body, String contentType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/custom".replaceAll("\\{format\\}", "json");<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
86,728 | public void startLifecyclesInRole(String role) {<NEW_LINE>if (this.lazyLifecycles.size() > 0) {<NEW_LINE>addLazyLifecycles();<NEW_LINE>}<NEW_LINE>List<SmartLifecycle> componentsInRole = this.lifecycles.get(role);<NEW_LINE>if (componentsInRole != null) {<NEW_LINE>componentsInRole = new ArrayList<>(componentsInRole);<NEW_LINE>componentsInRole.sort(Comparator.comparingInt(Phased::getPhase));<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Starting " + componentsInRole + IN_ROLE + role);<NEW_LINE>}<NEW_LINE>componentsInRole.forEach(lifecycle -> {<NEW_LINE>try {<NEW_LINE>lifecycle.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to start " + lifecycle + IN_ROLE + role, e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | debug("No components in role " + role + ". Nothing to start"); |
668,738 | public PriamInstance grabExistingToken() throws Exception {<NEW_LINE>return new RetryableCallable<PriamInstance>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public PriamInstance retriableCall() throws Exception {<NEW_LINE>logger.info("Trying to grab an existing token");<NEW_LINE>sleeper.sleep(new Random().nextInt(5000) + 10000);<NEW_LINE>Set<String> racInstanceIds = getRacInstanceIds();<NEW_LINE>ImmutableSet<PriamInstance> allIds = factory.getAllIds(config.getAppName());<NEW_LINE>List<PriamInstance> instances = allIds.stream().filter(i -> i.getRac().equals(myInstanceInfo.getRac())).filter(i -> !racInstanceIds.contains(i.getInstanceId())).collect(Collectors.toList());<NEW_LINE>Optional<PriamInstance> candidate = instances.stream().filter(i -> !isNew(i)).findFirst();<NEW_LINE>candidate.ifPresent(i -> replacedIp = getReplacedIpForExistingToken(allIds, i));<NEW_LINE>if (replacedIp == null) {<NEW_LINE>candidate = instances.stream().filter(i -> isNew(i)).findFirst();<NEW_LINE>candidate.<MASK><NEW_LINE>}<NEW_LINE>return candidate.map(i -> claimToken(i)).orElse(null);<NEW_LINE>}<NEW_LINE>}.call();<NEW_LINE>} | ifPresent(i -> isTokenPregenerated = true); |
650,935 | public static Vector apply(LongIntVector v1, LongDummyVector v2, Binary op) {<NEW_LINE>LongIntVector res;<NEW_LINE>if (v1.isSparse()) {<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>// multi-rehash<NEW_LINE>LongIntVectorStorage newStorage = v1.getStorage().emptySparse((int) (v1.getDim()));<NEW_LINE>LongIntVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>res = new LongIntVector(v1.getMatrixId(), v1.getRowId(), v1.getClock(), <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// sorted<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>LongIntVectorStorage newStorage = new LongIntSparseVectorStorage(v1.getDim());<NEW_LINE>LongIntVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>res = new LongIntVector(v1.getMatrixId(), v1.getRowId(), v1.getClock(), v1.getDim(), newStorage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | v1.getDim(), newStorage); |
1,241,041 | private AmenityRoutePoint dist(LatLon l, List<Location> locations, double radius) {<NEW_LINE>float dist = (float) (radius + 0.1);<NEW_LINE>AmenityRoutePoint arp = null;<NEW_LINE>// Special iterations because points stored by pairs!<NEW_LINE>for (int i = 1; i < locations.size(); i += 2) {<NEW_LINE>float d = (float) MapUtils.getOrthogonalDistance(l.getLatitude(), l.getLongitude(), locations.get(i - 1).getLatitude(), locations.get(i - 1).getLongitude(), locations.get(i).getLatitude(), locations.get(i).getLongitude());<NEW_LINE>if (d < dist) {<NEW_LINE>arp = new Amenity.AmenityRoutePoint();<NEW_LINE>dist = d;<NEW_LINE>arp.deviateDistance = dist;<NEW_LINE>arp.pointA = locations.get(i - 1);<NEW_LINE>arp.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (arp != null && arp.deviateDistance != 0 && arp.pointA != null && arp.pointB != null) {<NEW_LINE>arp.deviationDirectionRight = MapUtils.rightSide(l.getLatitude(), l.getLongitude(), arp.pointA.getLatitude(), arp.pointA.getLongitude(), arp.pointB.getLatitude(), arp.pointB.getLongitude());<NEW_LINE>}<NEW_LINE>return arp;<NEW_LINE>} | pointB = locations.get(i); |
76,279 | public void init(final ShardingSphereMetaData metaData, final SQLStatement sqlStatement) {<NEW_LINE>long currentTimeMillis = System.currentTimeMillis();<NEW_LINE>data = RULE_ALTERED_JOB_API.getProgress(((ShowScalingStatusStatement) sqlStatement).getJobId()).entrySet().stream().map(entry -> {<NEW_LINE>Collection<Object> list = new LinkedList<>();<NEW_LINE>list.add(entry.getKey());<NEW_LINE>if (null != entry.getValue()) {<NEW_LINE>list.add(entry.getValue().getDataSource());<NEW_LINE>list.add(entry.getValue().getStatus());<NEW_LINE>list.add(entry.getValue().isActive() ? "true" : "false");<NEW_LINE>list.add(entry.getValue().getInventoryFinishedPercentage());<NEW_LINE>long latestActiveTimeMillis = entry<MASK><NEW_LINE>list.add(latestActiveTimeMillis > 0 ? TimeUnit.MILLISECONDS.toSeconds(currentTimeMillis - latestActiveTimeMillis) : 0);<NEW_LINE>} else {<NEW_LINE>list.add("");<NEW_LINE>list.add("");<NEW_LINE>list.add("");<NEW_LINE>list.add("");<NEW_LINE>list.add("");<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}).collect(Collectors.toList()).iterator();<NEW_LINE>} | .getValue().getIncrementalLatestActiveTimeMillis(); |
1,251,221 | // submit the map/reduce job.<NEW_LINE>public int run(final String[] args) throws Exception {<NEW_LINE>if (args.length < 5) {<NEW_LINE>return printUsage();<NEW_LINE>}<NEW_LINE>edge_path = new Path(args[0]);<NEW_LINE>tempmv_path = <MASK><NEW_LINE>output_path = new Path(args[2]);<NEW_LINE>nreducer = Integer.parseInt(args[3]);<NEW_LINE>if (args[4].equals("makesym"))<NEW_LINE>makesym = 1;<NEW_LINE>if (args.length > 5)<NEW_LINE>vector_path = new Path(args[5]);<NEW_LINE>if (args.length > 6)<NEW_LINE>transpose = Integer.parseInt(args[6]);<NEW_LINE>if (args.length > 7)<NEW_LINE>ignore_weights = Integer.parseInt(args[7]);<NEW_LINE>final FileSystem fs = FileSystem.get(getConf());<NEW_LINE>fs.delete(tempmv_path);<NEW_LINE>fs.delete(output_path);<NEW_LINE>JobClient.runJob(configPass1());<NEW_LINE>JobClient.runJob(configPass2());<NEW_LINE>fs.delete(tempmv_path);<NEW_LINE>return 0;<NEW_LINE>} | new Path(args[1]); |
915,308 | public static String stripXss(String value) {<NEW_LINE>String rlt = null;<NEW_LINE>if (null != value) {<NEW_LINE>// NOTE: It's highly recommended to use the ESAPI library and uncomment the following line to<NEW_LINE>// avoid encoded attacks.<NEW_LINE>rlt = <MASK><NEW_LINE>// Avoid anything between script tags<NEW_LINE>rlt = SCRIPT1_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Remove any lonesome </script> tag<NEW_LINE>rlt = SCRIPT2_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Remove any lonesome <script ...> tag<NEW_LINE>rlt = SCRIPT3_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Avoid eval(...) expressions<NEW_LINE>rlt = STR_EVAL_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Avoid expression(...) expressions<NEW_LINE>rlt = STR_EXP_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Avoid javascript:... expressions<NEW_LINE>rlt = STR_JS_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Avoid vbscript:... expressions<NEW_LINE>rlt = STR_VB_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>// Avoid onload= expressions<NEW_LINE>rlt = STR_ON_PATTERN.matcher(rlt).replaceAll("");<NEW_LINE>}<NEW_LINE>return rlt;<NEW_LINE>} | value.replaceAll("", ""); |
1,020,255 | public void loadKeyboard(final EditorInfo editorInfo, final SettingsValues settingsValues, final int currentAutoCapsState, final int currentRecapitalizeState) {<NEW_LINE>final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(mThemeContext, editorInfo);<NEW_LINE>final Resources res = mThemeContext.getResources();<NEW_LINE>final int keyboardWidth = ResourceUtils.getKeyboardWidth(res, settingsValues);<NEW_LINE>final int keyboardHeight = <MASK><NEW_LINE>builder.setKeyboardGeometry(keyboardWidth, keyboardHeight);<NEW_LINE>builder.setSubtype(mRichImm.getCurrentSubtype());<NEW_LINE>builder.setVoiceInputKeyEnabled(settingsValues.mShowsVoiceInputKey);<NEW_LINE>builder.setNumberRowEnabled(settingsValues.mShowsNumberRow);<NEW_LINE>builder.setLanguageSwitchKeyEnabled(mLatinIME.shouldShowLanguageSwitchKey());<NEW_LINE>builder.setEmojiKeyEnabled(settingsValues.mShowsEmojiKey);<NEW_LINE>builder.setSplitLayoutEnabledByUser(ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED && settingsValues.mIsSplitKeyboardEnabled);<NEW_LINE>final boolean oneHandedModeEnabled = settingsValues.mOneHandedModeEnabled;<NEW_LINE>builder.setOneHandedModeEnabled(oneHandedModeEnabled);<NEW_LINE>mKeyboardLayoutSet = builder.build();<NEW_LINE>try {<NEW_LINE>mState.onLoadKeyboard(currentAutoCapsState, currentRecapitalizeState, oneHandedModeEnabled);<NEW_LINE>mKeyboardTextsSet.setLocale(mRichImm.getCurrentSubtypeLocale(), mThemeContext);<NEW_LINE>} catch (KeyboardLayoutSetException e) {<NEW_LINE>Log.w(TAG, "loading keyboard failed: " + e.mKeyboardId, e.getCause());<NEW_LINE>}<NEW_LINE>} | ResourceUtils.getKeyboardHeight(res, settingsValues); |
1,324,558 | ActionResult<WrapOutId> execute(String appDictFlag, String appInfoFlag, String path0, String path1, String path2, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<WrapOutId> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = business.getAppInfoFactory().pick(appInfoFlag);<NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionAppInfoNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>String id = business.getAppDictFactory().getWithAppInfoWithUniqueName(appInfo.getId(), appDictFlag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new ExceptionAppDictNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>AppDict dict = emc.<MASK><NEW_LINE>this.create(business, dict, jsonElement, path0, path1, path2);<NEW_LINE>emc.commit();<NEW_LINE>WrapOutId wrap = new WrapOutId(dict.getId());<NEW_LINE>result.setData(wrap);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | find(id, AppDict.class); |
655,826 | public StickingPolygon generateStickingBorder(int x, int y, int width, int height) {<NEW_LINE>StickingPolygon p = new StickingPolygon(0, 0);<NEW_LINE>Vector<String> tmp = new Vector<String>(getStringVector());<NEW_LINE>if (tmp.size() == 0) {<NEW_LINE>tmp.add(" ");<NEW_LINE>}<NEW_LINE>int yPos = (int) HandlerElementMap.getHandlerForElement(this)<MASK><NEW_LINE>boolean borders = false;<NEW_LINE>// int maxUpperBox=5*this.getHandler().getFontHandler().getFontsize();<NEW_LINE>int maxUpperBox = (int) (width * 0.4);<NEW_LINE>for (int i = 0; i < tmp.size(); i++) {<NEW_LINE>String s = tmp.elementAt(i);<NEW_LINE>// G. Mueller start<NEW_LINE>if (tmp.elementAt(0).equals("--") && !borders) {<NEW_LINE>// if there is no Packagename<NEW_LINE>yPos = (int) HandlerElementMap.getHandlerForElement(this).getFontHandler().getDistanceBetweenTexts() + (int) HandlerElementMap.getHandlerForElement(this).getFontHandler().getDistanceBetweenTexts() + (int) HandlerElementMap.getHandlerForElement(this).getFontHandler().getFontSize();<NEW_LINE>}<NEW_LINE>// G.Mueller End<NEW_LINE>if (s.equals("--") && !borders) {<NEW_LINE>borders = true;<NEW_LINE>} else if (!borders) {<NEW_LINE>maxUpperBox = (int) Math.max(maxUpperBox, HandlerElementMap.getHandlerForElement(this).getFontHandler().getTextWidth(s) + (int) HandlerElementMap.getHandlerForElement(this).getFontHandler().getFontSize());<NEW_LINE>yPos += (int) (HandlerElementMap.getHandlerForElement(this).getFontHandler().getFontSize() + HandlerElementMap.getHandlerForElement(this).getFontHandler().getDistanceBetweenTexts());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p.addPoint(x, y);<NEW_LINE>p.addPoint(x + maxUpperBox, y);<NEW_LINE>p.addPoint(x + maxUpperBox, y + yPos);<NEW_LINE>p.addPoint(x + width, y + yPos);<NEW_LINE>p.addPoint(x + width, y + height);<NEW_LINE>p.addPoint(x, y + height, true);<NEW_LINE>return p;<NEW_LINE>} | .getFontHandler().getDistanceBetweenTexts(); |
1,428,793 | public void initData(@Nullable Bundle bundle) {<NEW_LINE>mTitleView = bindTitleView();<NEW_LINE>if (mTitleView == null) {<NEW_LINE>int titleRes = bindTitleRes();<NEW_LINE>if (titleRes != View.NO_ID) {<NEW_LINE>mTitleView = new CommonActivityTitleView(this, titleRes, isSupportScroll());<NEW_LINE>} else {<NEW_LINE>CharSequence title = bindTitle();<NEW_LINE>if (!TextUtils.isEmpty(title)) {<NEW_LINE>mTitleView = new CommonActivityTitleView(this, title, isSupportScroll());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mItemsView = bindItemsView();<NEW_LINE>if (mItemsView == null) {<NEW_LINE>List<MASK><NEW_LINE>if (items != null) {<NEW_LINE>mItemsView = new CommonActivityItemsView(this, items);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mDrawerView = bindDrawerView();<NEW_LINE>if (mDrawerView == null) {<NEW_LINE>if (bindDrawer()) {<NEW_LINE>mDrawerView = new CommonActivityDrawerView(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTitleView != null && mItemsView != null) {<NEW_LINE>mTitleView.setIsSupportScroll(false);<NEW_LINE>}<NEW_LINE>findViewById(android.R.id.content).setBackgroundColor(getResources().getColor(R.color.lightGrayDark));<NEW_LINE>initSwipeBack();<NEW_LINE>} | <CommonItem> items = bindItems(); |
182,298 | private void updateSpeedAltitudeLegend(boolean isAnalysisProvided) {<NEW_LINE>TextView minValue = view.findViewById(R.id.min_value);<NEW_LINE>TextView maxValue = view.findViewById(R.id.max_value);<NEW_LINE>if (isAnalysisProvided) {<NEW_LINE>if (coloringType == ColoringType.SPEED && gpxTrackAnalysis.isSpeedSpecified() || coloringType == ColoringType.ALTITUDE && gpxTrackAnalysis.isElevationSpecified()) {<NEW_LINE>ColorizationType colorizationType = coloringType.toGradientScaleType().toColorizationType();<NEW_LINE>double min = RouteColorize.getMinValue(colorizationType, gpxTrackAnalysis);<NEW_LINE>double max = RouteColorize.getMaxValue(colorizationType, gpxTrackAnalysis, min, app.getSettings().getApplicationMode().getMaxSpeed());<NEW_LINE>minValue.setText(formatValue(min));<NEW_LINE>maxValue.setText(formatValue(max));<NEW_LINE>} else if (coloringType == ColoringType.SPEED) {<NEW_LINE>minValue.<MASK><NEW_LINE>maxValue.setText(R.string.shared_string_max_speed);<NEW_LINE>} else if (coloringType == ColoringType.ALTITUDE) {<NEW_LINE>minValue.setText(R.string.shared_string_min_height);<NEW_LINE>maxValue.setText(R.string.shared_string_max_height);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (coloringType == ColoringType.ALTITUDE) {<NEW_LINE>minValue.setText(R.string.shared_string_min_height);<NEW_LINE>maxValue.setText(R.string.shared_string_max_height);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setText(R.string.shared_string_min_speed); |
1,046,614 | public static void main(String[] argv) throws IOException, SAXException {<NEW_LINE>// parse command-line<NEW_LINE>CommandLineParser parser = new CommandLineParser();<NEW_LINE>parser.setMinimumArguments(1);<NEW_LINE>parser.setMaximumArguments(1);<NEW_LINE>parser.addStringOption("testfile", 'T');<NEW_LINE>parser.addBooleanOption("scientific", 's');<NEW_LINE>parser.addStringOption("generations", 'G');<NEW_LINE><MASK><NEW_LINE>parser.addStringOption("questions", 'Q');<NEW_LINE>parser.addStringOption("output", 'O');<NEW_LINE>parser.addStringOption("threads", 't');<NEW_LINE>parser.addBooleanOption("active", 'A');<NEW_LINE>parser.addStringOption("linkfile", 'l');<NEW_LINE>parser.addBooleanOption("sparse", 'S');<NEW_LINE>parser.addStringOption("mutation-rate", 'm');<NEW_LINE>parser.addStringOption("recombination-rate", 'r');<NEW_LINE>parser.addBooleanOption("no-comparators", 'C');<NEW_LINE>parser.addStringOption("original", 'o');<NEW_LINE>parser.addBooleanOption("incomplete-data", 'I');<NEW_LINE>try {<NEW_LINE>argv = parser.parse(argv);<NEW_LINE>} catch (CommandLineParser.CommandLineParserException e) {<NEW_LINE>System.err.println("ERROR: " + e.getMessage());<NEW_LINE>usage();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String testfile = parser.getOptionValue("testfile");<NEW_LINE>if (parser.getOptionState("scientific") && testfile == null) {<NEW_LINE>System.err.println("ERROR: scientific mode requires a test file");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// get started<NEW_LINE>Configuration config = ConfigLoader.load(argv[0]);<NEW_LINE>GeneticAlgorithm genetic = new GeneticAlgorithm(config, testfile, parser.getOptionState("scientific"));<NEW_LINE>genetic.setPopulation(parser.getOptionInteger("population", 100));<NEW_LINE>genetic.setGenerations(parser.getOptionInteger("generations", 100));<NEW_LINE>genetic.setQuestions(parser.getOptionInteger("questions", 10));<NEW_LINE>genetic.setConfigOutput(parser.getOptionValue("output"));<NEW_LINE>genetic.setThreads(parser.getOptionInteger("threads", 1));<NEW_LINE>genetic.setSparse(parser.getOptionState("sparse"));<NEW_LINE>genetic.setMutationRate(parser.getOptionInteger("mutation-rate", -1));<NEW_LINE>genetic.setRecombinationRate(parser.getOptionDouble("recombination-rate", -1.0));<NEW_LINE>genetic.setEvolveComparators(!parser.getOptionState("no-comparators"));<NEW_LINE>genetic.setCopiesOfOriginal(parser.getOptionInteger("original", 0));<NEW_LINE>genetic.setIncompleteTest(parser.getOptionState("incomplete-data"));<NEW_LINE>if (parser.getOptionState("active"))<NEW_LINE>genetic.setActive(true);<NEW_LINE>if (parser.getOptionValue("linkfile") != null)<NEW_LINE>genetic.setLinkFile(parser.getOptionValue("linkfile"));<NEW_LINE>genetic.run();<NEW_LINE>} | parser.addStringOption("population", 'P'); |
932,921 | public void testPurchaseValueOfSecurityPositionWithTransfers() throws IOException {<NEW_LINE>Client client = ClientFactory.load(// $NON-NLS-1$<NEW_LINE>IssueCurrencyGainsRoundingError.class.// $NON-NLS-1$<NEW_LINE>getResourceAsStream("IssueCurrencyGainsRoundingError.xml"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Interval // $NON-NLS-1$<NEW_LINE>period = // $NON-NLS-1$<NEW_LINE>Interval.// $NON-NLS-1$<NEW_LINE>of(// $NON-NLS-1$<NEW_LINE>LocalDate.parse("2015-01-09"), LocalDate.parse("2016-01-09"));<NEW_LINE>CurrencyConverter converter = new TestCurrencyConverter();<NEW_LINE>ClientPerformanceSnapshot snapshot = new ClientPerformanceSnapshot(client, converter, period);<NEW_LINE>MutableMoney currencyGains = MutableMoney.of(converter.getTermCurrency());<NEW_LINE>currencyGains.subtract(snapshot.getValue(CategoryType.INITIAL_VALUE));<NEW_LINE>currencyGains.subtract(snapshot.getValue(CategoryType.CAPITAL_GAINS));<NEW_LINE>currencyGains.subtract(snapshot.getValue(CategoryType.REALIZED_CAPITAL_GAINS));<NEW_LINE>currencyGains.subtract(snapshot.getValue(CategoryType.EARNINGS));<NEW_LINE>currencyGains.add(snapshot.getValue(CategoryType.FEES));<NEW_LINE>currencyGains.add(snapshot<MASK><NEW_LINE>currencyGains.add(snapshot.getValue(CategoryType.TRANSFERS));<NEW_LINE>currencyGains.add(snapshot.getValue(CategoryType.FINAL_VALUE));<NEW_LINE>assertThat(snapshot.getCategoryByType(CategoryType.CURRENCY_GAINS).getValuation(), is(currencyGains.toMoney()));<NEW_LINE>snapshot.getCategories().stream().flatMap(c -> c.getPositions().stream()).forEach(p -> {<NEW_LINE>Money value = p.getValue();<NEW_LINE>Optional<Trail> valueTrail = p.explain(ClientPerformanceSnapshot.Position.TRAIL_VALUE);<NEW_LINE>valueTrail.ifPresent(t -> assertThat(t.getRecord().getValue(), is(value)));<NEW_LINE>Money gain = p.getForexGain();<NEW_LINE>Optional<Trail> gainTrail = p.explain(ClientPerformanceSnapshot.Position.TRAIL_FOREX_GAIN);<NEW_LINE>gainTrail.ifPresent(t -> assertThat(t.getRecord().getValue(), is(gain)));<NEW_LINE>});<NEW_LINE>} | .getValue(CategoryType.TAXES)); |
1,461,400 | public io.kubernetes.client.proto.V1Autoscaling.MetricSpec buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Autoscaling.MetricSpec result = new io.kubernetes.client.proto.V1Autoscaling.MetricSpec(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.type_ = type_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>if (objectBuilder_ == null) {<NEW_LINE>result.object_ = object_;<NEW_LINE>} else {<NEW_LINE>result.object_ = objectBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>if (podsBuilder_ == null) {<NEW_LINE>result.pods_ = pods_;<NEW_LINE>} else {<NEW_LINE>result.pods_ = podsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>if (resourceBuilder_ == null) {<NEW_LINE>result.resource_ = resource_;<NEW_LINE>} else {<NEW_LINE>result.resource_ = resourceBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>if (containerResourceBuilder_ == null) {<NEW_LINE>result.containerResource_ = containerResource_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>to_bitField0_ |= 0x00000020;<NEW_LINE>}<NEW_LINE>if (externalBuilder_ == null) {<NEW_LINE>result.external_ = external_;<NEW_LINE>} else {<NEW_LINE>result.external_ = externalBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .containerResource_ = containerResourceBuilder_.build(); |
1,309,179 | public static ZoneInfo buildInfo(List<String> mainHosts, List<String> oldHosts, String regionId) {<NEW_LINE>if (mainHosts == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> up = new HashMap<>();<NEW_LINE>up.put("domains", new JSONArray(mainHosts));<NEW_LINE>if (oldHosts != null) {<NEW_LINE>up.put("old", new JSONArray(oldHosts));<NEW_LINE>}<NEW_LINE>JSONObject upJson = new JSONObject(up);<NEW_LINE>if (regionId == null) {<NEW_LINE>regionId = EmptyRegionId;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> info = new HashMap<>();<NEW_LINE>info.put("ttl", 86400 * 1000);<NEW_LINE>info.put("region", regionId);<NEW_LINE>info.put("up", upJson);<NEW_LINE>JSONObject object = new JSONObject(info);<NEW_LINE>ZoneInfo zoneInfo = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (JSONException e) {<NEW_LINE>}<NEW_LINE>return zoneInfo;<NEW_LINE>} | zoneInfo = ZoneInfo.buildFromJson(object); |
1,383,768 | protected static void listRegistries(String projectId, String cloudRegion) throws GeneralSecurityException, IOException {<NEW_LINE>GoogleCredentials credential = GoogleCredentials.getApplicationDefault().createScoped(CloudIotScopes.all());<NEW_LINE><MASK><NEW_LINE>HttpRequestInitializer init = new HttpCredentialsAdapter(credential);<NEW_LINE>final CloudIot service = new CloudIot.Builder(GoogleNetHttpTransport.newTrustedTransport(), jsonFactory, init).setApplicationName(APP_NAME).build();<NEW_LINE>final String projectPath = "projects/" + projectId + "/locations/" + cloudRegion;<NEW_LINE>List<DeviceRegistry> registries = service.projects().locations().registries().list(projectPath).execute().getDeviceRegistries();<NEW_LINE>if (registries != null) {<NEW_LINE>System.out.println("Found " + registries.size() + " registries");<NEW_LINE>for (DeviceRegistry r : registries) {<NEW_LINE>System.out.println("Id: " + r.getId());<NEW_LINE>System.out.println("Name: " + r.getName());<NEW_LINE>if (r.getMqttConfig() != null) {<NEW_LINE>System.out.println("Config: " + r.getMqttConfig().toPrettyString());<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("Project has no registries.");<NEW_LINE>}<NEW_LINE>} | JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); |
205,259 | public void updateMyLocation(View mainView, Location location) {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (mapActivity != null) {<NEW_LINE>LineChart chart = mainView.findViewById(R.id.chart);<NEW_LINE>GpxDisplayItem gpxItem = getGpxItem();<NEW_LINE>TrkSegment segment = getTrackSegment(chart);<NEW_LINE><MASK><NEW_LINE>List<ILineDataSet> ds = lineData != null ? lineData.getDataSets() : null;<NEW_LINE>if (ds != null && ds.size() > 0 && gpxItem != null && segment != null) {<NEW_LINE>RotatedTileBox tb = mapActivity.getMapView().getCurrentRotatedTileBox();<NEW_LINE>int mx = (int) tb.getPixXFromLatLon(location.getLatitude(), location.getLongitude());<NEW_LINE>int my = (int) tb.getPixYFromLatLon(location.getLatitude(), location.getLongitude());<NEW_LINE>int r = (int) (MAX_DISTANCE_LOCATION_PROJECTION * tb.getPixDensity());<NEW_LINE>Pair<WptPt, WptPt> points = GPXLayer.findPointsNearSegment(tb, segment.points, r, mx, my);<NEW_LINE>if (points != null) {<NEW_LINE>LatLon latLon = tb.getLatLonFromPixel(mx, my);<NEW_LINE>gpxItem.locationOnMap = GPXLayer.createProjectionPoint(points.first, points.second, latLon);<NEW_LINE>float pos;<NEW_LINE>if (gpxItem.chartAxisType == GPXDataSetAxisType.TIME || gpxItem.chartAxisType == GPXDataSetAxisType.TIMEOFDAY) {<NEW_LINE>pos = gpxItem.locationOnMap.time / 1000f;<NEW_LINE>} else {<NEW_LINE>double totalDistance = 0;<NEW_LINE>int index = segment.points.indexOf(points.first);<NEW_LINE>if (index != -1) {<NEW_LINE>WptPt previousPoint = null;<NEW_LINE>for (int i = 0; i < index; i++) {<NEW_LINE>WptPt currentPoint = segment.points.get(i);<NEW_LINE>if (previousPoint != null) {<NEW_LINE>totalDistance += MapUtils.getDistance(previousPoint.lat, previousPoint.lon, currentPoint.lat, currentPoint.lon);<NEW_LINE>}<NEW_LINE>previousPoint = currentPoint;<NEW_LINE>}<NEW_LINE>totalDistance += MapUtils.getDistance(gpxItem.locationOnMap.lat, gpxItem.locationOnMap.lon, points.first.lat, points.first.lon);<NEW_LINE>}<NEW_LINE>pos = (float) (totalDistance / ((OrderedLineDataSet) ds.get(0)).getDivX());<NEW_LINE>}<NEW_LINE>float lowestVisibleX = chart.getLowestVisibleX();<NEW_LINE>float highestVisibleX = chart.getHighestVisibleX();<NEW_LINE>float nextVisibleX = lowestVisibleX + (pos - gpxItem.chartHighlightPos);<NEW_LINE>float oneFourthDiff = (highestVisibleX - lowestVisibleX) / 4f;<NEW_LINE>if (pos > oneFourthDiff) {<NEW_LINE>nextVisibleX = pos - oneFourthDiff;<NEW_LINE>}<NEW_LINE>gpxItem.chartHighlightPos = pos;<NEW_LINE>chart.moveViewToX(nextVisibleX);<NEW_LINE>chart.highlightValue(gpxItem.chartHighlightPos, 0);<NEW_LINE>}<NEW_LINE>myLocation = location;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LineData lineData = chart.getLineData(); |
57,830 | public CreateParallelDataResult createParallelData(CreateParallelDataRequest createParallelDataRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createParallelDataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateParallelDataRequest> request = null;<NEW_LINE>Response<CreateParallelDataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateParallelDataRequestMarshaller().marshall(createParallelDataRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateParallelDataResult, <MASK><NEW_LINE>JsonResponseHandler<CreateParallelDataResult> responseHandler = new JsonResponseHandler<CreateParallelDataResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | JsonUnmarshallerContext> unmarshaller = new CreateParallelDataResultJsonUnmarshaller(); |
373,753 | public String executeCustomFormLogin(HttpClient httpclient, String url, String username, String password, String viewState, String[] cookies) throws Exception {<NEW_LINE>String methodName = "executeCustomFormLogin";<NEW_LINE>Log.info(logClass, methodName, "Submitting custom login form (POST) = " + url + ", username = " + username + ", password = " + password + ", viewState = " + viewState);<NEW_LINE>HttpPost postMethod = new HttpPost(url);<NEW_LINE>// postMethod.setEntity(new StringEntity(loginData));<NEW_LINE>List<NameValuePair> nvps = new ArrayList<NameValuePair>();<NEW_LINE>nvps.add(new BasicNameValuePair("form:username", username));<NEW_LINE>nvps.add(new BasicNameValuePair("form:password", password));<NEW_LINE>nvps.add(new BasicNameValuePair("form:j_id_e", "Login"));<NEW_LINE>nvps.add(new BasicNameValuePair("form_SUBMIT", "1"));<NEW_LINE>if (viewState != null) {<NEW_LINE>if (JakartaEE9Action.isActive()) {<NEW_LINE>nvps.add(new BasicNameValuePair("jakarta.faces.ViewState", viewState));<NEW_LINE>} else {<NEW_LINE>nvps.add(new BasicNameValuePair("javax.faces.ViewState", viewState));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>postMethod.setEntity(new UrlEncodedFormEntity<MASK><NEW_LINE>HttpResponse response = httpclient.execute(postMethod);<NEW_LINE>Log.info(logClass, methodName, "postMethod.getStatusCode(): " + response.getStatusLine().getStatusCode());<NEW_LINE>String content = EntityUtils.toString(response.getEntity());<NEW_LINE>EntityUtils.consume(response.getEntity());<NEW_LINE>Log.info(logClass, methodName, "contents : " + content);<NEW_LINE>// Verify redirect to servlet<NEW_LINE>int status = response.getStatusLine().getStatusCode();<NEW_LINE>assertTrue("Form login did not result in redirect: " + status, status == HttpServletResponse.SC_MOVED_TEMPORARILY);<NEW_LINE>Header header = response.getFirstHeader("Location");<NEW_LINE>String location = header.getValue();<NEW_LINE>Log.info(logClass, methodName, "Redirect location: " + location);<NEW_LINE>if (cookies != null) {<NEW_LINE>for (String cookie : cookies) {<NEW_LINE>Header cookieHeader = getCookieHeader(response, cookie);<NEW_LINE>assertCookie(cookieHeader.toString(), false, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return location;<NEW_LINE>} | (nvps, HTTP.UTF_8)); |
148,619 | private static void simulateLookUpBufferAddress(LevelZeroContext context, LevelZeroDevice device) {<NEW_LINE>LevelZeroCommandQueue commandQueue = LevelZeroUtils.createCommandQueue(device, context);<NEW_LINE>LevelZeroCommandList commandList = LevelZeroUtils.createCommandList(device, context, commandQueue.getCommandQueueDescription().getOrdinal());<NEW_LINE>final int elements = 1;<NEW_LINE>final int bufferSize = elements * 8;<NEW_LINE>ZeDeviceMemAllocDesc deviceMemAllocDesc = new ZeDeviceMemAllocDesc();<NEW_LINE>deviceMemAllocDesc.setFlags(ZeDeviceMemAllocFlags.ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED);<NEW_LINE>deviceMemAllocDesc.setOrdinal(0);<NEW_LINE>long[] output = new long[elements];<NEW_LINE>deviceHeapBuffer = new LevelZeroByteBuffer();<NEW_LINE>int result = context.zeMemAllocDevice(context.getDefaultContextPtr(), deviceMemAllocDesc, DEVICE_HEAP_SIZE, 1, device.getDeviceHandlerPtr(), deviceHeapBuffer);<NEW_LINE>LevelZeroUtils.errorLog("zeMemAllocDevice", result);<NEW_LINE>LevelZeroKernel levelZeroKernel = LevelZeroUtils.compileSPIRVKernel(device, context, "lookUp", "/tmp/lookUpBufferAddress.spv");<NEW_LINE>LevelZeroUtils.dispatchLookUpBuffer(commandList, commandQueue, levelZeroKernel, deviceHeapBuffer, output, bufferSize);<NEW_LINE>result = commandList.zeCommandListReset(commandList.getCommandListHandlerPtr());<NEW_LINE>errorLog("zeCommandListReset", result);<NEW_LINE>// Run 2nd Kernel: Execute-Copy<NEW_LINE>ByteBuffer stack = ByteBuffer.allocate(32);<NEW_LINE>stack.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>stack.putLong(777);<NEW_LINE>stack.putLong(888);<NEW_LINE>stack.putLong(999);<NEW_LINE>stack.putLong(output[0] + 80L);<NEW_LINE>// Copy Host -> Device<NEW_LINE>result = commandList.zeCommandListAppendMemoryCopyWithOffset(commandList.getCommandListHandlerPtr(), deviceHeapBuffer, stack.array(), stack.position(), 0, 0, null, 0, null);<NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendMemoryCopyWithOffset", result);<NEW_LINE>result = commandList.zeCommandListAppendBarrier(commandList.getCommandListHandlerPtr(), null, 0, null);<NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendBarrier", result);<NEW_LINE>LevelZeroKernel kernelCopy = LevelZeroUtils.compileSPIRVKernel(device, context, "copyTest", "/tmp/example.spv");<NEW_LINE>long[] output2 = new long[128];<NEW_LINE>dispatchCopyKernel(commandList, commandQueue, kernelCopy, output2, 128 * Sizeof.<MASK><NEW_LINE>// Free resources<NEW_LINE>errorLog("zeMemFree", result);<NEW_LINE>result = context.zeMemFree(context.getDefaultContextPtr(), deviceHeapBuffer);<NEW_LINE>errorLog("zeMemFree", result);<NEW_LINE>result = context.zeCommandListDestroy(commandList.getCommandListHandler());<NEW_LINE>errorLog("zeCommandListDestroy", result);<NEW_LINE>result = context.zeCommandQueueDestroy(commandQueue.getCommandQueueHandle());<NEW_LINE>errorLog("zeCommandQueueDestroy", result);<NEW_LINE>} | LONG.getNumBytes(), stack); |
824,787 | static void writeUpdateOfUpdaterJar(JarEntry updaterJarEntry, File zipFileWithUpdater, File targetCluster) throws IOException {<NEW_LINE>JarFile jf = new JarFile(zipFileWithUpdater);<NEW_LINE>String entryPath = updaterJarEntry.getName();<NEW_LINE>String entryName = entryPath.contains("/") ? entryPath.substring(entryPath.lastIndexOf("/") + 1) : entryPath;<NEW_LINE>File dest = new // updater<NEW_LINE>File(// updater<NEW_LINE>targetCluster, // new_updater<NEW_LINE>UpdaterDispatcher.UPDATE_DIR + UpdateTracking.FILE_SEPARATOR + UpdaterDispatcher.NEW_UPDATER_DIR + UpdateTracking.FILE_SEPARATOR + entryName);<NEW_LINE>dest.getParentFile().mkdirs();<NEW_LINE>assert dest.getParentFile().exists() && dest.getParentFile().isDirectory() : "Parent of " + dest + " exists and is directory.";<NEW_LINE>InputStream is = null;<NEW_LINE>OutputStream fos = null;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>fos = new FileOutputStream(dest);<NEW_LINE>is = jf.getInputStream(updaterJarEntry);<NEW_LINE>FileUtil.copy(is, fos);<NEW_LINE>} finally {<NEW_LINE>if (is != null)<NEW_LINE>is.close();<NEW_LINE>if (fos != null)<NEW_LINE>fos.close();<NEW_LINE>jf.close();<NEW_LINE>}<NEW_LINE>} catch (java.io.FileNotFoundException fnfe) {<NEW_LINE>getLogger().log(Level.SEVERE, fnfe.getLocalizedMessage(), fnfe);<NEW_LINE>} catch (java.io.IOException ioe) {<NEW_LINE>getLogger().log(Level.SEVERE, <MASK><NEW_LINE>}<NEW_LINE>} | ioe.getLocalizedMessage(), ioe); |
1,367,997 | void transpileTry(Node n, @Nullable TranspilationContext.Case breakCase) {<NEW_LINE>Node tryBlock = n.removeFirstChild();<NEW_LINE>Node catchBlock = n.removeFirstChild();<NEW_LINE><MASK><NEW_LINE>TranspilationContext.Case catchCase = catchBlock.hasChildren() ? context.createCase() : null;<NEW_LINE>TranspilationContext.Case finallyCase = finallyBlock == null ? null : context.createCase();<NEW_LINE>TranspilationContext.Case endCase = context.maybeCreateCase(breakCase);<NEW_LINE>// Transpile "try" block<NEW_LINE>context.enterTryBlock(catchCase, finallyCase, tryBlock);<NEW_LINE>transpileStatement(tryBlock);<NEW_LINE>if (finallyBlock == null) {<NEW_LINE>context.leaveTryBlock(catchCase, endCase, tryBlock);<NEW_LINE>} else {<NEW_LINE>// Transpile "finally" block<NEW_LINE>context.switchCaseTo(finallyCase);<NEW_LINE>context.enterFinallyBlock(catchCase, finallyCase, finallyBlock);<NEW_LINE>transpileStatement(finallyBlock);<NEW_LINE>context.leaveFinallyBlock(endCase, finallyBlock);<NEW_LINE>}<NEW_LINE>// Transpile "catch" block<NEW_LINE>if (catchBlock.hasChildren()) {<NEW_LINE>checkState(catchBlock.getFirstChild().isCatch());<NEW_LINE>context.switchCaseTo(catchCase);<NEW_LINE>Node exceptionName = catchBlock.getFirstFirstChild().detach();<NEW_LINE>context.enterCatchBlock(finallyCase, exceptionName);<NEW_LINE>Node catchBody = catchBlock.getFirstFirstChild().detach();<NEW_LINE>checkState(catchBody.isBlock());<NEW_LINE>transpileStatement(catchBody);<NEW_LINE>context.leaveCatchBlock(finallyCase, catchBody);<NEW_LINE>}<NEW_LINE>context.switchCaseTo(endCase);<NEW_LINE>} | Node finallyBlock = n.removeFirstChild(); |
1,740,377 | private void createDifferences() throws Exception {<NEW_LINE>Project project = env.getProject();<NEW_LINE>ProjectData projectData = project.getProjectData();<NEW_LINE>DomainFile file = projectData.getRootFolder().getFile("WinHelloCpp.exe");<NEW_LINE>Program p = (Program) file.getDomainObject(this, false, false, dummyMonitor);<NEW_LINE>int id = p.startTransaction("Test");<NEW_LINE>Listing listing = p.getListing();<NEW_LINE>listing.clearCodeUnits(addr(0x408dcd), addr(0x408dcd), false);<NEW_LINE>SymbolTable symbolTable = p.getSymbolTable();<NEW_LINE>symbolTable.createLabel(addr(0x408dd9), "BOB", SourceType.USER_DEFINED);<NEW_LINE>symbolTable.createLabel(addr(0x408deb<MASK><NEW_LINE>p.endTransaction(id, true);<NEW_LINE>p.save("some changes", dummyMonitor);<NEW_LINE>p.release(this);<NEW_LINE>} | ), "EXTRA", SourceType.USER_DEFINED); |
1,111,538 | private JComboBox createComboBox(DataItem item, Font font, FocusListener listener) {<NEW_LINE>List<ItemVariant> variants = item.getVariants();<NEW_LINE>JComboBox combo = new JComboBox(variants.toArray());<NEW_LINE>combo.setSelectedItem(item.getDefaultVariant());<NEW_LINE>// NOI18N<NEW_LINE>combo.getAccessibleContext().setAccessibleDescription(getBundleString("FixDupImportStmts_Combo_ACSD"));<NEW_LINE>// NOI18N<NEW_LINE>combo.getAccessibleContext().setAccessibleName(getBundleString("FixDupImportStmts_Combo_Name_ACSD"));<NEW_LINE>combo.setOpaque(false);<NEW_LINE>combo.setFont(font);<NEW_LINE>combo.addFocusListener(listener);<NEW_LINE>combo.setEnabled(variants.size() > 1);<NEW_LINE>combo.setRenderer(new DelegatingRenderer(combo.getRenderer(), variants, item.getVariantIcons()));<NEW_LINE>InputMap inputMap = combo.getInputMap(JComboBox.WHEN_FOCUSED);<NEW_LINE>// NOI18N<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "showPopup");<NEW_LINE>// NOI18N<NEW_LINE>combo.getActionMap().put<MASK><NEW_LINE>return combo;<NEW_LINE>} | ("showPopup", new TogglePopupAction()); |
1,226,655 | protected SecretKey engineGenerateKey() {<NEW_LINE>if (genSpec != null) {<NEW_LINE>BCSABERPublicKey pubKey = (BCSABERPublicKey) genSpec.getPublicKey();<NEW_LINE>SABERKEMGenerator kemGen = new SABERKEMGenerator(random);<NEW_LINE>SecretWithEncapsulation secEnc = kemGen.generateEncapsulated(pubKey.getKeyParams());<NEW_LINE>SecretKey rv = new SecretKeyWithEncapsulation(new SecretKeySpec(secEnc.getSecret(), genSpec.getKeyAlgorithmName()), secEnc.getEncapsulation());<NEW_LINE>try {<NEW_LINE>secEnc.destroy();<NEW_LINE>} catch (DestroyFailedException e) {<NEW_LINE>throw new IllegalStateException("key cleanup failed");<NEW_LINE>}<NEW_LINE>return rv;<NEW_LINE>} else {<NEW_LINE>BCSABERPrivateKey privKey = (BCSABERPrivateKey) extSpec.getPrivateKey();<NEW_LINE>SABERKEMExtractor kemExt = new SABERKEMExtractor(privKey.getKeyParams());<NEW_LINE>byte[<MASK><NEW_LINE>byte[] secret = kemExt.extractSecret(encapsulation);<NEW_LINE>SecretKey rv = new SecretKeyWithEncapsulation(new SecretKeySpec(secret, extSpec.getKeyAlgorithmName()), encapsulation);<NEW_LINE>Arrays.clear(secret);<NEW_LINE>return rv;<NEW_LINE>}<NEW_LINE>} | ] encapsulation = extSpec.getEncapsulation(); |
1,571,396 | private boolean testCount() {<NEW_LINE>final <MASK><NEW_LINE>final String dynWhere = getSQLWhere();<NEW_LINE>final StringBuilder sql = new StringBuilder(m_sqlCount);<NEW_LINE>if (dynWhere.length() > 0) {<NEW_LINE>// includes first AND<NEW_LINE>sql.append(dynWhere);<NEW_LINE>}<NEW_LINE>final IStringExpression sqlExpression = Services.get(IExpressionFactory.class).compile(sql.toString(), IStringExpression.class);<NEW_LINE>// onlyWindow=false<NEW_LINE>final Evaluatee evalCtx = Evaluatees.ofCtx(getCtx(), getWindowNo(), false);<NEW_LINE>// ignoreUnparsable=true<NEW_LINE>String countSql = sqlExpression.evaluate(evalCtx, true);<NEW_LINE>countSql = Env.getUserRolePermissions().addAccessSQL(countSql, getTableName(), IUserRolePermissions.SQL_FULLYQUALIFIED, Access.READ);<NEW_LINE>log.trace(countSql);<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>int no = -1;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(countSql, null);<NEW_LINE>setParameters(pstmt, true);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>no = rs.getInt(1);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.error(countSql, e);<NEW_LINE>no = -2;<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>log.debug("#" + no + " - " + (System.currentTimeMillis() - start) + "ms");<NEW_LINE>// Armen: add role checking (Patch #1694788 )<NEW_LINE>final GridTabMaxRowsRestrictionChecker maxRowsChecker = // .setAD_Role(role) // use default role<NEW_LINE>GridTabMaxRowsRestrictionChecker.builder().// .setGridTab(gridTab) // no grid tab available<NEW_LINE>build();<NEW_LINE>if (maxRowsChecker.isQueryMax(no)) {<NEW_LINE>return ADialog.ask(p_WindowNo, getWindow(), "InfoHighRecordCount", String.valueOf(no));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | long start = System.currentTimeMillis(); |
1,844,211 | protected void onCreate(Bundle bundle, boolean ready) {<NEW_LINE>setContentView(R.layout.profile_activity);<NEW_LINE>initializeResources();<NEW_LINE>setSupportActionBar(this.toolbar);<NEW_LINE>ActionBar supportActionBar = getSupportActionBar();<NEW_LINE>supportActionBar.setDisplayHomeAsUpEnabled(false);<NEW_LINE>supportActionBar.setCustomView(R.layout.conversation_title_view);<NEW_LINE>supportActionBar.setDisplayShowCustomEnabled(true);<NEW_LINE>supportActionBar.setDisplayShowTitleEnabled(false);<NEW_LINE>Toolbar parent = (Toolbar) supportActionBar.getCustomView().getParent();<NEW_LINE>parent.setPadding(0, 0, 0, 0);<NEW_LINE>parent.setContentInsetsAbsolute(0, 0);<NEW_LINE>titleView = (ConversationTitleView) supportActionBar.getCustomView();<NEW_LINE>titleView.setOnBackClickedListener(view -> onBackPressed());<NEW_LINE>titleView.setOnClickListener(view -> onEnlargeAvatar());<NEW_LINE>updateToolbar();<NEW_LINE><MASK><NEW_LINE>this.viewPager.setAdapter(new ProfilePagerAdapter(getSupportFragmentManager()));<NEW_LINE>int forceTab = getIntent().getIntExtra(FORCE_TAB_EXTRA, -1);<NEW_LINE>if (forceTab != -1) {<NEW_LINE>int forceIndex = tabs.indexOf(forceTab);<NEW_LINE>if (forceIndex != -1) {<NEW_LINE>this.viewPager.setCurrentItem(forceIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DcEventCenter eventCenter = DcHelper.getEventCenter(this);<NEW_LINE>eventCenter.addObserver(DcContext.DC_EVENT_CHAT_MODIFIED, this);<NEW_LINE>eventCenter.addObserver(DcContext.DC_EVENT_CONTACTS_CHANGED, this);<NEW_LINE>} | this.tabLayout.setupWithViewPager(viewPager); |
28,647 | public void executeAction(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>final String wfContentletId = request.getParameter("wfContentletId");<NEW_LINE>final String wfActionAssign = request.getParameter("wfActionAssign");<NEW_LINE>final String wfActionComments = request.getParameter("wfActionComments");<NEW_LINE>final String wfActionId = request.getParameter("wfActionId");<NEW_LINE>final String wfPublishDate = request.getParameter("wfPublishDate");<NEW_LINE>final String wfPublishTime = request.getParameter("wfPublishTime");<NEW_LINE>final String wfExpireDate = request.getParameter("wfExpireDate");<NEW_LINE>final String wfExpireTime = request.getParameter("wfExpireTime");<NEW_LINE>final String wfNeverExpire = request.getParameter("wfNeverExpire");<NEW_LINE>final String whereToSend = request.getParameter("whereToSend");<NEW_LINE>final WorkflowAPI workflowAPI = APILocator.getWorkflowAPI();<NEW_LINE>Contentlet contentlet = null;<NEW_LINE>// execute workflow<NEW_LINE>try {<NEW_LINE>final WorkflowAction action = workflowAPI.findAction(wfActionId, getUser());<NEW_LINE>if (action == null) {<NEW_LINE>throw new ServletException("No such workflow action");<NEW_LINE>}<NEW_LINE>contentlet = APILocator.getContentletAPI().find(wfContentletId, getUser(), false);<NEW_LINE>contentlet.setStringProperty("wfActionId", action.getId());<NEW_LINE>contentlet.setStringProperty("wfActionComments", wfActionComments);<NEW_LINE>contentlet.setStringProperty("wfActionAssign", wfActionAssign);<NEW_LINE>contentlet.setStringProperty("wfPublishDate", wfPublishDate);<NEW_LINE>contentlet.setStringProperty("wfPublishTime", wfPublishTime);<NEW_LINE>contentlet.setStringProperty("wfExpireDate", wfExpireDate);<NEW_LINE>contentlet.setStringProperty("wfExpireTime", wfExpireTime);<NEW_LINE>contentlet.setStringProperty("wfNeverExpire", wfNeverExpire);<NEW_LINE><MASK><NEW_LINE>APILocator.getWorkflowAPI().fireContentWorkflow(contentlet, new ContentletDependencies.Builder().respectAnonymousPermissions(PageMode.get(request).respectAnonPerms).modUser(getUser()).build());<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(WfTaskAjax.class, e.getMessage(), e);<NEW_LINE>writeError(response, e.getMessage());<NEW_LINE>throw new ServletException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>response.getWriter().println("SUCCESS:" + contentlet.getInode());<NEW_LINE>} | contentlet.setStringProperty("whereToSend", whereToSend); |
1,524,850 | public static List<URL> listFiles(URL directory) throws IOException {<NEW_LINE>List<URL> ret = new ArrayList<URL>();<NEW_LINE>String s = directory.toString();<NEW_LINE>if (s.startsWith("jar:")) {<NEW_LINE>String[] ss = s.substring("jar:".length()).split("!");<NEW_LINE>String path = ss[1];<NEW_LINE>URL target = new URL(ss[0]);<NEW_LINE>InputStream tin = target.openStream();<NEW_LINE>try {<NEW_LINE>JarInputStream jin = new JarInputStream(tin);<NEW_LINE>JarEntry je;<NEW_LINE>while ((je = jin.getNextJarEntry()) != null) {<NEW_LINE>String p = "/" + je.getName();<NEW_LINE>if (p.startsWith(path) && p.indexOf('/', path.length() + 1) < 0)<NEW_LINE>ret.add(new URL("jar:" <MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>tin.close();<NEW_LINE>}<NEW_LINE>} else if (s.startsWith("file:")) {<NEW_LINE>File f = new File(directory.getFile());<NEW_LINE>File[] ffs = f.listFiles();<NEW_LINE>if (ffs != null)<NEW_LINE>for (File ff : ffs) ret.add(ff.toURI().toURL());<NEW_LINE>} else<NEW_LINE>throw new IOException("Cannot list contents of " + directory);<NEW_LINE>return ret;<NEW_LINE>} | + target + "!" + p)); |
133,757 | private void addDraweeControllerListener(final View view) {<NEW_LINE>if (mDraweeControllerListener != null)<NEW_LINE>return;<NEW_LINE>if (!(view instanceof GenericDraweeView))<NEW_LINE>return;<NEW_LINE>GenericDraweeView imageView = (GenericDraweeView) view;<NEW_LINE>DraweeController controller = imageView.getController();<NEW_LINE>if (!(controller instanceof PipelineDraweeController))<NEW_LINE>return;<NEW_LINE>PipelineDraweeController pipelineController = (PipelineDraweeController) controller;<NEW_LINE>mDraweeControllerListener = new BaseControllerListener<ImageInfo>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSubmit(String id, Object callerContext) {<NEW_LINE>// Log.d(LOG_TAG, "mDraweeControllerListener.onSubmit: " + id + ", callerContext: " + callerContext);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFinalImageSet(String id, @Nullable final ImageInfo imageInfo, @Nullable Animatable animatable) {<NEW_LINE>// Log.d(LOG_TAG, "mDraweeControllerListener.onFinalImageSet: " + id + ", imageInfo: " + imageInfo);<NEW_LINE>removeDraweeControllerListener(view);<NEW_LINE>fetchInitialContent();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(String id, Throwable throwable) {<NEW_LINE>Log.d(LOG_TAG, <MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>pipelineController.addControllerListener(mDraweeControllerListener);<NEW_LINE>} | "mDraweeControllerListener.onFailure: " + id + ", throwable: " + throwable); |
37,359 | public SettableFuture<Connection> sendMessage(Connection connection, NetworkEnvelope networkEnvelope) {<NEW_LINE>// connection.sendMessage might take a bit (compression, write to stream), so we use a thread to not block<NEW_LINE>ListenableFuture<Connection> future = executorService.submit(() -> {<NEW_LINE>String id = connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get().getFullAddress() : connection.getUid();<NEW_LINE>Thread.currentThread().setName("NetworkNode:SendMessage-to-" + id);<NEW_LINE>connection.sendMessage(networkEnvelope);<NEW_LINE>return connection;<NEW_LINE>});<NEW_LINE>final SettableFuture<Connection<MASK><NEW_LINE>Futures.addCallback(future, new FutureCallback<Connection>() {<NEW_LINE><NEW_LINE>public void onSuccess(Connection connection) {<NEW_LINE>UserThread.execute(() -> resultFuture.set(connection));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void onFailure(@NotNull Throwable throwable) {<NEW_LINE>UserThread.execute(() -> resultFuture.setException(throwable));<NEW_LINE>}<NEW_LINE>}, MoreExecutors.directExecutor());<NEW_LINE>return resultFuture;<NEW_LINE>} | > resultFuture = SettableFuture.create(); |
766,544 | public Object execute(Object[] parameters) {<NEW_LINE>if (getAnnotation(this.entityType.getSuperclass(), DiscriminatorField.class) != null) {<NEW_LINE>throw new DatastoreDataException("Can't append discrimination condition");<NEW_LINE>}<NEW_LINE>ParsedQueryWithTagsAndValues parsedQueryWithTagsAndValues = new ParsedQueryWithTagsAndValues(this.originalParamTags, parameters);<NEW_LINE>GqlQuery query = parsedQueryWithTagsAndValues.bindArgsToGqlQuery();<NEW_LINE>Class returnedItemType = this.queryMethod.getReturnedObjectType();<NEW_LINE>boolean isNonEntityReturnType = isNonEntityReturnedType(returnedItemType);<NEW_LINE>DatastoreResultsIterable found = isNonEntityReturnType ? this.datastoreOperations.queryIterable(query, GqlDatastoreQuery::getNonEntityObjectFromRow) : this.datastoreOperations.queryKeysOrEntities(query, this.entityType);<NEW_LINE>Object result;<NEW_LINE>if (isPageQuery() || isSliceQuery()) {<NEW_LINE>result = buildPageOrSlice(parameters, parsedQueryWithTagsAndValues, found);<NEW_LINE>} else if (this.queryMethod.isCollectionQuery()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>result = convertSingularResult(returnedItemType, isNonEntityReturnType, found);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = convertCollectionResult(returnedItemType, found); |
1,700,910 | public void write(org.apache.thrift.protocol.TProtocol prot, startConditionalUpdate_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetAuthorizations()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableID()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetDurability()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetClassLoaderContext()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 6);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetAuthorizations()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(struct.authorizations.size());<NEW_LINE>for (java.nio.ByteBuffer _iter272 : struct.authorizations) {<NEW_LINE>oprot.writeBinary(_iter272);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetTableID()) {<NEW_LINE>oprot.writeString(struct.tableID);<NEW_LINE>}<NEW_LINE>if (struct.isSetDurability()) {<NEW_LINE>oprot.writeI32(<MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetClassLoaderContext()) {<NEW_LINE>oprot.writeString(struct.classLoaderContext);<NEW_LINE>}<NEW_LINE>} | struct.durability.getValue()); |
1,603,982 | public static void main(String[] args) {<NEW_LINE>final MetricsAdvisorAsyncClient advisorAsyncClient = new MetricsAdvisorClientBuilder().endpoint("https://{endpoint}.cognitiveservices.azure.com/").credential(new MetricsAdvisorKeyCredential("subscription_key", "api_key")).buildAsyncClient();<NEW_LINE>final String detectionConfigurationId = "e87d899d-a5a0-4259-b752-11aea34d5e34";<NEW_LINE>final DimensionKey seriesKey = new DimensionKey().put("Dim1", "Common Lime"<MASK><NEW_LINE>final OffsetDateTime startTime = OffsetDateTime.parse("2020-08-12T00:00:00Z");<NEW_LINE>final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-12T00:00:00Z");<NEW_LINE>PagedFlux<MetricEnrichedSeriesData> enrichedDataFlux = advisorAsyncClient.listMetricEnrichedSeriesData(detectionConfigurationId, Arrays.asList(seriesKey), startTime, endTime);<NEW_LINE>enrichedDataFlux.doOnNext(enrichedData -> {<NEW_LINE>System.out.printf("Series Key %s%n:", enrichedData.getSeriesKey().asMap());<NEW_LINE>System.out.println("List of data points for this series");<NEW_LINE>System.out.println(enrichedData.getMetricValues());<NEW_LINE>System.out.println("Timestamps of the data related to this time series:");<NEW_LINE>System.out.println(enrichedData.getTimestamps());<NEW_LINE>System.out.println("The expected values of the data points calculated by the smart detector:");<NEW_LINE>System.out.println(enrichedData.getExpectedMetricValues());<NEW_LINE>System.out.println("The lower boundary values of the data points calculated by smart detector:");<NEW_LINE>System.out.println(enrichedData.getLowerBoundaryValues());<NEW_LINE>System.out.println("the periods calculated for the data points in the time series:");<NEW_LINE>System.out.println(enrichedData.getPeriods());<NEW_LINE>}).blockLast();<NEW_LINE>} | ).put("Dim2", "Antelope"); |
930,457 | private void installSnapshot(Map<Integer, FileSnapshot> snapshotMap, boolean isDataMigration) throws SnapshotInstallationException {<NEW_LINE>// In data migration, meta group member other than new node does not need to synchronize the<NEW_LINE>// leader, because data migration must be carried out after meta group applied add/remove node<NEW_LINE>// log.<NEW_LINE>dataGroupMember.getMetaGroupMember().syncLocalApply(dataGroupMember.getMetaGroupMember().getPartitionTable().getLastMetaLogIndex() - 1, false);<NEW_LINE>for (Entry<Integer, FileSnapshot> integerSnapshotEntry : snapshotMap.entrySet()) {<NEW_LINE>Integer slot = integerSnapshotEntry.getKey();<NEW_LINE>FileSnapshot snapshot = integerSnapshotEntry.getValue();<NEW_LINE>installFileSnapshotSchema(snapshot);<NEW_LINE>if (isDataMigration) {<NEW_LINE>SlotStatus status = slotManager.getStatus(slot);<NEW_LINE>if (status == SlotStatus.PULLING) {<NEW_LINE>// as schemas are set, writes can proceed<NEW_LINE>slotManager.setToPullingWritable(slot, false);<NEW_LINE>logger.debug("{}: slot {} is now pulling writable", name, slot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDataMigration) {<NEW_LINE>slotManager.save();<NEW_LINE>}<NEW_LINE>for (Entry<Integer, FileSnapshot> integerSnapshotEntry : snapshotMap.entrySet()) {<NEW_LINE>Integer slot = integerSnapshotEntry.getKey();<NEW_LINE>FileSnapshot snapshot = integerSnapshotEntry.getValue();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (PullFileException e) {<NEW_LINE>throw new SnapshotInstallationException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>slotManager.save();<NEW_LINE>} | installFileSnapshotFiles(snapshot, slot, isDataMigration); |
1,134,686 | public Note updateNote(Note note, boolean updateLastModification) {<NEW_LINE>db = getDatabase(true);<NEW_LINE>String content = Boolean.TRUE.equals(note.isLocked()) ? Security.encrypt(note.getContent(), Prefs.getString(PREF_PASSWORD, ""<MASK><NEW_LINE>// To ensure note and attachments insertions are atomic and boost performances transaction are used<NEW_LINE>db.beginTransaction();<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(KEY_TITLE, note.getTitle());<NEW_LINE>values.put(KEY_CONTENT, content);<NEW_LINE>values.put(KEY_CREATION, note.getCreation() != null ? note.getCreation() : Calendar.getInstance().getTimeInMillis());<NEW_LINE>long lastModification = note.getLastModification() != null && !updateLastModification ? note.getLastModification() : Calendar.getInstance().getTimeInMillis();<NEW_LINE>values.put(KEY_LAST_MODIFICATION, lastModification);<NEW_LINE>values.put(KEY_ARCHIVED, note.isArchived());<NEW_LINE>values.put(KEY_TRASHED, note.isTrashed());<NEW_LINE>values.put(KEY_REMINDER, note.getAlarm());<NEW_LINE>values.put(KEY_REMINDER_FIRED, note.isReminderFired());<NEW_LINE>values.put(KEY_RECURRENCE_RULE, note.getRecurrenceRule());<NEW_LINE>values.put(KEY_LATITUDE, note.getLatitude());<NEW_LINE>values.put(KEY_LONGITUDE, note.getLongitude());<NEW_LINE>values.put(KEY_ADDRESS, note.getAddress());<NEW_LINE>values.put(KEY_CATEGORY, note.getCategory() != null ? note.getCategory().getId() : null);<NEW_LINE>values.put(KEY_LOCKED, note.isLocked() != null && note.isLocked());<NEW_LINE>values.put(KEY_CHECKLIST, note.isChecklist() != null && note.isChecklist());<NEW_LINE>db.insertWithOnConflict(TABLE_NOTES, KEY_ID, values, SQLiteDatabase.CONFLICT_REPLACE);<NEW_LINE>LogDelegate.d("Updated note titled '" + note.getTitle() + "'");<NEW_LINE>// Updating attachments<NEW_LINE>List<Attachment> deletedAttachments = note.getAttachmentsListOld();<NEW_LINE>for (Attachment attachment : note.getAttachmentsList()) {<NEW_LINE>updateAttachment(note.get_id() != null ? note.get_id() : values.getAsLong(KEY_CREATION), attachment, db);<NEW_LINE>deletedAttachments.remove(attachment);<NEW_LINE>}<NEW_LINE>// Remove from database deleted attachments<NEW_LINE>for (Attachment attachmentDeleted : deletedAttachments) {<NEW_LINE>db.delete(TABLE_ATTACHMENTS, KEY_ATTACHMENT_ID + " = ?", new String[] { String.valueOf(attachmentDeleted.getId()) });<NEW_LINE>}<NEW_LINE>db.setTransactionSuccessful();<NEW_LINE>db.endTransaction();<NEW_LINE>// Fill the note with correct data before returning it<NEW_LINE>note.setCreation(note.getCreation() != null ? note.getCreation() : values.getAsLong(KEY_CREATION));<NEW_LINE>note.setLastModification(values.getAsLong(KEY_LAST_MODIFICATION));<NEW_LINE>return note;<NEW_LINE>} | )) : note.getContent(); |
645,944 | private void consulLoad(final Supplier<ConfigLoader.Context> context, final ConfigLoader.LoaderHandler<ConsulConfig> handler, final ConsulConfig config) {<NEW_LINE>if (config != null) {<NEW_LINE>check(config);<NEW_LINE>if (Objects.isNull(client)) {<NEW_LINE>client = ConsulClient.getInstance(config);<NEW_LINE>}<NEW_LINE>if (config.isUpdate()) {<NEW_LINE>client.put(config.getKey(), FileUtils.readYAML(config.getUpdateFileName()));<NEW_LINE>}<NEW_LINE>LOGGER.info("loader consul config: {}", config);<NEW_LINE><MASK><NEW_LINE>PropertyLoader propertyLoader = LOADERS.get(fileExtension);<NEW_LINE>if (propertyLoader == null) {<NEW_LINE>throw new ConfigException("consul.fileExtension setting error, The loader was not found");<NEW_LINE>}<NEW_LINE>InputStream pull = client.pull(config);<NEW_LINE>Optional.ofNullable(pull).map(e -> propertyLoader.load("remote.consul." + fileExtension, e)).ifPresent(e -> context.get().getOriginal().load(() -> context.get().withSources(e), this::consulFinish));<NEW_LINE>handler.finish(context, config);<NEW_LINE>try {<NEW_LINE>client.addListener(context, (c1, c2) -> this.passive(c1, null, c2), config);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("passive consul remote started error....");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ConfigException("consul config is null");<NEW_LINE>}<NEW_LINE>} | String fileExtension = config.getFileExtension(); |
1,122,773 | public static String trimIndent(String text) {<NEW_LINE>int indentLevel = indentLevel(text);<NEW_LINE>StringBuilder trimmed = new StringBuilder();<NEW_LINE>AtomicBoolean dropWhile = new AtomicBoolean(false);<NEW_LINE>int[] charArray = text.replaceAll("\\s+$", "").chars().filter(c -> {<NEW_LINE>dropWhile.set(dropWhile.get() || !(c <MASK><NEW_LINE>return dropWhile.get();<NEW_LINE>}).toArray();<NEW_LINE>for (int i = 0; i < charArray.length; i++) {<NEW_LINE>boolean nonWhitespaceEncountered = false;<NEW_LINE>int j = i;<NEW_LINE>for (; j < charArray.length; j++) {<NEW_LINE>int c = charArray[j];<NEW_LINE>if (j - i >= indentLevel || (nonWhitespaceEncountered |= !Character.isWhitespace(c))) {<NEW_LINE>trimmed.append((char) c);<NEW_LINE>}<NEW_LINE>if (c == '\r' || c == '\n') {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>i = j;<NEW_LINE>}<NEW_LINE>return trimmed.toString();<NEW_LINE>} | == '\n' || c == '\r')); |
1,729,781 | AlphaClusterDiscovery alphaClusterAddress(@Value("${alpha.cluster.serviceId:servicecomb-alpha-server}") String serviceId, @Value("${alpha.cluster.address:0.0.0.0:8080}") String[] addresses) {<NEW_LINE>StringBuffer serviceUrls = new StringBuffer();<NEW_LINE>String[] alphaAddresses = this.getAlphaAddress(serviceId);<NEW_LINE>LOG.info("alphaAddress = {}"<MASK><NEW_LINE>if (alphaAddresses.length > 0) {<NEW_LINE>AlphaClusterDiscovery alphaClusterDiscovery = AlphaClusterDiscovery.builder().discoveryType(AlphaClusterDiscovery.DiscoveryType.NACOS).discoveryInfo(serviceUrls.toString()).addresses(alphaAddresses).build();<NEW_LINE>return alphaClusterDiscovery;<NEW_LINE>} else {<NEW_LINE>AlphaClusterDiscovery alphaClusterDiscovery = AlphaClusterDiscovery.builder().discoveryType(AlphaClusterDiscovery.DiscoveryType.DEFAULT).addresses(addresses).build();<NEW_LINE>return alphaClusterDiscovery;<NEW_LINE>}<NEW_LINE>} | , Arrays.toString(alphaAddresses)); |
1,043,268 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>PHONE_STRING = getResources().getString(R.string.my_phone);<NEW_LINE>mDB = DBHelper.getReadableDatabase(this);<NEW_LINE>syncManager = new SyncManager(this);<NEW_LINE>adapter = new WorkoutAccountListAdapter(this);<NEW_LINE>ExpandableListView list = findViewById(R.id.expandable_list_view);<NEW_LINE>list.setAdapter(adapter);<NEW_LINE>deleteButton = findViewById(R.id.delete_workout_button);<NEW_LINE>deleteButton.setOnClickListener(deleteButtonClick);<NEW_LINE>createButton = findViewById(R.id.create_workout_button);<NEW_LINE>createButton.setOnClickListener(createButtonClick);<NEW_LINE>shareButton = findViewById(R.id.share_workout_button);<NEW_LINE>shareButton.setOnClickListener(shareButtonClick);<NEW_LINE>editButton = findViewById(R.id.edit_workout_button);<NEW_LINE>editButton.setOnClickListener(editButtonClick);<NEW_LINE>handleButtons();<NEW_LINE>requery();<NEW_LINE>listLocal();<NEW_LINE>list.expandGroup(0);<NEW_LINE>Uri data = getIntent().getData();<NEW_LINE>if (data != null) {<NEW_LINE>getIntent().setData(null);<NEW_LINE>String fileName = getFilename(data);<NEW_LINE>if (fileName == null)<NEW_LINE>fileName = "noname";<NEW_LINE>try {<NEW_LINE>importData(fileName, data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>new AlertDialog.Builder(this).setTitle(R.string.Error).setMessage(getString(R.string.Failed_to_import) + ": " + fileName).setPositiveButton(R.string.OK, (dialog, which) -> {<NEW_LINE>dialog.dismiss();<NEW_LINE>ManageWorkoutsActivity.this.finish();<NEW_LINE>}).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// launch home Activity (with FLAG_ACTIVITY_CLEAR_TOP)<NEW_LINE>} | setContentView(R.layout.manage_workouts); |
1,504,228 | protected I_C_DunningDoc_Line_Source createDunningDocLineSource(final I_C_Dunning_Candidate candidate) {<NEW_LINE>final IDunningDAO dunningDAO = <MASK><NEW_LINE>if (dunningDocLine.getC_DunningDoc_Line_ID() <= 0) {<NEW_LINE>dunningDAO.save(dunningDocLine);<NEW_LINE>}<NEW_LINE>final I_C_DunningDoc_Line_Source source = dunningDAO.newInstance(getDunningContext(), I_C_DunningDoc_Line_Source.class);<NEW_LINE>source.setAD_Org_ID(candidate.getAD_Org_ID());<NEW_LINE>source.setC_Dunning_Candidate(candidate);<NEW_LINE>source.setC_DunningDoc_Line(dunningDocLine);<NEW_LINE>source.setProcessed(false);<NEW_LINE>source.setIsActive(true);<NEW_LINE>source.setIsWriteOff(candidate.isWriteOff());<NEW_LINE>source.setIsWriteOffApplied(false);<NEW_LINE>dunningDAO.save(source);<NEW_LINE>dunningDocLineSources.add(source);<NEW_LINE>return source;<NEW_LINE>} | Services.get(IDunningDAO.class); |
89,937 | final SetIdentityPoolRolesResult executeSetIdentityPoolRoles(SetIdentityPoolRolesRequest setIdentityPoolRolesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setIdentityPoolRolesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetIdentityPoolRolesRequest> request = null;<NEW_LINE>Response<SetIdentityPoolRolesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetIdentityPoolRolesRequestProtocolMarshaller(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, "Cognito Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetIdentityPoolRoles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SetIdentityPoolRolesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetIdentityPoolRolesResultJsonUnmarshaller());<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(setIdentityPoolRolesRequest)); |
1,424,651 | public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) throws CancelledException {<NEW_LINE>Memory memory = program.getMemory();<NEW_LINE>AddressSetView validMemorySet = memory.getLoadedAndInitializedAddressSet();<NEW_LINE>AddressSetView searchSet = set.intersect(validMemorySet);<NEW_LINE>if (searchSet.isEmpty()) {<NEW_LINE>// no valid addresses to search<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>MemoryBytePatternSearcher searcher = new MemoryBytePatternSearcher("Embedded Media");<NEW_LINE>List<Address> foundMedia = new ArrayList<>();<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new GifDataType(), "GIF 87", GifDataType.MAGIC_87, GifDataType.GIFMASK);<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new GifDataType(), "GIF 89", GifDataType.MAGIC_89, GifDataType.GIFMASK);<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new PngDataType(), "PNG", PngDataType.MAGIC, PngDataType.MASK);<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new JPEGDataType(), "JPEG", JPEGDataType.MAGIC, JPEGDataType.MAGIC_MASK);<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new WAVEDataType(), "WAVE", WAVEDataType.MAGIC, WAVEDataType.MAGIC_MASK);<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new AUDataType(), "AU", AUDataType.MAGIC, AUDataType.MAGIC_MASK);<NEW_LINE>addByteSearchPattern(searcher, program, foundMedia, new AIFFDataType(), "AIFF", AIFFDataType.MAGIC, AIFFDataType.MAGIC_MASK);<NEW_LINE>searcher.search(program, searchSet, monitor);<NEW_LINE><MASK><NEW_LINE>} | return foundMedia.size() > 0; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.