idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
855,450 | private List<MBeanParameterInfo[]> extractMBeanParameterInfos(MBeanServerConnection pServer, JmxExecRequest pRequest, String pOperation) throws InstanceNotFoundException, ReflectionException, IOException {<NEW_LINE>try {<NEW_LINE>MBeanInfo mBeanInfo = pServer.getMBeanInfo(pRequest.getObjectName());<NEW_LINE>List<MBeanParameterInfo[]> paramInfos = new ArrayList<MBeanParameterInfo[]>();<NEW_LINE>for (MBeanOperationInfo opInfo : mBeanInfo.getOperations()) {<NEW_LINE>if (opInfo.getName().equals(pOperation)) {<NEW_LINE>paramInfos.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (paramInfos.size() == 0) {<NEW_LINE>throw new IllegalArgumentException("No operation " + pOperation + " found on MBean " + pRequest.getObjectNameAsString());<NEW_LINE>}<NEW_LINE>return paramInfos;<NEW_LINE>} catch (IntrospectionException e) {<NEW_LINE>throw new IllegalStateException("Cannot extract MBeanInfo for " + pRequest.getObjectNameAsString(), e);<NEW_LINE>}<NEW_LINE>} | add(opInfo.getSignature()); |
648,657 | final GetDistributionConfigurationResult executeGetDistributionConfiguration(GetDistributionConfigurationRequest getDistributionConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDistributionConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDistributionConfigurationRequest> request = null;<NEW_LINE>Response<GetDistributionConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDistributionConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDistributionConfigurationRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDistributionConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDistributionConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDistributionConfigurationResultJsonUnmarshaller());<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>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
834,674 | public final void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>DataContext dataContext = e.getDataContext();<NEW_LINE>final Project project = e.getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project == null)<NEW_LINE>return;<NEW_LINE>PsiDocumentManager.<MASK><NEW_LINE>final Editor editor = e.getData(CommonDataKeys.EDITOR);<NEW_LINE>final PsiElement[] elements = getPsiElementArray(dataContext);<NEW_LINE>int eventCount = IdeEventQueue.getInstance().getEventCount();<NEW_LINE>RefactoringActionHandler handler;<NEW_LINE>try {<NEW_LINE>handler = getHandler(dataContext);<NEW_LINE>} catch (ProcessCanceledException ignored) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (handler == null) {<NEW_LINE>CommonRefactoringUtil.showErrorHint(project, editor, RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("error.wrong.caret.position.symbol.to.refactor")), RefactoringBundle.getCannotRefactorMessage(null), null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!InplaceRefactoring.canStartAnotherRefactoring(editor, project, handler, elements)) {<NEW_LINE>InplaceRefactoring.unableToStartWarning(project, editor);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (InplaceRefactoring.getActiveInplaceRenamer(editor) == null) {<NEW_LINE>final LookupEx lookup = LookupManager.getActiveLookup(editor);<NEW_LINE>if (lookup instanceof LookupImpl) {<NEW_LINE>Runnable command = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>((LookupImpl) lookup).finishLookup(Lookup.NORMAL_SELECT_CHAR);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>assert editor != null;<NEW_LINE>Document doc = editor.getDocument();<NEW_LINE>DocCommandGroupId group = DocCommandGroupId.noneGroupId(doc);<NEW_LINE>CommandProcessor.getInstance().executeCommand(editor.getProject(), command, "Completion", group, UndoConfirmationPolicy.DEFAULT, doc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IdeEventQueue.getInstance().setEventCount(eventCount);<NEW_LINE>if (editor != null) {<NEW_LINE>final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());<NEW_LINE>if (file == null)<NEW_LINE>return;<NEW_LINE>DaemonCodeAnalyzer.getInstance(project).autoImportReferenceAtCursor(editor, file);<NEW_LINE>handler.invoke(project, editor, file, dataContext);<NEW_LINE>} else {<NEW_LINE>handler.invoke(project, elements, dataContext);<NEW_LINE>}<NEW_LINE>} | getInstance(project).commitAllDocuments(); |
1,591,423 | public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.userId, convLabelName("User Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.userId, convLabelName("User Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.kind, convLabelName("Kind"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.kind, convLabelName("Kind"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.target, convLabelName("Target"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.target, convLabelName("Target"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | .deleteFlag, convLabelName("Delete Flag")); |
1,092,358 | public K ceiling(K e) {<NEW_LINE>java.lang.Comparable<K> object = map.comparator() == null ? toComparable((K) e) : null;<NEW_LINE>Entry<K, V> node = <MASK><NEW_LINE>if (node != null && !map.checkUpperBound(node.key)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (node != null && !map.checkLowerBound(node.key)) {<NEW_LINE>Entry<K, V> first = map.loInclusive ? map.m.findFloorEntry(map.lo) : map.m.findLowerEntry(map.lo);<NEW_LINE>if (first != null && map.cmp(object, e, first.key) <= 0 && map.checkUpperBound(first.key)) {<NEW_LINE>node = first;<NEW_LINE>} else {<NEW_LINE>node = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return node == null ? null : node.key;<NEW_LINE>} | map.m.findFloorEntry(e); |
991,587 | protected void dynInit() throws Exception {<NEW_LINE>m_AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());<NEW_LINE>c_AcctSchema_ID = DB.getSQLValue(null, "SELECT MIN(C_AcctSchema_ID) FROM C_AcctSchema WHERE AD_CLient_ID=?", m_AD_Client_ID);<NEW_LINE>MElementValue reEl = (MElementValue) MAcctSchemaGL.get(Env.getCtx(), c_AcctSchema_ID).getRetainedEarning_A().getAccount();<NEW_LINE>RETAIN_EARNING_ELEMENT_ID = reEl.getC_ElementValue_ID();<NEW_LINE>RETAIN_EARNING_ELEMENT_VALUE = reEl.getValue();<NEW_LINE>pa_ReportCube_ID = DB.getSQLValue(null, "SELECT MIN(PA_ReportCube_ID) FROM PA_ReportCube WHERE isactive='Y' AND isuser1dim='Y' AND isactivitydim='N' AND isbpartnerdim='N' AND " + <MASK><NEW_LINE>} | " iscampaigndim='N' AND isglbudgetdim='N' AND islocfromdim='N' AND isloctodim='N' AND isorgtrxdim='N' AND isproductdim='N' AND isprojectdim='N' AND " + " isprojectphasedim='N' AND isprojecttaskdim='N' AND issalesregiondim='N' AND issubacctdim='N' AND isuser2dim='N' AND isuserelement2dim='N' AND isuserelement1dim='N'" + " AND AD_Client_ID=" + m_AD_Client_ID); |
1,809,145 | // /////////////////////////<NEW_LINE>// ActionListener method //<NEW_LINE>// /////////////////////////<NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>Object source = e.getSource();<NEW_LINE>if (source == cancelButton) {<NEW_LINE>dispose();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// otherwise, searchButton was pressed<NEW_LINE>if (!validateAndUpdateValues())<NEW_LINE>return;<NEW_LINE>String searchIn = searchInField.getText();<NEW_LINE>AbstractFile file = FileFactory.getFile(searchIn);<NEW_LINE>if (file == null || !file.exists()) {<NEW_LINE>searchInField.setBorder(BorderFactory.createLineBorder(Color.RED, 1));<NEW_LINE>searchInField.setToolTipText(Translator.get("folder_does_not_exist"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileURL fileURL = SearchUtils.toSearchURL(file);<NEW_LINE>fileURL.<MASK><NEW_LINE>String searchQuery = getSearchQuery();<NEW_LINE>if (!searchQuery.isEmpty())<NEW_LINE>fileURL.setQuery(searchQuery);<NEW_LINE>dispose();<NEW_LINE>mainFrame.getActivePanel().tryChangeCurrentFolder(fileURL);<NEW_LINE>} | setPath(searchFilesField.getText()); |
1,430,649 | public void announceBackgroundJobServer(BackgroundJobServerStatus serverStatus) {<NEW_LINE>try (final Jedis jedis = getJedis();<NEW_LINE>final Transaction t = jedis.multi()) {<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_ID, serverStatus.getId().toString());<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_WORKER_POOL_SIZE, String.valueOf(serverStatus.getWorkerPoolSize()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_POLL_INTERVAL_IN_SECONDS, String.valueOf(serverStatus.getPollIntervalInSeconds()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_DELETE_SUCCEEDED_JOBS_AFTER, String.valueOf(serverStatus.getDeleteSucceededJobsAfter()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_DELETE_DELETED_JOBS_AFTER, String.valueOf(serverStatus.getPermanentlyDeleteDeletedJobsAfter()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_FIRST_HEARTBEAT, String.valueOf(serverStatus.getFirstHeartbeat()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_LAST_HEARTBEAT, String.valueOf(serverStatus.getLastHeartbeat()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_IS_RUNNING, String.valueOf(serverStatus.isRunning()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_TOTAL_MEMORY, String.valueOf(serverStatus.getSystemTotalMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_FREE_MEMORY, String.valueOf<MASK><NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_CPU_LOAD, String.valueOf(serverStatus.getSystemCpuLoad()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_MAX_MEMORY, String.valueOf(serverStatus.getProcessMaxMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_FREE_MEMORY, String.valueOf(serverStatus.getProcessFreeMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_ALLOCATED_MEMORY, String.valueOf(serverStatus.getProcessAllocatedMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_CPU_LOAD, String.valueOf(serverStatus.getProcessCpuLoad()));<NEW_LINE>t.zadd(backgroundJobServersCreatedKey(keyPrefix), toMicroSeconds(now()), serverStatus.getId().toString());<NEW_LINE>t.zadd(backgroundJobServersUpdatedKey(keyPrefix), toMicroSeconds(now()), serverStatus.getId().toString());<NEW_LINE>t.exec();<NEW_LINE>}<NEW_LINE>} | (serverStatus.getSystemFreeMemory())); |
286,150 | private int[] longestPath(TreeNode root) {<NEW_LINE>if (root == null) {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>int increasing = 1;<NEW_LINE>int decreasing = 1;<NEW_LINE>if (root.left != null) {<NEW_LINE>int[] left = longestPath(root.left);<NEW_LINE>if (root.val == root.left.val + 1) {<NEW_LINE>decreasing = left[1] + 1;<NEW_LINE>} else if (root.val == root.left.val - 1) {<NEW_LINE>increasing = left[0] + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (root.right != null) {<NEW_LINE>int[] right = longestPath(root.right);<NEW_LINE>if (root.val == root.right.val + 1) {<NEW_LINE>decreasing = Math.max(right[1] + 1, decreasing);<NEW_LINE>} else if (root.val == root.right.val - 1) {<NEW_LINE>increasing = Math.max(right[0] + 1, increasing);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>max = Math.max(max, decreasing + increasing - 1);<NEW_LINE>return new int[] { increasing, decreasing };<NEW_LINE>} | int[] { 0, 0 }; |
182,275 | private void sendEvent(Address subscriber, EventEnvelope eventEnvelope, int orderKey) {<NEW_LINE>String serviceName = eventEnvelope.getServiceName();<NEW_LINE>EventServiceSegment segment = getSegment(serviceName, true);<NEW_LINE>boolean sync = segment.incrementPublish() % eventSyncFrequency == 0;<NEW_LINE>if (sync) {<NEW_LINE>SendEventOperation op = new SendEventOperation(eventEnvelope, orderKey);<NEW_LINE>Future f = nodeEngine.getOperationService().createInvocationBuilder(serviceName, op, subscriber).setTryCount(SEND_RETRY_COUNT).invoke();<NEW_LINE>try {<NEW_LINE>f.get(sendEventSyncTimeoutMillis, MILLISECONDS);<NEW_LINE>} catch (Exception e) {<NEW_LINE>syncDeliveryFailureCount.inc();<NEW_LINE>if (logger.isFinestEnabled()) {<NEW_LINE>logger.finest("Sync event delivery failed. Event: " + eventEnvelope, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Packet packet = new Packet(serializationService.toBytes(eventEnvelope), orderKey).<MASK><NEW_LINE>ServerConnectionManager cm = nodeEngine.getNode().getServer().getConnectionManager(MEMBER);<NEW_LINE>if (!cm.transmit(packet, subscriber)) {<NEW_LINE>if (nodeEngine.isRunning()) {<NEW_LINE>logFailure("Failed to send event packet to: %s, connection might not be alive.", subscriber);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setPacketType(Packet.Type.EVENT); |
1,050,674 | public BundleEntity postBundles(BundlesBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling postBundles");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/bundles";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<BundleEntity> localVarReturnType = new GenericType<BundleEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
1,270,303 | private boolean addChecksFromExplicitAccessRequiredAnnos(final AdminCommand command, final List<AccessCheckWork> accessChecks, final boolean isTaggable) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {<NEW_LINE>boolean isAnnotated = false;<NEW_LINE>for (ClassLineageIterator cIt = new ClassLineageIterator(command.getClass()); cIt.hasNext(); ) {<NEW_LINE>final Class<?> c = cIt.next();<NEW_LINE>final AccessRequired ar = c.getAnnotation(AccessRequired.class);<NEW_LINE>if (ar != null) {<NEW_LINE>isAnnotated = true;<NEW_LINE>addAccessChecksFromAnno(ar, command, accessChecks, c, isTaggable);<NEW_LINE>}<NEW_LINE>final AccessRequired.List arList = c.getAnnotation(AccessRequired.List.class);<NEW_LINE>if (arList != null) {<NEW_LINE>isAnnotated = true;<NEW_LINE>for (final AccessRequired repeatedAR : arList.value()) {<NEW_LINE>addAccessChecksFromAnno(repeatedAR, command, accessChecks, c, isTaggable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isAnnotated |= addAccessChecksFromFields(<MASK><NEW_LINE>}<NEW_LINE>return isAnnotated;<NEW_LINE>} | c, command, accessChecks, isTaggable); |
1,493,500 | public static DetailsHandle createDetailsArea(final String[] detailsItems, JComponent chartContainer) {<NEW_LINE>final HTMLTextArea detailsArea = new HTMLTextArea();<NEW_LINE>detailsArea.setBorder(BorderFactory.createEmptyBorder(8, 10, 0, 10));<NEW_LINE>detailsArea.setText(createDetailsString(detailsItems, null));<NEW_LINE>BorderLayout containerLayout = (BorderLayout) chartContainer.getLayout();<NEW_LINE>JComponent containerNorth = (JComponent) containerLayout.getLayoutComponent(BorderLayout.NORTH);<NEW_LINE>containerNorth.add(detailsArea, BorderLayout.CENTER);<NEW_LINE>final JComponent containerCenter = (JComponent) containerLayout.getLayoutComponent(BorderLayout.CENTER);<NEW_LINE>containerCenter.setBorder(BorderFactory.createEmptyBorder(6, 10, 0, 0));<NEW_LINE>chartContainer.addComponentListener(new ComponentAdapter() {<NEW_LINE><NEW_LINE>public void componentResized(ComponentEvent e) {<NEW_LINE>boolean visible = e.getComponent().getHeight() > DETAILS_HEIGHT_THRESHOLD;<NEW_LINE>detailsArea.setVisible(visible);<NEW_LINE>containerCenter.setBorder(BorderFactory.createEmptyBorder(visible ? 6 : 10, 10, 0, 0));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return new DetailsHandle() {<NEW_LINE><NEW_LINE>public void updateDetails(String[] details) {<NEW_LINE>try {<NEW_LINE>int selStart = detailsArea.getSelectionStart();<NEW_LINE>int selEnd = detailsArea.getSelectionEnd();<NEW_LINE>detailsArea.setText(createDetailsString(detailsItems, details));<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | detailsArea.select(selStart, selEnd); |
820,795 | private int scanIdentifier() {<NEW_LINE>final int start = position;<NEW_LINE>// Make sure first character is valid start character.<NEW_LINE>if (ch0 == '\\' && ch1 == 'u') {<NEW_LINE>skip(2);<NEW_LINE>final int ch = unicodeEscapeSequence(TokenType.IDENT);<NEW_LINE>if (!Character.isJavaIdentifierStart(ch)) {<NEW_LINE>error(Lexer.message("illegal.identifier.character"), TokenType.IDENT, start, position);<NEW_LINE>}<NEW_LINE>} else if (!Character.isJavaIdentifierStart(ch0)) {<NEW_LINE>// Not an identifier.<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// Make sure remaining characters are valid part characters.<NEW_LINE>while (!atEOF()) {<NEW_LINE>if (ch0 == '\\' && ch1 == 'u') {<NEW_LINE>skip(2);<NEW_LINE>final int <MASK><NEW_LINE>if (!Character.isJavaIdentifierPart(ch)) {<NEW_LINE>error(Lexer.message("illegal.identifier.character"), TokenType.IDENT, start, position);<NEW_LINE>}<NEW_LINE>} else if (Character.isJavaIdentifierPart(ch0)) {<NEW_LINE>skip(1);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Length of identifier sequence.<NEW_LINE>return position - start;<NEW_LINE>} | ch = unicodeEscapeSequence(TokenType.IDENT); |
959,730 | /*<NEW_LINE>* Adds a new file entry to the ZIP output stream.<NEW_LINE>*/<NEW_LINE>public static boolean addFileToZip(@Nonnull ZipOutputStream zos, @Nonnull File file, @Nonnull String relativeName, @Nullable Set<String> writtenItemRelativePaths, @Nullable FileFilter fileFilter, @Nonnull FileContentProcessor contentProcessor) throws IOException {<NEW_LINE>while (relativeName.length() != 0 && relativeName.charAt(0) == '/') {<NEW_LINE>relativeName = relativeName.substring(1);<NEW_LINE>}<NEW_LINE>boolean isDir = file.isDirectory();<NEW_LINE>if (isDir && !StringUtil.endsWithChar(relativeName, '/')) {<NEW_LINE>relativeName += "/";<NEW_LINE>}<NEW_LINE>if (fileFilter != null && !FileUtil.isFilePathAcceptable(file, fileFilter))<NEW_LINE>return false;<NEW_LINE>if (writtenItemRelativePaths != null && !writtenItemRelativePaths.add(relativeName))<NEW_LINE>return false;<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Add " + file + " as " + relativeName);<NEW_LINE>}<NEW_LINE>long size = isDir <MASK><NEW_LINE>ZipEntry e = new ZipEntry(relativeName);<NEW_LINE>e.setTime(file.lastModified());<NEW_LINE>if (size == 0) {<NEW_LINE>e.setMethod(ZipEntry.STORED);<NEW_LINE>e.setSize(0);<NEW_LINE>e.setCrc(0);<NEW_LINE>}<NEW_LINE>zos.putNextEntry(e);<NEW_LINE>if (!isDir) {<NEW_LINE>InputStream is = null;<NEW_LINE>try {<NEW_LINE>is = contentProcessor.getContent(file);<NEW_LINE>FileUtil.copy(is, zos);<NEW_LINE>} finally {<NEW_LINE>StreamUtil.closeStream(is);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>zos.closeEntry();<NEW_LINE>return true;<NEW_LINE>} | ? 0 : file.length(); |
131,236 | public static boolean checkParamsCompliance(JSONObject queryParamsObj, List<MockConfigRequestParams> mockConfigRequestParamList, boolean isAllMatch) {<NEW_LINE>if (isAllMatch) {<NEW_LINE>if (CollectionUtils.isNotEmpty(mockConfigRequestParamList)) {<NEW_LINE>for (MockConfigRequestParams params : mockConfigRequestParamList) {<NEW_LINE>String key = params.getKey();<NEW_LINE>if (queryParamsObj.containsKey(key)) {<NEW_LINE>boolean isMatch = MockApiUtils.isValueMatch(String.valueOf(queryParamsObj.get(key)), params);<NEW_LINE>if (!isMatch) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>if (CollectionUtils.isNotEmpty(mockConfigRequestParamList)) {<NEW_LINE>for (MockConfigRequestParams params : mockConfigRequestParamList) {<NEW_LINE><MASK><NEW_LINE>if (queryParamsObj.containsKey(key)) {<NEW_LINE>boolean isMatch = MockApiUtils.isValueMatch(String.valueOf(queryParamsObj.get(key)), params);<NEW_LINE>if (isMatch) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | String key = params.getKey(); |
977,365 | public void execute(UIManager.ViewHolder viewHolder) {<NEW_LINE>try {<NEW_LINE>NativeAdView nativeAdView = null;<NEW_LINE>MediaView mediaView = null;<NEW_LINE>MediaView adIconView = null;<NEW_LINE>if (adTag != -1) {<NEW_LINE>nativeAdView = (NativeAdView) viewHolder.get(adTag);<NEW_LINE>}<NEW_LINE>if (mediaViewTag != -1) {<NEW_LINE>mediaView = (MediaView) viewHolder.get(mediaViewTag);<NEW_LINE>}<NEW_LINE>if (adIconViewTag != -1) {<NEW_LINE>adIconView = (MediaView) viewHolder.get(adIconViewTag);<NEW_LINE>}<NEW_LINE>List<View> clickableViews = new ArrayList<>();<NEW_LINE>for (Object clickableViewTag : clickableViewsTags) {<NEW_LINE>clickableViews.add(viewHolder.get(clickableViewTag));<NEW_LINE>}<NEW_LINE>nativeAdView.registerViewsForInteraction(mediaView, adIconView, clickableViews);<NEW_LINE>promise.resolve(null);<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE><MASK><NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>promise.reject("E_NO_NATIVE_AD_VIEW", e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>promise.reject("E_AD_REGISTER_ERROR", e);<NEW_LINE>}<NEW_LINE>} | promise.reject("E_CANNOT_CAST", e); |
1,592,837 | public okhttp3.Call addAPIProductDocumentCall(String apiProductId, DocumentDTO documentDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = documentDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api-products/{apiProductId}/documents".replaceAll("\\{" + "apiProductId" + "\\}", localVarApiClient.escapeString(apiProductId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarHeaderParams.put("Accept", localVarAccept); |
531,397 | public void delete(Iterable<AllValueTypesTestRow> rows) {<NEW_LINE>List<byte[]> rowBytes = Persistables.persistAll(rows);<NEW_LINE>Set<Cell> cells = Sets.newHashSetWithExpectedSize(rowBytes.size() * 11);<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c0")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c1")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c10")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c2")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c3")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c4")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c5")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c6")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c7")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c8")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c9")));<NEW_LINE><MASK><NEW_LINE>} | t.delete(tableRef, cells); |
1,552,939 | private void printStats(CombinedStatistics combinedStatistics) {<NEW_LINE>MutationStatistics stats = combinedStatistics.getMutationStatistics();<NEW_LINE>final PrintStream ps = System.out;<NEW_LINE>ps.println<MASK><NEW_LINE>ps.println("- Mutators");<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>for (final Score each : stats.getScores()) {<NEW_LINE>each.report(ps);<NEW_LINE>ps.println(StringUtil.separatorLine());<NEW_LINE>}<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>ps.println("- Timings");<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>this.timings.report(ps);<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>ps.println("- Statistics");<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>final CoverageSummary coverage = combinedStatistics.getCoverageSummary();<NEW_LINE>if (coverage != null) {<NEW_LINE>ps.println(String.format(">> Line Coverage: %d/%d (%d%%)", coverage.getNumberOfCoveredLines(), coverage.getNumberOfLines(), coverage.getCoverage()));<NEW_LINE>}<NEW_LINE>stats.report(ps);<NEW_LINE>} | (StringUtil.separatorLine('=')); |
1,794,674 | protected void convertAgg(Blackboard bb, SqlSelect select, List<SqlNode> orderExprList) {<NEW_LINE>final boolean distinct = select.isDistinct();<NEW_LINE>assert bb.root != null : "precondition: child != null";<NEW_LINE>SqlNodeList groupList = select.getGroup();<NEW_LINE>SqlNodeList selectList = select.getSelectList();<NEW_LINE>SqlNode having = select.getHaving();<NEW_LINE>final AggConverter aggConverter = new AggConverter(bb, select);<NEW_LINE>if (this.validator instanceof SqlValidatorImpl) {<NEW_LINE>SqlValidatorImpl sqlValidator = (SqlValidatorImpl) this.validator;<NEW_LINE>having = sqlValidator.validatedExpandingHaving(select);<NEW_LINE>}<NEW_LINE>List<SqlIdentifier> firstValueForSubquery = Lists.newArrayList();<NEW_LINE>RelNode input = bb.root;<NEW_LINE>int count = 0;<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>createAggImpl(bb, aggConverter, selectList, groupList, having, orderExprList, firstValueForSubquery);<NEW_LINE>break;<NEW_LINE>} catch (ValidationFirstValueException e) {<NEW_LINE>if (count++ > CORRELATE_LOOP_UPPER_BAND) {<NEW_LINE>throw new AssertionError(e.getMessage() + ", DEAD LOOP DETECTED:" + firstValueForSubquery.subList(0, 10).toString());<NEW_LINE>}<NEW_LINE>firstValueForSubquery.add(e.getSqlIdentifier());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (distinct) {<NEW_LINE>distinctify(bb, null, null, true);<NEW_LINE>}<NEW_LINE>} | bb.setRoot(input, false); |
389,789 | public static CommunicationIdentifierModel convert(CommunicationIdentifier identifier) throws IllegalArgumentException {<NEW_LINE>if (identifier == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (identifier instanceof CommunicationUserIdentifier) {<NEW_LINE>CommunicationUserIdentifier communicationUserIdentifier = (CommunicationUserIdentifier) identifier;<NEW_LINE>return new CommunicationIdentifierModel().setCommunicationUser(new CommunicationUserIdentifierModel().setId(communicationUserIdentifier.getId()));<NEW_LINE>}<NEW_LINE>if (identifier instanceof PhoneNumberIdentifier) {<NEW_LINE>PhoneNumberIdentifier phoneNumberIdentifier = (PhoneNumberIdentifier) identifier;<NEW_LINE>return new CommunicationIdentifierModel().setRawId(phoneNumberIdentifier.getRawId()).setPhoneNumber(new PhoneNumberIdentifierModel().setValue(phoneNumberIdentifier.getPhoneNumber()));<NEW_LINE>}<NEW_LINE>if (identifier instanceof MicrosoftTeamsUserIdentifier) {<NEW_LINE>MicrosoftTeamsUserIdentifier teamsUserIdentifier = (MicrosoftTeamsUserIdentifier) identifier;<NEW_LINE>return new CommunicationIdentifierModel().setRawId(teamsUserIdentifier.getRawId()).setMicrosoftTeamsUser(new MicrosoftTeamsUserIdentifierModel().setIsAnonymous(teamsUserIdentifier.isAnonymous()).setUserId(teamsUserIdentifier.getUserId()).setCloud(CommunicationCloudEnvironmentModel.fromString(teamsUserIdentifier.getCloudEnvironment(<MASK><NEW_LINE>}<NEW_LINE>if (identifier instanceof UnknownIdentifier) {<NEW_LINE>UnknownIdentifier unknownIdentifier = (UnknownIdentifier) identifier;<NEW_LINE>return new CommunicationIdentifierModel().setRawId(unknownIdentifier.getId());<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(String.format("Unknown identifier class '%s'", identifier.getClass().getName()));<NEW_LINE>} | ).toString()))); |
1,007,979 | // auto-generated, see spoon.generating.ReplacementVisitorGenerator<NEW_LINE>@java.lang.Override<NEW_LINE>public <T> void visitCtConditional(final spoon.reflect.code.CtConditional<T> conditional) {<NEW_LINE>replaceElementIfExist(conditional.getType(), new spoon.support.visitor.replace.ReplacementVisitor.CtTypedElementTypeReplaceListener(conditional));<NEW_LINE>replaceInListIfExist(conditional.getAnnotations(), new spoon.support.visitor.replace.ReplacementVisitor.CtElementAnnotationsReplaceListener(conditional));<NEW_LINE>replaceElementIfExist(conditional.getCondition(), new spoon.support.visitor.replace.ReplacementVisitor.CtConditionalConditionReplaceListener(conditional));<NEW_LINE>replaceElementIfExist(conditional.getThenExpression(), new spoon.support.visitor.replace.ReplacementVisitor.CtConditionalThenExpressionReplaceListener(conditional));<NEW_LINE>replaceElementIfExist(conditional.getElseExpression(), new spoon.support.visitor.replace.ReplacementVisitor.CtConditionalElseExpressionReplaceListener(conditional));<NEW_LINE>replaceInListIfExist(conditional.getComments(), new spoon.support.visitor.replace<MASK><NEW_LINE>replaceInListIfExist(conditional.getTypeCasts(), new spoon.support.visitor.replace.ReplacementVisitor.CtExpressionTypeCastsReplaceListener(conditional));<NEW_LINE>} | .ReplacementVisitor.CtElementCommentsReplaceListener(conditional)); |
466,995 | protected void close(boolean closeWrapperOnly) throws SQLException {<NEW_LINE>TraceComponent tc = getTracer();<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "close");<NEW_LINE>// Make sure we only get closed once.<NEW_LINE>if (// already closed, just return<NEW_LINE>state == State.CLOSED) {<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "close", "Already closed");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>state = State.CLOSED;<NEW_LINE>if (isTraceOn && tc.isEventEnabled())<NEW_LINE>Tr.event(this, tc, <MASK><NEW_LINE>// Close all children. Then close the current wrapper, saving the first exception<NEW_LINE>// encountered. Others are logged.<NEW_LINE>closeChildWrappers();<NEW_LINE>SQLException sqlX = freeResourcesOnClose ? closeResources() : null;<NEW_LINE>SQLException sqlX2 = closeWrapper(closeWrapperOnly);<NEW_LINE>sqlX = sqlX == null ? sqlX2 : sqlX;<NEW_LINE>// When JDBC event listeners are enabled, the connection error notification is sent<NEW_LINE>// prior to raising the error, which means close is invoked prior to mapException.<NEW_LINE>// The reference to the parent wrapper must be kept so that exception mapping can<NEW_LINE>// still be performed.<NEW_LINE>childWrappers = null;<NEW_LINE>ifcToDynamicWrapper.clear();<NEW_LINE>dynamicWrapperToImpl.clear();<NEW_LINE>if (sqlX != null) {<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "close", sqlX);<NEW_LINE>throw sqlX;<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "close");<NEW_LINE>} | "state --> " + state.name()); |
674,396 | public boolean saveAs(final MapModel map) {<NEW_LINE>final JFileChooser chooser = getMindMapFileChooser();<NEW_LINE>File mapFile = map.getFile();<NEW_LINE>if (mapFile == null || mapFile.getParentFile() == null) {<NEW_LINE>File defaultFile = new File(getFileNameProposal(map) + org.freeplane.features.url.UrlManager.FREEPLANE_FILE_EXTENSION);<NEW_LINE>chooser.setSelectedFile(defaultFile);<NEW_LINE>} else {<NEW_LINE>chooser.setSelectedFile(mapFile);<NEW_LINE>}<NEW_LINE>chooser.setDialogTitle(TextUtils.getText("SaveAsAction.text"));<NEW_LINE>final int returnVal = chooser.showSaveDialog(Controller.getCurrentController().getMapViewManager().getMapViewComponent());<NEW_LINE>if (returnVal != JFileChooser.APPROVE_OPTION) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>File f = chooser.getSelectedFile();<NEW_LINE>final String ext = FileUtils.getExtension(f.getName());<NEW_LINE>if (!ext.equals(org.freeplane.features.url.UrlManager.FREEPLANE_FILE_EXTENSION_WITHOUT_DOT)) {<NEW_LINE>f = new File(f.getParent(), f.getName() + org.freeplane.features.url.UrlManager.FREEPLANE_FILE_EXTENSION);<NEW_LINE>}<NEW_LINE>if (f.exists()) {<NEW_LINE>final int overwriteMap = JOptionPane.showConfirmDialog(Controller.getCurrentController().getMapViewManager().getMapViewComponent(), TextUtils.getText("map_already_exists"), "Freeplane", JOptionPane.YES_NO_OPTION);<NEW_LINE>if (overwriteMap != JOptionPane.YES_OPTION) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// extra backup in this case.<NEW_LINE>File oldFile = mapFile;<NEW_LINE>if (oldFile != null) {<NEW_LINE>oldFile = oldFile.getAbsoluteFile();<NEW_LINE>}<NEW_LINE>if (!f.getAbsoluteFile().equals(oldFile)) {<NEW_LINE>if (null != map.getExtension(BackupFlag.class)) {<NEW_LINE>map.removeExtension(BackupFlag.class);<NEW_LINE>}<NEW_LINE>if (null != map.getExtension(DocuMapAttribute.class)) {<NEW_LINE>map.removeExtension(DocuMapAttribute.class);<NEW_LINE>}<NEW_LINE>map.setReadOnly(false);<NEW_LINE>}<NEW_LINE>if (save(map, f)) {<NEW_LINE>Controller.getCurrentController()<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getMapViewManager().updateMapViewName(); |
1,354,238 | protected HashMap<String, IntFunction<LocalDateTime>> initHolidayFuncs() {<NEW_LINE>HashMap<String, IntFunction<LocalDateTime>> holidays = new HashMap<>(super.initHolidayFuncs());<NEW_LINE>holidays.put("mayday", EnglishHolidayParserConfiguration::mayday);<NEW_LINE>holidays.put("yuandan", EnglishHolidayParserConfiguration::newYear);<NEW_LINE>holidays.put("newyear", EnglishHolidayParserConfiguration::newYear);<NEW_LINE>holidays.put("youthday", EnglishHolidayParserConfiguration::youthDay);<NEW_LINE>holidays.put("girlsday", EnglishHolidayParserConfiguration::girlsDay);<NEW_LINE>holidays.put("xmas", EnglishHolidayParserConfiguration::christmasDay);<NEW_LINE>holidays.put("newyearday", EnglishHolidayParserConfiguration::newYear);<NEW_LINE>holidays.put("aprilfools", EnglishHolidayParserConfiguration::foolDay);<NEW_LINE>holidays.put("easterday", EnglishHolidayParserConfiguration::easterDay);<NEW_LINE>holidays.put("newyearsday", EnglishHolidayParserConfiguration::newYear);<NEW_LINE>holidays.put("femaleday", EnglishHolidayParserConfiguration::femaleDay);<NEW_LINE>holidays.put("singleday", EnglishHolidayParserConfiguration::singlesDay);<NEW_LINE>holidays.put("newyeareve", EnglishHolidayParserConfiguration::newYearEve);<NEW_LINE>holidays.<MASK><NEW_LINE>holidays.put("loverday", EnglishHolidayParserConfiguration::valentinesDay);<NEW_LINE>holidays.put("christmas", EnglishHolidayParserConfiguration::christmasDay);<NEW_LINE>holidays.put("teachersday", EnglishHolidayParserConfiguration::teacherDay);<NEW_LINE>holidays.put("stgeorgeday", EnglishHolidayParserConfiguration::stGeorgeDay);<NEW_LINE>holidays.put("baptisteday", EnglishHolidayParserConfiguration::baptisteDay);<NEW_LINE>holidays.put("bastilleday", EnglishHolidayParserConfiguration::bastilleDay);<NEW_LINE>holidays.put("allsoulsday", EnglishHolidayParserConfiguration::allSoulsDay);<NEW_LINE>holidays.put("veteransday", EnglishHolidayParserConfiguration::veteransDay);<NEW_LINE>holidays.put("childrenday", EnglishHolidayParserConfiguration::childrenDay);<NEW_LINE>holidays.put("maosbirthday", EnglishHolidayParserConfiguration::maoBirthday);<NEW_LINE>holidays.put("allsaintsday", EnglishHolidayParserConfiguration::halloweenDay);<NEW_LINE>holidays.put("stpatrickday", EnglishHolidayParserConfiguration::stPatrickDay);<NEW_LINE>holidays.put("halloweenday", EnglishHolidayParserConfiguration::halloweenDay);<NEW_LINE>holidays.put("allhallowday", EnglishHolidayParserConfiguration::allHallowDay);<NEW_LINE>holidays.put("guyfawkesday", EnglishHolidayParserConfiguration::guyFawkesDay);<NEW_LINE>holidays.put("christmaseve", EnglishHolidayParserConfiguration::christmasEve);<NEW_LINE>holidays.put("groundhougday", EnglishHolidayParserConfiguration::groundhogDay);<NEW_LINE>holidays.put("whiteloverday", EnglishHolidayParserConfiguration::whiteLoverDay);<NEW_LINE>holidays.put("valentinesday", EnglishHolidayParserConfiguration::valentinesDay);<NEW_LINE>holidays.put("treeplantingday", EnglishHolidayParserConfiguration::treePlantDay);<NEW_LINE>holidays.put("cincodemayoday", EnglishHolidayParserConfiguration::cincoDeMayoDay);<NEW_LINE>holidays.put("inaugurationday", EnglishHolidayParserConfiguration::inaugurationDay);<NEW_LINE>holidays.put("independenceday", EnglishHolidayParserConfiguration::usaIndependenceDay);<NEW_LINE>holidays.put("usindependenceday", EnglishHolidayParserConfiguration::usaIndependenceDay);<NEW_LINE>holidays.put("juneteenth", EnglishHolidayParserConfiguration::juneteenth);<NEW_LINE>return holidays;<NEW_LINE>} | put("arborday", EnglishHolidayParserConfiguration::treePlantDay); |
1,748,787 | public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {<NEW_LINE>Player player = game.getPlayer(controllerId);<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>paid = false;<NEW_LINE>if (player.getHand().count(filter, game) > 0 && player.chooseUse(Outcome.Benefit, "Reveal a Merfolk card? Otherwise pay {3}.", ability, game)) {<NEW_LINE><MASK><NEW_LINE>if (player.choose(Outcome.Benefit, target, source, game)) {<NEW_LINE>Card card = player.getHand().get(target.getFirstTarget(), game);<NEW_LINE>if (card != null) {<NEW_LINE>paid = true;<NEW_LINE>player.revealCards("Revealed card", new CardsImpl(card), game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mana.clearPaid();<NEW_LINE>if (mana.pay(ability, game, source, player.getId(), false)) {<NEW_LINE>paid = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return paid;<NEW_LINE>} | TargetCardInHand target = new TargetCardInHand(filter); |
814,760 | private void registerModal(String id, String title, String... lines) {<NEW_LINE>contents.append("<div id=\"").append(id).append("\" uk-modal>\n").append(" <div class=\"uk-modal-dialog uk-modal-body\">\n").append(" <h2 class=\"uk-modal-title\">").append(title).append("</h2>\n");<NEW_LINE>for (String line : lines) {<NEW_LINE>contents.append(line).append("\n");<NEW_LINE>}<NEW_LINE>contents.append(" <p>See the <a href=\"").append(documentationRegistry.getDocumentationFor("dependency_verification", "sec:signature-verification")).append("\" target=\"_blank\">documentation</a> to get more information.</p>\n").append(" <button class=\"uk-button uk-button-primary uk-modal-close\" type=\"button\">Ok</button>\n").append<MASK><NEW_LINE>} | (" </div>\n").append("</div>\n"); |
1,302,612 | protected void blurObjectIntoView(Graphics2D gView, BufferedImage frame, Nozzle nozzle, Location l) {<NEW_LINE>// Blur according to Z coordinate<NEW_LINE>AffineTransform tx = gView.getTransform();<NEW_LINE>gView.setTransform(new AffineTransform());<NEW_LINE>double distanceMm = Math.abs(l.subtract(getSimulatedLocation()).convertToUnits(LengthUnit<MASK><NEW_LINE>final double bokeh = 0.01 / getSimulatedUnitsPerPixel().convertToUnits(LengthUnit.Millimeters).getX();<NEW_LINE>// Be reasonable.<NEW_LINE>double radius = Math.min(distanceMm * bokeh, 5);<NEW_LINE>ConvolveOp op = null;<NEW_LINE>if (radius > 0.01) {<NEW_LINE>int size = (int) Math.ceil(radius) * 2 + 1;<NEW_LINE>float[] data = new float[size * size];<NEW_LINE>double sum = 0;<NEW_LINE>int num = 0;<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>double x = i / size - size / 2.0 + 0.5;<NEW_LINE>double y = i % size - size / 2.0 + 0.5;<NEW_LINE>double r = Math.sqrt(x * x + y * y);<NEW_LINE>// rough approximation<NEW_LINE>float weight = (float) Math.max(0, Math.min(1, radius + 1 - r));<NEW_LINE>data[i] = weight;<NEW_LINE>sum += weight;<NEW_LINE>if (weight > 0) {<NEW_LINE>num++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (num > 1) {<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>data[i] /= sum;<NEW_LINE>}<NEW_LINE>Kernel kernel = new Kernel(size, size, data);<NEW_LINE>op = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gView.drawImage(frame, op, 0, 0);<NEW_LINE>gView.setTransform(tx);<NEW_LINE>} | .Millimeters).getZ()); |
1,034,440 | public Result isConditionMet(Index index, ClusterState clusterState) {<NEW_LINE>IndexMetadata followerIndex = clusterState.metadata().index(index);<NEW_LINE>if (followerIndex == null) {<NEW_LINE>// Index must have been since deleted, ignore it<NEW_LINE>logger.debug("[{}] lifecycle action for index [{}] executed but index no longer exists", getKey().getAction(), index.getName());<NEW_LINE>return new Result(false, null);<NEW_LINE>}<NEW_LINE>Map<String, String> customIndexMetadata = followerIndex.getCustomData(CCR_METADATA_KEY);<NEW_LINE>if (customIndexMetadata == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>boolean indexingComplete = LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE_SETTING.get(followerIndex.getSettings());<NEW_LINE>if (indexingComplete) {<NEW_LINE>return new Result(true, null);<NEW_LINE>} else {<NEW_LINE>return new Result(false, new IndexingNotCompleteInfo());<NEW_LINE>}<NEW_LINE>} | return new Result(true, null); |
1,282,540 | final void loadFile(final AbstractFile file) {<NEW_LINE>ensureInSwingThread();<NEW_LINE>if (!isInited()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final double panelHeight = fxPanel.getHeight();<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>if (readImageFileTask != null) {<NEW_LINE>readImageFileTask.cancel();<NEW_LINE>}<NEW_LINE>readImageFileTask = ImageUtils.newReadImageTask(file);<NEW_LINE>readImageFileTask.setOnSucceeded(succeeded -> {<NEW_LINE>onReadImageTaskSucceeded(file, panelWidth, panelHeight);<NEW_LINE>});<NEW_LINE>readImageFileTask.setOnFailed(failed -> {<NEW_LINE>onReadImageTaskFailed(file);<NEW_LINE>});<NEW_LINE>maskerPane.setProgressNode(progressBar);<NEW_LINE>progressBar.progressProperty().bind(readImageFileTask.progressProperty());<NEW_LINE>maskerPane.textProperty().bind(readImageFileTask.messageProperty());<NEW_LINE>// Prevent content display issues.<NEW_LINE>scrollPane.setContent(null);<NEW_LINE>scrollPane.setCursor(Cursor.WAIT);<NEW_LINE>new Thread(readImageFileTask).start();<NEW_LINE>});<NEW_LINE>} | double panelWidth = fxPanel.getWidth(); |
19,700 | public void onEnd(AttributesBuilder attributes, Context context, String s, @Nullable Object result, @Nullable Throwable error) {<NEW_LINE>if (result == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Unwrap ListenableFuture (if present)<NEW_LINE>if (result instanceof ListenableFuture) {<NEW_LINE>try {<NEW_LINE>result = Uninterruptibles.getUninterruptibly((ListenableFuture<?>) result, 0, TimeUnit.MICROSECONDS);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(FINE, "Error unwrapping result", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Provide helpful metadata for some of the more common response types<NEW_LINE>attributes.put("twilio.type", result.getClass().getCanonicalName());<NEW_LINE>// Instrument the most popular resource types directly<NEW_LINE>if (result instanceof Message) {<NEW_LINE>Message message = (Message) result;<NEW_LINE>attributes.put("twilio.account", message.getAccountSid());<NEW_LINE>attributes.put("twilio.sid", message.getSid());<NEW_LINE>Message.<MASK><NEW_LINE>if (status != null) {<NEW_LINE>attributes.put("twilio.status", status.toString());<NEW_LINE>}<NEW_LINE>} else if (result instanceof Call) {<NEW_LINE>Call call = (Call) result;<NEW_LINE>attributes.put("twilio.account", call.getAccountSid());<NEW_LINE>attributes.put("twilio.sid", call.getSid());<NEW_LINE>attributes.put("twilio.parentSid", call.getParentCallSid());<NEW_LINE>Call.Status status = call.getStatus();<NEW_LINE>if (status != null) {<NEW_LINE>attributes.put("twilio.status", status.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Use reflection to gather insight from other types; note that Twilio requests take close to<NEW_LINE>// 1 second, so the added hit from reflection here is relatively minimal in the grand scheme<NEW_LINE>// of things<NEW_LINE>setTagIfPresent(attributes, result, "twilio.sid", "getSid");<NEW_LINE>setTagIfPresent(attributes, result, "twilio.account", "getAccountSid");<NEW_LINE>setTagIfPresent(attributes, result, "twilio.status", "getStatus");<NEW_LINE>}<NEW_LINE>} | Status status = message.getStatus(); |
1,284,111 | protected static BigInteger calculateY_FF3(BlockCipher cipher, BigInteger bigRadix, byte[] T, int wOff, int round, short[] AB) {<NEW_LINE>// ii.<NEW_LINE>byte[] P = new byte[BLOCK_SIZE];<NEW_LINE>Pack.intToBigEndian(round, P, 0);<NEW_LINE>xor(T, wOff, P, 0, 4);<NEW_LINE>BigInteger numAB = num(bigRadix, AB);<NEW_LINE>byte[] <MASK><NEW_LINE>if (// to be sure...<NEW_LINE>(P.length - bytesAB.length) < 4) {<NEW_LINE>throw new IllegalStateException("input out of range");<NEW_LINE>}<NEW_LINE>System.arraycopy(bytesAB, 0, P, P.length - bytesAB.length, bytesAB.length);<NEW_LINE>// iii.<NEW_LINE>rev(P);<NEW_LINE>cipher.processBlock(P, 0, P, 0);<NEW_LINE>rev(P);<NEW_LINE>byte[] S = P;<NEW_LINE>// iv.<NEW_LINE>return num(S, 0, S.length);<NEW_LINE>} | bytesAB = BigIntegers.asUnsignedByteArray(numAB); |
325,611 | public void marshall(CreateProjectRequest createProjectRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createProjectRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getSource(), SOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getSecondarySources(), SECONDARYSOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getSourceVersion(), SOURCEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getSecondarySourceVersions(), SECONDARYSOURCEVERSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getArtifacts(), ARTIFACTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getSecondaryArtifacts(), SECONDARYARTIFACTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getCache(), CACHE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getServiceRole(), SERVICEROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getTimeoutInMinutes(), TIMEOUTINMINUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getQueuedTimeoutInMinutes(), QUEUEDTIMEOUTINMINUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getEncryptionKey(), ENCRYPTIONKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getVpcConfig(), VPCCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getBadgeEnabled(), BADGEENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getLogsConfig(), LOGSCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getFileSystemLocations(), FILESYSTEMLOCATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getBuildBatchConfig(), BUILDBATCHCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProjectRequest.getConcurrentBuildLimit(), CONCURRENTBUILDLIMIT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createProjectRequest.getEnvironment(), ENVIRONMENT_BINDING); |
1,623,932 | public MFAOptionType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MFAOptionType mFAOptionType = new MFAOptionType();<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("DeliveryMedium", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mFAOptionType.setDeliveryMedium(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AttributeName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mFAOptionType.setAttributeName(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 mFAOptionType;<NEW_LINE>} | class).unmarshall(context)); |
1,758,388 | private <T extends Metric> AsyncFuture<WriteMetric> writeOne(final String columnFamily, Series series, BigtableDataClient client, T p, Function<T, ByteString> serializer) throws IOException {<NEW_LINE>final long timestamp = p.getTimestamp();<NEW_LINE>final long base = base(timestamp);<NEW_LINE>final long offset = offset(timestamp);<NEW_LINE>final RowKey rowKey = new RowKey(series, base);<NEW_LINE>final Mutations.<MASK><NEW_LINE>final ByteString offsetBytes = serializeOffset(offset);<NEW_LINE>final ByteString valueBytes = serializer.apply(p);<NEW_LINE>builder.setCell(columnFamily, offsetBytes, valueBytes);<NEW_LINE>final RequestTimer<WriteMetric> timer = WriteMetric.timer();<NEW_LINE>final ByteString rowKeyBytes = rowKeySerializer.serializeFull(rowKey);<NEW_LINE>if (rowKeyBytes.size() >= MAX_KEY_ROW_SIZE) {<NEW_LINE>reporter.reportWritesDroppedBySize();<NEW_LINE>log.error("Row key length greater than 4096 bytes (1): {} {}", rowKeyBytes.size(), rowKey);<NEW_LINE>return async.resolved().directTransform(result -> timer.end());<NEW_LINE>}<NEW_LINE>return client.mutateRow(table, rowKeyBytes, builder.build()).directTransform(result -> timer.end());<NEW_LINE>} | Builder builder = Mutations.builder(); |
1,199,726 | public <T> T putAndLockProject(Project project, ProjectLockAction<T> func) throws ResourceConflictException {<NEW_LINE>return transaction((handle, dao) -> {<NEW_LINE>StoredProject proj;<NEW_LINE>if (dao instanceof H2Dao) {<NEW_LINE>((H2Dao) dao).upsertAndLockProject(siteId, project.getName());<NEW_LINE>proj = dao.getProjectByName(siteId, project.getName());<NEW_LINE>if (proj == null) {<NEW_LINE>throw new IllegalStateException(String.format(ENGLISH, "Database state error: locked project is null: site_id=%d, name=%s", siteId, project.getName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// select first so that conflicting insert doesn't increment sequence of primary key unnecessarily<NEW_LINE>proj = dao.getProjectByName(siteId, project.getName());<NEW_LINE>if (proj == null) {<NEW_LINE>proj = ((PgDao) dao).upsertAndLockProject(siteId, project.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return func.call(new DatabaseProjectControlStore<MASK><NEW_LINE>}, ResourceConflictException.class);<NEW_LINE>} | (handle, siteId), proj); |
276,838 | public Resolution unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Resolution resolution = new Resolution();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("width", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resolution.setWidth(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("height", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resolution.setHeight(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resolution;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,046,807 | public Object put(HttpServletRequest request, HttpServletResponse response) throws DdlException {<NEW_LINE>checkFromValidFe(request);<NEW_LINE>String portStr = request.getParameter(PORT);<NEW_LINE>// check port to avoid SSRF(Server-Side Request Forgery)<NEW_LINE>if (Strings.isNullOrEmpty(portStr)) {<NEW_LINE>return ResponseEntityBuilder.badRequest("Port number cannot be empty");<NEW_LINE>}<NEW_LINE>int port = Integer.parseInt(portStr);<NEW_LINE>if (port < 0 || port > 65535) {<NEW_LINE>return ResponseEntityBuilder.badRequest("port is invalid. The port number is between 0-65535");<NEW_LINE>}<NEW_LINE>String versionStr = request.getParameter(VERSION);<NEW_LINE>if (Strings.isNullOrEmpty(versionStr)) {<NEW_LINE>return ResponseEntityBuilder.badRequest("Miss version parameter");<NEW_LINE>}<NEW_LINE>checkLongParam(versionStr);<NEW_LINE>String machine = request.getRemoteHost();<NEW_LINE>String url = "http://" + machine + ":" + port + "/image?version=" + versionStr;<NEW_LINE>String filename <MASK><NEW_LINE>File dir = new File(Catalog.getCurrentCatalog().getImageDir());<NEW_LINE>try {<NEW_LINE>OutputStream out = MetaHelper.getOutputStream(filename, dir);<NEW_LINE>MetaHelper.getRemoteFile(url, TIMEOUT_SECOND * 1000, out);<NEW_LINE>MetaHelper.complete(filename, dir);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>return ResponseEntityBuilder.notFound("file not found.");<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("failed to get remote file. url: {}", url, e);<NEW_LINE>return ResponseEntityBuilder.internalError("failed to get remote file: " + e.getMessage());<NEW_LINE>}<NEW_LINE>// Delete old image files<NEW_LINE>try {<NEW_LINE>MetaCleaner cleaner = new MetaCleaner(Config.meta_dir + "/image");<NEW_LINE>cleaner.clean();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Follower/Observer delete old image file fail.", e);<NEW_LINE>}<NEW_LINE>return ResponseEntityBuilder.ok();<NEW_LINE>} | = Storage.IMAGE + "." + versionStr; |
1,293,058 | // guarded by myLock<NEW_LINE>private void initMetricsIfNeeded() {<NEW_LINE>if (myPlainSpaceWidth >= 0)<NEW_LINE>return;<NEW_LINE>Font font = myEditor.getColorsScheme().getFont(EditorFontType.PLAIN);<NEW_LINE>FontMetrics fm = FontInfo.getFontMetrics(font, myFontRenderContext);<NEW_LINE>float width = FontLayoutService.getInstance().charWidth2D(fm, ' ');<NEW_LINE>myPlainSpaceWidth = width > 0 ? width : 1;<NEW_LINE>myCharHeight = FontLayoutService.getInstance().charWidth(fm, 'a');<NEW_LINE>float verticalScalingFactor = getVerticalScalingFactor();<NEW_LINE>int fontMetricsHeight = FontLayoutService.getInstance().getHeight(fm);<NEW_LINE>int lineHeight;<NEW_LINE>if (Registry.is("editor.text.xcode.vertical.spacing")) {<NEW_LINE>// Here we approximate line calculation to the variant used in Xcode 9 editor<NEW_LINE>LineMetrics metrics = font.getLineMetrics("", myFontRenderContext);<NEW_LINE>double height = Math.ceil(metrics.getHeight(<MASK><NEW_LINE>double delta = verticalScalingFactor - 1;<NEW_LINE>int spacing;<NEW_LINE>if (Math.round((height * delta) / 2) <= 1) {<NEW_LINE>spacing = delta > 0 ? 2 : 0;<NEW_LINE>} else {<NEW_LINE>spacing = ((int) Math.ceil((height * delta) / 2)) * 2;<NEW_LINE>}<NEW_LINE>lineHeight = (int) Math.ceil(height) + spacing;<NEW_LINE>} else if (Registry.is("editor.text.vertical.spacing.correct.rounding")) {<NEW_LINE>if (verticalScalingFactor == 1f) {<NEW_LINE>lineHeight = fontMetricsHeight;<NEW_LINE>} else {<NEW_LINE>Font scaledFont = font.deriveFont(font.getSize() * verticalScalingFactor);<NEW_LINE>FontMetrics scaledMetrics = FontInfo.getFontMetrics(scaledFont, myFontRenderContext);<NEW_LINE>lineHeight = FontLayoutService.getInstance().getHeight(scaledMetrics);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>lineHeight = (int) Math.ceil(fontMetricsHeight * verticalScalingFactor);<NEW_LINE>}<NEW_LINE>myLineHeight = Math.max(1, lineHeight);<NEW_LINE>int descent = FontLayoutService.getInstance().getDescent(fm);<NEW_LINE>myDescent = descent + (myLineHeight - fontMetricsHeight) / 2;<NEW_LINE>myTopOverhang = fontMetricsHeight - myLineHeight + myDescent - descent;<NEW_LINE>myBottomOverhang = descent - myDescent;<NEW_LINE>// assuming that bold italic 'W' gives a good approximation of font's widest character<NEW_LINE>FontMetrics fmBI = FontInfo.getFontMetrics(myEditor.getColorsScheme().getFont(EditorFontType.BOLD_ITALIC), myFontRenderContext);<NEW_LINE>myMaxCharWidth = FontLayoutService.getInstance().charWidth2D(fmBI, 'W');<NEW_LINE>} | )) + metrics.getLeading(); |
973,098 | public ApiReturn doFilter(String fullyName) {<NEW_LINE>if (TYPE_SET.stream().anyMatch(fullyName::startsWith)) {<NEW_LINE>ApiReturn apiReturn = new ApiReturn();<NEW_LINE>if (fullyName.contains("<")) {<NEW_LINE>String[] strings = DocClassUtil.getSimpleGicName(fullyName);<NEW_LINE>String newFullName = strings[0];<NEW_LINE>if (newFullName.contains("<")) {<NEW_LINE>apiReturn.setGenericCanonicalName(newFullName);<NEW_LINE>apiReturn.setSimpleName(newFullName.substring(0, <MASK><NEW_LINE>} else {<NEW_LINE>apiReturn.setGenericCanonicalName(newFullName);<NEW_LINE>apiReturn.setSimpleName(newFullName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// directly return Java Object<NEW_LINE>apiReturn.setGenericCanonicalName(DocGlobalConstants.JAVA_OBJECT_FULLY);<NEW_LINE>apiReturn.setSimpleName(DocGlobalConstants.JAVA_OBJECT_FULLY);<NEW_LINE>}<NEW_LINE>return apiReturn;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | newFullName.indexOf("<"))); |
1,696,047 | final DBSubnetGroup executeModifyDBSubnetGroup(ModifyDBSubnetGroupRequest modifyDBSubnetGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBSubnetGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBSubnetGroupRequest> request = null;<NEW_LINE>Response<DBSubnetGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyDBSubnetGroupRequestMarshaller().marshall(super.beforeMarshalling(modifyDBSubnetGroupRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBSubnetGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBSubnetGroup> responseHandler = new StaxResponseHandler<DBSubnetGroup>(new DBSubnetGroupStaxUnmarshaller());<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>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,687,011 | private boolean doOutputStreamEncrypt07() throws Exception {<NEW_LINE>if (StringUtils.isEmpty(writeWorkbookHolder.getPassword()) || !ExcelTypeEnum.XLSX.equals(writeWorkbookHolder.getExcelType())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (writeWorkbookHolder.getFile() != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>File tempXlsx = FileUtils.createTmpFile(UUID.randomUUID() + ".xlsx");<NEW_LINE>FileOutputStream tempFileOutputStream = new FileOutputStream(tempXlsx);<NEW_LINE>try {<NEW_LINE>writeWorkbookHolder.getWorkbook().write(tempFileOutputStream);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>writeWorkbookHolder<MASK><NEW_LINE>tempFileOutputStream.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!tempXlsx.delete()) {<NEW_LINE>throw new ExcelGenerateException("Can not delete temp File!");<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (POIFSFileSystem fileSystem = openFileSystemAndEncrypt(tempXlsx)) {<NEW_LINE>fileSystem.writeFilesystem(writeWorkbookHolder.getOutputStream());<NEW_LINE>} finally {<NEW_LINE>if (!tempXlsx.delete()) {<NEW_LINE>throw new ExcelGenerateException("Can not delete temp File!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getWorkbook().close(); |
1,066,642 | public void enableUARTPassThrough(int baudrate, boolean persist) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>mPacketHandler.sendByte(mCommandsProto.PASS_UART);<NEW_LINE>if (persist)<NEW_LINE>mPacketHandler.sendByte(1);<NEW_LINE>else<NEW_LINE>mPacketHandler.sendByte(0);<NEW_LINE>mPacketHandler.sendInt((int) Math.round(((64e6 / baudrate) / 4) - 1));<NEW_LINE>Log.v(TAG, "BRG2VAL: " + Math.round(((64e6 / baudrate) / 4) - 1));<NEW_LINE>// sleep for 0.1 sec<NEW_LINE>byte[] junk = new byte[100];<NEW_LINE>mPacketHandler.read(junk, 100);<NEW_LINE>// Log junk to see :D<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | mPacketHandler.sendByte(mCommandsProto.PASSTHROUGHS); |
1,675,649 | public void handle(JsonNode packet) {<NEW_LINE>if (!packet.hasNonNull("user_id")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long userId = packet.get("user_id").asLong();<NEW_LINE>if (packet.hasNonNull("guild_id")) {<NEW_LINE>handleServerVoiceChannel(packet, userId);<NEW_LINE>} else if (packet.hasNonNull("channel_id")) {<NEW_LINE>long channelId = packet.get("channel_id").asLong();<NEW_LINE>Optional<VoiceChannel> <MASK><NEW_LINE>if (optionalChannel.isPresent()) {<NEW_LINE>VoiceChannel voiceChannel = optionalChannel.get();<NEW_LINE>if (voiceChannel instanceof PrivateChannel) {<NEW_LINE>handlePrivateChannel(userId, ((PrivateChannelImpl) voiceChannel));<NEW_LINE>} else if (voiceChannel instanceof GroupChannel) {<NEW_LINE>handleGroupChannel(userId, ((GroupChannelImpl) voiceChannel));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LoggerUtil.logMissingChannel(logger, channelId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (api.getYourself().getId() == userId) {<NEW_LINE>handleSelf(packet);<NEW_LINE>}<NEW_LINE>} | optionalChannel = api.getVoiceChannelById(channelId); |
566,387 | final CreateConfigurationProfileResult executeCreateConfigurationProfile(CreateConfigurationProfileRequest createConfigurationProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createConfigurationProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateConfigurationProfileRequest> request = null;<NEW_LINE>Response<CreateConfigurationProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateConfigurationProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createConfigurationProfileRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateConfigurationProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateConfigurationProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateConfigurationProfileResultJsonUnmarshaller());<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>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,030,141 | public static String replace(@NonNls @Nonnull final String text, @NonNls @Nonnull final String oldS, @NonNls @Nonnull final String newS, final boolean ignoreCase) {<NEW_LINE>if (text.length() < oldS.length())<NEW_LINE>return text;<NEW_LINE>StringBuilder newText = null;<NEW_LINE>int i = 0;<NEW_LINE>while (i < text.length()) {<NEW_LINE>final int index = ignoreCase ? indexOfIgnoreCase(text, oldS, i) : text.indexOf(oldS, i);<NEW_LINE>if (index < 0) {<NEW_LINE>if (i == 0) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>newText.append(text, <MASK><NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>if (newText == null) {<NEW_LINE>if (text.length() == oldS.length()) {<NEW_LINE>return newS;<NEW_LINE>}<NEW_LINE>newText = new StringBuilder(text.length() - i);<NEW_LINE>}<NEW_LINE>newText.append(text, i, index);<NEW_LINE>newText.append(newS);<NEW_LINE>i = index + oldS.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newText != null ? newText.toString() : "";<NEW_LINE>} | i, text.length()); |
1,543,067 | public String toEnumVarName(String value, String datatype) {<NEW_LINE>// our enum var names are keys in a python dict, so change spaces to underscores<NEW_LINE>if (value.length() == 0) {<NEW_LINE>return "EMPTY";<NEW_LINE>}<NEW_LINE>String intPattern = "^[-\\+]?\\d+$";<NEW_LINE>String floatPattern = "^[-\\+]?\\d+\\.\\d+$";<NEW_LINE>Boolean intMatch = Pattern.matches(intPattern, value);<NEW_LINE>Boolean floatMatch = Pattern.matches(floatPattern, value);<NEW_LINE>if (intMatch || floatMatch) {<NEW_LINE>String plusSign = "^\\+.+";<NEW_LINE>String negSign = "^-.+";<NEW_LINE>if (Pattern.matches(plusSign, value)) {<NEW_LINE>value = value.replace("+", "POSITIVE_");<NEW_LINE>} else if (Pattern.matches(negSign, value)) {<NEW_LINE>value = value.replace("-", "NEGATIVE_");<NEW_LINE>} else {<NEW_LINE>value = "POSITIVE_" + value;<NEW_LINE>}<NEW_LINE>if (floatMatch) {<NEW_LINE>value = value.replace(".", "_PT_");<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>// Replace " " with _<NEW_LINE>String usedValue = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT);<NEW_LINE>// strip first character if it is invalid<NEW_LINE>usedValue = usedValue.replaceAll("^[^_a-zA-Z]", "");<NEW_LINE>usedValue = usedValue.replaceAll("[^_a-zA-Z0-9]*", "");<NEW_LINE>if (usedValue.length() == 0) {<NEW_LINE>for (int i = 0; i < value.length(); i++) {<NEW_LINE>Character c = value.charAt(i);<NEW_LINE>String charName = Character.getName(c.hashCode());<NEW_LINE>usedValue += charNameToVarName(charName);<NEW_LINE>}<NEW_LINE>// remove trailing _<NEW_LINE>usedValue = <MASK><NEW_LINE>}<NEW_LINE>return usedValue;<NEW_LINE>} | usedValue.replaceAll("[_]$", ""); |
1,297,322 | private SlimAssertion callFunctionInRow(ScenarioTable scenario, String functionName, int row) throws SyntaxError {<NEW_LINE>int <MASK><NEW_LINE>String name = Disgracer.disgraceMethodName(functionName);<NEW_LINE>if (!scenario.getOutputs().contains(name)) {<NEW_LINE>throw new SyntaxError(String.format("The argument %s is not an output of the scenario.", name));<NEW_LINE>}<NEW_LINE>String assignedSymbol = isSymbolAssignment(col, row);<NEW_LINE>SlimAssertion assertion;<NEW_LINE>if (assignedSymbol != null) {<NEW_LINE>assertion = makeAssertion(callAndAssign(assignedSymbol, getTestContext().getCurrentScriptActor(), "cloneSymbol", "$" + name), new ReturnedSymbolExpectation(col, row, name, assignedSymbol));<NEW_LINE>} else {<NEW_LINE>assertion = makeAssertion(Instruction.NOOP_INSTRUCTION, new ReturnedSymbolExpectation(getDTCellContents(col, row), col, row, name));<NEW_LINE>}<NEW_LINE>return assertion;<NEW_LINE>} | col = funcStore.getColumnNumber(functionName); |
685,918 | public void configurarCores() {<NEW_LINE>if (Configuracoes.getInstancia().isTemaDark()) {<NEW_LINE>jPanel1.setBackground(ColorController.FUNDO_BOTOES_EXPANSIVEIS);<NEW_LINE>if (WeblafUtils.weblafEstaInstalado()) {<NEW_LINE>WeblafUtils.configurarBotao(botaoRetrair, ColorController.FUNDO_BOTOES_EXPANSIVEIS, ColorController.COR_LETRA, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, 5);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>jPanel1.setBackground(ColorController.FUNDO_ESCURO);<NEW_LINE>if (WeblafUtils.weblafEstaInstalado()) {<NEW_LINE>WeblafUtils.configurarBotao(botaoRetrair, ColorController.FUNDO_ESCURO, ColorController.COR_LETRA, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, 5);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (WeblafUtils.weblafEstaInstalado()) {<NEW_LINE>WeblafUtils.configurarBotao(botaoPlay, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 5);<NEW_LINE>WeblafUtils.configurarBotao(botaoAjuda, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.<MASK><NEW_LINE>WeblafUtils.configurarBotao(botaoParar, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 5);<NEW_LINE>WeblafUtils.configurarBotao(botaoPasso, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 5);<NEW_LINE>WeblafUtils.configurarBotao(botaoSalvar, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 5);<NEW_LINE>WeblafUtils.configurarBotao(botaoSalvarComo, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 5);<NEW_LINE>WeblafUtils.configurarBotao(botaoAbrir, ColorController.COR_PRINCIPAL, ColorController.COR_LETRA, ColorController.COR_DESTAQUE, ColorController.COR_LETRA, 5);<NEW_LINE>}<NEW_LINE>} | COR_DESTAQUE, ColorController.COR_LETRA, 5); |
612,103 | public NoteEncryption.Encryption.EncPlaintext encode() {<NEW_LINE>ByteBuffer <MASK><NEW_LINE>buffer.putLong(0, value);<NEW_LINE>byte[] valueLong = buffer.array();<NEW_LINE>for (int i = 0; i < valueLong.length / 2; i++) {<NEW_LINE>byte temp = valueLong[i];<NEW_LINE>valueLong[i] = valueLong[valueLong.length - 1 - i];<NEW_LINE>valueLong[valueLong.length - 1 - i] = temp;<NEW_LINE>}<NEW_LINE>byte[] data = new byte[ZC_ENCPLAINTEXT_SIZE];<NEW_LINE>data[0] = 0x01;<NEW_LINE>System.arraycopy(d.getData(), 0, data, ZC_NOTEPLAINTEXT_LEADING, ZC_DIVERSIFIER_SIZE);<NEW_LINE>System.arraycopy(valueLong, 0, data, ZC_NOTEPLAINTEXT_LEADING + ZC_DIVERSIFIER_SIZE, ZC_V_SIZE);<NEW_LINE>System.arraycopy(rcm, 0, data, ZC_NOTEPLAINTEXT_LEADING + ZC_DIVERSIFIER_SIZE + ZC_V_SIZE, ZC_R_SIZE);<NEW_LINE>System.arraycopy(memo, 0, data, ZC_NOTEPLAINTEXT_LEADING + ZC_DIVERSIFIER_SIZE + ZC_V_SIZE + ZC_R_SIZE, ZC_MEMO_SIZE);<NEW_LINE>NoteEncryption.Encryption.EncPlaintext ret = new NoteEncryption.Encryption.EncPlaintext();<NEW_LINE>ret.setData(data);<NEW_LINE>return ret;<NEW_LINE>} | buffer = ByteBuffer.allocate(ZC_V_SIZE); |
1,718,502 | private void run(String... args) {<NEW_LINE>TreeMap<Integer, String> map = getProcesses();<NEW_LINE>System.out.println("Processes:");<NEW_LINE>System.out.println(map);<NEW_LINE>if (args.length == 0) {<NEW_LINE>System.out.println("Kill a Java process");<NEW_LINE>System.out.println("Usage: java " + getClass().getName() + " <name>");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String processName = args[0];<NEW_LINE>int killCount = 0;<NEW_LINE>for (Entry<Integer, String> e : map.entrySet()) {<NEW_LINE>String name = e.getValue();<NEW_LINE>if (name.equals(processName)) {<NEW_LINE>int pid = e.getKey();<NEW_LINE>System.out.println("Killing pid " + pid + "...");<NEW_LINE>// Windows<NEW_LINE>try {<NEW_LINE>exec("taskkill", "/pid", "" + pid, "/f");<NEW_LINE>} catch (Exception e2) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>// Unix<NEW_LINE>try {<NEW_LINE>exec("kill", "-9", "" + pid);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>System.out.println("done.");<NEW_LINE>killCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (killCount == 0) {<NEW_LINE>System.out.<MASK><NEW_LINE>}<NEW_LINE>map = getProcesses();<NEW_LINE>System.out.println("Processes now:");<NEW_LINE>System.out.println(map);<NEW_LINE>} | println("Process " + processName + " not found"); |
346,852 | public static void resolve(String[] sourceUnits, String[] encodings, String[] bindingKeys, FileASTRequestor requestor, int apiLevel, Map options, List classpaths, int flags, IProgressMonitor monitor) {<NEW_LINE>INameEnvironmentWithProgress environment = null;<NEW_LINE>CancelableProblemFactory problemFactory = null;<NEW_LINE>try {<NEW_LINE>// 1 for beginToCompile, 1 for resolve<NEW_LINE>int amountOfWork = (sourceUnits.length + bindingKeys.length) * 2;<NEW_LINE>SubMonitor subMonitor = SubMonitor.convert(monitor, amountOfWork);<NEW_LINE>Classpath[] allEntries = new Classpath[classpaths.size()];<NEW_LINE>classpaths.toArray(allEntries);<NEW_LINE>environment = new NameEnvironmentWithProgress(allEntries, null, subMonitor);<NEW_LINE>problemFactory = new CancelableProblemFactory(subMonitor);<NEW_LINE>CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);<NEW_LINE>compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;<NEW_LINE>CompilationUnitResolver resolver = new CompilationUnitResolver(environment, getHandlingPolicy(), compilerOptions, getRequestor(<MASK><NEW_LINE>resolver.resolve(sourceUnits, encodings, bindingKeys, requestor, apiLevel, options, flags);<NEW_LINE>if (NameLookup.VERBOSE && (environment instanceof CancelableNameEnvironment)) {<NEW_LINE>CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms");<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (environment != null) {<NEW_LINE>// don't hold a reference to this external object<NEW_LINE>environment.setMonitor(null);<NEW_LINE>}<NEW_LINE>if (problemFactory != null) {<NEW_LINE>// don't hold a reference to this external object<NEW_LINE>problemFactory.monitor = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), problemFactory, subMonitor, false); |
741,735 | public static void main(String[] args) throws PcapNativeException, NotOpenException {<NEW_LINE>String filter = args.length != 0 ? args[0] : "";<NEW_LINE>System.out.println(COUNT_KEY + ": " + COUNT);<NEW_LINE>System.out.println(READ_TIMEOUT_KEY + ": " + READ_TIMEOUT);<NEW_LINE>System.out.println(SNAPLEN_KEY + ": " + SNAPLEN);<NEW_LINE>System.out.println("\n");<NEW_LINE>PcapNetworkInterface nif;<NEW_LINE>try {<NEW_LINE>nif = new NifSelector().selectNetworkInterface();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (nif == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println(nif.getName() + "(" + nif.getDescription() + ")");<NEW_LINE>final PcapHandle handle = nif.openLive(SNAPLEN, PromiscuousMode.PROMISCUOUS, READ_TIMEOUT);<NEW_LINE>if (filter.length() != 0) {<NEW_LINE>handle.setFilter(filter, BpfCompileMode.OPTIMIZE);<NEW_LINE>}<NEW_LINE>PacketListener listener = new PacketListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void gotPacket(Packet packet) {<NEW_LINE>System.out.println(handle.getTimestamp());<NEW_LINE>System.out.println(packet);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>handle.loop(COUNT, listener);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>PcapStat ps = handle.getStats();<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println("ps_drop: " + ps.getNumPacketsDropped());<NEW_LINE>System.out.println("ps_ifdrop: " + ps.getNumPacketsDroppedByIf());<NEW_LINE>if (Platform.isWindows()) {<NEW_LINE>System.out.println("bs_capt: " + ps.getNumPacketsCaptured());<NEW_LINE>}<NEW_LINE>handle.close();<NEW_LINE>} | "ps_recv: " + ps.getNumPacketsReceived()); |
1,541,176 | final DescribeJobResult executeDescribeJob(DescribeJobRequest describeJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeJobRequest> request = null;<NEW_LINE>Response<DescribeJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeJobRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Snowball");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeJobResultJsonUnmarshaller());<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>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,573,001 | public static void main(String[] args) {<NEW_LINE>Exercise41_OddLengthDirectedCycle oddLengthDirectedCycle = new Exercise41_OddLengthDirectedCycle();<NEW_LINE>Digraph digraph1 = new Digraph(4);<NEW_LINE>digraph1.addEdge(0, 1);<NEW_LINE>digraph1.addEdge(1, 2);<NEW_LINE>digraph1.addEdge(2, 3);<NEW_LINE>digraph1.addEdge(3, 0);<NEW_LINE>StdOut.println("Has odd length directed cycle: " + oddLengthDirectedCycle.hasOddLengthDirectedCycle(digraph1) + " Expected: false");<NEW_LINE>Digraph digraph2 = new Digraph(5);<NEW_LINE>digraph2.addEdge(0, 1);<NEW_LINE>digraph2.addEdge(1, 2);<NEW_LINE>digraph2.addEdge(2, 0);<NEW_LINE>digraph2.addEdge(3, 4);<NEW_LINE>StdOut.println("Has odd length directed cycle: " + oddLengthDirectedCycle.hasOddLengthDirectedCycle(digraph2) + " Expected: true");<NEW_LINE>Digraph digraph3 = new Digraph(10);<NEW_LINE>digraph3.addEdge(0, 1);<NEW_LINE>digraph3.addEdge(1, 2);<NEW_LINE>digraph3.addEdge(3, 4);<NEW_LINE>digraph3.addEdge(4, 6);<NEW_LINE>digraph3.addEdge(6, 8);<NEW_LINE>digraph3.addEdge(8, 5);<NEW_LINE>digraph3.addEdge(5, 9);<NEW_LINE><MASK><NEW_LINE>digraph3.addEdge(7, 0);<NEW_LINE>StdOut.println("Has odd length directed cycle: " + oddLengthDirectedCycle.hasOddLengthDirectedCycle(digraph3) + " Expected: true");<NEW_LINE>Digraph digraph4 = new Digraph(5);<NEW_LINE>digraph4.addEdge(0, 1);<NEW_LINE>digraph4.addEdge(1, 0);<NEW_LINE>digraph4.addEdge(2, 3);<NEW_LINE>digraph4.addEdge(3, 4);<NEW_LINE>StdOut.println("Has odd length directed cycle: " + oddLengthDirectedCycle.hasOddLengthDirectedCycle(digraph4) + " Expected: false");<NEW_LINE>} | digraph3.addEdge(9, 4); |
1,731,598 | public void run() {<NEW_LINE>org.bitcoinj.core.Context.propagate(Constants.CONTEXT);<NEW_LINE>while (running.get()) {<NEW_LINE>try (// start a blocking call, and return only on success or exception<NEW_LINE>final BluetoothSocket socket = listeningSocket.accept();<NEW_LINE>final DataInputStream is = new DataInputStream(socket.getInputStream());<NEW_LINE>final DataOutputStream os = new DataOutputStream(socket.getOutputStream())) {<NEW_LINE>log.info("accepted classic bluetooth connection");<NEW_LINE>boolean ack = true;<NEW_LINE>final int numMessages = is.readInt();<NEW_LINE>for (int i = 0; i < numMessages; i++) {<NEW_LINE>final int msgLength = is.readInt();<NEW_LINE>final byte[] msg = new byte[msgLength];<NEW_LINE>is.readFully(msg);<NEW_LINE>try {<NEW_LINE>final Transaction tx = new Transaction(Constants.NETWORK_PARAMETERS, msg);<NEW_LINE>if (!handleTx(tx))<NEW_LINE>ack = false;<NEW_LINE>} catch (final ProtocolException x) {<NEW_LINE><MASK><NEW_LINE>ack = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>os.writeBoolean(ack);<NEW_LINE>} catch (final IOException x) {<NEW_LINE>log.info("exception in bluetooth accept loop", x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log.info("cannot decode message received via bluetooth", x); |
113,872 | public void doApplyInformationToEditor() {<NEW_LINE>final Long stamp = myEditor.getUserData(LAST_TIME_INDENTS_BUILT);<NEW_LINE>if (stamp != null && stamp.longValue() == nowStamp())<NEW_LINE>return;<NEW_LINE>List<RangeHighlighter> oldHighlighters = myEditor.getUserData(INDENT_HIGHLIGHTERS_IN_EDITOR_KEY);<NEW_LINE>final List<RangeHighlighter> newHighlighters = new ArrayList<>();<NEW_LINE>final MarkupModel mm = myEditor.getMarkupModel();<NEW_LINE>int curRange = 0;<NEW_LINE>if (oldHighlighters != null) {<NEW_LINE>// after document change some range highlighters could have become invalid, or the order could have been broken<NEW_LINE>oldHighlighters.sort(Comparator.comparing((RangeHighlighter h) -> !h.isValid()).thenComparing(Segment.BY_START_OFFSET_THEN_END_OFFSET));<NEW_LINE>int curHighlight = 0;<NEW_LINE>while (curRange < myRanges.size() && curHighlight < oldHighlighters.size()) {<NEW_LINE>TextRange range = myRanges.get(curRange);<NEW_LINE>RangeHighlighter highlighter = oldHighlighters.get(curHighlight);<NEW_LINE>if (!highlighter.isValid())<NEW_LINE>break;<NEW_LINE>int cmp = compare(range, highlighter);<NEW_LINE>if (cmp < 0) {<NEW_LINE>newHighlighters.add(createHighlighter(mm, range));<NEW_LINE>curRange++;<NEW_LINE>} else if (cmp > 0) {<NEW_LINE>highlighter.dispose();<NEW_LINE>curHighlight++;<NEW_LINE>} else {<NEW_LINE>newHighlighters.add(highlighter);<NEW_LINE>curHighlight++;<NEW_LINE>curRange++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (; curHighlight < oldHighlighters.size(); curHighlight++) {<NEW_LINE>RangeHighlighter highlighter = oldHighlighters.get(curHighlight);<NEW_LINE>if (!highlighter.isValid())<NEW_LINE>break;<NEW_LINE>highlighter.dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int startRangeIndex = curRange;<NEW_LINE>assert myDocument != null;<NEW_LINE>DocumentUtil.executeInBulk(myDocument, myRanges.size() > 10000, () -> {<NEW_LINE>for (int i = startRangeIndex; i < myRanges.size(); i++) {<NEW_LINE>newHighlighters.add(createHighlighter(mm, myRanges.get(i)));<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>myEditor.putUserData(LAST_TIME_INDENTS_BUILT, nowStamp());<NEW_LINE>myEditor.getIndentsModel().assumeIndents(myDescriptors);<NEW_LINE>} | myEditor.putUserData(INDENT_HIGHLIGHTERS_IN_EDITOR_KEY, newHighlighters); |
732,953 | private void readBandType3And4(BitReader _in, float[] coef, int idx, int g, int sfb, float[] vq, VLC vlc) {<NEW_LINE>int g_len = group_len[g];<NEW_LINE>int cfo = swbOffset[sfb];<NEW_LINE>int off_len = swbOffset[sfb + 1] - swbOffset[sfb];<NEW_LINE>for (int group = 0; group < g_len; group++, cfo += 128) {<NEW_LINE>int cf = cfo;<NEW_LINE>int len = off_len;<NEW_LINE>do {<NEW_LINE>int cb_idx = vlc.readVLC(_in);<NEW_LINE>int nnz = cb_idx >> 8 & 15;<NEW_LINE>int bits = nnz == 0 ? <MASK><NEW_LINE>VMUL4S(coef, cf, vq, cb_idx, bits, (float) sfs[idx]);<NEW_LINE>cf += 4;<NEW_LINE>len -= 4;<NEW_LINE>} while (len > 0);<NEW_LINE>}<NEW_LINE>} | 0 : _in.readNBit(nnz); |
118,206 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>log.fine("");<NEW_LINE>HttpSession sess = request.getSession();<NEW_LINE>WWindowStatus ws = WWindowStatus.get(request);<NEW_LINE>if (ws == null) {<NEW_LINE>WebUtil.createTimeoutPage(request, response, this, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get Mandatory Parameters<NEW_LINE>String columnName = WebUtil.getParameter(request, "ColumnName");<NEW_LINE>log.info("ColumnName=" + columnName + " - " + ws.toString());<NEW_LINE>//<NEW_LINE>GridField mField = ws.curTab.getField(columnName);<NEW_LINE>log.config("ColumnName=" + columnName + ", MField=" + mField);<NEW_LINE>if (mField == null || columnName == null || columnName.equals("")) {<NEW_LINE>WebUtil.createErrorPage(request, response, this, Msg.getMsg(ws.ctx, "ParameterMissing"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MLocation location = null;<NEW_LINE>Object value = mField.getValue();<NEW_LINE>if (value != null && value instanceof Integer)<NEW_LINE>location = new MLocation(ws.ctx, ((Integer) value).intValue(), null);<NEW_LINE>else<NEW_LINE>location = new MLocation(ws.ctx, 0, null);<NEW_LINE>// String targetBase = "parent.WWindow." + WWindow.FORM_NAME + "." + columnName;<NEW_LINE>String targetBase = "opener.WWindow." + WWindow.FORM_NAME + "." + columnName;<NEW_LINE>String action = request.getRequestURI();<NEW_LINE>// Create Document<NEW_LINE>WebDoc doc = WebDoc.createPopup(mField.getHeader());<NEW_LINE>doc.addPopupClose(ws.ctx);<NEW_LINE>boolean hasDependents = ws.curTab.hasDependants(columnName);<NEW_LINE>boolean hasCallout = mField.getCallout<MASK><NEW_LINE>// Reset<NEW_LINE>button reset = new button();<NEW_LINE>// translate<NEW_LINE>reset.addElement("Reset");<NEW_LINE>String script = targetBase + "D.value='';" + targetBase + "F.value='';closePopup();";<NEW_LINE>if (hasDependents || hasCallout)<NEW_LINE>script += "startUpdate(" + targetBase + "F);";<NEW_LINE>reset.setOnClick(script);<NEW_LINE>//<NEW_LINE>doc.getTable().addElement(new tr().addElement(fillForm(ws, action, location, targetBase, hasDependents || hasCallout)).addElement(reset));<NEW_LINE>//<NEW_LINE>doc.addPopupClose(ws.ctx);<NEW_LINE>// log.trace(log.l6_Database, doc.toString());<NEW_LINE>WebUtil.createResponse(request, response, this, null, doc, true);<NEW_LINE>} | ().length() > 0; |
1,397,973 | public UpdateVocabularyFilterResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateVocabularyFilterResult updateVocabularyFilterResult = new UpdateVocabularyFilterResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateVocabularyFilterResult;<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("VocabularyFilterName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateVocabularyFilterResult.setVocabularyFilterName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LanguageCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateVocabularyFilterResult.setLanguageCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LastModifiedTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateVocabularyFilterResult.setLastModifiedTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 updateVocabularyFilterResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
764,181 | public void validateCreateTable(SqlNode sqlCreateTable) {<NEW_LINE>// Validate all fields<NEW_LINE>SqlNode node = sqlCreateTable;<NEW_LINE>List<RelDataType> relDataTypes = new ArrayList<>();<NEW_LINE>List<String> fieldList = new ArrayList<>();<NEW_LINE>final SqlCreateTable sqlCreateTbNode = (SqlCreateTable) node;<NEW_LINE>final List<Pair<SqlIdentifier, SqlColumnDeclaration>> colDefs = sqlCreateTbNode.getColDefs();<NEW_LINE>if (colDefs != null) {<NEW_LINE>for (Pair<SqlIdentifier, SqlColumnDeclaration> column : colDefs) {<NEW_LINE>final SqlIdentifier name = column.left;<NEW_LINE>final SqlDataTypeSpec dataType = column.right.getDataType();<NEW_LINE>String typeName = dataType.getTypeName().getSimple().toUpperCase();<NEW_LINE>switch(typeName) {<NEW_LINE>case "INT":<NEW_LINE>typeName = "INTEGER";<NEW_LINE>break;<NEW_LINE>case "LONGBLOB":<NEW_LINE>typeName <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>final SqlTypeName sqlTypeName = SqlTypeName.get(typeName);<NEW_LINE>if (sqlTypeName != null) {<NEW_LINE>final RelDataType sqlType = typeFactory.createSqlType(sqlTypeName, dataType.getPrecision(), dataType.getScale());<NEW_LINE>fieldList.add(name.getSimple());<NEW_LINE>relDataTypes.add(sqlType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final RelDataType relDataType = typeFactory.createStructType(relDataTypes, fieldList);<NEW_LINE>setValidatedNodeType(node, relDataType);<NEW_LINE>} | = SqlTypeName.BLOB.getName(); |
1,797,267 | void propagate() {<NEW_LINE>if (this.parent != null) {<NEW_LINE>// Propagate the lowest death level of any descendants:<NEW_LINE>if (this.propagatedLowestChildSplitLevel == Double.MAX_VALUE) {<NEW_LINE>this.propagatedLowestChildSplitLevel = this.splitLevel;<NEW_LINE>}<NEW_LINE>if (this.propagatedLowestChildSplitLevel < this.parent.propagatedLowestChildSplitLevel) {<NEW_LINE>this.parent.propagatedLowestChildSplitLevel = this.propagatedLowestChildSplitLevel;<NEW_LINE>}<NEW_LINE>// If this cluster has no children, it must propagate itself:<NEW_LINE>if (!this.hasChildren) {<NEW_LINE>this.parent.propagatedStability += this.stability;<NEW_LINE>this.parent.propagatedDescendants.add(this);<NEW_LINE>} else {<NEW_LINE>// Chose the parent over descendants if there is a tie in stability:<NEW_LINE>if (this.stability >= this.propagatedStability) {<NEW_LINE>this.parent.propagatedStability += this.stability;<NEW_LINE>this.parent.propagatedDescendants.add(this);<NEW_LINE>} else {<NEW_LINE>this<MASK><NEW_LINE>this.parent.propagatedDescendants.addAll(this.propagatedDescendants);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .parent.propagatedStability += this.propagatedStability; |
689,194 | void swapIndex(int i, int j) {<NEW_LINE><MASK><NEW_LINE>byte tmpByte = this.y[i];<NEW_LINE>this.y[i] = this.y[j];<NEW_LINE>this.y[j] = tmpByte;<NEW_LINE>double tmp = this.gradient[i];<NEW_LINE>this.gradient[i] = this.gradient[j];<NEW_LINE>this.gradient[j] = tmp;<NEW_LINE>tmpByte = this.alphaStatus[i];<NEW_LINE>this.alphaStatus[i] = this.alphaStatus[j];<NEW_LINE>this.alphaStatus[j] = tmpByte;<NEW_LINE>tmp = this.alpha[i];<NEW_LINE>this.alpha[i] = this.alpha[j];<NEW_LINE>this.alpha[j] = tmp;<NEW_LINE>tmp = this.p[i];<NEW_LINE>this.p[i] = this.p[j];<NEW_LINE>this.p[j] = tmp;<NEW_LINE>int tmpInt = this.activeSet[i];<NEW_LINE>this.activeSet[i] = this.activeSet[j];<NEW_LINE>this.activeSet[j] = tmpInt;<NEW_LINE>tmp = this.gradientBar[i];<NEW_LINE>this.gradientBar[i] = this.gradientBar[j];<NEW_LINE>this.gradientBar[j] = tmp;<NEW_LINE>} | kernel.swapIndex(i, j); |
1,400,785 | public List<JavaFile> generate(ViewInterfaceInfo viewInterfaceInfo) {<NEW_LINE><MASK><NEW_LINE>TypeName nameWithTypeVariables = viewInterfaceInfo.getNameWithTypeVariables();<NEW_LINE>TypeSpec.Builder classBuilder = TypeSpec.classBuilder(viewName.simpleName() + MvpProcessor.VIEW_STATE_SUFFIX).addModifiers(Modifier.PUBLIC).superclass(ParameterizedTypeName.get(ClassName.get(MvpViewState.class), nameWithTypeVariables)).addSuperinterface(nameWithTypeVariables).addTypeVariables(viewInterfaceInfo.getTypeVariables());<NEW_LINE>for (ViewMethod method : viewInterfaceInfo.getMethods()) {<NEW_LINE>TypeSpec commandClass = generateCommandClass(method, nameWithTypeVariables);<NEW_LINE>classBuilder.addType(commandClass);<NEW_LINE>classBuilder.addMethod(generateMethod(method, nameWithTypeVariables, commandClass));<NEW_LINE>}<NEW_LINE>JavaFile javaFile = JavaFile.builder(viewName.packageName(), classBuilder.build()).indent("\t").build();<NEW_LINE>return Collections.singletonList(javaFile);<NEW_LINE>} | ClassName viewName = viewInterfaceInfo.getName(); |
30,893 | public ResponseEntity<?> index(HttpServletRequest request) {<NEW_LINE>Enumeration enumeration = request.getParameterNames();<NEW_LINE>Map<String, String[]> parameters = request.getParameterMap();<NEW_LINE>Map<String, String> response = new HashMap<>();<NEW_LINE>if (!parameters.containsKey(KEY_ID_PARAM_KEY) || !parameters.containsKey(SIGNATURE_PARAM_KEY)) {<NEW_LINE>response.put("verified", Boolean.FALSE.toString());<NEW_LINE>response.put("error", "Missing key_id and/or signature parameters.");<NEW_LINE>return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>Long keyId = Long.valueOf(parameters.get(KEY_ID_PARAM_KEY)[0]);<NEW_LINE>String signature = parameters.get(SIGNATURE_PARAM_KEY)[0];<NEW_LINE>String queryString = request.getQueryString();<NEW_LINE>byte[] payload = queryString.substring(0, queryString.indexOf(SIGNATURE_PARAM_KEY) - 1).getBytes(Charset.forName("UTF-8"));<NEW_LINE>response.put("payload", new String(payload));<NEW_LINE>response.put("key_id", keyId.toString());<NEW_LINE><MASK><NEW_LINE>HttpStatus status = HttpStatus.OK;<NEW_LINE>try {<NEW_LINE>verify(payload, keyId, Base64.urlSafeDecode(signature));<NEW_LINE>response.put("verified", Boolean.TRUE.toString());<NEW_LINE>} catch (GeneralSecurityException exception) {<NEW_LINE>status = HttpStatus.BAD_REQUEST;<NEW_LINE>response.put("verified", Boolean.FALSE.toString());<NEW_LINE>response.put("error", exception.getMessage());<NEW_LINE>}<NEW_LINE>return new ResponseEntity<>(response, status);<NEW_LINE>} | response.put("sig", signature); |
848,764 | public ResponseEntity<Resource> stream(Authentication authentication, @RequestParam(required = false) Integer playlist, @RequestParam(required = false) String format, @RequestParam(required = false) String suffix, @RequestParam Optional<Integer> maxBitRate, @RequestParam Optional<Integer> id, @RequestParam Optional<String> path, @RequestParam(required = false) Double offsetSeconds, ServletWebRequest swr) throws Exception {<NEW_LINE>HttpServletRequest request = wrapRequest(swr.getRequest());<NEW_LINE>User user = securityService.<MASK><NEW_LINE>if (!user.isStreamRole()) {<NEW_LINE>throw new APIException(ErrorCode.NOT_AUTHORIZED, user.getUsername() + " is not authorized to play files.");<NEW_LINE>}<NEW_LINE>return streamController.handleRequest(authentication, playlist, format, suffix, maxBitRate, id, path, offsetSeconds, new ServletWebRequest(request, swr.getResponse()));<NEW_LINE>} | getUserByName(authentication.getName()); |
419,986 | public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake_classname_test";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] { "api_key_query" };<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
847,838 | private void runAssertionSelectNested(RegressionEnvironment env, String typename, FunctionSendEvent send, Function<Object, Object> optionalValueConversion, Pair[] tests, Class expectedPropertyType, RegressionPath path) {<NEW_LINE>String stmtText = "@name('s0') select " + " item.nested?.nestedValue as n1, " + " exists(item.nested?.nestedValue) as exists_n1, " + " item.nested?.nestedValue? as n2, " + " exists(item.nested?.nestedValue?) as exists_n2, " + " item.nested?.nestedNested.nestedNestedValue as n3, " + " exists(item.nested?.nestedNested.nestedNestedValue) as exists_n3, " + " item.nested?.nestedNested?.nestedNestedValue as n4, " + " exists(item.nested?.nestedNested?.nestedNestedValue) as exists_n4, " + " item.nested?.nestedNested.nestedNestedValue? as n5, " + " exists(item.nested?.nestedNested.nestedNestedValue?) as exists_n5, " <MASK><NEW_LINE>env.compileDeploy(stmtText, path).addListener("s0");<NEW_LINE>String[] propertyNames = "n1,n2,n3,n4,n5,n6".split(",");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType eventType = statement.getEventType();<NEW_LINE>for (String propertyName : propertyNames) {<NEW_LINE>assertEquals(expectedPropertyType, eventType.getPropertyType(propertyName));<NEW_LINE>assertEquals(Boolean.class, eventType.getPropertyType("exists_" + propertyName));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (Pair pair : tests) {<NEW_LINE>send.apply(env, pair.getFirst(), typename);<NEW_LINE>env.assertEventNew("s0", event -> SupportEventInfra.assertValuesMayConvert(event, propertyNames, (ValueWithExistsFlag[]) pair.getSecond(), optionalValueConversion));<NEW_LINE>}<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>} | + " item.nested?.nestedNested?.nestedNestedValue? as n6, " + " exists(item.nested?.nestedNested?.nestedNestedValue?) as exists_n6 " + " from " + typename; |
188,493 | final DeletePortfolioResult executeDeletePortfolio(DeletePortfolioRequest deletePortfolioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePortfolioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePortfolioRequest> request = null;<NEW_LINE>Response<DeletePortfolioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePortfolioRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePortfolioRequest));<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.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePortfolio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePortfolioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePortfolioResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,561,014 | protected void deactivate(ComponentContext context) {<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>// Block the progress of deactivate so that session manager is able to access the cache until it finishes stopping applications.<NEW_LINE>// The approach of blocking is copied from DatabaseStoreService as a temporary workaround. It would be nice to have a better solution here.<NEW_LINE>final long MAX_WAIT = TimeUnit.SECONDS.toNanos(10);<NEW_LINE>for (long start = System.nanoTime(); !completedPassivation && System.nanoTime() - start < MAX_WAIT; ) try {<NEW_LINE>// sleep 1/10th of a second<NEW_LINE><MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>if (cachingProvider != null) {<NEW_LINE>if (trace && tc.isDebugEnabled())<NEW_LINE>CacheHashMap.tcInvoke(tcCachingProvider, "close");<NEW_LINE>AccessController.doPrivileged((PrivilegedAction<Void>) () -> {<NEW_LINE>if (cacheManagerService == null) {<NEW_LINE>cachingProvider.close();<NEW_LINE>}<NEW_LINE>if (cacheConfigUtil != null) {<NEW_LINE>cacheConfigUtil.cleanup();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>if (trace && tc.isDebugEnabled())<NEW_LINE>CacheHashMap.tcReturn(tcCachingProvider, "close");<NEW_LINE>cachingProvider = null;<NEW_LINE>cacheManager = null;<NEW_LINE>cacheConfigUtil = null;<NEW_LINE>}<NEW_LINE>} | TimeUnit.MILLISECONDS.sleep(100); |
695,751 | private void zip(ZipOutputStream out, File root, File file, TransferStatus status, HttpRange range) throws IOException {<NEW_LINE>// Exclude all hidden files starting with a "."<NEW_LINE>if (file.getName().startsWith(".")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String zipName = file.getCanonicalPath().substring(root.getCanonicalPath().length() + 1);<NEW_LINE>if (file.isFile()) {<NEW_LINE>status.setFile(file);<NEW_LINE><MASK><NEW_LINE>zipEntry.setSize(file.length());<NEW_LINE>zipEntry.setCompressedSize(file.length());<NEW_LINE>zipEntry.setCrc(computeCrc(file));<NEW_LINE>out.putNextEntry(zipEntry);<NEW_LINE>copyFileToStream(file, out, status, range);<NEW_LINE>out.closeEntry();<NEW_LINE>} else {<NEW_LINE>ZipEntry zipEntry = new ZipEntry(zipName + '/');<NEW_LINE>zipEntry.setSize(0);<NEW_LINE>zipEntry.setCompressedSize(0);<NEW_LINE>zipEntry.setCrc(0);<NEW_LINE>out.putNextEntry(zipEntry);<NEW_LINE>out.closeEntry();<NEW_LINE>File[] children = FileUtil.listFiles(file);<NEW_LINE>for (File child : children) {<NEW_LINE>zip(out, root, child, status, range);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ZipEntry zipEntry = new ZipEntry(zipName); |
746,453 | public static boolean handleLocalCommands(UUID chatId, String text) {<NEW_LINE>final StringTokenizer st = new StringTokenizer(text.trim());<NEW_LINE>final int tokens = st.countTokens();<NEW_LINE>if (tokens == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String serverAddress = SessionHandler.getSession().getServerHostname().orElse("");<NEW_LINE>Optional<String> response = Optional.empty();<NEW_LINE>String command = st.nextToken();<NEW_LINE>switch(command) {<NEW_LINE>case "/ignore":<NEW_LINE>case "\\ignore":<NEW_LINE><MASK><NEW_LINE>response = Optional.of(IgnoreList.ignore(serverAddress, ignoreTarget));<NEW_LINE>break;<NEW_LINE>case "/unignore":<NEW_LINE>case "\\unignore":<NEW_LINE>final String unignoreTarget = getRemainingTokens(st);<NEW_LINE>response = Optional.of(IgnoreList.unignore(serverAddress, unignoreTarget));<NEW_LINE>break;<NEW_LINE>// TODO: move profanity settings to here<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (response.isPresent()) {<NEW_LINE>displayLocalCommandResponse(chatId, response.get());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | final String ignoreTarget = getRemainingTokens(st); |
1,788,587 | public PrioritySearcher<DBIDRef> search(DBIDRef query) {<NEW_LINE>off = 0;<NEW_LINE>threshold = Double.POSITIVE_INFINITY;<NEW_LINE>int x = ids.getOffset(query);<NEW_LINE>int pos = triangleSize(x);<NEW_LINE>// Initialize ids:<NEW_LINE>idx[0] = x;<NEW_LINE>for (int y = 0; y < x; y++) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (int y = x + 1, size = dists.length; y < size; y++) {<NEW_LINE>idx[y] = y;<NEW_LINE>}<NEW_LINE>// Initialize distances:<NEW_LINE>dists[0] = 0;<NEW_LINE>System.arraycopy(matrix, pos, dists, 1, x);<NEW_LINE>pos = triangleSize(x + 1) + x;<NEW_LINE>for (int y = x + 1, size = dists.length; y < size; pos += y++) {<NEW_LINE>dists[y] = matrix[pos];<NEW_LINE>}<NEW_LINE>sorted = 1;<NEW_LINE>return this;<NEW_LINE>} | idx[y + 1] = y; |
1,225,700 | private void _notWriteDefault(MethodVisitor mw, FieldInfo property, Context context, Label _end) {<NEW_LINE>if (context.writeDirect) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Label elseLabel = new Label();<NEW_LINE>mw.visitVarInsn(ILOAD, context.var("notWriteDefaultValue"));<NEW_LINE>mw.visitJumpInsn(IFEQ, elseLabel);<NEW_LINE>Class<?> propertyClass = property.fieldClass;<NEW_LINE>if (propertyClass == boolean.class) {<NEW_LINE>mw.visitVarInsn(ILOAD, context.var("boolean"));<NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>} else if (propertyClass == byte.class) {<NEW_LINE>mw.visitVarInsn(ILOAD, context.var("byte"));<NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>} else if (propertyClass == short.class) {<NEW_LINE>mw.visitVarInsn(ILOAD<MASK><NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>} else if (propertyClass == int.class) {<NEW_LINE>mw.visitVarInsn(ILOAD, context.var("int"));<NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>} else if (propertyClass == long.class) {<NEW_LINE>mw.visitVarInsn(LLOAD, context.var("long"));<NEW_LINE>mw.visitInsn(LCONST_0);<NEW_LINE>mw.visitInsn(LCMP);<NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>} else if (propertyClass == float.class) {<NEW_LINE>mw.visitVarInsn(FLOAD, context.var("float"));<NEW_LINE>mw.visitInsn(FCONST_0);<NEW_LINE>mw.visitInsn(FCMPL);<NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>} else if (propertyClass == double.class) {<NEW_LINE>mw.visitVarInsn(DLOAD, context.var("double"));<NEW_LINE>mw.visitInsn(DCONST_0);<NEW_LINE>mw.visitInsn(DCMPL);<NEW_LINE>mw.visitJumpInsn(IFEQ, _end);<NEW_LINE>}<NEW_LINE>mw.visitLabel(elseLabel);<NEW_LINE>} | , context.var("short")); |
145,882 | public static void transformPermanent(Permanent permanent, Card sourceCard, Game game, Ability source) {<NEW_LINE>if (sourceCard == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>permanent.setTransformed(true);<NEW_LINE>permanent.setName(sourceCard.getName());<NEW_LINE>permanent.getColor(game).setColor(sourceCard.getColor(game));<NEW_LINE>permanent.getManaCost().clear();<NEW_LINE>permanent.getManaCost().add(sourceCard.getManaCost().copy());<NEW_LINE>permanent.removeAllCardTypes(game);<NEW_LINE>for (CardType type : sourceCard.getCardType(game)) {<NEW_LINE>permanent.addCardType(game, type);<NEW_LINE>}<NEW_LINE>permanent.removeAllSubTypes(game);<NEW_LINE><MASK><NEW_LINE>permanent.getSuperType().clear();<NEW_LINE>for (SuperType type : sourceCard.getSuperType()) {<NEW_LINE>permanent.addSuperType(type);<NEW_LINE>}<NEW_LINE>permanent.setExpansionSetCode(sourceCard.getExpansionSetCode());<NEW_LINE>permanent.getAbilities().clear();<NEW_LINE>for (Ability ability : sourceCard.getAbilities()) {<NEW_LINE>// source == null -- call from init card (e.g. own abilities)<NEW_LINE>// source != null -- from apply effect<NEW_LINE>permanent.addAbility(ability, source == null ? permanent.getId() : source.getSourceId(), game);<NEW_LINE>}<NEW_LINE>permanent.getPower().modifyBaseValue(sourceCard.getPower().getValue());<NEW_LINE>permanent.getToughness().modifyBaseValue(sourceCard.getToughness().getValue());<NEW_LINE>permanent.setStartingLoyalty(sourceCard.getStartingLoyalty());<NEW_LINE>} | permanent.copySubTypesFrom(game, sourceCard); |
1,640,200 | public WebDriver create(String name, DesiredCapabilities capabilities, String seleniumHost) {<NEW_LINE>RemoteWebDriver driver = null;<NEW_LINE>if (seleniumHost == null) {<NEW_LINE>seleniumHost = Configuration.getSeleniumUrl();<NEW_LINE>}<NEW_LINE>if (isCapabilitiesEmpty(capabilities)) {<NEW_LINE>capabilities = getCapabilities(name);<NEW_LINE>}<NEW_LINE>if (staticCapabilities != null) {<NEW_LINE>LOGGER.info("Static DesiredCapabilities will be merged to basic driver capabilities");<NEW_LINE>capabilities.merge(staticCapabilities);<NEW_LINE>}<NEW_LINE>LOGGER.debug("capabilities: " + capabilities);<NEW_LINE>try {<NEW_LINE>EventFiringSeleniumCommandExecutor ce = new <MASK><NEW_LINE>driver = new RemoteWebDriver(ce, capabilities);<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new RuntimeException("Malformed selenium URL!", e);<NEW_LINE>}<NEW_LINE>resizeBrowserWindow(driver, capabilities);<NEW_LINE>return driver;<NEW_LINE>} | EventFiringSeleniumCommandExecutor(new URL(seleniumHost)); |
1,523,351 | private void calculateAdditionalSpaceForYAxisTextWidth() {<NEW_LINE>double maxWidth = 0;<NEW_LINE>double valueWidth;<NEW_LINE>if (axisConfig.isxDescription()) {<NEW_LINE>// y-axis contains values<NEW_LINE>if (axisConfig.drawValueAxisMarkerText()) {<NEW_LINE>for (Double v : valuesShownOnAxisSorted) {<NEW_LINE>valueWidth = base.textWidth(String.valueOf(v));<NEW_LINE>if (valueWidth > maxWidth) {<NEW_LINE>maxWidth = valueWidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// y-axis contains description<NEW_LINE>if (axisConfig.drawDescriptionAxisMarkerText()) {<NEW_LINE>for (String d : desc) {<NEW_LINE>valueWidth = base.textWidth(d);<NEW_LINE>if (valueWidth > maxWidth) {<NEW_LINE>maxWidth = valueWidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double adjustValue = maxWidth + canvas.getOuterLeftPos() - (axisConfig.getyAxisPos() - canvas.getInnerLeftPos()) - 5;<NEW_LINE>if (adjustValue > canvas.getOuterLeftPos()) {<NEW_LINE>canvas.setBorderX((int) adjustValue);<NEW_LINE>setupAxis();<NEW_LINE>// If the y-axis is not exactly over the innerleft-border, it will be displaced by the last setupAxis() call and therefore the additional space for it must be recalculated again<NEW_LINE>if (axisConfig.getyAxisPos() - canvas.getInnerLeftPos() != 0) {<NEW_LINE>adjustValue = maxWidth + canvas.getOuterLeftPos() - (axisConfig.getyAxisPos() - canvas.getInnerLeftPos()) - 5;<NEW_LINE>if (adjustValue > canvas.getOuterLeftPos()) {<NEW_LINE>canvas<MASK><NEW_LINE>setupAxis();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .setBorderX((int) adjustValue); |
674,297 | public static OneWireBindingConfig createOneWireDeviceProperty(Item pvItem, String pvBindingConfig) throws BindingConfigParseException {<NEW_LINE>logger.debug("createOneWireDeviceProperty: {} - bindingConfig:{}", <MASK><NEW_LINE>OneWireBindingConfig lvNewBindingConfig = null;<NEW_LINE>if (OneWireClearCacheControlBindingConfig.isBindingConfigToCreate(pvItem, pvBindingConfig)) {<NEW_LINE>lvNewBindingConfig = new OneWireClearCacheControlBindingConfig(pvBindingConfig);<NEW_LINE>} else if (OneWireDevicePropertyPushButtonBindingConfig.isBindingConfigToCreate(pvItem, pvBindingConfig)) {<NEW_LINE>lvNewBindingConfig = new OneWireDevicePropertyPushButtonBindingConfig(pvBindingConfig);<NEW_LINE>} else if (OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig.isBindingConfigToCreate(pvItem, pvBindingConfig)) {<NEW_LINE>lvNewBindingConfig = new OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig(pvBindingConfig);<NEW_LINE>} else if (pvItem instanceof NumberItem) {<NEW_LINE>lvNewBindingConfig = new OneWireDevicePropertyNumberBindingConfig(pvBindingConfig);<NEW_LINE>} else if (pvItem instanceof ContactItem) {<NEW_LINE>lvNewBindingConfig = new OneWireDevicePropertyContactBindingConfig(pvBindingConfig);<NEW_LINE>} else if (pvItem instanceof SwitchItem) {<NEW_LINE>lvNewBindingConfig = new OneWireDevicePropertySwitchBindingConfig(pvBindingConfig);<NEW_LINE>} else if (pvItem instanceof StringItem) {<NEW_LINE>lvNewBindingConfig = new OneWireDevicePropertyStringBindingConfig(pvBindingConfig);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("the item-type " + pvItem.getClass() + " cannot be a onewire device");<NEW_LINE>}<NEW_LINE>logger.debug("created newBindingConfig: {}", lvNewBindingConfig.toString());<NEW_LINE>return lvNewBindingConfig;<NEW_LINE>} | pvItem.getName(), pvBindingConfig); |
537,190 | public void marshall(AwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getAutoprovision(), AUTOPROVISION_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getDriver(), DRIVER_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getDriverOpts(), DRIVEROPTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getLabels(), LABELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getScope(), SCOPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
502,554 | private SortedSetEntry readSortedSet(IndexInput meta) throws IOException {<NEW_LINE>SortedSetEntry entry = new SortedSetEntry();<NEW_LINE>byte multiValued = meta.readByte();<NEW_LINE>switch(multiValued) {<NEW_LINE>case // singlevalued<NEW_LINE>0:<NEW_LINE><MASK><NEW_LINE>return entry;<NEW_LINE>case // multivalued<NEW_LINE>1:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new CorruptIndexException("Invalid multiValued flag: " + multiValued, meta);<NEW_LINE>}<NEW_LINE>entry.docsWithFieldOffset = meta.readLong();<NEW_LINE>entry.docsWithFieldLength = meta.readLong();<NEW_LINE>entry.jumpTableEntryCount = meta.readShort();<NEW_LINE>entry.denseRankPower = meta.readByte();<NEW_LINE>entry.bitsPerValue = meta.readByte();<NEW_LINE>entry.ordsOffset = meta.readLong();<NEW_LINE>entry.ordsLength = meta.readLong();<NEW_LINE>entry.numDocsWithField = meta.readInt();<NEW_LINE>entry.addressesOffset = meta.readLong();<NEW_LINE>final int blockShift = meta.readVInt();<NEW_LINE>entry.addressesMeta = LegacyDirectMonotonicReader.loadMeta(meta, entry.numDocsWithField + 1, blockShift);<NEW_LINE>entry.addressesLength = meta.readLong();<NEW_LINE>readTermDict(meta, entry);<NEW_LINE>return entry;<NEW_LINE>} | entry.singleValueEntry = readSorted(meta); |
328,665 | private ImmutableMap<String, JdbcTable> computeTables() {<NEW_LINE>Connection connection = null;<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>try {<NEW_LINE>connection = dataSource.getConnection();<NEW_LINE>DatabaseMetaData metaData = connection.getMetaData();<NEW_LINE>resultSet = metaData.getTables(catalog, schema, null, null);<NEW_LINE>final ImmutableMap.Builder<String, JdbcTable> builder = ImmutableMap.builder();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>final String tableName = resultSet.getString(3);<NEW_LINE>final String catalogName = resultSet.getString(1);<NEW_LINE>final String <MASK><NEW_LINE>final String tableTypeName = resultSet.getString(4);<NEW_LINE>// Clean up table type. In particular, this ensures that 'SYSTEM TABLE',<NEW_LINE>// returned by Phoenix among others, maps to TableType.SYSTEM_TABLE.<NEW_LINE>// We know enum constants are upper-case without spaces, so we can't<NEW_LINE>// make things worse.<NEW_LINE>//<NEW_LINE>// PostgreSQL returns tableTypeName==null for pg_toast* tables<NEW_LINE>// This can happen if you start JdbcSchema off a "public" PG schema<NEW_LINE>// The tables are not designed to be queried by users, however we do<NEW_LINE>// not filter them as we keep all the other table types.<NEW_LINE>final String tableTypeName2 = tableTypeName == null ? null : tableTypeName.toUpperCase(Locale.ROOT).replace(' ', '_');<NEW_LINE>final TableType tableType = Util.enumVal(TableType.OTHER, tableTypeName2);<NEW_LINE>if (tableType == TableType.OTHER && tableTypeName2 != null) {<NEW_LINE>System.out.println("Unknown table type: " + tableTypeName2);<NEW_LINE>}<NEW_LINE>final JdbcTable table = new JdbcTable(this, catalogName, schemaName, tableName, tableType);<NEW_LINE>builder.put(tableName, table);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException("Exception while reading tables", e);<NEW_LINE>} finally {<NEW_LINE>close(connection, null, resultSet);<NEW_LINE>}<NEW_LINE>} | schemaName = resultSet.getString(2); |
545,184 | protected void initializeCapacities(MkAppEntry exampleLeaf) {<NEW_LINE>// exampleLeaf.getParentDistance().externalizableSize();<NEW_LINE>int distanceSize = ByteArrayUtil.SIZE_DOUBLE;<NEW_LINE>// overhead = index(4), numEntries(4), id(4), isLeaf(0.125)<NEW_LINE>double overhead = 12.125;<NEW_LINE>if (getPageSize() - overhead < 0) {<NEW_LINE>throw new RuntimeException("Node size of " + getPageSize() + " Bytes is chosen too small!");<NEW_LINE>}<NEW_LINE>// dirCapacity = (file.getPageSize() - overhead) / (nodeID + objectID +<NEW_LINE>// coveringRadius + parentDistance + approx) + 1<NEW_LINE>dirCapacity = (int) (getPageSize() - overhead) / (4 + 4 + distanceSize + distanceSize + (settings.p + 1) * 4 + 2) + 1;<NEW_LINE>if (dirCapacity <= 1) {<NEW_LINE>throw new RuntimeException("Node size of " + getPageSize() + " Bytes is chosen too small!");<NEW_LINE>}<NEW_LINE>if (dirCapacity < 10) {<NEW_LINE>LOG.warning("Page size is choosen too small! Maximum number of entries " + "in a directory node = " + (dirCapacity - 1));<NEW_LINE>}<NEW_LINE>// leafCapacity = (file.getPageSize() - overhead) / (objectID +<NEW_LINE>// parentDistance +<NEW_LINE>// approx) + 1<NEW_LINE>leafCapacity = (int) (getPageSize() - overhead) / (4 + distanceSize + (settings.p + 1) * 4 + 2) + 1;<NEW_LINE>if (leafCapacity <= 1) {<NEW_LINE>throw new RuntimeException("Node size of " + getPageSize() + " Bytes is chosen too small!");<NEW_LINE>}<NEW_LINE>if (leafCapacity < 10) {<NEW_LINE>LOG.warning("Page size is choosen too small! Maximum number of entries " + "in a leaf node = " + (leafCapacity - 1));<NEW_LINE>}<NEW_LINE>initialized = true;<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>LOG.verbose("Directory Capacity: " + (dirCapacity - 1) + <MASK><NEW_LINE>}<NEW_LINE>} | "\nLeaf Capacity: " + (leafCapacity - 1)); |
139,012 | private void drawLabel(Canvas canvas, Line line, PointValue pointValue, float rawX, float rawY, float offset) {<NEW_LINE>final Rect contentRect = computator.getContentRectMinusAllMargins();<NEW_LINE>final int numChars = line.getFormatter().formatChartValue(labelBuffer, pointValue);<NEW_LINE>if (numChars == 0) {<NEW_LINE>// No need to draw empty label<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final float labelWidth = labelPaint.measureText(labelBuffer, labelBuffer.length - numChars, numChars);<NEW_LINE>final int labelHeight = Math.abs(fontMetrics.ascent);<NEW_LINE>float left = rawX - labelWidth / 2 - labelMargin;<NEW_LINE>float right = rawX + labelWidth / 2 + labelMargin;<NEW_LINE>float top;<NEW_LINE>float bottom;<NEW_LINE>if (pointValue.getY() >= baseValue) {<NEW_LINE>top = rawY <MASK><NEW_LINE>bottom = rawY - offset;<NEW_LINE>} else {<NEW_LINE>top = rawY + offset;<NEW_LINE>bottom = rawY + offset + labelHeight + labelMargin * 2;<NEW_LINE>}<NEW_LINE>if (top < contentRect.top) {<NEW_LINE>top = rawY + offset;<NEW_LINE>bottom = rawY + offset + labelHeight + labelMargin * 2;<NEW_LINE>}<NEW_LINE>if (bottom > contentRect.bottom) {<NEW_LINE>top = rawY - offset - labelHeight - labelMargin * 2;<NEW_LINE>bottom = rawY - offset;<NEW_LINE>}<NEW_LINE>if (left < contentRect.left) {<NEW_LINE>left = rawX;<NEW_LINE>right = rawX + labelWidth + labelMargin * 2;<NEW_LINE>}<NEW_LINE>if (right > contentRect.right) {<NEW_LINE>left = rawX - labelWidth - labelMargin * 2;<NEW_LINE>right = rawX;<NEW_LINE>}<NEW_LINE>labelBackgroundRect.set(left, top, right, bottom);<NEW_LINE>drawLabelTextAndBackground(canvas, labelBuffer, labelBuffer.length - numChars, numChars, line.getDarkenColor());<NEW_LINE>} | - offset - labelHeight - labelMargin * 2; |
203,925 | public Controller createController() {<NEW_LINE>try {<NEW_LINE>Controller controller = new Controller(applicationResourceController);<NEW_LINE>Controller.setCurrentController(controller);<NEW_LINE>applicationResourceController.init();<NEW_LINE>LogInitializer.createLogger();<NEW_LINE>ApplicationResourceController.showSysInfo();<NEW_LINE>final HeadlessMapViewController mapViewController = new HeadlessMapViewController();<NEW_LINE>controller.setMapViewManager(mapViewController);<NEW_LINE>viewController = new HeadlessUIController(controller, mapViewController, "");<NEW_LINE>controller.setViewController(viewController);<NEW_LINE>controller.addExtension(HighlightController.class, new HighlightController());<NEW_LINE>FilterController.install();<NEW_LINE>FormatController.install(new FormatController());<NEW_LINE><MASK><NEW_LINE>ScannerController.install(scannerController);<NEW_LINE>scannerController.addParsersForStandardFormats();<NEW_LINE>ModelessAttributeController.install();<NEW_LINE>TextController.install();<NEW_LINE>TimeController.install();<NEW_LINE>LinkController.install();<NEW_LINE>IconController.installConditionControllers();<NEW_LINE>HelpController.install();<NEW_LINE>FilterController.getCurrentFilterController().getConditionFactory().addConditionController(70, new LogicalStyleFilterController());<NEW_LINE>MapController.install();<NEW_LINE>NodeHistory.install(controller);<NEW_LINE>return controller;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LogUtils.severe(e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | final ScannerController scannerController = new ScannerController(); |
791,157 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create table MyTable(k1 string primary key, c1 int);\n" + "insert into MyTable select theString as k1, intPrimitive as c1 from SupportBean;\n";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>epl = "@public on SupportBean_S0 " + " insert into AStream select MyTable['A'].c1 as c0 where id=1" + " insert into AStream select MyTable['B'].c1 as c0 where id=2;\n";<NEW_LINE><MASK><NEW_LINE>env.compileDeploy("@name('out') select * from AStream", path).addListener("out");<NEW_LINE>env.sendEventBean(new SupportBean("A", 10));<NEW_LINE>env.sendEventBean(new SupportBean("B", 20));<NEW_LINE>env.sendEventBean(new SupportBean_S0(1));<NEW_LINE>env.assertEqualsNew("out", "c0", 10);<NEW_LINE>env.sendEventBean(new SupportBean_S0(2));<NEW_LINE>env.assertEqualsNew("out", "c0", 20);<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeploy(epl, path); |
238,527 | private void handleSearchResult(SearchResult sr) {<NEW_LINE>final int hitCountTotal = sr.getTotalHitCount();<NEW_LINE>final int hitCount = sr.getHitCount();<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.log(Level.FINE, "Got SearchResult with " + hitCountTotal + " in total and " + hitCount + " hits in real for query with selection " + params.getDocumentSelection());<NEW_LINE>}<NEW_LINE>List<SearchResult.Hit> newHits = new ArrayList<>(hitCount);<NEW_LINE>for (int i = 0; i < hitCount; i++) {<NEW_LINE>SearchResult.Hit hit = sr.getHit(i);<NEW_LINE>newHits.add(hit);<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>totalHitCount += hitCountTotal;<NEW_LINE>hits = ListMerger.mergeIntoArrayList(hits, newHits, query.getOffset(<MASK><NEW_LINE>}<NEW_LINE>Map<Integer, byte[]> newGroupingMap = sr.getGroupingList();<NEW_LINE>mergeGroupingMaps(newGroupingMap);<NEW_LINE>} | ) + query.getHits()); |
1,424,493 | public Request<RequestEnvironmentInfoRequest> marshall(RequestEnvironmentInfoRequest requestEnvironmentInfoRequest) {<NEW_LINE>if (requestEnvironmentInfoRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RequestEnvironmentInfoRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "RequestEnvironmentInfo");<NEW_LINE>request.addParameter("Version", "2010-12-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (requestEnvironmentInfoRequest.getEnvironmentId() != null) {<NEW_LINE>request.addParameter("EnvironmentId", StringUtils.fromString(requestEnvironmentInfoRequest.getEnvironmentId()));<NEW_LINE>}<NEW_LINE>if (requestEnvironmentInfoRequest.getEnvironmentName() != null) {<NEW_LINE>request.addParameter("EnvironmentName", StringUtils.fromString(requestEnvironmentInfoRequest.getEnvironmentName()));<NEW_LINE>}<NEW_LINE>if (requestEnvironmentInfoRequest.getInfoType() != null) {<NEW_LINE>request.addParameter("InfoType", StringUtils.fromString(requestEnvironmentInfoRequest.getInfoType()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <RequestEnvironmentInfoRequest>(requestEnvironmentInfoRequest, "AWSElasticBeanstalk"); |
56,135 | private Scanner createScanner(Locale loc) {<NEW_LINE>final Scanner s = new Scanner(new String[] { loc.toString() }, false);<NEW_LINE>s.setFirstChars("+-0123456789,.");<NEW_LINE>final DateFormat shortDateTimeFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, loc);<NEW_LINE>if (shortDateTimeFormat instanceof SimpleDateFormat) {<NEW_LINE>s.addParser(createParser(STYLE_DATE, TYPE_DATETIME, ((SimpleDateFormat) shortDateTimeFormat).toPattern(), loc, "short datetime format"));<NEW_LINE>}<NEW_LINE>final DateFormat shortDateFormat = SimpleDateFormat.getDateInstance(DateFormat.SHORT, loc);<NEW_LINE>if (shortDateFormat instanceof SimpleDateFormat) {<NEW_LINE>s.addParser(createParser(STYLE_DATE, TYPE_DATE, ((SimpleDateFormat) shortDateFormat).toPattern<MASK><NEW_LINE>}<NEW_LINE>s.addParser(createParser(STYLE_DECIMAL, TYPE_NUMBER, null, loc, "number format"));<NEW_LINE>s.addParser(createParser(STYLE_ISODATE, TYPE_DATETIME, null, loc, "ISO reader for date and date/time"));<NEW_LINE>s.addParser(createParser(STYLE_NUMBERLITERAL, TYPE_NUMBER, null, loc, "support dot as decimal separator (if nothing else matches)"));<NEW_LINE>return s;<NEW_LINE>} | (), loc, "short date format")); |
731,056 | public void onChapterLoadSuccess(List<Chapter> list) {<NEW_LINE>hideProgressBar();<NEW_LINE>if (mPresenter.getComic().getTitle() != null && mPresenter.getComic().getCover() != null) {<NEW_LINE>mDetailAdapter.clear();<NEW_LINE>mDetailAdapter.addAll(list);<NEW_LINE>mDetailAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>if (App.getPreferenceManager().getBoolean(PreferenceManager.PREF_OTHER_FIREBASE_EVENT, true)) {<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>bundle.putString(FirebaseAnalytics.Param.CONTENT, mPresenter.getComic().getTitle());<NEW_LINE>bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Title");<NEW_LINE>bundle.putInt(FirebaseAnalytics.Param.SOURCE, mPresenter.getComic().getSource());<NEW_LINE>bundle.putBoolean(<MASK><NEW_LINE>FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);<NEW_LINE>mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);<NEW_LINE>}<NEW_LINE>} | FirebaseAnalytics.Param.SUCCESS, true); |
436,168 | public OBinaryResponse executeCreateDatabase(OCreateDatabaseRequest request) {<NEW_LINE>if (server.existsDatabase(request.getDatabaseName()))<NEW_LINE>throw new ODatabaseException("Database named '" + request.getDatabaseName() + "' already exists");<NEW_LINE>if (request.getBackupPath() != null && !"".equals(request.getBackupPath().trim())) {<NEW_LINE>server.restore(request.getDatabaseName(), request.getBackupPath());<NEW_LINE>} else {<NEW_LINE>server.createDatabase(request.getDatabaseName(), ODatabaseType.valueOf(request.getStorageMode().toUpperCase(Locale.ENGLISH)), null);<NEW_LINE>}<NEW_LINE>OLogManager.instance().info(this, "Created database '%s' of type '%s'", request.getDatabaseName(<MASK><NEW_LINE>// TODO: it should be here an additional check for open with the right user<NEW_LINE>connection.setDatabase(server.getDatabases().openNoAuthenticate(request.getDatabaseName(), connection.getServerUser().getName()));<NEW_LINE>return new OCreateDatabaseResponse();<NEW_LINE>} | ), request.getStorageMode()); |
466,546 | //<NEW_LINE>public // to this analysis of this method (which depends on context)<NEW_LINE>// to this analysis of this method (which depends on context)<NEW_LINE>boolean // to this analysis of this method (which depends on context)<NEW_LINE>isObjectLocal(Value local) {<NEW_LINE>EquivalentValue source = new CachedEquivalentValue(new AbstractDataSource(new String("SHARED")));<NEW_LINE>if (infoFlowGraph.containsNode(source)) {<NEW_LINE>List sinks = infoFlowGraph.getSuccsOf(source);<NEW_LINE>if (printMessages) {<NEW_LINE>logger.debug(" Requested value " + local + " is " + (!sinks.contains(new CachedEquivalentValue(local)) ? "Local" : "Shared") + " in " + sm + " ");<NEW_LINE>}<NEW_LINE>return !sinks.contains(new CachedEquivalentValue(local));<NEW_LINE>} else {<NEW_LINE>if (printMessages) {<NEW_LINE>logger.debug(" Requested value " + <MASK><NEW_LINE>}<NEW_LINE>// no shared data in this method<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | local + " is Local (LIKE ALL VALUES) in " + sm + " "); |
1,088,085 | private void processG1GCPhase(GCLogTrace trace, String line) {<NEW_LINE>String phase = trace.getGroup(1);<NEW_LINE>if ("Code Root Fixup".equals(phase))<NEW_LINE>((G1Young) forwardReference).setCodeRootFixupDuration(trace.getDoubleGroup(2));<NEW_LINE>else if ("Code Root Migration".equals(phase))<NEW_LINE>((G1Young) forwardReference).setCodeRootMigrationDuration(trace.getDoubleGroup(2));<NEW_LINE>else if ("Code Root Purge".equals(phase))<NEW_LINE>((G1Young) forwardReference).setCodeRootPurgeDuration(trace.getDoubleGroup(2));<NEW_LINE>else if ("Clear CT".equals(phase))<NEW_LINE>((G1Young) forwardReference).setClearCTDuration(trace.getDoubleGroup(2));<NEW_LINE>else if ("Other".equals(phase))<NEW_LINE>((G1Young) forwardReference).setOtherPhaseDurations(trace.getDoubleGroup(2));<NEW_LINE>else if ("Expand Heap".equals(phase)) {<NEW_LINE>((G1Young) forwardReference).setExpandHeapDuration<MASK><NEW_LINE>} else<NEW_LINE>trace.notYetImplemented();<NEW_LINE>} | (trace.getDoubleGroup(2)); |
119,778 | //<NEW_LINE>@Override<NEW_LINE>protected void visitAnnotation(final AnnotationNode node) {<NEW_LINE>ClassNode type = node.getClassNode();<NEW_LINE>VariableScope scope = scopes.getLast();<NEW_LINE>TypeLookupResult noLookup = new TypeLookupResult(type, type, node, TypeConfidence.EXACT, scope);<NEW_LINE>VisitStatus status = notifyRequestor(node, requestor, noLookup);<NEW_LINE>switch(status) {<NEW_LINE>case CONTINUE:<NEW_LINE>// visit annotation label<NEW_LINE>visitClassReference(type);<NEW_LINE>// visit attribute labels<NEW_LINE>visitAnnotationKeys(node);<NEW_LINE>// visit attribute values<NEW_LINE>super.visitAnnotation(node);<NEW_LINE>ClosureExpression test = node.getNodeMetaData(org.codehaus.groovy.transform.ASTTestTransformation.class);<NEW_LINE>if (test != null) {<NEW_LINE>Deque<VariableScope> saved = new java.<MASK><NEW_LINE>scopes.clear();<NEW_LINE>scopes.add(new VariableScope(null, enclosingModule, true));<NEW_LINE>scopes.add(new VariableScope(scopes.getLast(), ClassHelper.SCRIPT_TYPE, false));<NEW_LINE>scopes.add(scope = new VariableScope(scopes.getLast(), ClassHelper.SCRIPT_TYPE.getMethod("run", Parameter.EMPTY_ARRAY), false));<NEW_LINE>try {<NEW_LINE>scope.addVariable("compilationUnit", ClassHelper.make(org.codehaus.groovy.control.CompilationUnit.class), ClassHelper.BINDING_TYPE);<NEW_LINE>scope.addVariable("compilePhase", ClassHelper.make(org.codehaus.groovy.control.CompilePhase.class), ClassHelper.BINDING_TYPE);<NEW_LINE>scope.addVariable("sourceUnit", ClassHelper.make(org.codehaus.groovy.control.SourceUnit.class), ClassHelper.BINDING_TYPE);<NEW_LINE>scope.addVariable("lookup", ClassHelper.CLOSURE_TYPE.getPlainNodeReference(), ClassHelper.BINDING_TYPE);<NEW_LINE>scope.addVariable("node", ClassHelper.make(ASTNode.class), ClassHelper.BINDING_TYPE);<NEW_LINE>test.getCode().visit(this);<NEW_LINE>} finally {<NEW_LINE>scopes.clear();<NEW_LINE>scopes.addAll(saved);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CANCEL_BRANCH:<NEW_LINE>return;<NEW_LINE>case CANCEL_MEMBER:<NEW_LINE>case STOP_VISIT:<NEW_LINE>throw new VisitCompleted(status);<NEW_LINE>}<NEW_LINE>} | util.ArrayDeque<>(scopes); |
22,406 | public static Collection Collection(Context context, @NonNull String path, boolean server, boolean log, @NonNull Time time) {<NEW_LINE>assert (path.endsWith(".anki2") || path.endsWith(".anki21"));<NEW_LINE>File dbFile = new File(path);<NEW_LINE>boolean create = !dbFile.exists();<NEW_LINE>DroidBackend backend = <MASK><NEW_LINE>DB db = backend.openCollectionDatabase(sUseInMemory ? ":memory:" : path);<NEW_LINE>try {<NEW_LINE>// initialize<NEW_LINE>int ver;<NEW_LINE>if (create) {<NEW_LINE>ver = _createDB(db, time, backend);<NEW_LINE>} else {<NEW_LINE>ver = _upgradeSchema(db, time);<NEW_LINE>}<NEW_LINE>db.execute("PRAGMA temp_store = memory");<NEW_LINE>// add db to col and do any remaining upgrades<NEW_LINE>Collection col = backend.createCollection(context, db, path, server, log, time);<NEW_LINE>if (ver < Consts.SCHEMA_VERSION) {<NEW_LINE>_upgrade(col, ver);<NEW_LINE>} else if (ver > Consts.SCHEMA_VERSION) {<NEW_LINE>throw new RuntimeException("This file requires a newer version of Anki.");<NEW_LINE>} else if (create) {<NEW_LINE>addNoteTypes(col, backend);<NEW_LINE>col.onCreate();<NEW_LINE>col.save();<NEW_LINE>}<NEW_LINE>return col;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Timber.e(e, "Error opening collection; closing database");<NEW_LINE>db.close();<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | DroidBackendFactory.getInstance(useBackend()); |
321,739 | private boolean startAuthActivityForResult(Activity activity) {<NEW_LINE>final PackageManager pm = activity.getPackageManager();<NEW_LINE>final String packageName = availableSSOPackage(pm);<NEW_LINE>if (packageName == null) {<NEW_LINE>Twitter.getLogger().e(TwitterCore.TAG, "SSO app signature check failed", null);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final ComponentName ssoActivity <MASK><NEW_LINE>final TwitterAuthConfig authConfig = getAuthConfig();<NEW_LINE>final Intent intent = new Intent().setComponent(ssoActivity);<NEW_LINE>if (!IntentUtils.isActivityAvailable(activity, intent)) {<NEW_LINE>Twitter.getLogger().e(TwitterCore.TAG, "SSO auth activity not found", null);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>intent.putExtra(EXTRA_CONSUMER_KEY, authConfig.getConsumerKey()).putExtra(EXTRA_CONSUMER_SECRET, authConfig.getConsumerSecret());<NEW_LINE>try {<NEW_LINE>activity.startActivityForResult(intent, requestCode);<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Twitter.getLogger().e(TwitterCore.TAG, "SSO exception occurred", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | = new ComponentName(packageName, SSO_CLASS_NAME); |
1,225,898 | private Component buildToolbar() {<NEW_LINE>JXToolBar toolbar = UISupport.createToolbar();<NEW_LINE>methodCombo = new JComboBox(RestRequestInterface.HttpMethod.getMethods());<NEW_LINE>methodCombo.setSelectedItem(getModelItem().getMethod());<NEW_LINE>methodCombo.setToolTipText("Set desired HTTP method");<NEW_LINE>methodCombo.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>updatingRequest = true;<NEW_LINE>getModelItem().setMethod((RestRequestInterface.HttpMethod) methodCombo.getSelectedItem());<NEW_LINE>updatingRequest = false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>toolbar.addSeparator();<NEW_LINE>toolbar.addFixed(createActionButton(SwingActionDelegate.createDelegate(NewRestRequestAction.SOAPUI_ACTION_ID, getModelItem(), null, "/create_empty_request.gif"), true));<NEW_LINE>toolbar.addSeparator();<NEW_LINE>toolbar.addGlue();<NEW_LINE>toolbar.add(UISupport.createToolbarButton(new ShowOnlineHelpAction(HelpUrls.RESTMETHODEDITOR_HELP_URL)));<NEW_LINE>return toolbar;<NEW_LINE>} | toolbar.addLabeledFixed("HTTP method", methodCombo); |
1,429,598 | public BooleanExpr toBooleanExpr(Configuration c, CiscoConfiguration cc, Warnings w) {<NEW_LINE>Disjunction d = new Disjunction();<NEW_LINE>List<BooleanExpr> disjuncts = d.getDisjuncts();<NEW_LINE>for (String listName : _listNames) {<NEW_LINE>Object list;<NEW_LINE>Ip6AccessList ipAccessList = null;<NEW_LINE>Route6FilterList routeFilterList = null;<NEW_LINE>if (_routing) {<NEW_LINE>routeFilterList = c.getRoute6FilterLists().get(listName);<NEW_LINE>list = routeFilterList;<NEW_LINE>} else {<NEW_LINE>ipAccessList = c.getIp6AccessLists().get(listName);<NEW_LINE>list = ipAccessList;<NEW_LINE>}<NEW_LINE>if (list != null) {<NEW_LINE>if (_routing) {<NEW_LINE>disjuncts.add(new MatchPrefix6Set(new DestinationNetwork6(), new NamedPrefix6Set(listName)));<NEW_LINE>} else {<NEW_LINE>disjuncts.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return d.simplify();<NEW_LINE>} | add(new MatchIp6AccessList(listName)); |
1,817,087 | @Produces(MediaType.APPLICATION_JSON)<NEW_LINE>public JSONArray autoComplete(@FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, /* Optional: not needed for some completions */<NEW_LINE>@FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName, @FormDataParam(CoordConsts.SVC_KEY_COMPLETION_TYPE) String completionType, @FormDataParam(CoordConsts.SVC_KEY_QUERY) String query, /* Optional */<NEW_LINE>@FormDataParam(CoordConsts.SVC_KEY_MAX_SUGGESTIONS) String maxSuggestions) {<NEW_LINE>try {<NEW_LINE>_logger.infof("WMS:autoComplete %s %s %s\n", completionType, query, maxSuggestions);<NEW_LINE>checkStringParam(apiKey, "API key");<NEW_LINE>checkStringParam(clientVersion, "Client version");<NEW_LINE>checkStringParam(networkName, "Network name");<NEW_LINE>checkStringParam(completionType, "Completion type");<NEW_LINE>checkApiKeyValidity(apiKey);<NEW_LINE>checkNetworkAccessibility(apiKey, networkName);<NEW_LINE>Variable.Type varType = Variable.Type.fromString(completionType);<NEW_LINE>List<AutocompleteSuggestion> answer = Main.getWorkMgr().autoComplete(networkName, snapshotName, varType, query, Strings.isNullOrEmpty(maxSuggestions) ? Integer.MAX_VALUE : Integer.parseInt(maxSuggestions));<NEW_LINE>if (answer == null) {<NEW_LINE>return failureResponse("There was a problem getting Autocomplete suggestions - network or snapshot does not" + " exist!");<NEW_LINE>}<NEW_LINE>List<String> serializedSuggestions = answer.stream().map(BatfishObjectMapper::writeStringRuntimeError).collect(Collectors.toList());<NEW_LINE>InputValidationNotes validationNotes = Main.getWorkMgr().validateInput(networkName, snapshotName, varType, query);<NEW_LINE>String serializedMetadata = BatfishObjectMapper.writeString(validationNotes);<NEW_LINE>return successResponse(new JSONObject().put(CoordConsts.SVC_KEY_SUGGESTIONS, serializedSuggestions).put(CoordConsts.SVC_KEY_QUERY_METADATA, serializedMetadata));<NEW_LINE>} catch (IllegalArgumentException | AccessControlException e) {<NEW_LINE>_logger.errorf("WMS:autoComplete exception: %s\n", e.getMessage());<NEW_LINE>return failureResponse(e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>String stackTrace = Throwables.getStackTraceAsString(e);<NEW_LINE><MASK><NEW_LINE>return failureResponse(e.getMessage());<NEW_LINE>}<NEW_LINE>} | _logger.errorf("WMS:autoComplete exception: %s", stackTrace); |
1,013,505 | public ListenerResult listen(WorkflowContext context) {<NEW_LINE>GroupResourceProcessForm form = (GroupResourceProcessForm) context.getProcessForm();<NEW_LINE>String groupId = form.getInlongGroupId();<NEW_LINE><MASK><NEW_LINE>log.info("begin to execute UpdateGroupCompleteListener for groupId={}, operateType={}", groupId, operateType);<NEW_LINE>// update inlong group status and other configs<NEW_LINE>String operator = context.getOperator();<NEW_LINE>switch(operateType) {<NEW_LINE>case SUSPEND:<NEW_LINE>groupService.updateStatus(groupId, GroupStatus.SUSPENDED.getCode(), operator);<NEW_LINE>break;<NEW_LINE>case RESTART:<NEW_LINE>groupService.updateStatus(groupId, GroupStatus.RESTARTED.getCode(), operator);<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>groupService.updateStatus(groupId, GroupStatus.DELETED.getCode(), operator);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.warn("unsupported operate={} for inlong group", operateType);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>InlongGroupInfo groupInfo = form.getGroupInfo();<NEW_LINE>groupService.update(groupInfo.genRequest(), operator);<NEW_LINE>// if the inlong group is lightweight mode, the stream source needs to be processed.<NEW_LINE>if (InlongConstants.LIGHTWEIGHT_MODE.equals(groupInfo.getLightweight())) {<NEW_LINE>changeSource4Lightweight(groupId, operateType, operator);<NEW_LINE>}<NEW_LINE>log.info("success to execute UpdateGroupCompleteListener for groupId={}, operateType={}", groupId, operateType);<NEW_LINE>return ListenerResult.success();<NEW_LINE>} | GroupOperateType operateType = form.getGroupOperateType(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.