idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
99,819 | public Object evaluate(EditorAdaptor vim, Queue<String> command) throws CommandExecutionException {<NEW_LINE>LocalConfiguration configuration = vim.getConfiguration();<NEW_LINE>String hlScope = <MASK><NEW_LINE>if (hlScope.equals(SEARCH_HL_SCOPE_CLEAR)) {<NEW_LINE>// Every other editor must be cleared of highlighting.<NEW_LINE>clearHighlightExceptCurrent(vim, command);<NEW_LINE>}<NEW_LINE>// When using local registers, the search register is local. Act as if hlscope = "local"<NEW_LINE>if (hlScope.equals(SEARCH_HL_SCOPE_WINDOW)) {<NEW_LINE>try {<NEW_LINE>vim.getBufferAndTabService().doInBuffers(false, command, new Evaluator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object evaluate(EditorAdaptor vim, Queue<String> command) throws CommandExecutionException {<NEW_LINE>// Grab search for each editor - some might use local registers.<NEW_LINE>Search lastSearch = vim.getRegisterManager().getSearch();<NEW_LINE>vim.getSearchAndReplaceService().highlight(lastSearch);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (BufferDoException e) {<NEW_LINE>VrapperLog.error("search highlighting failed", e);<NEW_LINE>throw new CommandExecutionException("search highlighting failed: " + e.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Search lastSearch = vim.getRegisterManager().getSearch();<NEW_LINE>vim.getSearchAndReplaceService().highlight(lastSearch);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | configuration.get(Options.SEARCH_HL_SCOPE); |
1,041,429 | private static void tryAssertionTimeWinUnique(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "theString" };<NEW_LINE>env.advanceTime(1000);<NEW_LINE>sendEvent(env, "E1", 1);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E1"));<NEW_LINE>env.assertPropsNew("s0", fields, <MASK><NEW_LINE>env.milestone(1);<NEW_LINE>env.advanceTime(2000);<NEW_LINE>sendEvent(env, "E2", 2);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E1", "E2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E2" });<NEW_LINE>env.milestone(2);<NEW_LINE>env.advanceTime(3000);<NEW_LINE>sendEvent(env, "E3", 1);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { "E3" }, new Object[] { "E1" });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E2", "E3"));<NEW_LINE>env.milestone(3);<NEW_LINE>env.advanceTime(4000);<NEW_LINE>sendEvent(env, "E4", 3);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E4" });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E2", "E3", "E4"));<NEW_LINE>sendEvent(env, "E5", 3);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { "E5" }, new Object[] { "E4" });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E2", "E3", "E5"));<NEW_LINE>env.milestone(4);<NEW_LINE>env.advanceTime(11999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(12000);<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "E2" });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E3", "E5"));<NEW_LINE>env.milestone(5);<NEW_LINE>env.advanceTime(12999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(13000);<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "E3" });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr("E5"));<NEW_LINE>env.milestone(6);<NEW_LINE>env.advanceTime(13999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(14000);<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "E5" });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, toArr());<NEW_LINE>} | new Object[] { "E1" }); |
1,157,622 | public V next() {<NEW_LINE>if (!iter.hasNext()) {<NEW_LINE>if (group != null) {<NEW_LINE>Group current = group;<NEW_LINE>group = null;<NEW_LINE>return transform(current);<NEW_LINE>} else {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>// This type is mandated by the key type<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>K[] row = (K[]) iter.next().toArray();<NEW_LINE>if (group == null) {<NEW_LINE>group = new GroupImpl(groupExpressions, maps);<NEW_LINE>groupId = row[0];<NEW_LINE>group.add(row);<NEW_LINE>} else if (Objects.equals(groupId, row[0])) {<NEW_LINE>group.add(row);<NEW_LINE>} else {<NEW_LINE>Group current = group;<NEW_LINE>group <MASK><NEW_LINE>groupId = row[0];<NEW_LINE>group.add(row);<NEW_LINE>return transform(current);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Group current = group;<NEW_LINE>group = null;<NEW_LINE>return transform(current);<NEW_LINE>} | = new GroupImpl(groupExpressions, maps); |
325,010 | final CreateUserProfileResult executeCreateUserProfile(CreateUserProfileRequest createUserProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createUserProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateUserProfileRequest> request = null;<NEW_LINE>Response<CreateUserProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateUserProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createUserProfileRequest));<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, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateUserProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateUserProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateUserProfileResultJsonUnmarshaller());<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,111,592 | public void translateTag(NbtMapBuilder builder, CompoundTag tag, int blockState) {<NEW_LINE>if (tag == null || tag.size() < 5) {<NEW_LINE>// These values aren't here<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Java infers from the block state, but Bedrock needs it in the tag<NEW_LINE>builder.put("conditionalMode", BlockStateValues.getCommandBlockValues().getOrDefault(blockState, (byte) 0));<NEW_LINE>// Java and Bedrock values<NEW_LINE>builder.put("conditionMet", ((ByteTag) tag.get("conditionMet")).getValue());<NEW_LINE>builder.put("auto", ((ByteTag) tag.get("auto")).getValue());<NEW_LINE>builder.put("CustomName", MessageTranslator.convertMessage(((StringTag) tag.get("CustomName")).getValue()));<NEW_LINE>builder.put("powered", ((ByteTag) tag.get(<MASK><NEW_LINE>builder.put("Command", ((StringTag) tag.get("Command")).getValue());<NEW_LINE>builder.put("SuccessCount", ((IntTag) tag.get("SuccessCount")).getValue());<NEW_LINE>builder.put("TrackOutput", ((ByteTag) tag.get("TrackOutput")).getValue());<NEW_LINE>builder.put("UpdateLastExecution", ((ByteTag) tag.get("UpdateLastExecution")).getValue());<NEW_LINE>if (tag.get("LastExecution") != null) {<NEW_LINE>builder.put("LastExecution", ((LongTag) tag.get("LastExecution")).getValue());<NEW_LINE>} else {<NEW_LINE>builder.put("LastExecution", (long) 0);<NEW_LINE>}<NEW_LINE>} | "powered")).getValue()); |
689,948 | public boolean saveLogFile() {<NEW_LINE>File outputDir = null;<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss");<NEW_LINE>Date now = new Date();<NEW_LINE>String logFileName = "deltachat-log-" + dateFormat.format(now) + ".txt";<NEW_LINE>try {<NEW_LINE>outputDir = <MASK><NEW_LINE>String logText = logPreview.getText().toString();<NEW_LINE>if (!logText.trim().equals("")) {<NEW_LINE>File logFile = new File(outputDir + "/" + logFileName);<NEW_LINE>if (!logFile.exists())<NEW_LINE>logFile.createNewFile();<NEW_LINE>FileWriter logFileWriter = new FileWriter(logFile, false);<NEW_LINE>BufferedWriter logFileBufferWriter = new BufferedWriter(logFileWriter);<NEW_LINE>logFileBufferWriter.write(logText);<NEW_LINE>logFileBufferWriter.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); |
1,623,777 | public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>app = requiredMyApplication();<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>folderName = savedInstanceState.getString(FOLDER_NAME_KEY);<NEW_LINE>}<NEW_LINE>items.add(new TitleItem(getString(R.string.add_new_folder)));<NEW_LINE>View view = UiUtilities.getInflater(app, nightMode).inflate(R.layout.track_name_edit_text, null);<NEW_LINE>nameTextBox = view.findViewById(R.id.name_text_box);<NEW_LINE>int textBoxBgColorId = nightMode ? R.color.color_white : R.color.activity_background_color_light;<NEW_LINE>int textBoxBgColor = ContextCompat.getColor(app, textBoxBgColorId);<NEW_LINE>if (nightMode) {<NEW_LINE>textBoxBgColor = <MASK><NEW_LINE>}<NEW_LINE>nameTextBox.setBoxBackgroundColor(textBoxBgColor);<NEW_LINE>nameTextBox.setHint(AndroidUtils.addColon(app, R.string.shared_string_name));<NEW_LINE>ColorStateList colorStateList = ColorStateList.valueOf(ColorUtilities.getSecondaryTextColor(app, nightMode));<NEW_LINE>nameTextBox.setDefaultHintTextColor(colorStateList);<NEW_LINE>editText = view.findViewById(R.id.name_edit_text);<NEW_LINE>editText.setText(folderName);<NEW_LINE>editText.addTextChangedListener(new TextWatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeTextChanged(CharSequence s, int start, int count, int after) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTextChanged(CharSequence s, int start, int before, int count) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void afterTextChanged(Editable s) {<NEW_LINE>updateFileNameFromEditText(s.toString());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>BaseBottomSheetItem editFolderName = new BaseBottomSheetItem.Builder().setCustomView(view).create();<NEW_LINE>items.add(editFolderName);<NEW_LINE>items.add(new DividerSpaceItem(app, AndroidUtils.dpToPx(app, 12)));<NEW_LINE>} | ColorUtilities.getColorWithAlpha(textBoxBgColor, 0.1f); |
345,790 | public org.apache.dubbo.remoting.RemotingServer bind(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException {<NEW_LINE>if (arg0 == null)<NEW_LINE>throw new IllegalArgumentException("url == null");<NEW_LINE>org.apache.dubbo.common.URL url = arg0;<NEW_LINE>String extName = url.getParameter("server", url.getParameter("transporter", "netty"));<NEW_LINE>if (extName == null)<NEW_LINE>throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url (" + url.toString() + ") use keys([server, transporter])");<NEW_LINE>ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.<MASK><NEW_LINE>org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter) scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Transporter.class).getExtension(extName);<NEW_LINE>return extension.bind(arg0, arg1);<NEW_LINE>} | dubbo.remoting.Transporter.class); |
162,636 | private // <editor-fold desc="actions OK/APPLY/CANCEL, dirty "><NEW_LINE>void actionPerformedUpdates(Window _parent) {<NEW_LINE>boolean tempDirty = isDirty();<NEW_LINE>if (paneNaming.isDirty()) {<NEW_LINE>String filename = paneNaming.getAbsolutePath();<NEW_LINE>if (filename.contains("%")) {<NEW_LINE>Debug.error("%s\n%% in filename replaced with _", filename);<NEW_LINE>filename = <MASK><NEW_LINE>}<NEW_LINE>String oldFilename = imgBtn.getFilename();<NEW_LINE>if (new File(filename).exists()) {<NEW_LINE>String name = new File(filename).getName();<NEW_LINE>int ret = JOptionPane.showConfirmDialog(_parent, SikuliIDEI18N._I("msgFileExists", name), SikuliIDEI18N._I("dlgFileExists"), JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION);<NEW_LINE>if (ret != JOptionPane.YES_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isFileOverwritten) {<NEW_LINE>if (!revertImageRename()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isFileOverwritten = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileManager.xcopy(oldFilename, filename);<NEW_LINE>renameScreenshot(oldFilename, filename);<NEW_LINE>imgBtn.setImage(filename);<NEW_LINE>fileRenameOld = oldFilename;<NEW_LINE>fileRenameNew = filename;<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>Debug.error("renaming failed: old: %s \nnew: %s\n%s", oldFilename, filename, ioe.getMessage());<NEW_LINE>isFileOverwritten = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// paneNaming.updateFilename();<NEW_LINE>addDirty(true);<NEW_LINE>}<NEW_LINE>Rectangle changedBounds = _tarOffsetPane.getChangedBounds();<NEW_LINE>if (changedBounds != null) {<NEW_LINE>File file = new File(paneNaming.getAbsolutePath());<NEW_LINE>BufferedImage changedImg = _simg.getImage().getSubimage(changedBounds.x, changedBounds.y, changedBounds.width, changedBounds.height);<NEW_LINE>try {<NEW_LINE>ImageIO.write(changedImg, "png", file);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Debug.error("PatternWindow: Error while saving resized pattern image: %s", e.getMessage());<NEW_LINE>}<NEW_LINE>// TODO imgBtn.reloadImage();<NEW_LINE>_screenshot.reloadImage();<NEW_LINE>paneNaming.reloadImage();<NEW_LINE>currentPane.repaint();<NEW_LINE>if (!currentPane.hasScreenshotImage(file.getName())) {<NEW_LINE>_simg.save(file.getName(), currentPane.context.getScreenshotFolder().getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addDirty(imgBtn.setParameters(_screenshot.isExact(), _screenshot.getSimilarity(), _screenshot.getNumMatches()));<NEW_LINE>addDirty(imgBtn.setTargetOffset(_tarOffsetPane.getTargetOffset()));<NEW_LINE>if (isDirty() || tempDirty) {<NEW_LINE>Debug.log(3, "Preview: update: " + imgBtn.toString());<NEW_LINE>int i = imgBtn.getWindow().tabPane.getSelectedIndex();<NEW_LINE>imgBtn.getWindow().setMessageApplied(i, true);<NEW_LINE>imgBtn.repaint();<NEW_LINE>}<NEW_LINE>} | filename.replace("%", "_"); |
1,431,773 | public void sawOpcode(int seen) {<NEW_LINE>if (state == SEEN_NOTHING) {<NEW_LINE>if ((seen == Const.DCONST_0) || (seen == Const.DCONST_1)) {<NEW_LINE>constValue = seen - Const.DCONST_0;<NEW_LINE>state = SEEN_DCONST;<NEW_LINE>} else if ((seen == Const.LDC2_W) || (seen == Const.LDC_W)) {<NEW_LINE>state = SEEN_DCONST;<NEW_LINE>Constant c = this.getConstantRefOperand();<NEW_LINE>if (c instanceof ConstantDouble) {<NEW_LINE>constValue = ((ConstantDouble) c).getBytes();<NEW_LINE>} else if (c instanceof ConstantFloat) {<NEW_LINE>constValue = ((<MASK><NEW_LINE>} else if (c instanceof ConstantLong) {<NEW_LINE>constValue = ((ConstantLong) c).getBytes();<NEW_LINE>} else {<NEW_LINE>state = SEEN_NOTHING;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (state == SEEN_DCONST) {<NEW_LINE>if (seen == Const.INVOKESTATIC) {<NEW_LINE>state = SEEN_NOTHING;<NEW_LINE>if ("java.lang.Math".equals(getDottedClassConstantOperand())) {<NEW_LINE>String methodName = getNameConstantOperand();<NEW_LINE>if (((constValue == 0.0) && zeroMethods.contains(methodName)) || ((constValue == 1.0) && oneMethods.contains(methodName)) || (anyMethods.contains(methodName))) {<NEW_LINE>bugReporter.reportBug(new BugInstance(this, "UM_UNNECESSARY_MATH", LOW_PRIORITY).addClassAndMethod(this).addSourceLine(this));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>state = SEEN_NOTHING;<NEW_LINE>}<NEW_LINE>} | ConstantFloat) c).getBytes(); |
497,941 | final CreateGroupMembershipResult executeCreateGroupMembership(CreateGroupMembershipRequest createGroupMembershipRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createGroupMembershipRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateGroupMembershipRequest> request = null;<NEW_LINE>Response<CreateGroupMembershipResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateGroupMembershipRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createGroupMembershipRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateGroupMembership");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateGroupMembershipResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateGroupMembershipResultJsonUnmarshaller());<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); |
735,559 | private String receiveUpdateFromCentral() throws Exception {<NEW_LINE>ProcessInfo pi = getProcessInfo();<NEW_LINE>RemoteUpdateVO data = (RemoteUpdateVO) pi.getSerializableObject();<NEW_LINE>log.info(<MASK><NEW_LINE>//<NEW_LINE>RowSet sourceRS = data.CentralData;<NEW_LINE>if (sourceRS == null) {<NEW_LINE>log.log(Level.SEVERE, "receiveUpdateFromCentral - No Data - " + data);<NEW_LINE>pi.setSummary("NoData", true);<NEW_LINE>} else if (!data.Test.booleanValue()) {<NEW_LINE>RowSet targetRS = ReplicationLocal.getRowSet(data.Sql, null);<NEW_LINE>Object result = doIt(ReplicationLocal.START, "sync", new // Sync<NEW_LINE>Object[] { data.TableName, data.KeyColumns, sourceRS, targetRS, data.Test, Boolean.FALSE });<NEW_LINE>log.fine("receiveUpdateFromCentral - " + data.TableName + " - " + result);<NEW_LINE>pi.setSerializableObject(null);<NEW_LINE>boolean replicated = ReplicationLocal.isReplicated(result);<NEW_LINE>if (!replicated)<NEW_LINE>pi.setError(true);<NEW_LINE>if (result != null)<NEW_LINE>pi.addLog(0, null, null, result.toString());<NEW_LINE>if (Boolean.FALSE.equals(result))<NEW_LINE>throw new Exception("receiveUpdateFromCentral - " + data.TableName + " - " + result);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>pi.setSerializableObject(null);<NEW_LINE>log.info("receiveUpdateFromCentral End (" + pi + ") - " + data);<NEW_LINE>return "Remote Receive Update from Central OK";<NEW_LINE>} | "receiveUpdateFromCentral Start (" + pi + ") - " + data); |
1,007,560 | private Map<TransactionTO, TransactionRemoteFile> retrieveRemoteTransactions() throws StorageException {<NEW_LINE>Map<String, TransactionRemoteFile> <MASK><NEW_LINE>Map<TransactionTO, TransactionRemoteFile> transactions = new HashMap<TransactionTO, TransactionRemoteFile>();<NEW_LINE>for (TransactionRemoteFile transaction : transactionFiles.values()) {<NEW_LINE>try {<NEW_LINE>File transactionFile = createTempFile("transaction");<NEW_LINE>try {<NEW_LINE>// Download transaction file<NEW_LINE>download(transaction, transactionFile);<NEW_LINE>} catch (StorageFileNotFoundException e) {<NEW_LINE>// This happens if the file is deleted between listing and downloading. It is now final, so we skip it.<NEW_LINE>logger.log(Level.INFO, "Could not find transaction file: " + transaction);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Transformer transformer = config == null ? null : config.getTransformer();<NEW_LINE>TransactionTO transactionTO = TransactionTO.load(transformer, transactionFile);<NEW_LINE>// Extract final locations<NEW_LINE>transactions.put(transactionTO, transaction);<NEW_LINE>transactionFile.delete();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new StorageException("Failed to read transactionFile", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transactions;<NEW_LINE>} | transactionFiles = list(TransactionRemoteFile.class); |
1,208,798 | private void initInternalLibraryPath() {<NEW_LINE>try {<NEW_LINE>final Bundle bundle = Platform.getBundle(BuiltInModuleHelper.BUNDLE_ID);<NEW_LINE>Enumeration<URL> installedInternalModules = bundle.findEntries(BuiltInModuleHelper.STANDARD_MODULES_PATH, BuiltInModuleHelper.STANDARD_MODULES, true);<NEW_LINE>if (installedInternalModules == null) {<NEW_LINE>// Toolbox is running from inside Eclipse (dev mode) and the StandardModules are<NEW_LINE>// found in a slightly different location.<NEW_LINE>installedInternalModules = bundle.findEntries(File.separator + "src" + File.separator + BuiltInModuleHelper.STANDARD_MODULES_PATH, BuiltInModuleHelper.STANDARD_MODULES, true);<NEW_LINE>}<NEW_LINE>while (installedInternalModules.hasMoreElements()) {<NEW_LINE>final URL library = installedInternalModules.nextElement();<NEW_LINE>if (library != null) {<NEW_LINE>// add external (resolved) URL<NEW_LINE>final String path = FileLocator.<MASK><NEW_LINE>libraryPathEntries.add(path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | resolve(library).getPath(); |
970,965 | public boolean containsValue(@CheckForNull Object value) {<NEW_LINE>// does not impact recency ordering<NEW_LINE>if (value == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// This implementation is patterned after ConcurrentHashMap, but without the locking. The only<NEW_LINE>// way for it to return a false negative would be for the target value to jump around in the map<NEW_LINE>// such that none of the subsequent iterations observed it, despite the fact that at every point<NEW_LINE>// in time it was present somewhere int the map. This becomes increasingly unlikely as<NEW_LINE>// CONTAINS_VALUE_RETRIES increases, though without locking it is theoretically possible.<NEW_LINE>long now = ticker.read();<NEW_LINE>final Segment<K, V<MASK><NEW_LINE>long last = -1L;<NEW_LINE>for (int i = 0; i < CONTAINS_VALUE_RETRIES; i++) {<NEW_LINE>long sum = 0L;<NEW_LINE>for (Segment<K, V> segment : segments) {<NEW_LINE>// ensure visibility of most recent completed write<NEW_LINE>// read-volatile<NEW_LINE>int unused = segment.count;<NEW_LINE>AtomicReferenceArray<ReferenceEntry<K, V>> table = segment.table;<NEW_LINE>for (int j = 0; j < table.length(); j++) {<NEW_LINE>for (ReferenceEntry<K, V> e = table.get(j); e != null; e = e.getNext()) {<NEW_LINE>V v = segment.getLiveValue(e, now);<NEW_LINE>if (v != null && valueEquivalence.equivalent(value, v)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sum += segment.modCount;<NEW_LINE>}<NEW_LINE>if (sum == last) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>last = sum;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | >[] segments = this.segments; |
1,179,362 | public static void main(String[] args) {<NEW_LINE>MediaManager media = DefaultMediaManager.INSTANCE;<NEW_LINE>// String fileName0 = UtilIO.pathExample("denseflow/dogdance07.png");<NEW_LINE>// String fileName1 = UtilIO.pathExample("denseflow/dogdance08.png");<NEW_LINE>String fileName0 = UtilIO.pathExample("denseflow/Urban2_07.png");<NEW_LINE>String fileName1 = UtilIO.pathExample("denseflow/Urban2_08.png");<NEW_LINE>// String fileName0 = UtilIO.pathExample("denseflow/Grove2_07.png");<NEW_LINE>// String fileName1 = UtilIO.pathExample("denseflow/Grove2_09.png");<NEW_LINE>// FactoryDenseOpticalFlow.flowKlt(null, 6, GrayF32.class, null);<NEW_LINE>DenseOpticalFlow<GrayF32> // FactoryDenseOpticalFlow.flowKlt(null, 6, GrayF32.class, null);<NEW_LINE>denseFlow = // FactoryDenseOpticalFlow.region(null,GrayF32.class);<NEW_LINE>// FactoryDenseOpticalFlow.hornSchunck(20, 1000, GrayF32.class);<NEW_LINE>// FactoryDenseOpticalFlow.hornSchunckPyramid(null,GrayF32.class);<NEW_LINE>FactoryDenseOpticalFlow.broxWarping(null, GrayF32.class);<NEW_LINE>BufferedImage buff0 = media.openImage(fileName0);<NEW_LINE>BufferedImage buff1 = media.openImage(fileName1);<NEW_LINE>GrayF32 full = new GrayF32(buff0.getWidth(), buff0.getHeight());<NEW_LINE>// Dense optical flow is very computationally expensive. Just process the image at 1/2 resolution<NEW_LINE>GrayF32 previous = new GrayF32(full.width / 2, full.height / 2);<NEW_LINE>GrayF32 current = previous.createSameShape();<NEW_LINE>ImageFlow flow = new ImageFlow(previous.width, previous.height);<NEW_LINE>ConvertBufferedImage.convertFrom(buff0, full);<NEW_LINE>new FDistort(full, previous).scaleExt().apply();<NEW_LINE>ConvertBufferedImage.convertFrom(buff1, full);<NEW_LINE>new FDistort(full, current).scaleExt().apply();<NEW_LINE>// compute dense motion<NEW_LINE>denseFlow.process(previous, current, flow);<NEW_LINE>// Visualize the results<NEW_LINE>PanelGridPanel gui = new PanelGridPanel(1, 2);<NEW_LINE>BufferedImage converted0 = new BufferedImage(current.width, current.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>BufferedImage converted1 = new BufferedImage(current.width, current.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>BufferedImage visualized = new BufferedImage(current.width, current.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>ConvertBufferedImage.<MASK><NEW_LINE>ConvertBufferedImage.convertTo(current, converted1, true);<NEW_LINE>VisualizeOpticalFlow.colorized(flow, 10, visualized);<NEW_LINE>AnimatePanel animate = new AnimatePanel(150, converted0, converted1);<NEW_LINE>gui.add(animate);<NEW_LINE>gui.add(visualized);<NEW_LINE>animate.start();<NEW_LINE>ShowImages.showWindow(gui, "Dense Optical Flow", true);<NEW_LINE>} | convertTo(previous, converted0, true); |
683,821 | public final void executeCallout(final IAttributeValueContext attributeValueContext, final IAttributeSet attributeSet, final I_M_Attribute attribute, final Object valueOld, final Object valueNew) {<NEW_LINE>// Get the M_Attribute from storage (to make sure we are using the same instance of it)<NEW_LINE>final I_M_Attribute attributeCurrent = attributeSet.<MASK><NEW_LINE>if (attributeCurrent == null) {<NEW_LINE>if (logger.isWarnEnabled()) {<NEW_LINE>final AdempiereException ex = new AdempiereException("Skip executing the callout because the attribute was not found in attributesSet." + "\n Attribute: " + attribute + "\n AttributesSet: " + attributeSet + "\n Context: " + attributeValueContext + "\n Value Old:" + valueOld + "\n Value New:" + valueNew);<NEW_LINE>logger.warn(ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IAttributeValueCallout callout = attributeSet.getAttributeValueCallout(attributeCurrent);<NEW_LINE>executeCallout(attributeValueContext, callout, attributeSet, attributeCurrent, valueOld, valueNew);<NEW_LINE>} | getAttributeByIdIfExists(attribute.getM_Attribute_ID()); |
1,126,426 | public static void addModule(final AbstractSQLProvider provider, final INaviAddressSpace addressSpace, final INaviModule module) throws CouldntSaveDataException {<NEW_LINE>checkArguments(provider, addressSpace);<NEW_LINE>Preconditions.checkNotNull(module, "IE01859: Module argument can not be null");<NEW_LINE>Preconditions.checkArgument(module.inSameDatabase(provider), "IE01860: Module is not part of this database");<NEW_LINE>final CConnection connection = provider.getConnection();<NEW_LINE>final int addressSpaceId = addressSpace.getConfiguration().getId();<NEW_LINE>final int moduleId = module.getConfiguration().getId();<NEW_LINE>NaviLogger.info("Adding module %s (%d) to address space %s (%d)", addressSpace.getConfiguration().getName(), addressSpaceId, module.getConfiguration(<MASK><NEW_LINE>final String query = "INSERT INTO " + CTableNames.SPACE_MODULES_TABLE + " VALUES(" + moduleId + ", " + addressSpaceId + ", 0)";<NEW_LINE>try {<NEW_LINE>connection.executeUpdate(query, true);<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new CouldntSaveDataException(e);<NEW_LINE>}<NEW_LINE>PostgreSQLHelpers.updateModificationDate(connection, CTableNames.ADDRESS_SPACES_TABLE, addressSpace.getConfiguration().getId());<NEW_LINE>} | ).getName(), moduleId); |
150,938 | private String _buildPramatiXMLWebModule(String path) throws DocumentException, IOException {<NEW_LINE>String contextRoot = path.substring(2, path.length() - 4);<NEW_LINE>String filePath = path + "/docroot/WEB-INF/web.xml";<NEW_LINE>if (path.endsWith("-complete")) {<NEW_LINE>contextRoot = "/";<NEW_LINE>filePath = path.substring(0, path.length() - 9) + "/docroot/WEB-INF/web.xml";<NEW_LINE>}<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("\t<web-module>\n");<NEW_LINE>sb.append("\t\t<name>").append(contextRoot).append("</name>\n");<NEW_LINE>sb.append("\t\t<module-name>").append(path.substring(3, path.length())).append(".war</module-name>\n");<NEW_LINE>SAXReader reader = new SAXReader();<NEW_LINE>reader.setEntityResolver(new EntityResolver());<NEW_LINE>Document doc = reader.read(new File(filePath));<NEW_LINE>Iterator itr = doc.getRootElement().elements("ejb-local-ref").iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>Element ejbLocalRef = <MASK><NEW_LINE>sb.append("\t\t<ejb-local-ref>\n");<NEW_LINE>sb.append("\t\t\t<ejb-ref-name>").append(ejbLocalRef.elementText("ejb-ref-name")).append("</ejb-ref-name>\n");<NEW_LINE>sb.append("\t\t\t<ejb-link>").append(ejbLocalRef.elementText("ejb-link")).append("</ejb-link>\n");<NEW_LINE>sb.append("\t\t</ejb-local-ref>\n");<NEW_LINE>}<NEW_LINE>itr = doc.getRootElement().elements("resource-ref").iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>Element resourceRef = (Element) itr.next();<NEW_LINE>sb.append("\t\t<resource-mapping>\n");<NEW_LINE>sb.append("\t\t\t<resource-name>").append(resourceRef.elementText("res-ref-name")).append("</resource-name>\n");<NEW_LINE>sb.append("\t\t\t<resource-type>").append(resourceRef.elementText("res-type")).append("</resource-type>\n");<NEW_LINE>sb.append("\t\t\t<resource-link>").append(resourceRef.elementText("res-ref-name")).append("</resource-link>\n");<NEW_LINE>sb.append("\t\t</resource-mapping>\n");<NEW_LINE>}<NEW_LINE>sb.append("\t</web-module>\n");<NEW_LINE>return sb.toString();<NEW_LINE>} | (Element) itr.next(); |
881,023 | private static void write_package_keepout(app.freerouting.library.Package.Keepout p_keepout, WriteScopeParameter p_par, boolean p_is_via_keepout) throws java.io.IOException {<NEW_LINE>Layer keepout_layer;<NEW_LINE>if (p_keepout.layer >= 0) {<NEW_LINE>app.freerouting.board.Layer board_layer = p_par.board.layer_structure.arr[p_keepout.layer];<NEW_LINE>keepout_layer = new Layer(board_layer.name, p_keepout.layer, board_layer.is_signal);<NEW_LINE>} else {<NEW_LINE>keepout_layer = Layer.SIGNAL;<NEW_LINE>}<NEW_LINE>app.<MASK><NEW_LINE>app.freerouting.geometry.planar.Shape[] holes;<NEW_LINE>if (p_keepout.area instanceof app.freerouting.geometry.planar.Shape) {<NEW_LINE>boundary_shape = (app.freerouting.geometry.planar.Shape) p_keepout.area;<NEW_LINE>holes = new app.freerouting.geometry.planar.Shape[0];<NEW_LINE>} else {<NEW_LINE>boundary_shape = p_keepout.area.get_border();<NEW_LINE>holes = p_keepout.area.get_holes();<NEW_LINE>}<NEW_LINE>p_par.file.start_scope();<NEW_LINE>if (p_is_via_keepout) {<NEW_LINE>p_par.file.write("via_keepout");<NEW_LINE>} else {<NEW_LINE>p_par.file.write("keepout");<NEW_LINE>}<NEW_LINE>Shape dsn_shape = p_par.coordinate_transform.board_to_dsn(boundary_shape, keepout_layer);<NEW_LINE>if (dsn_shape != null) {<NEW_LINE>dsn_shape.write_scope(p_par.file, p_par.identifier_type);<NEW_LINE>}<NEW_LINE>for (int j = 0; j < holes.length; ++j) {<NEW_LINE>Shape dsn_hole = p_par.coordinate_transform.board_to_dsn(holes[j], keepout_layer);<NEW_LINE>dsn_hole.write_hole_scope(p_par.file, p_par.identifier_type);<NEW_LINE>}<NEW_LINE>p_par.file.end_scope();<NEW_LINE>} | freerouting.geometry.planar.Shape boundary_shape; |
38,152 | @ResourceFilters(DatasourceResourceFilter.class)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>public Response killUnusedSegmentsInInterval(@PathParam("dataSourceName") final String dataSourceName, @PathParam("interval") final String interval) {<NEW_LINE>if (indexingServiceClient == null) {<NEW_LINE>return Response.ok(ImmutableMap.of("error", "no indexing service found")).build();<NEW_LINE>}<NEW_LINE>if (StringUtils.contains(interval, '_')) {<NEW_LINE>log.warn("Use interval with '/', not '_': [%s] given", interval);<NEW_LINE>}<NEW_LINE>final Interval theInterval = Intervals.of(interval<MASK><NEW_LINE>try {<NEW_LINE>indexingServiceClient.killUnusedSegments("api-issued", dataSourceName, theInterval);<NEW_LINE>return Response.ok().build();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return Response.serverError().entity(ImmutableMap.of("error", "Exception occurred. Are you sure you have an indexing service?", "message", e.toString())).build();<NEW_LINE>}<NEW_LINE>} | .replace('_', '/')); |
1,265,176 | private byte[] sendAndReceive(final String address, final byte[] key, final byte[] ivspec, final byte[] data) {<NEW_LINE>final int timeoutMilliseconds = Long.valueOf(TimeUnit.SECONDS.toMillis(Settings.LicenseValidationTimeout.getValue(10))).intValue();<NEW_LINE>final int retries = 3;<NEW_LINE>// try to connect to the license server 3 times..<NEW_LINE>for (int i = 0; i < retries; i++) {<NEW_LINE>final byte[] result = new byte[256];<NEW_LINE>try (final Socket socket = new java.net.Socket(address, ServerPort)) {<NEW_LINE>socket.getOutputStream().write(key);<NEW_LINE>socket.getOutputStream().flush();<NEW_LINE>socket.getOutputStream().write(ivspec);<NEW_LINE>socket.getOutputStream().flush();<NEW_LINE>socket.getOutputStream().write(data);<NEW_LINE>socket.getOutputStream().flush();<NEW_LINE>socket.setSoTimeout(timeoutMilliseconds);<NEW_LINE>// read exactly 256 bytes (size of expected signature response)<NEW_LINE>socket.getInputStream().<MASK><NEW_LINE>return result;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.warn("Unable to verify volume license: {}, attempt {} of {}", t.getMessage(), (i + 1), retries);<NEW_LINE>if ((i + 1) == retries) {<NEW_LINE>throw new RuntimeException("No connection to license server");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | read(result, 0, 256); |
6,542 | protected static void recover(MultiScopeRecoveryLog recoveryLog, ReadableLogRecord record, LogHandle logHandle, int storageMode, Lock controlLock) throws LogCorruptedException, InternalLogException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "recover", recoveryLog, record, logHandle, storageMode, controlLock);<NEW_LINE>// First, read the length field of the serialized failure<NEW_LINE>// scope to which this recoverable unit section belongs.<NEW_LINE>final int failureScopeLength = record.getInt();<NEW_LINE>// Create a byte[] that contains the serialized failure scope<NEW_LINE>final byte[] failureScopeBytes = new byte[failureScopeLength];<NEW_LINE>record.get(failureScopeBytes);<NEW_LINE>try {<NEW_LINE>// Inflate the FailureScope<NEW_LINE>final FailureScope failureScope = FailureScopeManager.toFailureScope(failureScopeBytes);<NEW_LINE>// Read the RecoverableUnit identity.<NEW_LINE>final long recoverableUnitIdentity = record.getLong();<NEW_LINE>RecoverableUnitImpl recoverableUnit = recoveryLog.getRecoverableUnit(recoverableUnitIdentity);<NEW_LINE>if (recoverableUnit == null) {<NEW_LINE>recoverableUnit = new RecoverableUnitImpl(recoveryLog, recoverableUnitIdentity, failureScope, <MASK><NEW_LINE>} else {<NEW_LINE>recoverableUnit.recover(record);<NEW_LINE>}<NEW_LINE>} catch (LogCorruptedException lce) {<NEW_LINE>FFDCFilter.processException(lce, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.recover", "1604");<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "recover", lce);<NEW_LINE>throw lce;<NEW_LINE>} catch (InternalLogException ile) {<NEW_LINE>FFDCFilter.processException(ile, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.recover", "1608");<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "recover", ile);<NEW_LINE>throw ile;<NEW_LINE>} catch (Exception e) {<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.recover", "1612");<NEW_LINE>if (tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "Unexpected exception caught", e);<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "recover", "InternalLogException");<NEW_LINE>throw new InternalLogException(e);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "recover");<NEW_LINE>} | logHandle, storageMode, controlLock, record); |
519,292 | public void marshall(ImportFileTaskInformation importFileTaskInformation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (importFileTaskInformation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getCompletionTime(), COMPLETIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getImportName(), IMPORTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getInputS3Bucket(), INPUTS3BUCKET_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getInputS3Key(), INPUTS3KEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getNumberOfRecordsFailed(), NUMBEROFRECORDSFAILED_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getNumberOfRecordsSuccess(), NUMBEROFRECORDSSUCCESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getStatusReportS3Bucket(), STATUSREPORTS3BUCKET_BINDING);<NEW_LINE>protocolMarshaller.marshall(importFileTaskInformation.getStatusReportS3Key(), STATUSREPORTS3KEY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | importFileTaskInformation.getStartTime(), STARTTIME_BINDING); |
495,173 | public void onException(TcpChannel channel, Exception e) {<NEW_LINE>if (!lifecycle.started()) {<NEW_LINE>// just close and ignore - we are already stopped and just need to make sure we release all resources<NEW_LINE>CloseableChannel.closeChannel(channel);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isCloseConnectionException(e)) {<NEW_LINE>logger.trace(() -> new ParameterizedMessage("close connection exception caught on transport layer [{}], disconnecting from relevant node", channel), e);<NEW_LINE>// close the channel, which will cause a node to be disconnected if relevant<NEW_LINE>CloseableChannel.closeChannel(channel);<NEW_LINE>} else if (isConnectException(e)) {<NEW_LINE>logger.trace(() -> new ParameterizedMessage("connect exception caught on transport layer [{}]", channel), e);<NEW_LINE>// close the channel as safe measure, which will cause a node to be disconnected if relevant<NEW_LINE>CloseableChannel.closeChannel(channel);<NEW_LINE>} else if (e instanceof BindException) {<NEW_LINE>logger.trace(() -> new ParameterizedMessage("bind exception caught on transport layer [{}]", channel), e);<NEW_LINE>// close the channel as safe measure, which will cause a node to be disconnected if relevant<NEW_LINE>CloseableChannel.closeChannel(channel);<NEW_LINE>} else if (e instanceof CancelledKeyException) {<NEW_LINE>logger.trace(() -> new ParameterizedMessage("cancelled key exception caught on transport layer [{}], disconnecting from relevant node", channel), e);<NEW_LINE>// close the channel as safe measure, which will cause a node to be disconnected if relevant<NEW_LINE>CloseableChannel.closeChannel(channel);<NEW_LINE>} else if (e instanceof TcpTransport.HttpOnTransportException) {<NEW_LINE>// in case we are able to return data, serialize the exception content and sent it back to the client<NEW_LINE>if (channel.isOpen()) {<NEW_LINE>BytesArray message = new BytesArray(e.getMessage().getBytes(StandardCharsets.UTF_8));<NEW_LINE>outboundHandler.sendBytes(channel, message, ActionListener.wrap(() -> CloseableChannel.closeChannel(channel)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn(() -> new ParameterizedMessage<MASK><NEW_LINE>// close the channel, which will cause a node to be disconnected if relevant<NEW_LINE>CloseableChannel.closeChannel(channel);<NEW_LINE>}<NEW_LINE>} | ("exception caught on transport layer [{}], closing connection", channel), e); |
860,956 | public void showErrorOutput(UnhandledError err) {<NEW_LINE>hasErrors_ = true;<NEW_LINE>// if there's only one error frame, it's not worth showing dedicated<NEW_LINE>// error UX<NEW_LINE>if (err.getErrorFrames() != null && err.getErrorFrames().length() < 2) {<NEW_LINE>flushQueuedErrors();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int idx = queuedError_.indexOf(err.getErrorMessage());<NEW_LINE>if (idx >= 0) {<NEW_LINE>// emit any messages queued prior to the error<NEW_LINE>if (idx > 0) {<NEW_LINE>renderConsoleOutput(queuedError_.substring(0, idx), classOfOutput(ChunkConsolePage.CONSOLE_ERROR));<NEW_LINE>initializeOutput(RmdChunkOutputUnit.TYPE_ERROR);<NEW_LINE>}<NEW_LINE>// leave messages following the error in the queue<NEW_LINE>queuedError_ = queuedError_.substring(idx + err.getErrorMessage().length());<NEW_LINE>} else {<NEW_LINE>// flush any irrelevant messages from the stream<NEW_LINE>flushQueuedErrors();<NEW_LINE>}<NEW_LINE>UserState state = RStudioGinjector.INSTANCE.getUserState();<NEW_LINE>ConsoleError error = new ConsoleError(err, AceTheme.getThemeErrorClass(state.theme().getValue().cast()), this, null);<NEW_LINE>UserPrefs prefs = RStudioGinjector.INSTANCE.getUserPrefs();<NEW_LINE>error.setTracebackVisible(prefs.<MASK><NEW_LINE>add(error);<NEW_LINE>flushQueuedErrors();<NEW_LINE>onHeightChanged();<NEW_LINE>} | autoExpandErrorTracebacks().getValue()); |
1,163,934 | private void loadParams(String tenantId) throws URISyntaxException {<NEW_LINE>long startTimeMillis = System.currentTimeMillis();<NEW_LINE>if (Utils.isBlank(API_GATEWAY_HOST)) {<NEW_LINE>throw new IllegalStateException("Missing required environment variable API_GATEWAY_HOST");<NEW_LINE>}<NEW_LINE>if (Utils.isBlank(API_GATEWAY_STAGE)) {<NEW_LINE>throw new IllegalStateException("Missing required environment variable API_GATEWAY_STAGE");<NEW_LINE>}<NEW_LINE>if (Utils.isBlank(API_TRUST_ROLE)) {<NEW_LINE>throw new IllegalStateException("Missing required environment variable API_TRUST_ROLE");<NEW_LINE>}<NEW_LINE>LOGGER.info("Loading parameters from settings service for tenant {}", tenantId);<NEW_LINE>ApiRequest tenantSettings = ApiRequest.builder().resource("settings/tenant/" + tenantId).<MASK><NEW_LINE>SdkHttpFullRequest apiRequest = ApiGatewayHelper.getApiRequest(API_GATEWAY_HOST, API_GATEWAY_STAGE, tenantSettings);<NEW_LINE>String responseBody = null;<NEW_LINE>try {<NEW_LINE>responseBody = ApiGatewayHelper.signAndExecuteApiRequest(apiRequest, API_TRUST_ROLE, "MetricsService-LoadParams");<NEW_LINE>List<Map<String, String>> settings = Utils.fromJson(responseBody, ArrayList.class);<NEW_LINE>if (null == settings) {<NEW_LINE>throw new RuntimeException(("responseBody not valid list of Strings"));<NEW_LINE>}<NEW_LINE>for (Map<String, String> setting : settings) {<NEW_LINE>LOGGER.info("Caching {} => {}", tenantId + "/" + setting.get("name"), setting.get("value"));<NEW_LINE>parameterStore.put(tenantId + "/" + setting.get("name"), setting.get("value"));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Error invoking API settings/tenant/" + tenantId);<NEW_LINE>LOGGER.error(Utils.getFullStackTrace(e));<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>if (parameterStore.isEmpty()) {<NEW_LINE>throw new RuntimeException("loadParams: Error loading Parameter Store SaaS Boost parameters for tenant: " + tenantId);<NEW_LINE>}<NEW_LINE>long totalTimeMillis = System.currentTimeMillis() - startTimeMillis;<NEW_LINE>LOGGER.info("getParams: exec " + totalTimeMillis);<NEW_LINE>} | method("GET").build(); |
948,280 | public void marshall(FeatureSummary featureSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (featureSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(featureSummary.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getDefaultVariation(), DEFAULTVARIATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getEvaluationRules(), EVALUATIONRULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getEvaluationStrategy(), EVALUATIONSTRATEGY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(featureSummary.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getProject(), PROJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(featureSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | featureSummary.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING); |
89,546 | private static FilterResult filterFiles(FileSystem fileSystem, List<ResourceId> srcResourceIds, List<ResourceId> destResourceIds, MoveOptions... moveOptions) throws IOException {<NEW_LINE>FilterResult result = new FilterResult();<NEW_LINE>if (moveOptions.length == 0 || srcResourceIds.isEmpty()) {<NEW_LINE>// Nothing will be filtered.<NEW_LINE>result.resultSources = srcResourceIds;<NEW_LINE>result.resultDestinations = destResourceIds;<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Set<MoveOptions> moveOptionSet = Sets.newHashSet(moveOptions);<NEW_LINE>final boolean ignoreMissingSrc = moveOptionSet.contains(StandardMoveOptions.IGNORE_MISSING_FILES);<NEW_LINE>final boolean skipExistingDest = moveOptionSet.contains(StandardMoveOptions.SKIP_IF_DESTINATION_EXISTS);<NEW_LINE>final int size = srcResourceIds.size();<NEW_LINE>// Match necessary srcs and dests with a single match call.<NEW_LINE>List<ResourceId> matchResources = new ArrayList<>();<NEW_LINE>if (ignoreMissingSrc) {<NEW_LINE>matchResources.addAll(srcResourceIds);<NEW_LINE>}<NEW_LINE>if (skipExistingDest) {<NEW_LINE>matchResources.addAll(destResourceIds);<NEW_LINE>}<NEW_LINE>List<MatchResult> matchResults = fileSystem.match(FluentIterable.from(matchResources).transform(ResourceId::toString).toList());<NEW_LINE>List<MatchResult> matchSrcResults = ignoreMissingSrc ? matchResults.subList(0, size) : null;<NEW_LINE>List<MatchResult> matchDestResults = skipExistingDest ? matchResults.subList(matchResults.size() - size, matchResults.size()) : null;<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>if (matchSrcResults != null && matchSrcResults.get(i).status().equals(Status.NOT_FOUND)) {<NEW_LINE>// If the source is not found, and we are ignoring missing source files, then we skip it.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (matchDestResults != null && matchDestResults.get(i).status().equals(Status.OK) && checksumMatch(matchDestResults.get(i).metadata().get(0), matchSrcResults.get(i).metadata().get(0))) {<NEW_LINE>// If the destination exists, and we are skipping when destinations exist, then we skip<NEW_LINE>// the copy but note that the source exists in case it should be deleted.<NEW_LINE>result.filteredExistingSrcs.add(srcResourceIds.get(i));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.resultSources.add(srcResourceIds.get(i));<NEW_LINE>result.resultDestinations.add<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (destResourceIds.get(i)); |
775,010 | public void handle(PrimaryStorageInventory inv, NfsRebaseVolumeBackingFileMsg msg, ReturnValueCompletion<NfsRebaseVolumeBackingFileReply> completion) {<NEW_LINE>NfsRebaseVolumeBackingFileCmd cmd = new NfsRebaseVolumeBackingFileCmd();<NEW_LINE>cmd.srcPsMountPath = Q.New(PrimaryStorageVO.class).select(PrimaryStorageVO_.mountPath).eq(PrimaryStorageVO_.uuid, msg.getSrcPsUuid()).findValue();<NEW_LINE>cmd.dstPsMountPath = Q.New(PrimaryStorageVO.class).select(PrimaryStorageVO_.mountPath).eq(PrimaryStorageVO_.uuid, msg.getDstPsUuid()).findValue();<NEW_LINE>cmd.dstVolumeFolderPath = msg.getDstVolumeFolderPath();<NEW_LINE>cmd.dstImageCacheTemplateFolderPath = msg.getDstImageCacheTemplateFolderPath();<NEW_LINE>final HostInventory host = nfsFactory.getConnectedHostForOperation(inv).get(0);<NEW_LINE>new KvmCommandSender(host.getUuid()).send(cmd, NFS_REBASE_VOLUME_BACKING_FILE_PATH, new KvmCommandFailureChecker() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ErrorCode getError(KvmResponseWrapper wrapper) {<NEW_LINE>NfsRebaseVolumeBackingFileRsp rsp = wrapper.getResponse(NfsRebaseVolumeBackingFileRsp.class);<NEW_LINE>return rsp.isSuccess() ? null : operr("%s", rsp.getError());<NEW_LINE>}<NEW_LINE>}, new ReturnValueCompletion<KvmResponseWrapper>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(KvmResponseWrapper returnValue) {<NEW_LINE>logger.info("successfully rebased backing file for qcow2 files in " + msg.getDstVolumeFolderPath());<NEW_LINE>NfsRebaseVolumeBackingFileReply reply = new NfsRebaseVolumeBackingFileReply();<NEW_LINE>completion.success(reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>logger.error(<MASK><NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | "failed to rebase backing file for qcow2 files in " + msg.getDstVolumeFolderPath()); |
1,157,030 | public CodegenExpression makeCodegen(CodegenClassScope classScope, CodegenMethodScope parent, SAIFFInitializeSymbolWEventType symbols) {<NEW_LINE>CodegenMethod method = parent.makeChild(FilterSpecParam.EPTYPE, FilterSpecParamConstantForge.class, classScope);<NEW_LINE>method.getBlock().declareVar(ExprFilterSpecLookupable.EPTYPE, "lookupable", localMethod(lookupable.makeCodegen(method, symbols, classScope))).declareVar(ExprFilterSpecLookupable.EPTYPE_FILTEROPERATOR, "op", enumValue(FilterOperator.class, filterOperator.name()));<NEW_LINE>CodegenExpressionNewAnonymousClass inner = newAnonymousClass(method.getBlock(), FilterSpecParam.EPTYPE, Arrays.asList(ref("lookupable"), ref("op")));<NEW_LINE>CodegenMethod getFilterValue = CodegenMethod.makeParentNode(FilterValueSetParam.EPTYPE, this.getClass(), classScope).addParam(FilterSpecParam.GET_FILTER_VALUE_FP);<NEW_LINE>inner.addMethod("getFilterValue", getFilterValue);<NEW_LINE>getFilterValue.getBlock().methodReturn(FilterValueSetParamImpl.codegenNew(constant(filterConstant)));<NEW_LINE>method.<MASK><NEW_LINE>return localMethod(method);<NEW_LINE>} | getBlock().methodReturn(inner); |
296,489 | public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals, final File refflat, final Set<String> ignoreSequence) {<NEW_LINE>final MeanQualityByCycle program = new MeanQualityByCycle();<NEW_LINE>program.output = new RequiredOutputArgumentCollection(new File(outbase + METRICS_EXTENSION + outext));<NEW_LINE>program.CHART_OUTPUT <MASK><NEW_LINE>// Generally programs should not be accessing these directly but it might make things smoother<NEW_LINE>// to just set them anyway. These are set here to make sure that in case of a the derived class<NEW_LINE>// overrides<NEW_LINE>program.INPUT = input;<NEW_LINE>program.setReferenceSequence(reference);<NEW_LINE>return program;<NEW_LINE>} | = new File(outbase + PDF_EXTENSION); |
1,231,278 | private static boolean registerServerInstanceFO(FileObject serverInstanceDir, String url, String displayName, File payaraRoot, File java7orLaterExecutable) {<NEW_LINE>String name = FileUtil.findFreeFileName(serverInstanceDir, PayaraInstanceProvider.PAYARA_AUTOREGISTERED_INSTANCE, null);<NEW_LINE>FileObject instanceFO;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>instanceFO.setAttribute(PayaraModule.URL_ATTR, url);<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.USERNAME_ATTR, "admin");<NEW_LINE>// String password = Utils.generatePassword(8);<NEW_LINE>instanceFO.setAttribute(PayaraModule.PASSWORD_ATTR, "");<NEW_LINE>instanceFO.setAttribute(PayaraModule.DISPLAY_NAME_ATTR, displayName);<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.ADMINPORT_ATTR, "4848");<NEW_LINE>instanceFO.setAttribute(PayaraModule.INSTALL_FOLDER_ATTR, payaraRoot.getParent());<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.DEBUG_PORT, "");<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.DOMAIN_NAME_ATTR, "domain1");<NEW_LINE>instanceFO.setAttribute(PayaraModule.DOMAINS_FOLDER_ATTR, (new File(payaraRoot, "domains")).getAbsolutePath());<NEW_LINE>instanceFO.setAttribute(PayaraModule.DRIVER_DEPLOY_FLAG, "true");<NEW_LINE>instanceFO.setAttribute(PayaraModule.INSTALL_FOLDER_ATTR, payaraRoot.getParent());<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.HOSTNAME_ATTR, "localhost");<NEW_LINE>instanceFO.setAttribute(PayaraModule.PAYARA_FOLDER_ATTR, payaraRoot.getAbsolutePath());<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.JAVA_PLATFORM_ATTR, java7orLaterExecutable == null ? "" : java7orLaterExecutable.getAbsolutePath());<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.HTTPPORT_ATTR, "8080");<NEW_LINE>// NOI18N<NEW_LINE>instanceFO.setAttribute(PayaraModule.HTTPHOST_ATTR, "localhost");<NEW_LINE>instanceFO.setAttribute(PayaraModule.JVM_MODE, PayaraModule.NORMAL_MODE);<NEW_LINE>instanceFO.setAttribute(PayaraModule.HOT_DEPLOY, false);<NEW_LINE>instanceFO.setAttribute(PayaraModule.SESSION_PRESERVATION_FLAG, true);<NEW_LINE>instanceFO.setAttribute(PayaraModule.USE_IDE_PROXY_FLAG, true);<NEW_LINE>instanceFO.setAttribute(PayaraModule.USE_SHARED_MEM_ATTR, false);<NEW_LINE>return true;<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.INFO, "Cannot register the default Payara server.");<NEW_LINE>LOGGER.log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | instanceFO = serverInstanceDir.createData(name); |
389,113 | public Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (virtualHubName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, virtualHubName, apiVersion, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,417,176 | public void commit(Xid xid, boolean onePhase) throws XAException {<NEW_LINE>if (currentXid != null) {<NEW_LINE>throw new EhcacheXAException("Cannot commit a non-ended start on : " + xid, XAException.XAER_PROTO);<NEW_LINE>}<NEW_LINE>TransactionId transactionId = new TransactionId(xid);<NEW_LINE>XATransactionContext<K, V> transactionContext = transactionContextFactory.get(transactionId);<NEW_LINE>try {<NEW_LINE>if (onePhase) {<NEW_LINE>if (transactionContext == null) {<NEW_LINE>throw new EhcacheXAException("Cannot commit in one phase unknown XID : " + xid, XAException.XAER_NOTA);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>transactionContext.commitInOnePhase();<NEW_LINE>} catch (XATransactionContext.TransactionTimeoutException tte) {<NEW_LINE>throw new EhcacheXAException("Transaction timed out", XAException.XA_RBTIMEOUT);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>XATransactionContext<K, V> commitContext = transactionContext;<NEW_LINE>if (commitContext == null) {<NEW_LINE>// recovery commit<NEW_LINE>commitContext = new XATransactionContext<>(new TransactionId(new SerializableXid(xid)), underlyingStore, journal, null, 0L);<NEW_LINE>}<NEW_LINE>commitContext.commit(transactionContext == null);<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>throw new EhcacheXAException(<MASK><NEW_LINE>} catch (IllegalStateException ise) {<NEW_LINE>throw new EhcacheXAException("Cannot commit XID : " + xid, XAException.XAER_PROTO, ise);<NEW_LINE>} catch (StoreAccessException cae) {<NEW_LINE>throw new EhcacheXAException("Cannot commit XID : " + xid, XAException.XAER_RMERR, cae);<NEW_LINE>} finally {<NEW_LINE>if (transactionContext != null) {<NEW_LINE>transactionContextFactory.destroy(transactionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Cannot commit unknown XID : " + xid, XAException.XAER_NOTA); |
760,373 | public UpdateIndexingConfigurationResult updateIndexingConfiguration(UpdateIndexingConfigurationRequest updateIndexingConfigurationRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateIndexingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateIndexingConfigurationRequest> request = null;<NEW_LINE>Response<UpdateIndexingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateIndexingConfigurationRequestMarshaller().marshall(updateIndexingConfigurationRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<UpdateIndexingConfigurationResult, JsonUnmarshallerContext> unmarshaller = new UpdateIndexingConfigurationResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateIndexingConfigurationResult> responseHandler = <MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | new JsonResponseHandler<UpdateIndexingConfigurationResult>(unmarshaller); |
297,464 | public HeatMap readHeatMap(final MetricsCondition condition, final String valueColumnName, final Duration duration) throws IOException {<NEW_LINE>final List<PointOfTime> pointOfTimes = duration.assembleDurationPoints();<NEW_LINE>final List<String> ids = new ArrayList<>(pointOfTimes.size());<NEW_LINE>pointOfTimes.forEach(pointOfTime -> ids.add(pointOfTime.id(condition.getEntity().buildId())));<NEW_LINE>final WhereQueryImpl<SelectQueryImpl> query = select().column(ID_COLUMN).column(valueColumnName).from(client.getDatabase(), condition.getName()).where(contains(ID_COLUMN, Joiner.on("|").join(ids)));<NEW_LINE>final QueryResult.Series <MASK><NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("SQL: {} result set: {}", query.getCommand(), series);<NEW_LINE>}<NEW_LINE>final int defaultValue = ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName());<NEW_LINE>final HeatMap heatMap = new HeatMap();<NEW_LINE>if (series != null) {<NEW_LINE>for (List<Object> values : series.getValues()) {<NEW_LINE>heatMap.buildColumn(values.get(1).toString(), values.get(2).toString(), defaultValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>heatMap.fixMissingColumns(ids, defaultValue);<NEW_LINE>return heatMap;<NEW_LINE>} | series = client.queryForSingleSeries(query); |
1,188,910 | public void addMockResponseToTestCase(WsdlMockResponse mockResponse, WsdlTestCase testCase, int index) {<NEW_LINE>if (mockResponse.getMockOperation().getOperation() == null) {<NEW_LINE>UISupport.showErrorMessage("Missing operation for this mock response");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WsdlMockService mockService = mockResponse.getMockOperation().getMockService();<NEW_LINE>if (dialog == null) {<NEW_LINE>dialog = ADialogBuilder.buildDialog(Form.class);<NEW_LINE>}<NEW_LINE>dialog.setValue(Form.STEP_NAME, mockResponse.getMockOperation().getName());<NEW_LINE>dialog.setBooleanValue(Form.CLOSE_EDITOR, true);<NEW_LINE>dialog.setBooleanValue(Form.SHOW_TESTCASE, true);<NEW_LINE>dialog.setIntValue(Form.PORT, mockService.getPort());<NEW_LINE>dialog.setValue(Form.PATH, mockService.getPath());<NEW_LINE>SoapUIDesktop desktop = SoapUI.getDesktop();<NEW_LINE>dialog.getFormField(Form.CLOSE_EDITOR).setEnabled(desktop != null && desktop.hasDesktopPanel(mockResponse));<NEW_LINE>if (!dialog.show()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TestStepConfig config = WsdlMockResponseStepFactory.createConfig(mockResponse.getMockOperation().getOperation(), false);<NEW_LINE>MockResponseStepConfig mockResponseStepConfig = ((MockResponseStepConfig) config.getConfig());<NEW_LINE>config.setName(dialog.getValue(Form.STEP_NAME));<NEW_LINE>mockResponseStepConfig.setPath(dialog.getValue(Form.PATH));<NEW_LINE>mockResponseStepConfig.setPort(dialog.getIntValue(Form.PORT, mockService.getPort()));<NEW_LINE>mockResponse.beforeSave();<NEW_LINE>mockResponseStepConfig.getResponse().set(mockResponse.getConfig());<NEW_LINE>WsdlMockResponseTestStep testStep = (WsdlMockResponseTestStep) testCase<MASK><NEW_LINE>if (testStep == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dialog.getBooleanValue(Form.ADD_SCHEMA_ASSERTION)) {<NEW_LINE>testStep.addAssertion(SchemaComplianceAssertion.ID);<NEW_LINE>}<NEW_LINE>UISupport.selectAndShow(testStep);<NEW_LINE>if (dialog.getBooleanValue(Form.CLOSE_EDITOR) && desktop != null) {<NEW_LINE>desktop.closeDesktopPanel(mockResponse);<NEW_LINE>}<NEW_LINE>if (dialog.getBooleanValue(Form.SHOW_TESTCASE)) {<NEW_LINE>UISupport.selectAndShow(testCase);<NEW_LINE>}<NEW_LINE>} | .insertTestStep(config, -1); |
1,194,345 | public ServiceCombServer chooseServer(Invocation invocation) {<NEW_LINE>List<ServiceCombServer> servers = invocation.getLocalContext(LoadbalanceHandler.CONTEXT_KEY_SERVER_LIST);<NEW_LINE>int serversCount = servers.size();<NEW_LINE>for (ServerListFilterExt filterExt : filters) {<NEW_LINE>if (!filterExt.enabled()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>servers = filterExt.getFilteredListOfServers(servers, invocation);<NEW_LINE>if (servers.isEmpty() && serversCount > 0) {<NEW_LINE>LOGGER.warn("There are not servers exist after filtered by {}.", filterExt.getClass());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ServiceCombServer server = rule.choose(servers, invocation);<NEW_LINE>if (null == server) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ServiceCombServerStats serverStats = ServiceCombLoadBalancerStats.INSTANCE.getServiceCombServerStats(server);<NEW_LINE>if (serverStats.isIsolated()) {<NEW_LINE>LOGGER.info("The Service {}'s instance {} has been isolated for a while, give a single test opportunity.", invocation.getMicroserviceName(), server.<MASK><NEW_LINE>LOGGER.info("stats: {}-{}-{}-{}", serverStats.getTotalRequests(), serverStats.getSuccessRequests(), serverStats.getFailedRequests(), serverStats.getContinuousFailureCount());<NEW_LINE>}<NEW_LINE>return server;<NEW_LINE>} | getInstance().getInstanceId()); |
413,695 | protected void addSignatureSpecConventions(SignatureSpec spec) {<NEW_LINE>if (!(spec instanceof IConventionAware)) {<NEW_LINE>throw new InvalidUserDataException("Cannot add conventions to signature spec \'" + String.valueOf(spec) + "\' as it is not convention aware");<NEW_LINE>}<NEW_LINE>ConventionMapping conventionMapping = ((<MASK><NEW_LINE>conventionMapping.map("signatory", new Callable<Signatory>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Signatory call() {<NEW_LINE>return getSignatory();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>conventionMapping.map("signatureType", new Callable<SignatureType>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SignatureType call() {<NEW_LINE>return getSignatureType();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>conventionMapping.map("required", new Callable<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean call() {<NEW_LINE>return isRequired();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | IConventionAware) spec).getConventionMapping(); |
1,411,997 | public int compareTo(TDirectBuffer other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetDirectCount()).compareTo(other.isSetDirectCount());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetDirectCount()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.directCount, other.directCount);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetDirectMemoryUsed()).compareTo(other.isSetDirectMemoryUsed());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetDirectMemoryUsed()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.directMemoryUsed, other.directMemoryUsed);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetMappedCount()).compareTo(other.isSetMappedCount());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetMappedCount()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetMappedMemoryUsed()).compareTo(other.isSetMappedMemoryUsed());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetMappedMemoryUsed()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mappedMemoryUsed, other.mappedMemoryUsed);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.mappedCount, other.mappedCount); |
219,493 | private void displayServicesStatus() {<NEW_LINE>tbServicesStatusMessage.setText(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.tbServicesStatusMessage.Message", statusByService.get(ServicesMonitor.Service.REMOTE_CASE_DATABASE.toString()), statusByService.get(ServicesMonitor.Service.REMOTE_KEYWORD_SEARCH.toString()), statusByService.get(ServicesMonitor.Service.REMOTE_KEYWORD_SEARCH.toString()), statusByService.get(ServicesMonitor.Service.MESSAGING.toString())));<NEW_LINE>String upStatus = NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.tbServicesStatusMessage.Message.Up");<NEW_LINE>if (statusByService.get(ServicesMonitor.Service.REMOTE_CASE_DATABASE.toString()).compareTo(upStatus) != 0 || statusByService.get(ServicesMonitor.Service.REMOTE_KEYWORD_SEARCH.toString()).compareTo(upStatus) != 0 || statusByService.get(ServicesMonitor.Service.MESSAGING.toString()).compareTo(upStatus) != 0) {<NEW_LINE>tbServicesStatusMessage.setForeground(Color.RED);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | tbServicesStatusMessage.setForeground(Color.BLACK); |
547,420 | public static ListBarcodesResponse unmarshall(ListBarcodesResponse listBarcodesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listBarcodesResponse.setRequestId(_ctx.stringValue("ListBarcodesResponse.RequestId"));<NEW_LINE>listBarcodesResponse.setPageSize(_ctx.integerValue("ListBarcodesResponse.PageSize"));<NEW_LINE>listBarcodesResponse.setPageNumber(_ctx.integerValue("ListBarcodesResponse.PageNumber"));<NEW_LINE>listBarcodesResponse.setSuccess(_ctx.booleanValue("ListBarcodesResponse.Success"));<NEW_LINE>listBarcodesResponse.setTotalCount(_ctx.integerValue("ListBarcodesResponse.TotalCount"));<NEW_LINE>List<BarcodeModel> barcodes = new ArrayList<BarcodeModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListBarcodesResponse.Barcodes.Length"); i++) {<NEW_LINE>BarcodeModel barcodeModel = new BarcodeModel();<NEW_LINE>barcodeModel.setDisable(_ctx.integerValue("ListBarcodesResponse.Barcodes[" + i + "].Disable"));<NEW_LINE>barcodeModel.setStyleId(_ctx.stringValue<MASK><NEW_LINE>barcodeModel.setSizeName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].SizeName"));<NEW_LINE>barcodeModel.setRetailPrice(_ctx.floatValue("ListBarcodesResponse.Barcodes[" + i + "].RetailPrice"));<NEW_LINE>barcodeModel.setSizeCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].SizeCode"));<NEW_LINE>barcodeModel.setColorCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].ColorCode"));<NEW_LINE>barcodeModel.setName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].Name"));<NEW_LINE>barcodeModel.setColorId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].ColorId"));<NEW_LINE>barcodeModel.setCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].Code"));<NEW_LINE>barcodeModel.setUpdateDate(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].UpdateDate"));<NEW_LINE>barcodeModel.setSizeId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].SizeId"));<NEW_LINE>barcodeModel.setColorName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].ColorName"));<NEW_LINE>barcodeModel.setCreateDate(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].CreateDate"));<NEW_LINE>barcodeModel.setStyleCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].StyleCode"));<NEW_LINE>barcodeModel.setStyleName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].StyleName"));<NEW_LINE>barcodeModel.setDescription(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].Description"));<NEW_LINE>barcodeModel.setCurrentPrice(_ctx.floatValue("ListBarcodesResponse.Barcodes[" + i + "].CurrentPrice"));<NEW_LINE>barcodeModel.setBarcodeId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].BarcodeId"));<NEW_LINE>barcodes.add(barcodeModel);<NEW_LINE>}<NEW_LINE>listBarcodesResponse.setBarcodes(barcodes);<NEW_LINE>return listBarcodesResponse;<NEW_LINE>} | ("ListBarcodesResponse.Barcodes[" + i + "].StyleId")); |
612,938 | public com.amazonaws.services.simpleemailv2.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.simpleemailv2.model.ConflictException conflictException = new com.amazonaws.services.simpleemailv2.model.ConflictException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 conflictException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
30,272 | private void sumValues(List<MatchingDocs> matchingDocs, boolean keepScores, DoubleValuesSource valueSource) throws IOException {<NEW_LINE>for (MatchingDocs hits : matchingDocs) {<NEW_LINE>SortedNumericDocValues ordinalValues = DocValues.getSortedNumeric(hits.<MASK><NEW_LINE>DoubleValues scores = keepScores ? scores(hits) : null;<NEW_LINE>DoubleValues functionValues = valueSource.getValues(hits.context, scores);<NEW_LINE>DocIdSetIterator it = ConjunctionUtils.intersectIterators(List.of(hits.bits.iterator(), ordinalValues));<NEW_LINE>for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {<NEW_LINE>if (functionValues.advanceExact(doc)) {<NEW_LINE>float value = (float) functionValues.doubleValue();<NEW_LINE>int ordinalCount = ordinalValues.docValueCount();<NEW_LINE>for (int i = 0; i < ordinalCount; i++) {<NEW_LINE>values[(int) ordinalValues.nextValue()] += value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rollup();<NEW_LINE>} | context.reader(), indexFieldName); |
1,311,931 | private void handleNamedEvent(FacesConfigImpl facesConfig, Set<Class<?>> classes) {<NEW_LINE>for (Class<?> clazz : classes) {<NEW_LINE>NamedEvent namedEvent = (NamedEvent) clazz.getAnnotation(NamedEvent.class);<NEW_LINE>if (namedEvent != null) {<NEW_LINE>// Can only apply @NamedEvent to ComponentSystemEvent subclasses.<NEW_LINE>if (!ComponentSystemEvent.class.isAssignableFrom(clazz)) {<NEW_LINE>// Just log this. We'll catch it later in the runtime.<NEW_LINE>if (log.isLoggable(Level.WARNING)) {<NEW_LINE>log.warning(clazz.getName() + " is annotated with @javax.faces.event.NamedEvent, but does " + "not extend javax.faces.event.ComponentSystemEvent");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Have to register @NamedEvent annotations with the NamedEventManager class since<NEW_LINE>// we need to get access to this info later and can't from the dispenser (it's not a<NEW_LINE>// singleton).<NEW_LINE>org.apache.myfaces.config.impl.digester.elements.NamedEventImpl namedEventConfig = new org.apache.myfaces.config.impl<MASK><NEW_LINE>namedEventConfig.setEventClass(clazz.getName());<NEW_LINE>namedEventConfig.setShortName(namedEvent.shortName());<NEW_LINE>facesConfig.addNamedEvent(namedEventConfig);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .digester.elements.NamedEventImpl(); |
753,768 | public static boolean testAnswer(final String password, final String hashedPassword, final AppConfig appConfig) {<NEW_LINE>final char[] pwCharArray = password.toLowerCase().toCharArray();<NEW_LINE>final boolean bsdCryptPass = OpenBSDBCrypt.checkPassword(hashedPassword, pwCharArray);<NEW_LINE>if (!bsdCryptPass) {<NEW_LINE>final boolean enableJBCrypt = Boolean.parseBoolean(appConfig.readAppProperty(AppProperty.CONFIG_JBCRYPT_PWLIB_ENABLE));<NEW_LINE>if (enableJBCrypt) {<NEW_LINE>// legacy check, older jbcrypt library used previously incorrectly encoded some characters<NEW_LINE>// including special ascii characters.<NEW_LINE>try {<NEW_LINE>return <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.debug(() -> "error while checking bcypt password: " + e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bsdCryptPass;<NEW_LINE>} | JBCrypt.checkpw(password, hashedPassword); |
1,482,582 | public ProgramNode cloneBranch(final EncogProgram targetProgram, final ProgramNode sourceBranch) {<NEW_LINE>if (sourceBranch == null) {<NEW_LINE>throw new EncogError("Can't clone null branch.");<NEW_LINE>}<NEW_LINE>final String name = sourceBranch.getName();<NEW_LINE>// create any subnodes<NEW_LINE>final ProgramNode[] args = new ProgramNode[sourceBranch.<MASK><NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>args[i] = cloneBranch(targetProgram, (ProgramNode) sourceBranch.getChildNodes().get(i));<NEW_LINE>}<NEW_LINE>final ProgramNode result = targetProgram.getContext().getFunctions().factorProgramNode(name, targetProgram, args);<NEW_LINE>// now copy the expression data for the node<NEW_LINE>for (int i = 0; i < sourceBranch.getData().length; i++) {<NEW_LINE>result.getData()[i] = new ExpressionValue(sourceBranch.getData()[i]);<NEW_LINE>}<NEW_LINE>// return the new node<NEW_LINE>return result;<NEW_LINE>} | getChildNodes().size()]; |
568,939 | private void init(Context context) {<NEW_LINE>Resources resources = context.getResources();<NEW_LINE>mInflater = LayoutInflater.from(context);<NEW_LINE>mLayoutManager = new LinearLayoutManager(context);<NEW_LINE>mAdapter = new SearchAdapter();<NEW_LINE>setLayoutManager(mLayoutManager);<NEW_LINE>setAdapter(mAdapter);<NEW_LINE>setHasFixedSize(true);<NEW_LINE>setClipToPadding(false);<NEW_LINE>int interval = resources.getDimensionPixelOffset(R.dimen.search_layout_interval);<NEW_LINE>int paddingH = resources.getDimensionPixelOffset(R.dimen.search_layout_margin_h);<NEW_LINE>int paddingV = resources.getDimensionPixelOffset(R.dimen.search_layout_margin_v);<NEW_LINE>MarginItemDecoration decoration = new MarginItemDecoration(interval, paddingH, paddingV, paddingH, paddingV);<NEW_LINE>addItemDecoration(decoration);<NEW_LINE>decoration.applyPaddings(this);<NEW_LINE>// Create normal view<NEW_LINE>View normalView = mInflater.inflate(R.layout.search_normal, null);<NEW_LINE>mNormalView = normalView;<NEW_LINE>mCategoryTable = (CategoryTable) normalView.findViewById(R.id.search_category_table);<NEW_LINE>mNormalSearchMode = (RadioGridGroup) normalView.findViewById(R.id.normal_search_mode);<NEW_LINE>mNormalSearchModeHelp = (ImageView) normalView.findViewById(R.id.normal_search_mode_help);<NEW_LINE>mEnableAdvanceSwitch = (SwitchCompat) normalView.findViewById(R.id.search_enable_advance);<NEW_LINE>mNormalSearchModeHelp.setOnClickListener(this);<NEW_LINE>Ripple.addRipple(mNormalSearchModeHelp, !AttrResources.getAttrBoolean(context, R.attr.isLightTheme));<NEW_LINE><MASK><NEW_LINE>mEnableAdvanceSwitch.setSwitchPadding(resources.getDimensionPixelSize(R.dimen.switch_padding));<NEW_LINE>// Create advance view<NEW_LINE>mAdvanceView = mInflater.inflate(R.layout.search_advance, null);<NEW_LINE>mTableAdvanceSearch = (AdvanceSearchTable) mAdvanceView.findViewById(R.id.search_advance_search_table);<NEW_LINE>// Create image view<NEW_LINE>mImageView = (ImageSearchLayout) mInflater.inflate(R.layout.search_image, null);<NEW_LINE>mImageView.setHelper(this);<NEW_LINE>// Create action view<NEW_LINE>mActionView = mInflater.inflate(R.layout.search_action, null);<NEW_LINE>mAction = (TextView) mActionView.findViewById(R.id.action);<NEW_LINE>mAction.setOnClickListener(this);<NEW_LINE>} | mEnableAdvanceSwitch.setOnCheckedChangeListener(SearchLayout.this); |
144,840 | public void start() {<NEW_LINE>logger.info("[{}] pulsar sink starting...", getName());<NEW_LINE>// register metrics<NEW_LINE>this.dimensions = new HashMap<>();<NEW_LINE>this.dimensions.put(DataProxyMetricItem.KEY_CLUSTER_ID, "DataProxy");<NEW_LINE>this.dimensions.put(DataProxyMetricItem.KEY_SINK_ID, this.getName());<NEW_LINE>this.metricItemSet = new DataProxyMetricItemSet(this.getName());<NEW_LINE>MetricRegister.register(metricItemSet);<NEW_LINE>sinkCounter.start();<NEW_LINE>pulsarClientService.initCreateConnection(this);<NEW_LINE>int statIntervalSec = pulsarConfig.getStatIntervalSec();<NEW_LINE>Preconditions.checkArgument(statIntervalSec >= 0, "statIntervalSec must be >= 0");<NEW_LINE>if (statIntervalSec > 0) {<NEW_LINE>monitorIndex = new MonitorIndex("Pulsar_Sink", statIntervalSec, maxMonitorCnt);<NEW_LINE>monitorIndexExt = new MonitorIndexExt("Pulsar_Sink_monitors#" + this.getName(), statIntervalSec, maxMonitorCnt);<NEW_LINE>}<NEW_LINE>super.start();<NEW_LINE>try {<NEW_LINE>initTopicSet(pulsarClientService, new HashSet<String>(topicProperties.values()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.info("pulsar sink start publish topic fail.", e);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sinkThreadPoolSize; i++) {<NEW_LINE>sinkThreadPool[i] = new SinkTask(pulsarClientService, this, eventQueueSize / sinkThreadPoolSize, <MASK><NEW_LINE>sinkThreadPool[i].setName(getName() + "_pulsar_sink_sender-" + i);<NEW_LINE>sinkThreadPool[i].start();<NEW_LINE>}<NEW_LINE>this.canTake = true;<NEW_LINE>logger.info("[{}] Pulsar sink started", getName());<NEW_LINE>} | badEventQueueSize / sinkThreadPoolSize, i, true); |
1,225,816 | private void fireChanged() {<NEW_LINE>List<String> savedCategories = loadCategories();<NEW_LINE>ListModel model = lUseIn.getModel();<NEW_LINE>List<String> currentCategories = new ArrayList<String>(model.getSize());<NEW_LINE>for (int i = 0; i < model.getSize(); i++) {<NEW_LINE>currentCategories.add((String) model.getElementAt(i));<NEW_LINE>}<NEW_LINE>boolean isChanged = !savedCategories.equals(currentCategories);<NEW_LINE>List<Locale> savedLocales = new ArrayList<Locale>(Arrays.asList(DictionaryProviderImpl.getInstalledDictionariesLocales()));<NEW_LINE>model = installedLocalesList.getModel();<NEW_LINE>List<Locale> currentLocales = new ArrayList<Locale>(model.getSize());<NEW_LINE>for (int i = 0; i < model.getSize(); i++) {<NEW_LINE>currentLocales.add((Locale) model.getElementAt(i));<NEW_LINE>}<NEW_LINE>isChanged <MASK><NEW_LINE>Object selectedItem = defaultLocale.getSelectedItem();<NEW_LINE>Locale selectedLocale = null;<NEW_LINE>if (selectedItem instanceof Locale) {<NEW_LINE>selectedLocale = (Locale) selectedItem;<NEW_LINE>}<NEW_LINE>if (selectedItem instanceof String) {<NEW_LINE>String[] parsedComponents = ((String) selectedItem).split("_");<NEW_LINE>String[] components = new String[] { "", "", "" };<NEW_LINE>System.arraycopy(parsedComponents, 0, components, 0, parsedComponents.length);<NEW_LINE>selectedLocale = new Locale(components[0], components[1], components[2]);<NEW_LINE>}<NEW_LINE>if (selectedLocale != null) {<NEW_LINE>isChanged |= !DefaultLocaleQueryImplementation.getDefaultLocale().equals(selectedLocale);<NEW_LINE>}<NEW_LINE>c.notifyChanged(isChanged);<NEW_LINE>} | |= !savedLocales.equals(currentLocales); |
1,161,092 | public void testMultipleMultiArgConstructors(HttpServletRequest req, HttpServletResponse resp) throws Exception {<NEW_LINE>Response response = target(req, "MultiMultiArgCtor").queryParam("a", "b").request().get();<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>assertEquals("MultiMultiArgCtor 3", response.readEntity(String.class));<NEW_LINE>response = target(req, "MultiMultiArgCtor").queryParam("a", "c").request().post(Entity.text("POST"));<NEW_LINE>assertEquals(<MASK><NEW_LINE>assertEquals("MultiMultiArgCtor POST 3", response.readEntity(String.class));<NEW_LINE>response = target(req, "MultiMultiArgCtor").queryParam("a", "d").request().method("PATCH", Entity.text("PATCH"));<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>assertEquals("MultiMultiArgCtor PATCH 3", response.readEntity(String.class));<NEW_LINE>response = target(req, "MultiMultiArgCtor").request().options();<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>assertTrue(response.getHeaderString("Allow").contains("GET"));<NEW_LINE>assertTrue(response.getHeaderString("Allow").contains("POST"));<NEW_LINE>assertTrue(response.getHeaderString("Allow").contains("PATCH"));<NEW_LINE>} | 200, response.getStatus()); |
97,140 | public void updateConnectedControllers() {<NEW_LINE>logger.config("Updating connected controllers.");<NEW_LINE>if (environment != null) {<NEW_LINE>controllerCount = 0;<NEW_LINE>for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) {<NEW_LINE>int <MASK><NEW_LINE>if (classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_Controller || classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_GenericTracker) {<NEW_LINE>IntBuffer error = BufferUtils.createIntBuffer(1);<NEW_LINE>String controllerName = "Unknown";<NEW_LINE>String manufacturerName = "Unknown";<NEW_LINE>controllerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_TrackingSystemName_String, error);<NEW_LINE>manufacturerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_ManufacturerName_String, error);<NEW_LINE>if (error.get(0) != 0) {<NEW_LINE>logger.warning("Error getting controller information " + controllerName + " " + manufacturerName + "Code (" + error.get(0) + ")");<NEW_LINE>}<NEW_LINE>controllerIndex[controllerCount] = i;<NEW_LINE>// Adding tracked controller to control.<NEW_LINE>if (trackedControllers == null) {<NEW_LINE>trackedControllers = new ArrayList<VRTrackedController>(VR.k_unMaxTrackedDeviceCount);<NEW_LINE>}<NEW_LINE>trackedControllers.add(new LWJGLOpenVRTrackedController(i, this, controllerName, manufacturerName, environment));<NEW_LINE>// Send a Haptic pulse to the controller<NEW_LINE>triggerHapticPulse(controllerCount, 1.0f);<NEW_LINE>controllerCount++;<NEW_LINE>logger.config(" Tracked controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " " + controllerName + " (" + manufacturerName + ") attached.");<NEW_LINE>} else {<NEW_LINE>logger.config(" Controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " ignored.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("VR input is not attached to a VR environment.");<NEW_LINE>}<NEW_LINE>} | classCallback = VRSystem.VRSystem_GetTrackedDeviceClass(i); |
1,200,739 | public void evaluateObservationNoise(double minPixelError, double maxPixelError, int N, boolean isPlanar) {<NEW_LINE>System.out.println("------------------------");<NEW_LINE>rand = new Random(234);<NEW_LINE>for (int i = 0; i <= N; i++) {<NEW_LINE>double mag = (maxPixelError - minPixelError) * i / N + minPixelError;<NEW_LINE>init(NUM_POINTS, false, isPlanar);<NEW_LINE>addPixelNoise(mag);<NEW_LINE>if (!target.process(observationPose, found))<NEW_LINE>throw new RuntimeException("Not expected to fail");<NEW_LINE>double[] expectedEuler = ConvertRotation3D_F64.matrixToEuler(motion.getR(), EulerType.XYZ, (double[]) null);<NEW_LINE>double[] foundEuler = ConvertRotation3D_F64.matrixToEuler(found.getR(), EulerType.XYZ, (double[]) null);<NEW_LINE>Vector3D_F64 expectedTran = motion.getT();<NEW_LINE><MASK><NEW_LINE>double errorTran = expectedTran.distance(foundTran);<NEW_LINE>double errorEuler = 0;<NEW_LINE>double sum = 0;<NEW_LINE>for (int j = 0; j < 3; j++) {<NEW_LINE>double e = expectedEuler[j] - foundEuler[j];<NEW_LINE>errorEuler += e * e;<NEW_LINE>sum += expectedEuler[j];<NEW_LINE>}<NEW_LINE>errorEuler = 100 * Math.sqrt(errorEuler) / Math.sqrt(sum);<NEW_LINE>System.out.printf("%10s Err=%4.1f %3d angle %6.2f%% translation %6.2e\n", name, mag, i, errorEuler, errorTran);<NEW_LINE>}<NEW_LINE>} | Vector3D_F64 foundTran = found.getT(); |
1,462,812 | public static List<AlgorithmInstance> load(Path file, String name, ClassLoader classLoader) {<NEW_LINE>ConfigurationLoader loader = new ConfigurationLoader(classLoader);<NEW_LINE>AlgorithmInstanceBuilder aib = new AlgorithmInstanceBuilder(name);<NEW_LINE>if (name == null) {<NEW_LINE>aib.setName(file.getFileName().toString());<NEW_LINE>}<NEW_LINE>MultiAlgorithmDSL dsl = new MultiAlgorithmDSL(loader, aib);<NEW_LINE>try {<NEW_LINE>LenskitConfigScript script = loader.<MASK><NEW_LINE>dsl.setBaseURI(script.getDelegate().getBaseURI());<NEW_LINE>script.setDelegate(dsl);<NEW_LINE>script.configure();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new EvaluationException("cannot load configuration from " + file, e);<NEW_LINE>}<NEW_LINE>List<AlgorithmInstance> multi = dsl.getInstances();<NEW_LINE>if (multi.isEmpty()) {<NEW_LINE>multi = Collections.singletonList(aib.build());<NEW_LINE>}<NEW_LINE>logger.info("loaded {} algorithms from {}", multi.size(), file);<NEW_LINE>return multi;<NEW_LINE>} | loadScript(file.toFile()); |
275,627 | @Consumes(APPLICATION_JSON)<NEW_LINE>@Produces(APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Update a bucket state", notes = "Can only close a bucket which is not in DRAFT state", response = Bucket.class)<NEW_LINE>@Timed<NEW_LINE>public Response putBucketState(@PathParam("experimentID") @ApiParam(value = "Experiment ID") final Experiment.ID experimentID, @PathParam("bucketLabel") @ApiParam(value = "Bucket Label") final Bucket.Label bucketLabel, @PathParam("desiredState") @ApiParam(value = "Desired Bucket State") final Bucket.State desiredState, @HeaderParam(AUTHORIZATION) @ApiParam(value = EXAMPLE_AUTHORIZATION_HEADER, required = true) final String authorizationHeader) {<NEW_LINE>try {<NEW_LINE>Username <MASK><NEW_LINE>Experiment experiment = experiments.getExperiment(experimentID);<NEW_LINE>// Throw an exception if the current experiment is not valid<NEW_LINE>if (experiment == null) {<NEW_LINE>throw new ExperimentNotFoundException(experimentID);<NEW_LINE>}<NEW_LINE>authorization.checkUserPermissions(userName, experiment.getApplicationName(), UPDATE);<NEW_LINE>UserInfo user = authorization.getUserInfo(userName);<NEW_LINE>Bucket bucket = buckets.updateBucketState(experimentID, bucketLabel, desiredState, user);<NEW_LINE>assert bucket != null : "Error updating bucket state";<NEW_LINE>return httpHeader.headers().entity(bucket).build();<NEW_LINE>} catch (Exception exception) {<NEW_LINE>LOGGER.error("putBucketState failed for experimentID={}, bucketLabel={}, desiredState={} with error:", experimentID, bucketLabel, desiredState, exception);<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>} | userName = authorization.getUser(authorizationHeader); |
375,008 | final UpdateSipMediaApplicationCallResult executeUpdateSipMediaApplicationCall(UpdateSipMediaApplicationCallRequest updateSipMediaApplicationCallRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSipMediaApplicationCallRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSipMediaApplicationCallRequest> request = null;<NEW_LINE>Response<UpdateSipMediaApplicationCallResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSipMediaApplicationCallRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSipMediaApplicationCallRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSipMediaApplicationCall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSipMediaApplicationCallResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSipMediaApplicationCallResultJsonUnmarshaller());<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()); |
814,708 | protected // e.g. 'a[1] = 2 #=> 2' or 'a[1] = 1,2,3 #=> [1,2,3]'<NEW_LINE>Operand buildAttrAssignCallArgs(List<Operand> argsList, Node args, boolean containsAssignment) {<NEW_LINE>if (args == null)<NEW_LINE>return manager.getNil();<NEW_LINE>switch(args.getNodeType()) {<NEW_LINE>case ARRAYNODE:<NEW_LINE>{<NEW_LINE>// a[1] = 2; a[1,2,3] = 4,5,6<NEW_LINE><MASK><NEW_LINE>for (Node n : ((ListNode) args).children()) {<NEW_LINE>last = buildWithOrder(n, containsAssignment);<NEW_LINE>argsList.add(last);<NEW_LINE>}<NEW_LINE>return last;<NEW_LINE>}<NEW_LINE>case ARGSCATNODE:<NEW_LINE>{<NEW_LINE>ArgsCatNode argsCatNode = (ArgsCatNode) args;<NEW_LINE>Operand lhs = build(argsCatNode.getFirstNode());<NEW_LINE>Operand rhs = build(argsCatNode.getSecondNode());<NEW_LINE>Variable res = createTemporaryVariable();<NEW_LINE>addInstr(new BuildCompoundArrayInstr(res, lhs, rhs, false));<NEW_LINE>argsList.add(new Splat(res));<NEW_LINE>return rhs;<NEW_LINE>}<NEW_LINE>case ARGSPUSHNODE:<NEW_LINE>{<NEW_LINE>// a[1, *b] = 2<NEW_LINE>ArgsPushNode argsPushNode = (ArgsPushNode) args;<NEW_LINE>Operand lhs = build(argsPushNode.getFirstNode());<NEW_LINE>Operand rhs = build(argsPushNode.getSecondNode());<NEW_LINE>Variable res = createTemporaryVariable();<NEW_LINE>addInstr(new BuildCompoundArrayInstr(res, lhs, rhs, true));<NEW_LINE>argsList.add(new Splat(res));<NEW_LINE>return rhs;<NEW_LINE>}<NEW_LINE>case SPLATNODE:<NEW_LINE>{<NEW_LINE>// a[1] = *b<NEW_LINE>Splat rhs = new Splat(buildSplat((SplatNode) args));<NEW_LINE>argsList.add(rhs);<NEW_LINE>return rhs;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw notCompilable("Invalid node for attrassign call args", args);<NEW_LINE>} | Operand last = manager.getNil(); |
698,736 | private static MatchResult tryTreeMatches(TryTree tryTree, VisitorState state) {<NEW_LINE>BlockTree tryBlock = tryTree.getBlock();<NEW_LINE>List<? extends StatementTree> statements = tryBlock.getStatements();<NEW_LINE>if (statements.isEmpty()) {<NEW_LINE>return doesNotMatch();<NEW_LINE>}<NEW_LINE>// Check if any of the statements is a fail or assert* method (i.e. any<NEW_LINE>// method that can throw an AssertionFailedError)<NEW_LINE>StatementTree failStatement = null;<NEW_LINE>for (StatementTree statement : statements) {<NEW_LINE>if (!(statement instanceof ExpressionStatementTree)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (failOrAssert.matches(((ExpressionStatementTree) statement).getExpression(), state)) {<NEW_LINE>failStatement = statement;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (failStatement == null) {<NEW_LINE>return doesNotMatch();<NEW_LINE>}<NEW_LINE>// Verify that the only catch clause catches Throwable<NEW_LINE>List<? extends CatchTree> catches = tryTree.getCatches();<NEW_LINE>if (catches.size() != 1) {<NEW_LINE>// TODO(adamwos): this could be supported - only the last catch would need<NEW_LINE>// to be checked - it would either be Throwable or Error.<NEW_LINE>return doesNotMatch();<NEW_LINE>}<NEW_LINE>CatchTree <MASK><NEW_LINE>VariableTree catchType = catchTree.getParameter();<NEW_LINE>boolean catchesThrowable = javaLangThrowable.matches(catchType, state);<NEW_LINE>boolean catchesError = javaLangError.matches(catchType, state);<NEW_LINE>boolean catchesOtherError = someAssertionFailure.matches(catchType, state);<NEW_LINE>if (!catchesThrowable && !catchesError && !catchesOtherError) {<NEW_LINE>return doesNotMatch();<NEW_LINE>}<NEW_LINE>// Verify that the catch block is empty or contains only comments.<NEW_LINE>List<? extends StatementTree> catchStatements = catchTree.getBlock().getStatements();<NEW_LINE>for (StatementTree catchStatement : catchStatements) {<NEW_LINE>// Comments are not a part of the AST. Therefore, we should either get<NEW_LINE>// an empty list of statements (regardless of the number of comments),<NEW_LINE>// or a list of empty statements.<NEW_LINE>if (!Matchers.<Tree>kindIs(EMPTY_STATEMENT).matches(catchStatement, state)) {<NEW_LINE>return doesNotMatch();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return matches(failStatement, catchesThrowable ? JAVA_LANG_THROWABLE : catchesError ? JAVA_LANG_ERROR : SOME_ASSERTION_FAILURE);<NEW_LINE>} | catchTree = catches.get(0); |
1,528,201 | public static byte[] readBytes(@This File thiz) {<NEW_LINE>try (FileInputStream input = new FileInputStream(thiz)) {<NEW_LINE>int offset = 0;<NEW_LINE>long remaining = thiz.length();<NEW_LINE>if (remaining > Integer.MAX_VALUE) {<NEW_LINE>throw new OutOfMemoryError("File " + thiz + " is too big (" + remaining + " bytes) to fit in memory.");<NEW_LINE>}<NEW_LINE>byte[] result = new byte[(int) remaining];<NEW_LINE>while (remaining > 0) {<NEW_LINE>int count = input.read(result, offset, (int) remaining);<NEW_LINE>if (count < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>remaining -= count;<NEW_LINE>offset += count;<NEW_LINE>}<NEW_LINE>if (remaining != 0) {<NEW_LINE>byte[] copy = new byte[offset];<NEW_LINE>System.arraycopy(result, <MASK><NEW_LINE>result = copy;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | 0, copy, 0, offset); |
1,304,009 | public Future<IHAReadResponse> readFromDisk(final IHAReadRequest msg) {<NEW_LINE>final long token = msg.getQuorumToken();<NEW_LINE>// final UUID storeId = msg.getStoreUUID();<NEW_LINE>final <MASK><NEW_LINE>if (haLog.isInfoEnabled())<NEW_LINE>haLog.info("token=" + token + ", addr=" + addr);<NEW_LINE>final FutureTask<IHAReadResponse> ft = new FutureTask<IHAReadResponse>(new Callable<IHAReadResponse>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IHAReadResponse call() throws Exception {<NEW_LINE>if (haLog.isInfoEnabled())<NEW_LINE>haLog.info("token=" + token);<NEW_LINE>quorum.assertQuorum(token);<NEW_LINE>// final ILRUCache<Long, Object> cache = (LRUNexus.INSTANCE<NEW_LINE>// == null) ? null<NEW_LINE>// : LRUNexus.getCache(jnl);<NEW_LINE>//<NEW_LINE>// Object obj = cache.get(addr);<NEW_LINE>//<NEW_LINE>// if(obj != null && obj instanceof IDataRecordAccess) {<NEW_LINE>//<NEW_LINE>// return ((IDataRecordAccess)obj).data();<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>// read from the local store.<NEW_LINE>final ByteBuffer b = ((IHABufferStrategy) getBufferStrategy()).readFromLocalStore(addr);<NEW_LINE>final byte[] a = BytesUtil.toArray(b);<NEW_LINE>// cache.putIfAbsent(addr, b);<NEW_LINE>return new HAReadResponse(a);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ft.run();<NEW_LINE>return getProxy(ft);<NEW_LINE>} | long addr = msg.getAddr(); |
723,689 | public Map<String, DocumentField> flattenDocumentField(final String[] fieldFilter, final String path, final Object node, Map<String, DocumentField> flatFields) {<NEW_LINE>if ((node instanceof List) || (node instanceof Set)) {<NEW_LINE>for (Object o : ((Collection) node)) {<NEW_LINE>flattenDocumentField(<MASK><NEW_LINE>}<NEW_LINE>} else if (node instanceof Map) {<NEW_LINE>for (String key : ((Map<String, Object>) node).keySet()) {<NEW_LINE>String fullname = (path.length() > 0) ? path + '.' + key : key;<NEW_LINE>flattenDocumentField(fieldFilter, fullname, ((Map<String, Object>) node).get(key), flatFields);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (fieldFilter != null) {<NEW_LINE>for (String f : fieldFilter) {<NEW_LINE>if (path.equals(f)) {<NEW_LINE>DocumentField gf = flatFields.get(path);<NEW_LINE>if (gf == null) {<NEW_LINE>gf = new DocumentField(path, ImmutableList.builder().add(node).build());<NEW_LINE>} else {<NEW_LINE>gf = new DocumentField(path, ImmutableList.builder().addAll(gf.getValues()).add(node).build());<NEW_LINE>}<NEW_LINE>flatFields.put(path, gf);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return flatFields;<NEW_LINE>} | fieldFilter, path, o, flatFields); |
1,544,287 | private void initMethodHandles() throws ClassNotFoundException, NoSuchMethodException, SecurityException {<NEW_LINE>Class<?> androidInputDeviceRegistry = getApplicationClassLoader().loadClass("com.sun.glass.ui.monocle.AndroidInputDeviceRegistry");<NEW_LINE>Method registerDevice = androidInputDeviceRegistry.getMethod("registerDevice");<NEW_LINE>fxDalvikEntity.setInitializeMonocleMethod(registerDevice);<NEW_LINE>Class<?> dalvikInputClass = getApplicationClassLoader().loadClass("com.sun.glass.ui.android.DalvikInput");<NEW_LINE>fxDalvikEntity.setOnMultiTouchEventMethod(dalvikInputClass.getMethod("onMultiTouchEvent", int.class, int[].class, int[].class, int[].class, int[].class));<NEW_LINE>fxDalvikEntity.setOnKeyEventMethod(dalvikInputClass.getMethod("onKeyEvent", int.class, int.class, String.class));<NEW_LINE>fxDalvikEntity.setOnGlobalLayoutChangedMethod(dalvikInputClass.getMethod("onGlobalLayoutChanged"));<NEW_LINE>fxDalvikEntity.setOnSurfaceChangedNativeMethod1(dalvikInputClass.getMethod("onSurfaceChangedNative"));<NEW_LINE>fxDalvikEntity.setOnSurfaceChangedNativeMethod2(dalvikInputClass.getMethod("onSurfaceChangedNative", int.class, int.class, int.class));<NEW_LINE>fxDalvikEntity.setOnSurfaceRedrawNeededNativeMethod(dalvikInputClass.getMethod("onSurfaceRedrawNeededNative"));<NEW_LINE>fxDalvikEntity.setOnConfigurationChangedNativeMethod(dalvikInputClass.getMethod("onConfigurationChangedNative", int.class));<NEW_LINE>boolean hasAccessToFXClasses = false;<NEW_LINE>try {<NEW_LINE>// this.getClass().getClassLoader().loadClass("com.sun.javafx.application.PlatformImpl.FinishListener");<NEW_LINE>registerExitListener();<NEW_LINE><MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>Log.v(TAG, "No JavaFX on our current (base) classpath, don't register exit listener");<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>} | Log.v(TAG, "We have JavaFX on our current (base) classpath, registered exit listener"); |
1,442,477 | public void refresh() {<NEW_LINE>if (hideCloudCliServices.getValue()) {<NEW_LINE>cloudCliServices.getValue().forEach(bde -> bde.dispose());<NEW_LINE>cloudCliServices.replaceAll(Collections.emptySet());<NEW_LINE>buttons.replaceAll(Collections.emptySet());<NEW_LINE>} else {<NEW_LINE>new Job("Loading local cloud services") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>try {<NEW_LINE>if (cloudCliInstall.getValue() == null) {<NEW_LINE>buttons.add(enableCloudServicesButton);<NEW_LINE>}<NEW_LINE>refreshState.setValue(RefreshState.loading("Fetching Local Cloud Sevices..."));<NEW_LINE>List<LocalCloudServiceDashElement> newCloudCliservices = fetchLocalServices();<NEW_LINE>cloudCliServices.getValue().forEach(<MASK><NEW_LINE>cloudCliServices.replaceAll(newCloudCliservices);<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} finally {<NEW_LINE>refreshState.setValue(RefreshState.READY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.schedule();<NEW_LINE>}<NEW_LINE>} | bde -> bde.dispose()); |
392,805 | public short parseFile(File f) throws Exception {<NEW_LINE>String filename = f.getAbsolutePath();<NEW_LINE>String classname = filename.substring(this.basedir.length() + 1).replaceAll("/", ".");<NEW_LINE>classname = classname.substring(0, classname.length() - 5);<NEW_LINE>BufferedReader in = new BufferedReader(new FileReader(f));<NEW_LINE>String line;<NEW_LINE>int lineNo = 1;<NEW_LINE>short rc = 0;<NEW_LINE>while ((line = in.readLine()) != null) {<NEW_LINE>Matcher m = pattern.matcher(line);<NEW_LINE>if (m.matches()) {<NEW_LINE>String number = m.group(1);<NEW_LINE>if (this.points.containsKey(number)) {<NEW_LINE>System.out.println("Duplicate Trace Point: " + number);<NEW_LINE>System.out.println(" " + this<MASK><NEW_LINE>System.out.println(" " + classname + ":" + lineNo);<NEW_LINE>rc = 1;<NEW_LINE>}<NEW_LINE>// The original extractor put out 4 values for each trace point<NEW_LINE>// out.println(number+".class="+classname);<NEW_LINE>// out.println(number+".line="+lineNo);<NEW_LINE>// out.println(number+".value="+m.group(2));<NEW_LINE>this.points.put(number, classname + ":" + lineNo);<NEW_LINE>out.println(number + "=" + m.group(2));<NEW_LINE>}<NEW_LINE>lineNo++;<NEW_LINE>}<NEW_LINE>in.close();<NEW_LINE>return rc;<NEW_LINE>} | .points.get(number)); |
1,779,267 | public ListenerResult listen(WorkflowContext context) throws WorkflowListenerException {<NEW_LINE>ApplyGroupProcessForm form = (ApplyGroupProcessForm) context.getProcessForm();<NEW_LINE>String groupId = form.getInlongGroupId();<NEW_LINE><MASK><NEW_LINE>// only the [TO_BE_APPROVAL] status allowed the rejecting operation<NEW_LINE>InlongGroupEntity entity = groupMapper.selectByGroupId(groupId);<NEW_LINE>if (entity == null) {<NEW_LINE>throw new WorkflowListenerException("inlong group not found with groupId=" + groupId);<NEW_LINE>}<NEW_LINE>if (!Objects.equals(GroupStatus.TO_BE_APPROVAL.getCode(), entity.getStatus())) {<NEW_LINE>throw new WorkflowListenerException("current status was not allowed to reject inlong group");<NEW_LINE>}<NEW_LINE>// after reject, update InlongGroup status to [APPROVE_REJECTED]<NEW_LINE>String username = context.getOperator();<NEW_LINE>groupService.updateStatus(groupId, GroupStatus.APPROVE_REJECTED.getCode(), username);<NEW_LINE>return ListenerResult.success();<NEW_LINE>} | log.info("begin to execute RejectApplyProcessListener for groupId={}", groupId); |
335,905 | private static void processAnnotationInfoType(AnnotationInfoType ait, String indent, StringBuilder sb) {<NEW_LINE>final String type = ait.getType();<NEW_LINE>sb.append(indent).append("@").append(type);<NEW_LINE>final List<AnnotationValueType> avtList = ait.getAnnoKeyVal();<NEW_LINE>if (avtList.size() > 0) {<NEW_LINE>sb.append("(");<NEW_LINE>boolean first = true;<NEW_LINE>for (AnnotationValueType avt : avtList) {<NEW_LINE>final String name = avt.getName();<NEW_LINE>final <MASK><NEW_LINE>final AnnotationsType at2 = avt.getAnnotations();<NEW_LINE>final ValueInstanceType vit = avt.getValue();<NEW_LINE>final ArrayInstanceType arrit = avt.getValues();<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>sb.append(name).append("=");<NEW_LINE>if (vit != null) {<NEW_LINE>processValueInstanceType(vit, sb);<NEW_LINE>} else if (ait2 != null) {<NEW_LINE>processAnnotationInfoType(ait2, indent + " ", sb);<NEW_LINE>} else if (at2 != null) {<NEW_LINE>sb.append("{ ");<NEW_LINE>processAnnotationsType(at2, indent + " ", sb, true);<NEW_LINE>sb.append("} ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(")");<NEW_LINE>}<NEW_LINE>sb.append("\n");<NEW_LINE>} | AnnotationInfoType ait2 = avt.getAnnotation(); |
1,071,237 | public Request<CreateReservedInstancesListingRequest> marshall(CreateReservedInstancesListingRequest createReservedInstancesListingRequest) {<NEW_LINE>if (createReservedInstancesListingRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateReservedInstancesListingRequest> request = new DefaultRequest<CreateReservedInstancesListingRequest>(createReservedInstancesListingRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "CreateReservedInstancesListing");<NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>if (createReservedInstancesListingRequest.getReservedInstancesId() != null) {<NEW_LINE>request.addParameter("ReservedInstancesId", StringUtils.fromString(createReservedInstancesListingRequest.getReservedInstancesId()));<NEW_LINE>}<NEW_LINE>if (createReservedInstancesListingRequest.getInstanceCount() != null) {<NEW_LINE>request.addParameter("InstanceCount", StringUtils.fromInteger(createReservedInstancesListingRequest.getInstanceCount()));<NEW_LINE>}<NEW_LINE>java.util.List<PriceScheduleSpecification> priceSchedulesList = createReservedInstancesListingRequest.getPriceSchedules();<NEW_LINE>int priceSchedulesListIndex = 1;<NEW_LINE>for (PriceScheduleSpecification priceSchedulesListValue : priceSchedulesList) {<NEW_LINE>PriceScheduleSpecification priceScheduleSpecificationMember = priceSchedulesListValue;<NEW_LINE>if (priceScheduleSpecificationMember != null) {<NEW_LINE>if (priceScheduleSpecificationMember.getTerm() != null) {<NEW_LINE>request.addParameter("PriceSchedules." + priceSchedulesListIndex + ".Term", StringUtils.fromLong(priceScheduleSpecificationMember.getTerm()));<NEW_LINE>}<NEW_LINE>if (priceScheduleSpecificationMember.getPrice() != null) {<NEW_LINE>request.addParameter("PriceSchedules." + priceSchedulesListIndex + ".Price", StringUtils.fromDouble(priceScheduleSpecificationMember.getPrice()));<NEW_LINE>}<NEW_LINE>if (priceScheduleSpecificationMember.getCurrencyCode() != null) {<NEW_LINE>request.addParameter("PriceSchedules." + priceSchedulesListIndex + ".CurrencyCode", StringUtils.fromString(priceScheduleSpecificationMember.getCurrencyCode()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>priceSchedulesListIndex++;<NEW_LINE>}<NEW_LINE>if (createReservedInstancesListingRequest.getClientToken() != null) {<NEW_LINE>request.addParameter("ClientToken", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (createReservedInstancesListingRequest.getClientToken())); |
1,194,569 | public int write(Tablet tablet) throws WriteProcessException {<NEW_LINE>int maxPointCount = 0, pointCount;<NEW_LINE>List<MeasurementSchema> timeseries = tablet.getSchemas();<NEW_LINE>for (int column = 0; column < timeseries.size(); column++) {<NEW_LINE>String measurementId = timeseries.get(column).getMeasurementId();<NEW_LINE>TSDataType tsDataType = timeseries.<MASK><NEW_LINE>pointCount = 0;<NEW_LINE>for (int row = 0; row < tablet.rowSize; row++) {<NEW_LINE>// check isNull in tablet<NEW_LINE>if (tablet.bitMaps != null && tablet.bitMaps[column] != null && tablet.bitMaps[column].isMarked(row)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long time = tablet.timestamps[row];<NEW_LINE>checkIsHistoryData(measurementId, time);<NEW_LINE>pointCount++;<NEW_LINE>switch(tsDataType) {<NEW_LINE>case INT32:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((int[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case INT64:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((long[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((float[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((double[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((boolean[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((Binary[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnSupportedDataTypeException(String.format("Data type %s is not supported.", tsDataType));<NEW_LINE>}<NEW_LINE>lastTimeMap.put(measurementId, time);<NEW_LINE>}<NEW_LINE>maxPointCount = Math.max(pointCount, maxPointCount);<NEW_LINE>}<NEW_LINE>return maxPointCount;<NEW_LINE>} | get(column).getType(); |
217,743 | public void marshall(AutoScalingConfiguration autoScalingConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (autoScalingConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getAutoScalingConfigurationArn(), AUTOSCALINGCONFIGURATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getAutoScalingConfigurationName(), AUTOSCALINGCONFIGURATIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getAutoScalingConfigurationRevision(), AUTOSCALINGCONFIGURATIONREVISION_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getLatest(), LATEST_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getMinSize(), MINSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getMaxSize(), MAXSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(autoScalingConfiguration.getDeletedAt(), DELETEDAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | autoScalingConfiguration.getMaxConcurrency(), MAXCONCURRENCY_BINDING); |
1,628,333 | private static void verifyVrrpGroups(Configuration c, Warnings w) {<NEW_LINE>for (Interface i : c.getAllInterfaces().values()) {<NEW_LINE>boolean modified = false;<NEW_LINE>ImmutableSortedMap.Builder<Integer, VrrpGroup> groupsBuilder = ImmutableSortedMap.naturalOrder();<NEW_LINE>for (Entry<Integer, VrrpGroup> vrrpGroupByVrid : i.getVrrpGroups().entrySet()) {<NEW_LINE>int vrid = vrrpGroupByVrid.getKey();<NEW_LINE>VrrpGroup vrrpGroup = vrrpGroupByVrid.getValue();<NEW_LINE>ImmutableMap.Builder<String, Set<Ip>> addressesBuilder = ImmutableMap.builder();<NEW_LINE>for (Entry<String, Set<Ip>> addressesByInterface : vrrpGroup.getVirtualAddresses().entrySet()) {<NEW_LINE>String referencedIface = addressesByInterface.getKey();<NEW_LINE>if (!c.getAllInterfaces().containsKey(referencedIface)) {<NEW_LINE>w.redFlag(String.format("Removing virtual addresses to be assigned to non-existent interface '%s' for" + " VRID %d on sync interface '%s'", referencedIface, vrid, i.getName()));<NEW_LINE>modified = true;<NEW_LINE>} else {<NEW_LINE>addressesBuilder.put(referencedIface, addressesByInterface.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>groupsBuilder.put(vrid, vrrpGroup.toBuilder().setVirtualAddresses(addressesBuilder.build<MASK><NEW_LINE>}<NEW_LINE>if (modified) {<NEW_LINE>i.setVrrpGroups(groupsBuilder.build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ()).build()); |
717,785 | public void processSelection(@NonNull final WindowId windowId, @NonNull final Document document, @NonNull final String bpartnerFieldName, @NonNull final String selectionIdStr) {<NEW_LINE>final SqlViewKeyColumnNamesMap keyColumnNamesMap = sqlViewFactory.getKeyColumnNamesMap(windowId);<NEW_LINE>final SqlComposedKey composedKey = keyColumnNamesMap.extractComposedKey(DocumentId.of(selectionIdStr));<NEW_LINE>//<NEW_LINE>// BPartner<NEW_LINE>final BPartnerId bpartnerId = composedKey.getValueAsId(I_C_BPartner_Adv_Search.COLUMNNAME_C_BPartner_ID, BPartnerId<MASK><NEW_LINE>if (bpartnerId == null) {<NEW_LINE>// shall not happen<NEW_LINE>throw new AdempiereException("@NoSelection@");<NEW_LINE>}<NEW_LINE>document.processValueChange(bpartnerFieldName, bpartnerId, null, false);<NEW_LINE>//<NEW_LINE>// Location<NEW_LINE>final BPartnerLocationId bpLocationId = BPartnerLocationId.ofRepoIdOrNull(bpartnerId, composedKey.getValueAsInteger(I_C_BPartner_Adv_Search.COLUMNNAME_C_BPartner_Location_ID).orElse(-1));<NEW_LINE>if (bpLocationId != null) {<NEW_LINE>final String locationFieldName = getLocationFieldNameForBPartnerField(bpartnerFieldName);<NEW_LINE>document.processValueChange(locationFieldName, bpLocationId.getRepoId(), null, false);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Contact<NEW_LINE>final BPartnerContactId bpContactId = BPartnerContactId.ofRepoIdOrNull(bpartnerId, composedKey.getValueAsInteger(I_C_BPartner_Adv_Search.COLUMNNAME_C_BP_Contact_ID).orElse(-1));<NEW_LINE>if (bpContactId != null) {<NEW_LINE>final String bpContactIdFieldName = getUserIdFieldNameForBPartnerField(bpartnerFieldName);<NEW_LINE>document.processValueChange(bpContactIdFieldName, bpContactId.getRepoId(), null, false);<NEW_LINE>}<NEW_LINE>} | .class).orElse(null); |
1,069,092 | public com.amazonaws.services.workmail.model.MailDomainNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.workmail.model.MailDomainNotFoundException mailDomainNotFoundException = new com.amazonaws.services.workmail.model.MailDomainNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 mailDomainNotFoundException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
166,495 | // fill emitted num to nodes<NEW_LINE>private static void fillValue2Node(List<MetricInfo> componentMetrics, Map<String, TopologyNode> nodes) {<NEW_LINE>String NODE_DIM = MetricDef.EMMITTED_NUM;<NEW_LINE>List<String> FILTER = Arrays.asList(MetricDef.EMMITTED_NUM, MetricDef.SEND_TPS, MetricDef.RECV_TPS);<NEW_LINE>for (MetricInfo info : componentMetrics) {<NEW_LINE>if (info == null)<NEW_LINE>continue;<NEW_LINE>for (Map.Entry<String, Map<Integer, MetricSnapshot>> metric : info.get_metrics().entrySet()) {<NEW_LINE>String name = metric.getKey();<NEW_LINE>String[] split_name = name.split("@");<NEW_LINE>String metricName = UIMetricUtils.extractMetricName(split_name);<NEW_LINE>String compName = UIMetricUtils.extractComponentName(split_name);<NEW_LINE>TopologyNode node = nodes.get(compName);<NEW_LINE>if (node != null && FILTER.contains(metricName)) {<NEW_LINE>for (Map.Entry<Integer, MetricSnapshot> winData : metric.getValue().entrySet()) {<NEW_LINE>node.putMapValue(metricName, winData.getKey(), UIMetricUtils.getMetricValue(winData.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (metricName == null || !metricName.equals(NODE_DIM)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// get 60 window metric<NEW_LINE>MetricSnapshot snapshot = metric.getValue().get(AsmWindow.M1_WINDOW);<NEW_LINE>if (node != null) {<NEW_LINE>node.<MASK><NEW_LINE>nodes.get(compName).setTitle("Emitted: " + UIMetricUtils.getMetricValue(snapshot));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setValue(snapshot.get_longValue()); |
319,622 | public Pair<INDArray, MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize) {<NEW_LINE>if (maskArray == null || maskArray.rank() == 2)<NEW_LINE>return new <MASK><NEW_LINE>if (maskArray.rank() != 4 || maskArray.size(2) != 1 || maskArray.size(3) != 1) {<NEW_LINE>throw new UnsupportedOperationException("Expected rank 4 mask array for 2D CNN layer activations. Got rank " + maskArray.rank() + " mask array (shape " + Arrays.toString(maskArray.shape()) + ") - when used in conjunction with input data of shape" + " [batch,channels,h,w] 4d masks passing through CnnToFeedForwardPreProcessor should have shape" + " [batchSize,1,1,1]");<NEW_LINE>}<NEW_LINE>return new Pair<>(maskArray.reshape(maskArray.ordering(), maskArray.size(0), maskArray.size(1)), currentMaskState);<NEW_LINE>} | Pair<>(maskArray, currentMaskState); |
132,876 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// create a scene and add a basemap to it<NEW_LINE>ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);<NEW_LINE>// add the scene to a scene view<NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// set the camera to the scene view<NEW_LINE>Camera camera = new Camera(41.985, 2.82691, 124.987, 332.131, 82.4732, 0.0);<NEW_LINE>mSceneView.setViewpointCamera(camera);<NEW_LINE>// add base surface for elevation data to the scene view<NEW_LINE>Surface surface = new Surface();<NEW_LINE>ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");<NEW_LINE>surface.getElevationSources().add(elevationSource);<NEW_LINE>scene.setBaseSurface(surface);<NEW_LINE>// add an integrated mesh layer to the scene<NEW_LINE>IntegratedMeshLayer gironaMeshLayer = new IntegratedMeshLayer("https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Girona_Spain/SceneServer");<NEW_LINE>scene.<MASK><NEW_LINE>// create a viewshed from the camera<NEW_LINE>LocationViewshed viewshed = new LocationViewshed(camera, 1.0, 500.0);<NEW_LINE>// create an analysis overlay to add the viewshed to the scene view<NEW_LINE>AnalysisOverlay analysisOverlay = new AnalysisOverlay();<NEW_LINE>analysisOverlay.getAnalyses().add(viewshed);<NEW_LINE>mSceneView.getAnalysisOverlays().add(analysisOverlay);<NEW_LINE>// create a button to update the viewshed with the current camera<NEW_LINE>Button cameraButton = findViewById(R.id.updateViewshedButton);<NEW_LINE>cameraButton.setOnClickListener(view -> viewshed.updateFromCamera(mSceneView.getCurrentViewpointCamera()));<NEW_LINE>} | getOperationalLayers().add(gironaMeshLayer); |
842,994 | /*<NEW_LINE>* Load the given resource bundle using the specified class loader.<NEW_LINE>*/<NEW_LINE>static void load(final String bundleName, Class<?> clazz) {<NEW_LINE>final Field[] fieldArray = clazz.getDeclaredFields();<NEW_LINE><MASK><NEW_LINE>boolean isAccessible = (clazz.getModifiers() & Modifier.PUBLIC) != 0;<NEW_LINE>// build a map of field names to Field objects<NEW_LINE>final int len = fieldArray.length;<NEW_LINE>Map<Object, Object> fields = new HashMap<Object, Object>(len * 2);<NEW_LINE>for (int i = 0; i < len; i++) fields.put(fieldArray[i].getName(), fieldArray[i]);<NEW_LINE>// search the variants from most specific to most general, since<NEW_LINE>// the MessagesProperties.put method will mark assigned fields<NEW_LINE>// to prevent them from being assigned twice<NEW_LINE>final String[] variants = buildVariants(bundleName);<NEW_LINE>for (int i = 0; i < variants.length; i++) {<NEW_LINE>// loader==null if we're launched off the Java boot classpath<NEW_LINE>final InputStream input = loader == null ? ClassLoader.getSystemResourceAsStream(variants[i]) : loader.getResourceAsStream(variants[i]);<NEW_LINE>if (input == null)<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>final MessagesProperties properties = new MessagesProperties(fields, bundleName, isAccessible);<NEW_LINE>properties.load(input);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log(SEVERITY_ERROR, "Error loading " + variants[i], e);<NEW_LINE>} finally {<NEW_LINE>if (input != null)<NEW_LINE>try {<NEW_LINE>input.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>computeMissingMessages(bundleName, clazz, fields, fieldArray, isAccessible);<NEW_LINE>} | ClassLoader loader = clazz.getClassLoader(); |
1,295,624 | private Object toJsonValue_PrettyValues(@Nullable final Object value, @NonNull final KPIJsonOptions jsonOpts) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (valueType == KPIFieldValueType.Date) {<NEW_LINE>if (value instanceof String) {<NEW_LINE>final Date date = TimeUtil.asDate(DateTimeConverters.fromObjectToZonedDateTime(value));<NEW_LINE>final Language language = Language.getLanguage(jsonOpts.getAdLanguage());<NEW_LINE>return DisplayType.getDateFormat(DisplayType.Date, language).format(date);<NEW_LINE>} else if (value instanceof Date) {<NEW_LINE>final Date date = (Date) value;<NEW_LINE>final Language language = Language.getLanguage(jsonOpts.getAdLanguage());<NEW_LINE>return DisplayType.getDateFormat(DisplayType.Date, language).format(date);<NEW_LINE>} else if (value instanceof Number) {<NEW_LINE>final long millis = ((Number) value).longValue();<NEW_LINE>final Date date = new Date(millis);<NEW_LINE>final Language language = Language.getLanguage(jsonOpts.getAdLanguage());<NEW_LINE>return DisplayType.getDateFormat(DisplayType.Date, language).format(date);<NEW_LINE>} else {<NEW_LINE>return value.toString();<NEW_LINE>}<NEW_LINE>} else if (valueType == KPIFieldValueType.DateTime) {<NEW_LINE>if (value instanceof String) {<NEW_LINE>final Date date = TimeUtil.asDate<MASK><NEW_LINE>final Language language = Language.getLanguage(jsonOpts.getAdLanguage());<NEW_LINE>return DisplayType.getDateFormat(DisplayType.DateTime, language).format(date);<NEW_LINE>} else if (value instanceof Date) {<NEW_LINE>final Date date = (Date) value;<NEW_LINE>final Language language = Language.getLanguage(jsonOpts.getAdLanguage());<NEW_LINE>return DisplayType.getDateFormat(DisplayType.DateTime, language).format(date);<NEW_LINE>} else if (value instanceof Number) {<NEW_LINE>final long millis = ((Number) value).longValue();<NEW_LINE>final Date date = new Date(millis);<NEW_LINE>final Language language = Language.getLanguage(jsonOpts.getAdLanguage());<NEW_LINE>return DisplayType.getDateFormat(DisplayType.DateTime, language).format(date);<NEW_LINE>} else {<NEW_LINE>return value.toString();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return toJsonValue_NoFormat(value, jsonOpts);<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>logger.warn("Failed converting {} for field {}", value, this, ex);<NEW_LINE>return value.toString();<NEW_LINE>}<NEW_LINE>} | (DateTimeConverters.fromObjectToZonedDateTime(value)); |
349,438 | final ListAppInstanceAdminsResult executeListAppInstanceAdmins(ListAppInstanceAdminsRequest listAppInstanceAdminsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAppInstanceAdminsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAppInstanceAdminsRequest> request = null;<NEW_LINE>Response<ListAppInstanceAdminsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAppInstanceAdminsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAppInstanceAdminsRequest));<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, "Chime SDK Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAppInstanceAdmins");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAppInstanceAdminsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAppInstanceAdminsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
408,634 | private Set<Class<?>> doGetClasses() {<NEW_LINE>String packages = servletContext.getInitParameter(OryxApplication.class.getName() + ".packages");<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(packages);<NEW_LINE>Set<Class<?>> classes = new HashSet<>();<NEW_LINE>for (String thePackage : packages.split(",")) {<NEW_LINE>Reflections reflections = new Reflections(thePackage);<NEW_LINE>classes.addAll(getClassesInPackageAnnotatedBy(thePackage, reflections, Path.class));<NEW_LINE>classes.addAll(getClassesInPackageAnnotatedBy(thePackage, reflections, Produces.class));<NEW_LINE>classes.addAll(getClassesInPackageAnnotatedBy(thePackage, reflections, Provider.class));<NEW_LINE>}<NEW_LINE>// Want to configure these globally, but not depend on Jersey, even though it's<NEW_LINE>// what will be used in practice by the provided apps.<NEW_LINE>for (String optionalJerseyClass : new String[] { "org.glassfish.jersey.message.DeflateEncoder", "org.glassfish.jersey.message.GZipEncoder", "org.glassfish.jersey.server.filter.EncodingFilter" }) {<NEW_LINE>if (ClassUtils.classExists(optionalJerseyClass)) {<NEW_LINE>classes.add(ClassUtils.loadClass(optionalJerseyClass));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("Found JAX-RS resources: {}", classes);<NEW_LINE>return classes;<NEW_LINE>} | log.info("Creating JAX-RS from endpoints in package(s) {}", packages); |
1,561,918 | public static void vertical3(Kernel1D_S32 kernel, GrayU8 input, GrayI16 output, int skip) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int <MASK><NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = input.width;<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offsetY = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offsetY; y <= heightEnd; y += skip) {<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int i = input.startIndex + (y - radius) * input.stride;<NEW_LINE>final int iEnd = i + width;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc] & 0xFF) * k1;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | k2 = kernel.data[1]; |
484,981 | protected Answer execute(final CreateIpAliasCommand cmd) {<NEW_LINE>if (s_logger.isInfoEnabled()) {<NEW_LINE>s_logger.info("Executing createIpAlias command: " + s_gson.toJson(cmd));<NEW_LINE>}<NEW_LINE>cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);<NEW_LINE>final List<IpAliasTO> ipAliasTOs = cmd.getIpAliasList();<NEW_LINE>final StringBuilder args = new StringBuilder();<NEW_LINE>for (final IpAliasTO ipaliasto : ipAliasTOs) {<NEW_LINE>args.<MASK><NEW_LINE>args.append(":");<NEW_LINE>args.append(ipaliasto.getRouterip());<NEW_LINE>args.append(":");<NEW_LINE>args.append(ipaliasto.getNetmask());<NEW_LINE>args.append("-");<NEW_LINE>}<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/createIpAlias " + args);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String controlIp = getRouterSshControlIp(cmd);<NEW_LINE>final Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", getSystemVMKeyFile(), null, "/root/createIpAlias.sh " + args);<NEW_LINE>if (!result.first()) {<NEW_LINE>s_logger.error("CreateIpAlias command on domr " + controlIp + " failed, message: " + result.second());<NEW_LINE>return new Answer(cmd, false, "createipAlias failed due to " + result.second());<NEW_LINE>}<NEW_LINE>if (s_logger.isInfoEnabled()) {<NEW_LINE>s_logger.info("createIpAlias command on domain router " + controlIp + " completed");<NEW_LINE>}<NEW_LINE>} catch (final Throwable e) {<NEW_LINE>final String msg = "createIpAlias failed due to " + e;<NEW_LINE>s_logger.error(msg, e);<NEW_LINE>return new Answer(cmd, false, msg);<NEW_LINE>}<NEW_LINE>return new Answer(cmd);<NEW_LINE>} | append(ipaliasto.getAlias_count()); |
441,488 | void refresh(TruffleHeapHistogram histogram) {<NEW_LINE>if (histogram == null || isPaused())<NEW_LINE>return;<NEW_LINE>forceRefresh = false;<NEW_LINE>boolean diff = lrDeltasButton.isSelected();<NEW_LINE>if (diff) {<NEW_LINE>if (baseClasses == null) {<NEW_LINE>baseClasses = new ArrayList(classes);<NEW_LINE>baseTotalBytes = totalBytes;<NEW_LINE>baseTotalInstances = totalInstances;<NEW_LINE>baseTotalAllocBytes = totalAllocBytes;<NEW_LINE>baseTotalAllocInstances = totalAllocInstances;<NEW_LINE>}<NEW_LINE>Collection<TruffleClassInfo> newClasses = getHistogram(histogram);<NEW_LINE>classes = computeDeltaClasses(baseClasses, newClasses);<NEW_LINE>totalBytes = histogram.getTotalBytes() - baseTotalBytes;<NEW_LINE>totalInstances = histogram.getTotalInstances() - baseTotalInstances;<NEW_LINE>totalAllocBytes = histogram.getTotalAllocBytes() - baseTotalAllocBytes;<NEW_LINE>totalAllocInstances = histogram.getTotalAllocInstances() - baseTotalAllocInstances;<NEW_LINE>long maxAbsDiffBytes = 0;<NEW_LINE>for (ClassInfo cInfo : classes) maxAbsDiffBytes = Math.max(maxAbsDiffBytes, Math.abs(cInfo.getBytes()));<NEW_LINE>} else {<NEW_LINE>if (baseClasses != null) {<NEW_LINE>baseClasses = null;<NEW_LINE>baseTotalBytes = -1;<NEW_LINE>baseTotalInstances = -1;<NEW_LINE>}<NEW_LINE>classes.clear();<NEW_LINE>classes.addAll(getHistogram(histogram));<NEW_LINE>totalBytes = histogram.getTotalBytes();<NEW_LINE>totalInstances = histogram.getTotalInstances();<NEW_LINE>totalAllocBytes = histogram.getTotalAllocBytes();<NEW_LINE>totalAllocInstances = histogram.getTotalAllocInstances();<NEW_LINE>}<NEW_LINE>renderers[0].setDiffMode(diff);<NEW_LINE>renderers[0].setMaxValue(totalBytes);<NEW_LINE>renderers[1].setDiffMode(diff);<NEW_LINE>renderers[1].setMaxValue(totalInstances);<NEW_LINE>renderers[2].setDiffMode(diff);<NEW_LINE>renderers[2].setMaxValue(totalAllocBytes);<NEW_LINE>renderers[3].setDiffMode(diff);<NEW_LINE>renderers<MASK><NEW_LINE>tableModel.fireTableDataChanged();<NEW_LINE>if (pdSnapshotButton != null)<NEW_LINE>pdSnapshotButton.setEnabled(true);<NEW_LINE>} | [3].setMaxValue(totalAllocInstances); |
1,342,294 | public static IRubyObject name_list(ThreadContext context, IRubyObject recv) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>EncodingService service = runtime.getEncodingService();<NEW_LINE>RubyArray result = runtime.newArray(service.getEncodings().size() + service.<MASK><NEW_LINE>HashEntryIterator i;<NEW_LINE>i = service.getEncodings().entryIterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>) i.next());<NEW_LINE>result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));<NEW_LINE>}<NEW_LINE>i = service.getAliases().entryIterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>) i.next());<NEW_LINE>result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));<NEW_LINE>}<NEW_LINE>result.append(runtime.newString(EXTERNAL));<NEW_LINE>result.append(runtime.newString(FILESYSTEM));<NEW_LINE>result.append(runtime.newString(INTERNAL));<NEW_LINE>result.append(runtime.newString(LOCALE));<NEW_LINE>return result;<NEW_LINE>} | getAliases().size()); |
472,463 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kind_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 2, namespace_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uid_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, resourceVersion_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 7, fieldPath_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeString(output, 5, apiVersion_); |
270,183 | protected String doIt() {<NEW_LINE>if (p_C_Print_Job_ID <= 0) {<NEW_LINE>throw new FillMandatoryException(I_C_Print_Job.COLUMNNAME_C_Print_Job_ID);<NEW_LINE>}<NEW_LINE>if (p_SeqNo_From <= 0) {<NEW_LINE>p_SeqNo_From = IPrintingDAO.SEQNO_First;<NEW_LINE>}<NEW_LINE>if (p_SeqNo_To <= 0) {<NEW_LINE>p_SeqNo_To = IPrintingDAO.SEQNO_Last;<NEW_LINE>}<NEW_LINE>final UserId adUserToPrintId = UserId.ofRepoIdOrNull(getAD_User_ID());<NEW_LINE>// create those instructions just for us and don't let some other printing client running with the same user-id snatch it from us.<NEW_LINE>final boolean createWithSpecificHostKey = true;<NEW_LINE>final I_C_Print_Job printJob = InterfaceWrapperHelper.create(getCtx(), p_C_Print_Job_ID, <MASK><NEW_LINE>final I_C_Print_Job_Line firstLine = printingDAO.retrievePrintJobLine(printJob, p_SeqNo_From);<NEW_LINE>final I_C_Print_Job_Line lastLine = printingDAO.retrievePrintJobLine(printJob, p_SeqNo_To);<NEW_LINE>this.jobInstructions = printJobBL.createPrintJobInstructions(adUserToPrintId, createWithSpecificHostKey, firstLine, lastLine, p_copies);<NEW_LINE>return MSG_OK;<NEW_LINE>} | I_C_Print_Job.class, get_TrxName()); |
1,554,249 | private synchronized void writeInstanceToFile(String url, String username, String password, String serverName) throws IOException {<NEW_LINE>if (url == null) {<NEW_LINE>Logger.getLogger("global").log(Level.SEVERE, NbBundle.getMessage(ServerRegistry.class, "MSG_NullUrl"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileObject dir = FileUtil.getConfigFile(DIR_INSTALLED_SERVERS);<NEW_LINE>FileObject[] instanceFOs = dir.getChildren();<NEW_LINE>FileObject instanceFO = null;<NEW_LINE>for (int i = 0; i < instanceFOs.length; i++) {<NEW_LINE>if (url.equals(instanceFOs[i].getAttribute(URL_ATTR)))<NEW_LINE>instanceFO = instanceFOs[i];<NEW_LINE>}<NEW_LINE>if (instanceFO == null) {<NEW_LINE>String name = FileUtil.findFreeFileName(dir, "instance", null);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>instanceFO.setAttribute(URL_ATTR, url);<NEW_LINE>instanceFO.setAttribute(InstanceProperties.USERNAME_ATTR, username);<NEW_LINE>savePassword(instanceFO, password, NbBundle.getMessage(ServerRegistry.class, "MSG_KeyringDisplayName", serverName));<NEW_LINE>} | instanceFO = dir.createData(name); |
440,391 | public void run() {<NEW_LINE>if (G.isProfileMigrated()) {<NEW_LINE>ProfileData data = ProfileHelper.getProfileByName(profileName);<NEW_LINE>G.setProfile(true, data.getIdentifier());<NEW_LINE>} else {<NEW_LINE>G.setProfile(true, profileName);<NEW_LINE>}<NEW_LINE>Api.applySavedIptablesRules(context, true, new RootCommand().setSuccessToast(R.string.rules_applied).setFailureToast(R.string.error_apply).setCallback(new RootCommand.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cbFunc(RootCommand state) {<NEW_LINE>Message msg = new Message();<NEW_LINE>if (state.exitCode == 0) {<NEW_LINE>msg.arg1 = R.string.rules_applied;<NEW_LINE>} else {<NEW_LINE>// error details are already in logcat<NEW_LINE>msg.arg1 = R.string.error_apply;<NEW_LINE>}<NEW_LINE>toaster.sendMessage(msg);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>// Api.showNotification(Api.isEnabled(getApplicationContext()), getApplicationContext());<NEW_LINE>Api.updateNotification(Api.isEnabled(getApplicationContext<MASK><NEW_LINE>} | ()), getApplicationContext()); |
1,786,392 | /*<NEW_LINE>* @see com.sitewhere.grpc.service.AssetManagementGrpc.AssetManagementImplBase#<NEW_LINE>* deleteAssetType(com.sitewhere.grpc.service.GDeleteAssetTypeRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void deleteAssetType(GDeleteAssetTypeRequest request, StreamObserver<GDeleteAssetTypeResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, AssetManagementGrpc.getDeleteAssetTypeMethod());<NEW_LINE>IAssetType apiResult = getAssetManagement().deleteAssetType(CommonModelConverter.asApiUuid(request.getAssetTypeId()));<NEW_LINE>GDeleteAssetTypeResponse.Builder response = GDeleteAssetTypeResponse.newBuilder();<NEW_LINE>response.setAssetType(AssetModelConverter.asGrpcAssetType(apiResult));<NEW_LINE>responseObserver.<MASK><NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(AssetManagementGrpc.getDeleteAssetTypeMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(AssetManagementGrpc.getDeleteAssetTypeMethod());<NEW_LINE>}<NEW_LINE>} | onNext(response.build()); |
1,139,979 | public ListRoomMembershipsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListRoomMembershipsResult listRoomMembershipsResult = new ListRoomMembershipsResult();<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 listRoomMembershipsResult;<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("RoomMemberships", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRoomMembershipsResult.setRoomMemberships(new ListUnmarshaller<RoomMembership>(RoomMembershipJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRoomMembershipsResult.setNextToken(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 listRoomMembershipsResult;<NEW_LINE>} | class).unmarshall(context)); |
1,679,280 | public static Color decodeHtmlColorString(String colorString) {<NEW_LINE>colorString = colorString.replaceAll("[#;\\s]", "");<NEW_LINE>int red, green, blue;<NEW_LINE>switch(colorString.length()) {<NEW_LINE>case 6:<NEW_LINE>red = Integer.parseInt(colorString.substring(0, 2), 16);<NEW_LINE>green = Integer.parseInt(colorString.substring<MASK><NEW_LINE>blue = Integer.parseInt(colorString.substring(4, 6), 16);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>red = Integer.parseInt(colorString.substring(0, 1), 16);<NEW_LINE>green = Integer.parseInt(colorString.substring(1, 2), 16);<NEW_LINE>blue = Integer.parseInt(colorString.substring(2, 3), 16);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>red = green = blue = Integer.parseInt(colorString.substring(0, 1), 16);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.warn("Unable to read {} as a proper color string, returning default", colorString);<NEW_LINE>return DEFAULT_COLOR;<NEW_LINE>}<NEW_LINE>return new Color(red, green, blue);<NEW_LINE>} | (2, 4), 16); |
63,936 | protected void addMenuItems(Menu menu, Activity activity) {<NEW_LINE>boolean isTablet = AstridPreferences.useTabletLayout(activity);<NEW_LINE>TaskListActivity tla = null;<NEW_LINE>if (activity instanceof TaskListActivity) {<NEW_LINE>tla = (TaskListActivity) activity;<NEW_LINE>tla.getMainMenuPopover().clear();<NEW_LINE>}<NEW_LINE>// --- sync<NEW_LINE>if (tla == null || tla.getTaskEditFragment() == null && Preferences.getBoolean(R.string.p_show_menu_sync, true))<NEW_LINE>addSyncRefreshMenuItem(menu, isTablet ? ThemeService.FLAG_INVERT : 0);<NEW_LINE>// --- sort<NEW_LINE>if (allowResorting() && Preferences.getBoolean(R.string.p_show_menu_sort, true)) {<NEW_LINE>addMenuItem(menu, R.string.TLA_menu_sort, ThemeService.getDrawable(R.drawable.icn_menu_sort_by_size, isTablet ? ThemeService.FLAG_FORCE_DARK : 0), MENU_SORT_ID, false);<NEW_LINE>}<NEW_LINE>// --- new filter<NEW_LINE>if (Preferences.getBoolean(R.string.p_use_filters, true))<NEW_LINE>addMenuItem(menu, R.string.FLA_new_filter, ThemeService.getDrawable(R.drawable.icn_menu_filters, isTablet ? ThemeService.FLAG_FORCE_DARK : 0), MENU_NEW_FILTER_ID, false);<NEW_LINE>// ask about plug-ins<NEW_LINE>Intent queryIntent <MASK><NEW_LINE>PackageManager pm = getActivity().getPackageManager();<NEW_LINE>List<ResolveInfo> resolveInfoList = pm.queryIntentActivities(queryIntent, 0);<NEW_LINE>int length = resolveInfoList.size();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>ResolveInfo resolveInfo = resolveInfoList.get(i);<NEW_LINE>Intent intent = new Intent(AstridApiConstants.ACTION_TASK_LIST_MENU);<NEW_LINE>intent.setClassName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name);<NEW_LINE>addMenuItem(menu, resolveInfo.loadLabel(pm), resolveInfo.loadIcon(pm), intent, MENU_ADDON_INTENT_ID);<NEW_LINE>}<NEW_LINE>} | = new Intent(AstridApiConstants.ACTION_TASK_LIST_MENU); |
957,922 | public void start(OperationOrder operationOrder) throws AxelorException {<NEW_LINE>if (operationOrder.getStatusSelect() != OperationOrderRepository.STATUS_IN_PROGRESS) {<NEW_LINE>operationOrder.setStatusSelect(OperationOrderRepository.STATUS_IN_PROGRESS);<NEW_LINE>operationOrder.setRealStartDateT(appProductionService.getTodayDateTime().toLocalDateTime());<NEW_LINE>startOperationOrderDuration(operationOrder);<NEW_LINE>if (operationOrder.getManufOrder() != null) {<NEW_LINE>int beforeOrAfterConfig = operationOrder.getManufOrder().getProdProcess().getStockMoveRealizeOrderSelect();<NEW_LINE>if (beforeOrAfterConfig == ProductionConfigRepository.REALIZE_START) {<NEW_LINE>for (StockMove stockMove : operationOrder.getInStockMoveList()) {<NEW_LINE>Beans.get(ManufOrderStockMoveService.class).finishStockMove(stockMove);<NEW_LINE>}<NEW_LINE>StockMove newStockMove = operationOrderStockMoveService._createToConsumeStockMove(operationOrder, operationOrder.getManufOrder().getCompany());<NEW_LINE>newStockMove.setStockMoveLineList<MASK><NEW_LINE>Beans.get(StockMoveService.class).plan(newStockMove);<NEW_LINE>operationOrder.addInStockMoveListItem(newStockMove);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>operationOrderRepo.save(operationOrder);<NEW_LINE>}<NEW_LINE>if (operationOrder.getManufOrder().getStatusSelect() != ManufOrderRepository.STATUS_IN_PROGRESS) {<NEW_LINE>Beans.get(ManufOrderWorkflowService.class).start(operationOrder.getManufOrder());<NEW_LINE>}<NEW_LINE>} | (new ArrayList<>()); |
400,589 | public void fitCurrentRouteToMap(boolean portrait, int leftBottomPaddingPx) {<NEW_LINE>RoutingHelper rh = app.getRoutingHelper();<NEW_LINE>Location lt = rh.getLastProjection();<NEW_LINE>if (lt == null) {<NEW_LINE>lt = app.getTargetPointsHelper().getPointToStartLocation();<NEW_LINE>}<NEW_LINE>if (lt != null) {<NEW_LINE>double left = lt.getLongitude(), right = lt.getLongitude();<NEW_LINE>double top = lt.getLatitude()<MASK><NEW_LINE>List<Location> list = rh.getCurrentCalculatedRoute();<NEW_LINE>for (Location l : list) {<NEW_LINE>left = Math.min(left, l.getLongitude());<NEW_LINE>right = Math.max(right, l.getLongitude());<NEW_LINE>top = Math.max(top, l.getLatitude());<NEW_LINE>bottom = Math.min(bottom, l.getLatitude());<NEW_LINE>}<NEW_LINE>List<TargetPointsHelper.TargetPoint> targetPoints = app.getTargetPointsHelper().getIntermediatePointsWithTarget();<NEW_LINE>if (rh.getRoute().hasMissingMaps()) {<NEW_LINE>TargetPointsHelper.TargetPoint pointToStart = app.getTargetPointsHelper().getPointToStart();<NEW_LINE>if (pointToStart != null) {<NEW_LINE>targetPoints.add(pointToStart);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TargetPointsHelper.TargetPoint l : targetPoints) {<NEW_LINE>left = Math.min(left, l.getLongitude());<NEW_LINE>right = Math.max(right, l.getLongitude());<NEW_LINE>top = Math.max(top, l.getLatitude());<NEW_LINE>bottom = Math.min(bottom, l.getLatitude());<NEW_LINE>}<NEW_LINE>RotatedTileBox tb = getMapView().getCurrentRotatedTileBox().copy();<NEW_LINE>int tileBoxWidthPx = 0;<NEW_LINE>int tileBoxHeightPx = 0;<NEW_LINE>if (!portrait) {<NEW_LINE>tileBoxWidthPx = tb.getPixWidth() - leftBottomPaddingPx;<NEW_LINE>} else {<NEW_LINE>tileBoxHeightPx = tb.getPixHeight() - leftBottomPaddingPx;<NEW_LINE>}<NEW_LINE>getMapView().fitRectToMap(left, right, top, bottom, tileBoxWidthPx, tileBoxHeightPx, 0);<NEW_LINE>}<NEW_LINE>} | , bottom = lt.getLatitude(); |
1,827,945 | public static List<URI> readDnsConf() {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(DnsUtil.class);<NEW_LINE>final boolean debug = logger.isDebugEnabled();<NEW_LINE>final File file = new File(Sys.sysProp(QBIT_DNS_RESOLV_CONF, "/etc/resolv.conf"));<NEW_LINE>if (file.exists()) {<NEW_LINE>final List<String> lines = IO.readLines(file);<NEW_LINE>if (debug)<NEW_LINE>logger.debug("file contents {}", lines);<NEW_LINE>return lines.stream().filter(line -> line.startsWith("nameserver")).map(line -> {<NEW_LINE>if (debug)<NEW_LINE>logger.debug("file content line = {}", line);<NEW_LINE>final String uriToParse = line.replace("nameserver ", "").trim();<NEW_LINE>final String[] split = Str.split(uriToParse, ':');<NEW_LINE>try {<NEW_LINE>if (split.length == 1) {<NEW_LINE>return new URI("dns", "", split[0], 53, "", "", "");<NEW_LINE>} else if (split.length >= 2) {<NEW_LINE>return new URI("dns", "", split[0], Integer.parseInt(split[1]), "", "", "");<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unable to parse URI from /etc/resolv.conf");<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IllegalStateException("failed to convert to URI");<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} | IllegalStateException("" + file + " not found"); |
517,595 | public static String build(FacesContext context, UIComponent component, ValueExpression ve, Lazy<Object> value, boolean cache, boolean stream) {<NEW_LINE>Class<?> type = ELUtils.<MASK><NEW_LINE>// skip null type<NEW_LINE>if (type == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>if (String.class.isAssignableFrom(type)) {<NEW_LINE>String src = ResourceUtils.getResourceURL(context, (String) value.get());<NEW_LINE>return ResourceUtils.encodeResourceURL(context, src, cache);<NEW_LINE>} else if (StreamedContent.class.isAssignableFrom(type)) {<NEW_LINE>if (stream) {<NEW_LINE>ValueExpression extractedVE = ValueExpressionAnalyzer.getExpression(context.getELContext(), ve);<NEW_LINE>return buildStreaming(context, component, extractedVE, cache);<NEW_LINE>} else {<NEW_LINE>StreamedContent streamedContent = (StreamedContent) value.get();<NEW_LINE>if (streamedContent.getWriter() != null) {<NEW_LINE>return ResourceUtils.toBase64(context, streamedContent.getWriter(), streamedContent.getContentType());<NEW_LINE>}<NEW_LINE>return ResourceUtils.toBase64(context, streamedContent.getStream().get(), streamedContent.getContentType());<NEW_LINE>}<NEW_LINE>} else if (byte[].class.isAssignableFrom(type)) {<NEW_LINE>if (stream) {<NEW_LINE>ValueExpression extractedVE = ValueExpressionAnalyzer.getExpression(context.getELContext(), ve);<NEW_LINE>return buildStreaming(context, component, extractedVE, cache);<NEW_LINE>} else {<NEW_LINE>return ResourceUtils.toBase64(context, (byte[]) value.get());<NEW_LINE>}<NEW_LINE>} else if (InputStream.class.isAssignableFrom(type)) {<NEW_LINE>if (stream) {<NEW_LINE>ValueExpression extractedVE = ValueExpressionAnalyzer.getExpression(context.getELContext(), ve);<NEW_LINE>return buildStreaming(context, component, extractedVE, cache);<NEW_LINE>} else {<NEW_LINE>return ResourceUtils.toBase64(context, (InputStream) value.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | getType(context, ve, value); |
1,523,152 | private static boolean shouldSkipPartition(TypeManager typeManager, HiveTableLayoutHandle hiveLayout, DateTimeZone hiveStorageTimeZone, HiveSplit hiveSplit, SplitContext splitContext) {<NEW_LINE>List<HiveColumnHandle> partitionColumns = hiveLayout.getPartitionColumns();<NEW_LINE>List<Type> partitionTypes = partitionColumns.stream().map(column -> typeManager.getType(column.getTypeSignature())).collect(toList());<NEW_LINE>List<HivePartitionKey> partitionKeys = hiveSplit.getPartitionKeys();<NEW_LINE>if (!splitContext.getDynamicFilterPredicate().isPresent() || hiveSplit.getPartitionKeys().isEmpty() || partitionColumns.isEmpty() || partitionColumns.size() != partitionKeys.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TupleDomain<ColumnHandle> dynamicFilter = splitContext.getDynamicFilterPredicate().get();<NEW_LINE>Map<ColumnHandle, Domain> domains = dynamicFilter.getDomains().get();<NEW_LINE>for (int i = 0; i < partitionKeys.size(); i++) {<NEW_LINE>Type type = partitionTypes.get(i);<NEW_LINE>HivePartitionKey <MASK><NEW_LINE>HiveColumnHandle hiveColumnHandle = partitionColumns.get(i);<NEW_LINE>Domain allowedDomain = domains.get(hiveColumnHandle);<NEW_LINE>NullableValue value = parsePartitionValue(hivePartitionKey, type, hiveStorageTimeZone);<NEW_LINE>if (allowedDomain != null && !allowedDomain.includesNullableValue(value.getValue())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | hivePartitionKey = partitionKeys.get(i); |
398,891 | static String downloadSavedModel(String modelPath) {<NEW_LINE>String localModelPath;<NEW_LINE>File workDir = PythonFileUtils.createTempDir("temp_").toFile();<NEW_LINE>if (PythonFileUtils.isCompressedFile(modelPath)) {<NEW_LINE>workDir.deleteOnExit();<NEW_LINE>ArchivesUtils.downloadDecompressToDirectory(modelPath, workDir);<NEW_LINE>localModelPath = workDir.getAbsolutePath();<NEW_LINE>if (!TFSavedModelUtils.containSavedModel(workDir)) {<NEW_LINE><MASK><NEW_LINE>localModelPath = workDir.getAbsolutePath() + File.separator + PythonFileUtils.getCompressedFileName(modelPath);<NEW_LINE>}<NEW_LINE>} else if (modelPath.startsWith("oss://")) {<NEW_LINE>String fn = FileDownloadUtils.downloadHttpOrOssFile(modelPath, workDir.getAbsolutePath());<NEW_LINE>localModelPath = workDir + File.separator + fn;<NEW_LINE>} else if (modelPath.startsWith("file://")) {<NEW_LINE>localModelPath = modelPath.substring("file://".length());<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Model path must represent a compressed file or a local directory or an OSS directory.");<NEW_LINE>}<NEW_LINE>return localModelPath;<NEW_LINE>} | LOG.info("No .pb or .pbtxt files found in {}", workDir); |
1,160,253 | public void transmit(AMQChannel channel) throws IOException {<NEW_LINE>int channelNumber = channel.getChannelNumber();<NEW_LINE>AMQConnection connection = channel.getConnection();<NEW_LINE>synchronized (assembler) {<NEW_LINE>Method m = this.assembler.getMethod();<NEW_LINE>if (m.hasContent()) {<NEW_LINE>byte[] body = this.assembler.getContentBody();<NEW_LINE>Frame headerFrame = this.assembler.getContentHeader().<MASK><NEW_LINE>int frameMax = connection.getFrameMax();<NEW_LINE>boolean cappedFrameMax = frameMax > 0;<NEW_LINE>int bodyPayloadMax = cappedFrameMax ? frameMax - EMPTY_FRAME_SIZE : body.length;<NEW_LINE>if (cappedFrameMax && headerFrame.size() > frameMax) {<NEW_LINE>String msg = String.format("Content headers exceeded max frame size: %d > %d", headerFrame.size(), frameMax);<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>connection.writeFrame(m.toFrame(channelNumber));<NEW_LINE>connection.writeFrame(headerFrame);<NEW_LINE>for (int offset = 0; offset < body.length; offset += bodyPayloadMax) {<NEW_LINE>int remaining = body.length - offset;<NEW_LINE>int fragmentLength = (remaining < bodyPayloadMax) ? remaining : bodyPayloadMax;<NEW_LINE>Frame frame = Frame.fromBodyFragment(channelNumber, body, offset, fragmentLength);<NEW_LINE>connection.writeFrame(frame);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>connection.writeFrame(m.toFrame(channelNumber));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>connection.flush();<NEW_LINE>} | toFrame(channelNumber, body.length); |
1,264,036 | private void initKeysAndActions() {<NEW_LINE>unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));<NEW_LINE>unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));<NEW_LINE>unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));<NEW_LINE>unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK));<NEW_LINE>expandAction = new ExpandAction();<NEW_LINE>collapseAction = new CollapseAction();<NEW_LINE>defaultAction = new DefaultAction();<NEW_LINE>showPopupAction = new ShowPopupAction();<NEW_LINE>InputMap imp = getInputMap();<NEW_LINE>InputMap impAncestor = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>ActionMap am = getActionMap();<NEW_LINE>imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), ACTION_EXPAND);<NEW_LINE>imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), ACTION_COLLAPSE);<NEW_LINE>imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), ACTION_DEFAULT);<NEW_LINE>imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK), ACTION_SHOW_POPUP);<NEW_LINE>impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));<NEW_LINE>impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));<NEW_LINE>impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));<NEW_LINE>impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK));<NEW_LINE>am.put(ACTION_EXPAND, expandAction);<NEW_LINE>am.put(ACTION_COLLAPSE, collapseAction);<NEW_LINE>am.put(ACTION_DEFAULT, defaultAction);<NEW_LINE><MASK><NEW_LINE>} | am.put(ACTION_SHOW_POPUP, showPopupAction); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.