idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
538,736 | void register(BeanProp prop, Object value) {<NEW_LINE>BeanProperty bp = new BeanProperty(prop);<NEW_LINE>if (Common.isBean(prop.type))<NEW_LINE>((BaseBean) value).setDomBinding(this);<NEW_LINE>this.prop = bp;<NEW_LINE>if (DDLogFlags.debug) {<NEW_LINE>TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD, DDLogFlags.DBG_BLD, 1, DDLogFlags.BINDPROP, "property " + prop.getDtdName() + " bound to B(" + <MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Following is a little trick to deal with attribute that are not<NEW_LINE>// defined in the dtd. When we register this new element, we ask<NEW_LINE>// for all the attributes and add them dynamically, as transient,<NEW_LINE>// to the BeanProp list of attributes.<NEW_LINE>//<NEW_LINE>if (this.node != null) {<NEW_LINE>NamedNodeMap l = this.node.getAttributes();<NEW_LINE>for (int i = 0; i < l.getLength(); i++) {<NEW_LINE>Node n = l.item(i);<NEW_LINE>prop.createTransientAttribute(n.getNodeName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | this.hashCode() + ")"); |
486,615 | private HashMap deserializePostParam(IExtendedRequest req, byte[] cookieValueBytes, String reqURL) throws IOException, UnsupportedEncodingException, IllegalStateException {<NEW_LINE>HashMap output = null;<NEW_LINE>List<byte[]> data = splitBytes(cookieValueBytes, (byte) '.');<NEW_LINE>int total = data.size();<NEW_LINE>if (total > OFFSET_DATA) {<NEW_LINE>// url and at least one data. now deserializing the url.<NEW_LINE>String url = new String(Base64Coder.base64Decode(data.get(OFFSET_REQURL)), "UTF-8");<NEW_LINE>if (url != null && url.equals(reqURL)) {<NEW_LINE>byte[][] bytes = new <MASK><NEW_LINE>for (int i = 0; i < (total - OFFSET_DATA); i++) {<NEW_LINE>bytes[i] = Base64Coder.base64Decode(data.get(OFFSET_DATA + i));<NEW_LINE>}<NEW_LINE>output = req.deserializeInputStreamData(bytes);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("The url in the post param cookie does not match the requested url");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("The data of the post param cookie is too short. The data might be truncated.");<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | byte[total - OFFSET_DATA][]; |
545,471 | private // with the boundary of Line B.<NEW_LINE>void exteriorAreaBoundaryLine_(int half_edge, int id_a, int id_b, int cluster_index_b) {<NEW_LINE>if (m_matrix[MatrixPredicate.ExteriorBoundary] == 0)<NEW_LINE>return;<NEW_LINE>if (m_topo_graph.getHalfEdgeUserIndex(m_topo_graph.getHalfEdgePrev(m_topo_graph.getHalfEdgeTwin(half_edge)), m_visited_index) != 1) {<NEW_LINE>int cluster = m_topo_graph.getHalfEdgeTo(half_edge);<NEW_LINE>int clusterParentage = m_topo_graph.getClusterParentage(cluster);<NEW_LINE>if ((clusterParentage & id_a) == 0) {<NEW_LINE>int faceParentage = m_topo_graph.getHalfEdgeFaceParentage(half_edge);<NEW_LINE>if ((faceParentage & id_a) == 0) {<NEW_LINE>assert ((m_topo_graph.getHalfEdgeParentage(m_topo_graph.getHalfEdgeTwin(half_edge)) & id_a) == 0);<NEW_LINE>int index = <MASK><NEW_LINE>if ((clusterParentage & id_b) != 0 && (index % 2 != 0)) {<NEW_LINE>assert (index != -1);<NEW_LINE>m_matrix[MatrixPredicate.ExteriorBoundary] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | m_topo_graph.getClusterUserIndex(cluster, cluster_index_b); |
72,334 | public List<String> buildRuleShardFunctionStrInner(boolean ignoredShardKey) {<NEW_LINE>String ruleShardFuncionName = getRuleShardFuncionName();<NEW_LINE>long enumStepLen = 1;<NEW_LINE>long enumTime = 0;<NEW_LINE>if (shardType == SHARD_TYPE_DB) {<NEW_LINE>enumTime = dbCount;<NEW_LINE>} else {<NEW_LINE>enumTime = tbCountEachDb;<NEW_LINE>}<NEW_LINE>List<String> rsList = new LinkedList<String>();<NEW_LINE>String shardKeyStr;<NEW_LINE>for (String shardKeyName : shardKeyNames) {<NEW_LINE>Integer shardTypeVal = shardType;<NEW_LINE>String shardKeyNameStr = shardKeyName.toUpperCase();<NEW_LINE>if (ignoredShardKey) {<NEW_LINE>shardKeyNameStr = SHARD_COLUMN_DUAL;<NEW_LINE>shardTypeVal = SHARD_TYPE_DUAL;<NEW_LINE>}<NEW_LINE>if ("true".equalsIgnoreCase(isString)) {<NEW_LINE>shardKeyStr = String.format("#%s, %s, %s#", shardKeyNameStr, enumStepLen, enumTime);<NEW_LINE>} else {<NEW_LINE>shardKeyStr = String.format("#%s, %s_number, %s#", shardKeyNameStr, enumStepLen, enumTime);<NEW_LINE>}<NEW_LINE>String ruleShardFuncionParams = String.format("%s, %s, %s, %s, %s, %s", shardKeyStr, rangeCount, <MASK><NEW_LINE>String finalRuleShardFunStr = String.format(ruleShardFunctionFormat, ruleShardFuncionName, ruleShardFuncionParams);<NEW_LINE>rsList.add(finalRuleShardFunStr);<NEW_LINE>}<NEW_LINE>return rsList;<NEW_LINE>} | dbCount, tbCountEachDb, shardTypeVal, true); |
1,723,093 | public static WavHeader readChannel(ReadableByteChannel _in) throws IOException {<NEW_LINE>ByteBuffer buf = ByteBuffer.allocate(128);<NEW_LINE>buf.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>_in.read(buf);<NEW_LINE>if (buf.remaining() > 0)<NEW_LINE>throw new IOException("Incomplete wav header found");<NEW_LINE>buf.flip();<NEW_LINE>String chunkId = NIOUtils.readString(buf, 4);<NEW_LINE>int chunkSize = buf.getInt();<NEW_LINE>String format = NIOUtils.readString(buf, 4);<NEW_LINE>FmtChunk fmt = null;<NEW_LINE>if (!"RIFF".equals(chunkId) || !"WAVE".equals(format)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String fourcc;<NEW_LINE>int size = 0;<NEW_LINE>do {<NEW_LINE>fourcc = NIOUtils.readString(buf, 4);<NEW_LINE>size = buf.getInt();<NEW_LINE>if ("fmt ".equals(fourcc) && size >= 14 && size <= 1024 * 1024) {<NEW_LINE>switch(size) {<NEW_LINE>case 16:<NEW_LINE>fmt = FmtChunk.get(buf);<NEW_LINE>break;<NEW_LINE>case 18:<NEW_LINE>fmt = FmtChunk.get(buf);<NEW_LINE>NIOUtils.skip(buf, 2);<NEW_LINE>break;<NEW_LINE>case 40:<NEW_LINE>fmt = FmtChunkExtended.get(buf);<NEW_LINE>NIOUtils.skip(buf, 12);<NEW_LINE>break;<NEW_LINE>case 28:<NEW_LINE>fmt = FmtChunkExtended.get(buf);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnhandledStateException("Don't know how to handle fmt size: " + size);<NEW_LINE>}<NEW_LINE>} else if (!"data".equals(fourcc)) {<NEW_LINE>NIOUtils.skip(buf, size);<NEW_LINE>}<NEW_LINE>} while (<MASK><NEW_LINE>return new WavHeader(chunkId, chunkSize, format, fmt, buf.position(), size);<NEW_LINE>} | !"data".equals(fourcc)); |
136,520 | private void updateControls() {<NEW_LINE>this.cancelButton.setEnabled(backend.canCancel());<NEW_LINE>this.pauseButton.setEnabled(backend.canPause() || backend.isPaused());<NEW_LINE>this.pauseButton.setText(backend.getPauseResumeText());<NEW_LINE>this.sendButton.setEnabled(backend.canSend());<NEW_LINE>boolean hasFile = backend.getGcodeFile() != null;<NEW_LINE>if (hasFile) {<NEW_LINE>this.saveButton.setEnabled(true);<NEW_LINE>this.visualizeButton.setEnabled(true);<NEW_LINE>}<NEW_LINE>switch(backend.getControllerState()) {<NEW_LINE>case DISCONNECTED:<NEW_LINE>this.updateConnectionControlsStateOpen(false);<NEW_LINE>this.updateWorkflowControls(false);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case IDLE:<NEW_LINE>case CHECK:<NEW_LINE>case ALARM:<NEW_LINE>case CONNECTING:<NEW_LINE>this.updateConnectionControlsStateOpen(true);<NEW_LINE>this.updateWorkflowControls(true);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>this.updateWorkflowControls(false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | this.setStatusColorForState(ControllerState.UNKNOWN); |
626,614 | RedisProperties redisProperties(AzureRedisProperties azureRedisProperties, AzureResourceManager azureResourceManager) {<NEW_LINE>String cacheName = azureRedisProperties.getName();<NEW_LINE>String resourceGroup = azureRedisProperties.getResource().getResourceGroup();<NEW_LINE>RedisCache redisCache = azureResourceManager.redisCaches().getByResourceGroup(resourceGroup, cacheName);<NEW_LINE>RedisProperties redisProperties = new RedisProperties();<NEW_LINE>boolean useSsl = !redisCache.nonSslPort();<NEW_LINE>int port = useSsl ? redisCache.sslPort() : redisCache.port();<NEW_LINE>boolean isCluster = redisCache.shardCount() > 0;<NEW_LINE>if (isCluster) {<NEW_LINE>RedisProperties.Cluster cluster = new RedisProperties.Cluster();<NEW_LINE>cluster.setNodes(Arrays.asList(redisCache.hostname<MASK><NEW_LINE>redisProperties.setCluster(cluster);<NEW_LINE>} else {<NEW_LINE>redisProperties.setHost(redisCache.hostname());<NEW_LINE>redisProperties.setPort(port);<NEW_LINE>}<NEW_LINE>redisProperties.setPassword(redisCache.keys().primaryKey());<NEW_LINE>redisProperties.setSsl(useSsl);<NEW_LINE>return redisProperties;<NEW_LINE>} | () + ":" + port)); |
749,589 | protected void drawPanel(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY) {<NEW_LINE>if (logoPath != null) {<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionTexShader);<NEW_LINE>RenderSystem.enableBlend();<NEW_LINE>RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);<NEW_LINE>RenderSystem.setShaderTexture(0, logoPath);<NEW_LINE>// Draw the logo image inscribed in a rectangle with width entryWidth (minus some padding) and height 50<NEW_LINE>int headerHeight = 50;<NEW_LINE>GuiUtils.drawInscribedRect(poseStack, left + PADDING, relativeY, width - (PADDING * 2), headerHeight, logoDims.width, logoDims.height, false, true);<NEW_LINE>relativeY += headerHeight + PADDING;<NEW_LINE>}<NEW_LINE>for (FormattedCharSequence line : lines) {<NEW_LINE>if (line != null) {<NEW_LINE>RenderSystem.enableBlend();<NEW_LINE>ModListScreen.this.font.drawShadow(poseStack, line, left + PADDING, relativeY, 0xFFFFFF);<NEW_LINE>RenderSystem.disableBlend();<NEW_LINE>}<NEW_LINE>relativeY += font.lineHeight;<NEW_LINE>}<NEW_LINE>final Style component = findTextLine(mouseX, mouseY);<NEW_LINE>if (component != null) {<NEW_LINE>ModListScreen.this.renderComponentHoverEffect(<MASK><NEW_LINE>}<NEW_LINE>} | poseStack, component, mouseX, mouseY); |
942,165 | protected void scoreDisparity(final int disparityRange, final boolean leftToRight) {<NEW_LINE>final int[] scores = leftToRight ? scoreLtoR : scoreRtoL;<NEW_LINE>final short[] dataLeft = patchTemplate.data;<NEW_LINE>final <MASK><NEW_LINE>for (int d = 0; d < disparityRange; d++) {<NEW_LINE>int total = 0;<NEW_LINE>int idxLeft = 0;<NEW_LINE>for (int y = 0; y < blockHeight; y++) {<NEW_LINE>int idxRight = y * patchCompare.stride + d;<NEW_LINE>for (int x = 0; x < blockWidth; x++) {<NEW_LINE>total += Math.abs((dataLeft[idxLeft++] & 0xFFFF) - (dataRight[idxRight++] & 0xFFFF));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int index = leftToRight ? disparityRange - d - 1 : d;<NEW_LINE>scores[index] = total;<NEW_LINE>}<NEW_LINE>} | short[] dataRight = patchCompare.data; |
186,790 | static void c_1_3_1() throws Exception {<NEW_LINE>OssFileSystem oss = new OssFileSystem(OSS_VERSION, OSS_END_POINT, OSS_BUCKET_NAME, OSS_ACCESS_ID, OSS_ACCESS_KEY);<NEW_LINE>System.out.println(oss.getKind());<NEW_LINE>final String ossDir = OSS_PREFIX_URI + "alink/data/temp/";<NEW_LINE>if (!oss.exists(new Path(ossDir))) {<NEW_LINE>oss.mkdirs(new Path(ossDir));<NEW_LINE>}<NEW_LINE>String path = ossDir + "hello.txt";<NEW_LINE>OutputStream outputStream = oss.<MASK><NEW_LINE>outputStream.write("Hello Alink!".getBytes());<NEW_LINE>outputStream.close();<NEW_LINE>InputStream inputStream = oss.open(path);<NEW_LINE>String readString = IOUtils.toString(inputStream);<NEW_LINE>System.out.println(readString);<NEW_LINE>} | create(path, WriteMode.OVERWRITE); |
1,374,568 | String storeFile(String artifactPath, InputStream uploadedFileInputStream, HttpServletRequest request) throws ModelDBException {<NEW_LINE>LOGGER.trace("NFSService - storeFile called");<NEW_LINE>try {<NEW_LINE>var cleanArtifactPath = StringUtils.cleanPath(Objects.requireNonNull(artifactPath));<NEW_LINE>String[] folders = cleanArtifactPath.split("/");<NEW_LINE>var folderPath = new StringBuilder();<NEW_LINE>for (var i = 0; i < folders.length - 1; i++) {<NEW_LINE>folderPath.append(folders[i]);<NEW_LINE>folderPath.append(File.separator);<NEW_LINE>}<NEW_LINE>LOGGER.trace("NFSService - storeFile - folder path : {}", folderPath.toString());<NEW_LINE>// Copy file to the target location (Replacing existing file with the same name)<NEW_LINE>var foldersExists = new File(this.fileStorageLocation + File.separator + folderPath.toString());<NEW_LINE>if (!foldersExists.exists()) {<NEW_LINE>boolean folderCreatingStatus = foldersExists.mkdirs();<NEW_LINE>LOGGER.trace("NFSService - storeFile - folders created : {}, Path: {}", folderCreatingStatus, foldersExists.getAbsolutePath());<NEW_LINE>}<NEW_LINE>LOGGER.trace("NFSService - storeFile - folders found : {}", foldersExists.getAbsolutePath());<NEW_LINE>var destinationFile = new File(this.fileStorageLocation + File.separator + cleanArtifactPath);<NEW_LINE>if (!destinationFile.exists()) {<NEW_LINE>boolean destFileCreatingStatus = destinationFile.createNewFile();<NEW_LINE>LOGGER.trace("NFSService - storeFile - file created : {}, Path: {}", destFileCreatingStatus, destinationFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>LOGGER.trace("NFSService - storeFile - file found : {}", foldersExists.getAbsolutePath());<NEW_LINE>var fileOutputStream = new FileOutputStream(destinationFile);<NEW_LINE>IOUtils.copy(uploadedFileInputStream, fileOutputStream);<NEW_LINE>fileOutputStream.close();<NEW_LINE>uploadedFileInputStream.close();<NEW_LINE>LOGGER.trace(<MASK><NEW_LINE>LOGGER.trace("NFSService - storeFile returned");<NEW_LINE>return destinationFile.getName();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>var errorMessage = "Could not store file. Please try again!";<NEW_LINE>LOGGER.warn(errorMessage, ex);<NEW_LINE>throw new ModelDBException(errorMessage, ex);<NEW_LINE>}<NEW_LINE>} | "NFSService - storeFile - file stored successfully, target location : {}", destinationFile.getAbsolutePath()); |
1,372,337 | public void layout(List<SortableElement> elements) {<NEW_LINE>Map<String, List<SortableElement>> packages = extractPackages(elements);<NEW_LINE>Map<SortableElement, List<SortableElement>> packList = new TreeMap<SortableElement, List<SortableElement>>();<NEW_LINE>for (Map.Entry<String, List<SortableElement>> entry : packages.entrySet()) {<NEW_LINE>SortableElement pack = createPackageElement(entry.getKey());<NEW_LINE>List<SortableElement> packElements = entry.getValue();<NEW_LINE>Layout l = new HeightLayout();<NEW_LINE>l.layout(packElements);<NEW_LINE>Dimension size = l.bounds;<NEW_LINE>pack.getElement().setSize(size.width, size.height);<NEW_LINE>packList.put(pack, packElements);<NEW_LINE>}<NEW_LINE>Rectangle x = new Rectangle();<NEW_LINE>for (SortableElement pack : packList.keySet()) {<NEW_LINE>pack.getElement().setLocation(10, 10 + x.y + x.height);<NEW_LINE>x = pack<MASK><NEW_LINE>}<NEW_LINE>for (Entry<SortableElement, List<SortableElement>> entry : packList.entrySet()) {<NEW_LINE>adjustLocations(entry.getKey(), entry.getValue());<NEW_LINE>elements.add(entry.getKey());<NEW_LINE>}<NEW_LINE>} | .getElement().getRectangle(); |
714,240 | protected Bundle doInBackground(Bundle... params) {<NEW_LINE>Bundle result = new Bundle();<NEW_LINE>Bundle args = params[0];<NEW_LINE>String userID;<NEW_LINE>try {<NEW_LINE>LinkedInApiClient client = mLinkedInApiClientFactory.createLinkedInApiClient(new LinkedInAccessToken(mSharedPreferences.getString(SAVE_STATE_KEY_OAUTH_TOKEN, null), mSharedPreferences.getString(SAVE_STATE_KEY_OAUTH_SECRET, null)));<NEW_LINE>Person person;<NEW_LINE>if (args.containsKey(PARAM_USER_ID)) {<NEW_LINE>userID = args.getString(PARAM_USER_ID);<NEW_LINE>result.putBoolean(CURRENT, false);<NEW_LINE>Set<ProfileField> scope = EnumSet.of(ProfileField.PICTURE_URL, ProfileField.ID, ProfileField.FIRST_NAME, <MASK><NEW_LINE>person = client.getProfileById(userID, scope);<NEW_LINE>} else {<NEW_LINE>result.putBoolean(CURRENT, true);<NEW_LINE>person = client.getProfileForCurrentUser(PROFILE_PARAMETERS);<NEW_LINE>}<NEW_LINE>SocialPerson socialPerson = new SocialPerson();<NEW_LINE>getSocialPerson(socialPerson, person);<NEW_LINE>result.putParcelable(REQUEST_GET_PERSON, socialPerson);<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.putString(RESULT_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ProfileField.LAST_NAME, ProfileField.PUBLIC_PROFILE_URL); |
1,578,188 | private static void dispatchUnmatchedResponseListenerTasks(SipServletResponseImpl response, SipAppDesc appDescriptor, int taskNum) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceEntry(null, "dispatchUnmatchedRequestListenerTasks", new Object[] { response, appDescriptor, new Integer(taskNum) });<NEW_LINE>}<NEW_LINE>if (appDescriptor.getUnmatchedMessagesListeners().isEmpty()) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceExit(null, "dispatchUnmatchedResponseListenerTasks, no listeners to call");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EventObject evt = new UnmatchedResponseEvent(response, appDescriptor.getServletContext());<NEW_LINE>Iterator<UnmatchedMessageListener> iter = appDescriptor.getUnmatchedMessagesListeners().iterator();<NEW_LINE>dispatchTasks(iter, evt, taskNum, appDescriptor);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer buff = new StringBuffer(100);<NEW_LINE>buff.append("dispatchUnmatchedResponseListenerTasks sent: ");<NEW_LINE>buff.append(ListenerTask.getTaskName(taskNum));<NEW_LINE>buff.append("response = ");<NEW_LINE>buff.append(response.getMethod());<NEW_LINE>buff.append("id = ");<NEW_LINE>buff.<MASK><NEW_LINE>c_logger.traceDebug(null, "dispatchUnmatchedResponseListenerTasks", buff.toString());<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceExit(null, "dispatchUnmatchedResponseListenerTasks");<NEW_LINE>}<NEW_LINE>} | append(response.getCallId()); |
1,807,304 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {<NEW_LINE>View view;<NEW_LINE>switch(viewType) {<NEW_LINE>case TYPE_HEADER_FOLDERS:<NEW_LINE>case TYPE_HEADER_FILES:<NEW_LINE>if (mainFrag.getMainFragmentViewModel() != null && mainFrag.getMainFragmentViewModel().isList()) {<NEW_LINE>view = mInflater.inflate(R.layout.list_header, parent, false);<NEW_LINE>} else {<NEW_LINE>view = mInflater.inflate(R.layout.grid_header, parent, false);<NEW_LINE>}<NEW_LINE>int type = viewType == TYPE_HEADER_FOLDERS ? SpecialViewHolder.HEADER_FOLDERS : SpecialViewHolder.HEADER_FILES;<NEW_LINE>return new SpecialViewHolder(context, view, utilsProvider, type);<NEW_LINE>case TYPE_ITEM:<NEW_LINE>case TYPE_BACK:<NEW_LINE>if (mainFrag.getMainFragmentViewModel() != null && mainFrag.getMainFragmentViewModel().isList()) {<NEW_LINE>view = mInflater.inflate(R.layout.rowlayout, parent, false);<NEW_LINE>sizeProvider.addView(VIEW_GENERIC, view.findViewById(R.id.generic_icon));<NEW_LINE>sizeProvider.addView(VIEW_PICTURE, view.findViewById(R.id.picture_icon));<NEW_LINE>sizeProvider.addView(VIEW_APK, view.findViewById<MASK><NEW_LINE>} else {<NEW_LINE>view = mInflater.inflate(R.layout.griditem, parent, false);<NEW_LINE>sizeProvider.addView(VIEW_GENERIC, view.findViewById(R.id.generic_icon));<NEW_LINE>sizeProvider.addView(VIEW_THUMB, view.findViewById(R.id.icon_thumb));<NEW_LINE>}<NEW_LINE>sizeProvider.closeOffAddition();<NEW_LINE>return new ItemViewHolder(view);<NEW_LINE>case EMPTY_LAST_ITEM:<NEW_LINE>int totalFabHeight = (int) context.getResources().getDimension(R.dimen.fab_height), marginFab = (int) context.getResources().getDimension(R.dimen.fab_margin);<NEW_LINE>view = new View(context);<NEW_LINE>view.setMinimumHeight(totalFabHeight + marginFab);<NEW_LINE>return new EmptyViewHolder(view);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Illegal: " + viewType);<NEW_LINE>}<NEW_LINE>} | (R.id.apk_icon)); |
1,460,366 | private Mono<Response<Flux<ByteBuffer>>> createCheckpointWithResponseAsync(String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (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 (virtualMachineName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (body != null) {<NEW_LINE>body.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createCheckpoint(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), virtualMachineName, body, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,522,706 | private boolean checkSamples(UncertainObject o1, UncertainObject o2) {<NEW_LINE>final SquaredEuclideanDistance distance = SquaredEuclideanDistance.STATIC;<NEW_LINE>// Optimization for discrete objects:<NEW_LINE>if (o1 instanceof DiscreteUncertainObject && o2 instanceof DiscreteUncertainObject) {<NEW_LINE>DiscreteUncertainObject d1 = (DiscreteUncertainObject) o1;<NEW_LINE>DiscreteUncertainObject d2 = (DiscreteUncertainObject) o2;<NEW_LINE>final int l1 = d1.getNumberSamples(), l2 = d2.getNumberSamples();<NEW_LINE>final <MASK><NEW_LINE>int count = 0;<NEW_LINE>for (int i = 0; i < l1; i++) {<NEW_LINE>NumberVector s1 = d1.getSample(i);<NEW_LINE>for (int j = 0; j < l2; j++) {<NEW_LINE>NumberVector s2 = d2.getSample(j);<NEW_LINE>if (distance.distance(s2, s1) <= epsilonsq) {<NEW_LINE>// Keep track of how many are epsilon-close<NEW_LINE>count++;<NEW_LINE>// Stop early:<NEW_LINE>if (count >= limit) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final double limit = threshold * sampleSize * sampleSize;<NEW_LINE>int count = 0;<NEW_LINE>for (int j = 0; j < sampleSize; j++) {<NEW_LINE>NumberVector s1 = o1.drawSample(rand);<NEW_LINE>for (int i = 0; i < sampleSize; i++) {<NEW_LINE>NumberVector s2 = o2.drawSample(rand);<NEW_LINE>if (distance.distance(s2, s1) <= epsilonsq) {<NEW_LINE>// Keep track of how many are epsilon-close<NEW_LINE>count++;<NEW_LINE>// Stop early:<NEW_LINE>if (count >= limit) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | double limit = threshold * l1 * l2; |
1,546,903 | public com.amazonaws.services.iotthingsgraph.model.InternalFailureException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.iotthingsgraph.model.InternalFailureException internalFailureException = new com.amazonaws.services.iotthingsgraph.model.InternalFailureException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 internalFailureException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
82,840 | final GetAccountStatusResult executeGetAccountStatus(GetAccountStatusRequest getAccountStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAccountStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAccountStatusRequest> request = null;<NEW_LINE>Response<GetAccountStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAccountStatusRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAccountStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAccountStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAccountStatusResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(getAccountStatusRequest)); |
1,685,624 | public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tuple13Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> par(final Task<T1> task1, final Task<T2> task2, final Task<T3> task3, final Task<T4> task4, final Task<T5> task5, final Task<T6> task6, final Task<T7> task7, final Task<T8> task8, final Task<T9> task9, final Task<T10> task10, final Task<T11> task11, final Task<T12> task12, final Task<T13> task13) {<NEW_LINE>ArgumentUtil.requireNotNull(task1, "task1");<NEW_LINE>ArgumentUtil.requireNotNull(task2, "task2");<NEW_LINE>ArgumentUtil.requireNotNull(task3, "task3");<NEW_LINE>ArgumentUtil.requireNotNull(task4, "task4");<NEW_LINE>ArgumentUtil.requireNotNull(task5, "task5");<NEW_LINE>ArgumentUtil.requireNotNull(task6, "task6");<NEW_LINE>ArgumentUtil.requireNotNull(task7, "task7");<NEW_LINE>ArgumentUtil.requireNotNull(task8, "task8");<NEW_LINE><MASK><NEW_LINE>ArgumentUtil.requireNotNull(task10, "task10");<NEW_LINE>ArgumentUtil.requireNotNull(task11, "task11");<NEW_LINE>ArgumentUtil.requireNotNull(task12, "task12");<NEW_LINE>ArgumentUtil.requireNotNull(task13, "task13");<NEW_LINE>return new Par13Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>("par13", task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13);<NEW_LINE>} | ArgumentUtil.requireNotNull(task9, "task9"); |
961,759 | private void initComponents() {<NEW_LINE>setLayout(new BorderLayout());<NEW_LINE>setOpaque(false);<NEW_LINE>if (model == null) {<NEW_LINE>add(MessageComponent.notAvailable(), BorderLayout.CENTER);<NEW_LINE>} else if (!model.containsEvent(JFRSnapshotMonitorViewProvider.EventChecker.class)) {<NEW_LINE>// Remove the Java 7 only event from the list of required events (http://www.oracle.com/hotspot/jvm/vm/gc/heap/perm_gen_summary)<NEW_LINE>List<String> eventTypes = new ArrayList();<NEW_LINE>eventTypes.addAll(Arrays.asList(JFRSnapshotMonitorViewProvider.EventChecker.checkedTypes()));<NEW_LINE>eventTypes.remove(JFRSnapshotMonitorViewProvider.EVENT_PERMGEN_SUMMARY);<NEW_LINE>add(MessageComponent.noData(NbBundle.getMessage(MonitorViewSupport.class, "LBL_Monitor"), eventTypes.toArray(new String[0])), BorderLayout.CENTER);<NEW_LINE>} else {<NEW_LINE>area = new HTMLTextArea("<nobr><b>Progress:</b> reading data...</nobr>");<NEW_LINE>area.setBorder(BorderFactory.createEmptyBorder(14, 8, 14, 8));<NEW_LINE><MASK><NEW_LINE>addHierarchyListener(new HierarchyListener() {<NEW_LINE><NEW_LINE>public void hierarchyChanged(HierarchyEvent e) {<NEW_LINE>if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {<NEW_LINE>if (isShowing()) {<NEW_LINE>removeHierarchyListener(this);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>firstShown();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | add(area, BorderLayout.CENTER); |
828,880 | public void exitIftunnel_source(Iftunnel_sourceContext ctx) {<NEW_LINE>if (ctx.IP_ADDRESS() != null) {<NEW_LINE>Ip sourceAddress = toIp(ctx.IP_ADDRESS());<NEW_LINE>for (Interface iface : _currentInterfaces) {<NEW_LINE>iface.getTunnelInitIfNull().setSourceAddress(sourceAddress);<NEW_LINE>}<NEW_LINE>} else if (ctx.iname != null) {<NEW_LINE>String sourceInterfaceName = getCanonicalInterfaceName(ctx.iname.getText());<NEW_LINE>_configuration.referenceStructure(INTERFACE, sourceInterfaceName, TUNNEL_SOURCE, ctx.iname.getStart().getLine());<NEW_LINE>for (Interface iface : _currentInterfaces) {<NEW_LINE>iface.<MASK><NEW_LINE>}<NEW_LINE>} else if (ctx.DYNAMIC() != null) {<NEW_LINE>for (Interface iface : _currentInterfaces) {<NEW_LINE>iface.getTunnelInitIfNull().setSourceInterfaceName(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getTunnelInitIfNull().setSourceInterfaceName(sourceInterfaceName); |
1,835,419 | public static // <editor-fold defaultstate="collapsed" desc="Copy Operation"><NEW_LINE>void copyProject(final Project project) {<NEW_LINE>final ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(DefaultProjectOperationsImplementation.class, "LBL_Copy_Project_Handle"));<NEW_LINE>final ProjectCopyPanel panel = new ProjectCopyPanel(handle, project, false);<NEW_LINE>// #76559<NEW_LINE>handle.start(MAX_WORK);<NEW_LINE>showConfirmationDialog(panel, project, NbBundle.getMessage(DefaultProjectOperationsImplementation.class, "LBL_Copy_Project_Caption"), "Copy_Button", null, false, new // NOI18N<NEW_LINE>Executor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute() throws Exception {<NEW_LINE>final String nueName = panel.getNewName();<NEW_LINE>File newTarget = FileUtil.normalizeFile(panel.getNewDirectory());<NEW_LINE>FileObject newTargetFO = FileUtil.toFileObject(newTarget);<NEW_LINE>if (newTargetFO == null) {<NEW_LINE>newTargetFO = createFolder(newTarget.getParentFile(), newTarget.getName());<NEW_LINE>}<NEW_LINE>final FileObject newTgtFO = newTargetFO;<NEW_LINE>project.getProjectDirectory().getFileSystem().runAtomicAction(new FileSystem.AtomicAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() throws IOException {<NEW_LINE>try {<NEW_LINE>doCopyProject(handle, project, nueName, newTgtFO);<NEW_LINE>} catch (IOException x) {<NEW_LINE>LOG.log(Level.WARNING, null, x);<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Message(x.getLocalizedMessage(), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.<MASK><NEW_LINE>} catch (Exception x) {<NEW_LINE>LOG.log(Level.WARNING, null, x);<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Message(x.getLocalizedMessage(), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(nd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getDefault().notifyLater(nd); |
223,252 | private <T> MultiNodeResult<T> collectResults(Map<NodeExecution, Future<NodeResult<T>>> futures) {<NEW_LINE>boolean done = false;<NEW_LINE>MultiNodeResult<T> result = new MultiNodeResult<>();<NEW_LINE>Map<RedisClusterNode, Throwable> exceptions = new HashMap<>();<NEW_LINE>Set<String> <MASK><NEW_LINE>while (!done) {<NEW_LINE>done = true;<NEW_LINE>for (Map.Entry<NodeExecution, Future<NodeResult<T>>> entry : futures.entrySet()) {<NEW_LINE>if (!entry.getValue().isDone() && !entry.getValue().isCancelled()) {<NEW_LINE>done = false;<NEW_LINE>} else {<NEW_LINE>NodeExecution execution = entry.getKey();<NEW_LINE>try {<NEW_LINE>String futureId = ObjectUtils.getIdentityHexString(entry.getValue());<NEW_LINE>if (!saveGuard.contains(futureId)) {<NEW_LINE>if (execution.isPositional()) {<NEW_LINE>result.add(execution.getPositionalKey(), entry.getValue().get());<NEW_LINE>} else {<NEW_LINE>result.add(entry.getValue().get());<NEW_LINE>}<NEW_LINE>saveGuard.add(futureId);<NEW_LINE>}<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>RuntimeException ex = convertToDataAccessException((Exception) e.getCause());<NEW_LINE>exceptions.put(execution.getNode(), ex != null ? ex : e.getCause());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>RuntimeException ex = convertToDataAccessException((Exception) e.getCause());<NEW_LINE>exceptions.put(execution.getNode(), ex != null ? ex : e.getCause());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(10);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>done = true;<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!exceptions.isEmpty()) {<NEW_LINE>throw new ClusterCommandExecutionFailureException(new ArrayList<>(exceptions.values()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | saveGuard = new HashSet<>(); |
555,098 | private static // we need to only apply disable scanner policy when really changing the page.<NEW_LINE>boolean isControllerURL(String url) {<NEW_LINE>try {<NEW_LINE>Uri uri = Uri.parse(url);<NEW_LINE><MASK><NEW_LINE>if (null == protocol) {<NEW_LINE>protocol = "";<NEW_LINE>}<NEW_LINE>protocol = protocol.toLowerCase();<NEW_LINE>String host = uri.getHost();<NEW_LINE>if (null == host) {<NEW_LINE>host = "";<NEW_LINE>}<NEW_LINE>host = host.toLowerCase();<NEW_LINE>String path = uri.getPath();<NEW_LINE>if (null == path) {<NEW_LINE>path = "";<NEW_LINE>}<NEW_LINE>path = path.toLowerCase();<NEW_LINE>boolean validProtocol = protocol.isEmpty() || protocol.equals("http") || protocol.equals("https");<NEW_LINE>boolean validHost = host.isEmpty() || host.equals("localhost") || host.equals("127.0.0.1");<NEW_LINE>boolean validPath = path.startsWith("/app/");<NEW_LINE>Logger.D(TAG, "isControllerURL: " + "proto:" + protocol + ":" + String.valueOf(validProtocol) + " host:" + host + ":" + String.valueOf(validHost) + " path:" + path + ":" + String.valueOf(validPath));<NEW_LINE>return validProtocol && validHost && validPath;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Logger.W(TAG, "Error parsing pre-navigate URL");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | String protocol = uri.getScheme(); |
1,370,792 | public PartitionReplica[][] arrange(Collection<MemberGroup> memberGroups, InternalPartition[] currentState, Collection<Integer> partitions) {<NEW_LINE>Queue<NodeGroup> groups = createNodeGroups(memberGroups);<NEW_LINE>if (groups.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int partitionCount = currentState.length;<NEW_LINE>PartitionReplica[][] state = new PartitionReplica[partitionCount][InternalPartition.MAX_REPLICA_COUNT];<NEW_LINE>initialize(currentState, state, partitions);<NEW_LINE>int tryCount = 0;<NEW_LINE>do {<NEW_LINE>boolean aggressive = tryCount >= AGGRESSIVE_RETRY_THRESHOLD;<NEW_LINE>tryArrange(state, groups, partitionCount, aggressive, partitions);<NEW_LINE>if (tryCount++ > 0) {<NEW_LINE>if (LOGGER.isFineEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (tryCount < MAX_RETRY_COUNT && !areGroupsBalanced(groups, partitionCount));<NEW_LINE>return state;<NEW_LINE>} | LOGGER.fine("Re-trying partition arrangement. Count: " + tryCount); |
139,874 | public void buildGenericResponse(Components components, Map<String, Object> findControllerAdvice, Locale locale) {<NEW_LINE>// ControllerAdvice<NEW_LINE>for (Map.Entry<String, Object> entry : findControllerAdvice.entrySet()) {<NEW_LINE>List<Method> methods = new ArrayList<>();<NEW_LINE>Object controllerAdvice = entry.getValue();<NEW_LINE>// get all methods with annotation @ExceptionHandler<NEW_LINE>Class<?> objClz = controllerAdvice.getClass();<NEW_LINE>if (org.springframework.aop.support.AopUtils.isAopProxy(controllerAdvice))<NEW_LINE>objClz = org.springframework.aop.<MASK><NEW_LINE>ControllerAdviceInfo controllerAdviceInfo = new ControllerAdviceInfo(controllerAdvice);<NEW_LINE>Arrays.stream(ReflectionUtils.getAllDeclaredMethods(objClz)).filter(m -> m.isAnnotationPresent(ExceptionHandler.class) || isResponseEntityExceptionHandlerMethod(m)).forEach(methods::add);<NEW_LINE>// for each one build ApiResponse and add it to existing responses<NEW_LINE>for (Method method : methods) {<NEW_LINE>if (!operationService.isHidden(method)) {<NEW_LINE>RequestMapping reqMappingMethod = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class);<NEW_LINE>String[] methodProduces = { springDocConfigProperties.getDefaultProducesMediaType() };<NEW_LINE>if (reqMappingMethod != null)<NEW_LINE>methodProduces = reqMappingMethod.produces();<NEW_LINE>Map<String, ApiResponse> controllerAdviceInfoApiResponseMap = controllerAdviceInfo.getApiResponseMap();<NEW_LINE>MethodParameter methodParameter = new MethodParameter(method, -1);<NEW_LINE>ApiResponses apiResponsesOp = new ApiResponses();<NEW_LINE>MethodAttributes methodAttributes = new MethodAttributes(methodProduces, springDocConfigProperties.getDefaultConsumesMediaType(), springDocConfigProperties.getDefaultProducesMediaType(), controllerAdviceInfoApiResponseMap, locale);<NEW_LINE>// calculate JsonView Annotation<NEW_LINE>methodAttributes.setJsonViewAnnotation(AnnotatedElementUtils.findMergedAnnotation(method, JsonView.class));<NEW_LINE>// use the javadoc return if present<NEW_LINE>if (operationService.getJavadocProvider() != null) {<NEW_LINE>JavadocProvider javadocProvider = operationService.getJavadocProvider();<NEW_LINE>methodAttributes.setJavadocReturn(javadocProvider.getMethodJavadocReturn(methodParameter.getMethod()));<NEW_LINE>}<NEW_LINE>Map<String, ApiResponse> apiResponses = computeResponseFromDoc(components, methodParameter, apiResponsesOp, methodAttributes);<NEW_LINE>buildGenericApiResponses(components, methodParameter, apiResponsesOp, methodAttributes);<NEW_LINE>apiResponses.forEach(controllerAdviceInfoApiResponseMap::put);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>controllerAdviceInfos.add(controllerAdviceInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | support.AopUtils.getTargetClass(controllerAdvice); |
264,146 | private String toStringWithSuffix(final String suffix) {<NEW_LINE>StringBuilder toStringBuff = new StringBuilder();<NEW_LINE>toStringBuff.append(" hash=").append(toHexString(getHash())).append(suffix);<NEW_LINE>toStringBuff.append(" parentHash=").append(toHexString(parentHash)).append(suffix);<NEW_LINE>toStringBuff.append(" unclesHash=").append(toHexString(unclesHash)).append(suffix);<NEW_LINE>toStringBuff.append(" coinbase=").append(toHexString(coinbase)).append(suffix);<NEW_LINE>toStringBuff.append(" stateRoot=").append(toHexString(stateRoot)).append(suffix);<NEW_LINE>toStringBuff.append(" txTrieHash=").append(toHexString(txTrieRoot)).append(suffix);<NEW_LINE>toStringBuff.append(" receiptsTrieHash=").append(toHexString(receiptTrieRoot)).append(suffix);<NEW_LINE>toStringBuff.append(" difficulty=").append(toHexString(difficulty)).append(suffix);<NEW_LINE>toStringBuff.append(" number=").append<MASK><NEW_LINE>// toStringBuff.append(" gasLimit=").append(gasLimit).append(suffix);<NEW_LINE>toStringBuff.append(" gasLimit=").append(toHexString(gasLimit)).append(suffix);<NEW_LINE>toStringBuff.append(" gasUsed=").append(gasUsed).append(suffix);<NEW_LINE>toStringBuff.append(" timestamp=").append(timestamp).append(" (").append(Utils.longToDateTime(timestamp)).append(")").append(suffix);<NEW_LINE>toStringBuff.append(" extraData=").append(toHexString(extraData)).append(suffix);<NEW_LINE>toStringBuff.append(" mixHash=").append(toHexString(mixHash)).append(suffix);<NEW_LINE>toStringBuff.append(" nonce=").append(toHexString(nonce)).append(suffix);<NEW_LINE>return toStringBuff.toString();<NEW_LINE>} | (number).append(suffix); |
1,198,552 | protected void initView() {<NEW_LINE>initComponents();<NEW_LINE>// **** set mnemonics<NEW_LINE>jaxpLabel.setDisplayedMnemonic(// NOI18N<NEW_LINE>NbBundle.getMessage(SAXGeneratorVersionPanel.class, "SAXGeneratorVersionPanel.jaxpLabel.mne").// NOI18N<NEW_LINE>charAt(0));<NEW_LINE>versionLabel.setDisplayedMnemonic(// NOI18N<NEW_LINE>NbBundle.getMessage(SAXGeneratorVersionPanel.class, "SAXGeneratorCustomizer.versionLabel.mne").// NOI18N<NEW_LINE>charAt(0));<NEW_LINE>propagateSAXCheckBox.setMnemonic(// NOI18N<NEW_LINE>NbBundle.getMessage(SAXGeneratorVersionPanel.class, "SAXGeneratorVersionPanel.propagateSAXCheckBox.mne").// NOI18N<NEW_LINE>charAt(0));<NEW_LINE>// ****<NEW_LINE>// NOI18N<NEW_LINE>String[] items = new String[] { "SAX 1.0", "SAX 2.0" };<NEW_LINE>ComboBoxModel cbModel = new DefaultComboBoxModel(items);<NEW_LINE>versionComboBox.setModel(cbModel);<NEW_LINE>cbModel.setSelectedItem(items[model.getSAXversion() - 1]);<NEW_LINE>// NOI18N<NEW_LINE>items = new String[] { "JAXP 1.0", "JAXP 1.1" };<NEW_LINE>cbModel = new DefaultComboBoxModel(items);<NEW_LINE>jaxpVersionComboBox.setModel(cbModel);<NEW_LINE>cbModel.setSelectedItem(items[model<MASK><NEW_LINE>initAccessibility();<NEW_LINE>} | .getJAXPversion() - 1]); |
1,174,575 | /*<NEW_LINE>*<NEW_LINE>* NOTE that the source, user, and pass parameters are not standard parameters<NEW_LINE>* for the FHIR $evaluate-measure operation<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>@Operation(name = ProviderConstants.CQL_EVALUATE_MEASURE, idempotent = true, type = Measure.class)<NEW_LINE>public MeasureReport evaluateMeasure(@IdParam IdType theId, @OperationParam(name = "periodStart") String periodStart, @OperationParam(name = "periodEnd") String periodEnd, @OperationParam(name = "measure") String measureRef, @OperationParam(name = "reportType") String reportType, @OperationParam(name = "patient") String patientRef, @OperationParam(name = "productLine") String productLine, @OperationParam(name = "practitioner") String practitionerRef, @OperationParam(name = "lastReceivedOn") String lastReceivedOn, @OperationParam(name = "source") String source, @OperationParam(name = "user") String user, @OperationParam(name = "pass") String pass, RequestDetails theRequestDetails) throws InternalErrorException, FHIRException {<NEW_LINE>LibraryLoader libraryLoader = this.libraryHelper.createLibraryLoader(this.libraryResolutionProvider);<NEW_LINE>MeasureEvaluationSeed seed = new MeasureEvaluationSeed(this.factory, libraryLoader, <MASK><NEW_LINE>Measure measure = myMeasureDao.read(theId, theRequestDetails);<NEW_LINE>if (measure == null) {<NEW_LINE>throw new RuntimeException(Msg.code(1639) + "Could not find Measure/" + theId.getIdPart());<NEW_LINE>}<NEW_LINE>seed.setup(measure, periodStart, periodEnd, productLine, source, user, pass, theRequestDetails);<NEW_LINE>// resolve report type<NEW_LINE>MeasureEvaluation evaluator = new MeasureEvaluation(this.registry, seed.getMeasurementPeriod());<NEW_LINE>if (reportType != null) {<NEW_LINE>switch(reportType) {<NEW_LINE>case "patient":<NEW_LINE>return evaluator.evaluatePatientMeasure(seed.getMeasure(), seed.getContext(), patientRef, theRequestDetails);<NEW_LINE>case "patient-list":<NEW_LINE>return evaluator.evaluatePatientListMeasure(seed.getMeasure(), seed.getContext(), practitionerRef, theRequestDetails);<NEW_LINE>case "population":<NEW_LINE>return evaluator.evaluatePopulationMeasure(seed.getMeasure(), seed.getContext(), theRequestDetails);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(Msg.code(1640) + "Invalid report type: " + reportType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// default report type is patient<NEW_LINE>MeasureReport report = evaluator.evaluatePatientMeasure(seed.getMeasure(), seed.getContext(), patientRef, theRequestDetails);<NEW_LINE>if (productLine != null) {<NEW_LINE>Extension ext = new Extension();<NEW_LINE>ext.setUrl("http://hl7.org/fhir/us/cqframework/cqfmeasures/StructureDefinition/cqfm-productLine");<NEW_LINE>ext.setValue(new StringType(productLine));<NEW_LINE>report.addExtension(ext);<NEW_LINE>}<NEW_LINE>return report;<NEW_LINE>} | this.libraryResolutionProvider, this.libraryHelper); |
1,445,405 | boolean isTimeWindowForMovementExceeded() {<NEW_LINE>if (mLastLocation == null) {<NEW_LINE>final long timeWaited = sysClock.currentTimeMillis() - mStartTimeMs;<NEW_LINE>final boolean expired = timeWaited > mPrefMotionChangeTimeWindowMs;<NEW_LINE>AppGlobals.guiLogInfo("No loc., is gps wait exceeded:" + expired + <MASK><NEW_LINE>return expired;<NEW_LINE>}<NEW_LINE>final long ageLastLocation = sysClock.currentTimeMillis() - mLastLocation.getTime();<NEW_LINE>String log = "Last loc. age: " + ageLastLocation / 1000.0 + " s, (" + sysClock.currentTimeMillis() / 1000 + "-" + mLastLocation.getTime() / 1000 + ", max age: " + mPrefMotionChangeTimeWindowMs / 1000.0 + ")";<NEW_LINE>AppGlobals.guiLogInfo(log);<NEW_LINE>ClientLog.d(LOG_TAG, log);<NEW_LINE>return ageLastLocation > mPrefMotionChangeTimeWindowMs;<NEW_LINE>} | " (" + timeWaited / 1000.0 + "s)"); |
1,203,536 | private void loadComments(final int page, final boolean isReload) {<NEW_LINE>mView.showLoading();<NEW_LINE>final boolean <MASK><NEW_LINE>HttpObserver<ArrayList<IssueEvent>> httpObserver = new HttpObserver<ArrayList<IssueEvent>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable error) {<NEW_LINE>mView.hideLoading();<NEW_LINE>handleError(error);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(HttpResponse<ArrayList<IssueEvent>> response) {<NEW_LINE>mView.hideLoading();<NEW_LINE>ArrayList<IssueEvent> result = response.body();<NEW_LINE>result = filterTimeLine(result);<NEW_LINE>if (isReload || timeline == null || readCacheFirst) {<NEW_LINE>timeline = result;<NEW_LINE>timeline.add(0, getFirstComment());<NEW_LINE>} else {<NEW_LINE>timeline.addAll(result);<NEW_LINE>}<NEW_LINE>if (response.body().size() == 0 && timeline.size() != 0) {<NEW_LINE>mView.setCanLoadMore(false);<NEW_LINE>}<NEW_LINE>mView.showTimeline(timeline);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>generalRxHttpExecute(new IObservableCreator<ArrayList<IssueEvent>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<Response<ArrayList<IssueEvent>>> createObservable(boolean forceNetWork) {<NEW_LINE>// return getIssueService().getIssueComments(forceNetWork, issue.getRepoAuthorName(),<NEW_LINE>// issue.getRepoName(), issue.getNumber(), page);<NEW_LINE>return getIssueService().getIssueTimeline(forceNetWork, issue.getRepoAuthorName(), issue.getRepoName(), issue.getNumber(), page);<NEW_LINE>}<NEW_LINE>}, httpObserver, readCacheFirst);<NEW_LINE>} | readCacheFirst = page == 1 && !isReload; |
99,743 | static RoutingBottomMenuController newInstance(@NonNull Activity activity, @NonNull View frame, @Nullable RoutingBottomMenuListener listener) {<NEW_LINE>View altitudeChartFrame = getViewById(activity, frame, R.id.altitude_chart_panel);<NEW_LINE>View transitFrame = getViewById(activity, frame, R.id.transit_panel);<NEW_LINE>View taxiFrame = getViewById(activity, frame, R.id.taxi_panel);<NEW_LINE>TextView error = (TextView) getViewById(activity, frame, R.id.error);<NEW_LINE>Button start = (Button) getViewById(activity, frame, R.id.start);<NEW_LINE>ImageView altitudeChart = (ImageView) getViewById(activity, frame, R.id.altitude_chart);<NEW_LINE>TextView altitudeDifference = (TextView) getViewById(activity, <MASK><NEW_LINE>View numbersFrame = getViewById(activity, frame, R.id.numbers);<NEW_LINE>View actionFrame = getViewById(activity, frame, R.id.routing_action_frame);<NEW_LINE>return new RoutingBottomMenuController(activity, altitudeChartFrame, transitFrame, taxiFrame, error, start, altitudeChart, altitudeDifference, numbersFrame, actionFrame, listener);<NEW_LINE>} | frame, R.id.altitude_difference); |
1,186,391 | public void trashNotes(boolean trash) {<NEW_LINE>int selectedNotesSize = getSelectedNotes().size();<NEW_LINE>// Restore is performed immediately, otherwise undo bar is shown<NEW_LINE>if (trash) {<NEW_LINE>trackModifiedNotes(getSelectedNotes());<NEW_LINE>for (Note note : getSelectedNotes()) {<NEW_LINE>listAdapter.remove(note);<NEW_LINE>ReminderHelper.removeReminder(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>trashNote(getSelectedNotes(), false);<NEW_LINE>}<NEW_LINE>listAdapter.notifyDataSetChanged();<NEW_LINE>finishActionMode();<NEW_LINE>// Advice to user<NEW_LINE>if (trash) {<NEW_LINE>mainActivity.showMessage(R.string.note_trashed, ONStyle.WARN);<NEW_LINE>} else {<NEW_LINE>mainActivity.showMessage(R.string.note_untrashed, ONStyle.INFO);<NEW_LINE>}<NEW_LINE>// Creation of undo bar<NEW_LINE>if (trash) {<NEW_LINE>ubc.showUndoBar(false, selectedNotesSize + " " + getString(R.string.trashed), null);<NEW_LINE>fab.hideFab();<NEW_LINE>undoTrash = true;<NEW_LINE>} else {<NEW_LINE>getSelectedNotes().clear();<NEW_LINE>}<NEW_LINE>} | OmniNotes.getAppContext(), note); |
769,824 | public void refresh() {<NEW_LINE>setDate(DateUtil.yyyymmdd(TimeUtil.getCurrentTime()));<NEW_LINE>collectObj();<NEW_LINE>Integer[] serverIds = serverObjMap.keySet().toArray(new Integer[serverObjMap.size()]);<NEW_LINE>final TreeSet<XLogData> tempSet = new TreeSet<XLogData>(new XLogDataComparator());<NEW_LINE>int limit = PManager.getInstance().getInt(PreferenceConstants.P_XLOG_IGNORE_TIME);<NEW_LINE>final int max = getMaxCount();<NEW_LINE>twdata.setMax(max);<NEW_LINE>for (final int serverId : serverIds) {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = paramMap.get(serverId);<NEW_LINE>if (param == null) {<NEW_LINE>param = new MapPack();<NEW_LINE>paramMap.put(serverId, param);<NEW_LINE>}<NEW_LINE>ListValue objHashLv = serverObjMap.get(serverId);<NEW_LINE>if (objHashLv.size() > 0) {<NEW_LINE><MASK><NEW_LINE>param.put("limit", limit);<NEW_LINE>tcp.process(RequestCmd.TRANX_REAL_TIME_GROUP, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack p = in.readPack();<NEW_LINE>if (p instanceof MapPack) {<NEW_LINE>MapPack param = (MapPack) p;<NEW_LINE>paramMap.put(serverId, param);<NEW_LINE>} else {<NEW_LINE>XLogPack x = XLogUtil.toXLogPack(p);<NEW_LINE>tempSet.add(new XLogData(x, serverId));<NEW_LINE>while (tempSet.size() >= max) {<NEW_LINE>tempSet.pollFirst();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>ConsoleProxy.errorSafe(e.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (XLogData d : tempSet) {<NEW_LINE>twdata.putLast(d.p.txid, d);<NEW_LINE>}<NEW_LINE>viewPainter.build();<NEW_LINE>ExUtil.exec(canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>canvas.redraw();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | param.put("objHash", objHashLv); |
604,320 | private static PointShifts buildShifts(List<Curve> historicalCurves) {<NEW_LINE>PointShiftsBuilder builder = PointShifts.builder(ShiftType.ABSOLUTE);<NEW_LINE>for (int scenarioIndex = 1; scenarioIndex < historicalCurves.size(); scenarioIndex++) {<NEW_LINE>Curve previousCurve = historicalCurves.get(scenarioIndex - 1);<NEW_LINE>Curve <MASK><NEW_LINE>// build up the shifts to apply to each node<NEW_LINE>// these are calculated as the actual change in the zero rate at that node between the two scenario dates<NEW_LINE>for (int curveNodeIdx = 0; curveNodeIdx < curve.getParameterCount(); curveNodeIdx++) {<NEW_LINE>double zeroRate = curve.getParameter(curveNodeIdx);<NEW_LINE>double previousZeroRate = previousCurve.getParameter(curveNodeIdx);<NEW_LINE>double shift = (zeroRate - previousZeroRate);<NEW_LINE>// the parameter metadata is used to identify a node to apply a perturbation to<NEW_LINE>builder.addShift(scenarioIndex, curve.getParameterMetadata(curveNodeIdx).getIdentifier(), shift);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | curve = historicalCurves.get(scenarioIndex); |
1,699,550 | final BatchDescribeSimulationJobResult executeBatchDescribeSimulationJob(BatchDescribeSimulationJobRequest batchDescribeSimulationJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDescribeSimulationJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDescribeSimulationJobRequest> request = null;<NEW_LINE>Response<BatchDescribeSimulationJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDescribeSimulationJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchDescribeSimulationJobRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchDescribeSimulationJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchDescribeSimulationJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchDescribeSimulationJobResultJsonUnmarshaller());<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()); |
63,493 | protected String doIt() throws Exception {<NEW_LINE>//<NEW_LINE>log.fine("SQL = " + sql.toString());<NEW_LINE>// Prepare statement<NEW_LINE>PreparedStatement pstmtInsert = DB.prepareStatement(sql.toString(), get_TrxName());<NEW_LINE>int i = 1;<NEW_LINE>pstmtInsert.setTimestamp<MASK><NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateTo());<NEW_LINE>// Add parameters<NEW_LINE>if (getBPartnerId() > 0) {<NEW_LINE>pstmtInsert.setInt(i++, getBPartnerId());<NEW_LINE>}<NEW_LINE>// Currency<NEW_LINE>if (getCurrencyId() > 0) {<NEW_LINE>pstmtInsert.setInt(i++, getCurrencyId());<NEW_LINE>}<NEW_LINE>// Document Type<NEW_LINE>if (getDocTypeId() > 0) {<NEW_LINE>pstmtInsert.setInt(i++, getDocTypeId());<NEW_LINE>}<NEW_LINE>// Document Date<NEW_LINE>if (getDateDoc() != null) {<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateDoc());<NEW_LINE>}<NEW_LINE>// Date Invoiced To<NEW_LINE>if (getDateDocTo() != null) {<NEW_LINE>pstmtInsert.setTimestamp(i++, getDateDocTo());<NEW_LINE>}<NEW_LINE>// Financial Product<NEW_LINE>if (getProductId() > 0) {<NEW_LINE>pstmtInsert.setInt(i++, getProductId());<NEW_LINE>}<NEW_LINE>// Agreement Type<NEW_LINE>if (getAgreementTypeId() > 0) {<NEW_LINE>pstmtInsert.setInt(i++, getAgreementTypeId());<NEW_LINE>}<NEW_LINE>// Agreement<NEW_LINE>if (getAgreementId() > 0) {<NEW_LINE>pstmtInsert.setInt(i++, getAgreementId());<NEW_LINE>}<NEW_LINE>// Execute Query for insert<NEW_LINE>int noInserts = pstmtInsert.executeUpdate();<NEW_LINE>//<NEW_LINE>log.fine((System.currentTimeMillis() - m_start) + " ms");<NEW_LINE>//<NEW_LINE>return "@Created@ = " + noInserts;<NEW_LINE>} | (i++, getDateTo()); |
969,339 | public static void lightTreeToBuffer(@Nonnull final FlyweightCapableTreeStructure<LighterASTNode> tree, @Nonnull final LighterASTNode node, @Nonnull final Appendable buffer, final int indent, final boolean skipWhiteSpaces) {<NEW_LINE>final IElementType tokenType = node.getTokenType();<NEW_LINE>if (skipWhiteSpaces && tokenType == TokenType.WHITE_SPACE)<NEW_LINE>return;<NEW_LINE>final boolean isLeaf = (node instanceof LighterASTTokenNode);<NEW_LINE>StringUtil.<MASK><NEW_LINE>try {<NEW_LINE>if (tokenType == TokenType.ERROR_ELEMENT) {<NEW_LINE>buffer.append("PsiErrorElement:").append(PsiBuilderImpl.getErrorMessage(node).get());<NEW_LINE>} else if (tokenType == TokenType.WHITE_SPACE) {<NEW_LINE>buffer.append("PsiWhiteSpace");<NEW_LINE>} else {<NEW_LINE>buffer.append(isLeaf ? "PsiElement" : "Element").append('(').append(tokenType.toString()).append(')');<NEW_LINE>}<NEW_LINE>if (isLeaf) {<NEW_LINE>final String text = ((LighterASTTokenNode) node).getText().toString();<NEW_LINE>buffer.append("('").append(fixWhiteSpaces(text)).append("')");<NEW_LINE>}<NEW_LINE>buffer.append('\n');<NEW_LINE>if (!isLeaf) {<NEW_LINE>final Ref<LighterASTNode[]> kids = new Ref<LighterASTNode[]>();<NEW_LINE>final int numKids = tree.getChildren(tree.prepareForGetChildren(node), kids);<NEW_LINE>if (numKids == 0) {<NEW_LINE>StringUtil.repeatSymbol(buffer, ' ', indent + 2);<NEW_LINE>buffer.append("<empty list>\n");<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < numKids; i++) {<NEW_LINE>lightTreeToBuffer(tree, kids.get()[i], buffer, indent + 2, skipWhiteSpaces);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>} | repeatSymbol(buffer, ' ', indent); |
568,880 | public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) {<NEW_LINE>// Translate overlay and image<NEW_LINE>float flexibleRange = mFlexibleSpaceImageHeight - mActionBarSize;<NEW_LINE>int minOverlayTransitionY = mActionBarSize - mOverlayView.getHeight();<NEW_LINE>ViewHelper.setTranslationY(mOverlayView, ScrollUtils.getFloat(-scrollY, minOverlayTransitionY, 0));<NEW_LINE>ViewHelper.setTranslationY(mImageView, ScrollUtils.getFloat(-scrollY / 2, minOverlayTransitionY, 0));<NEW_LINE>// Change alpha of overlay<NEW_LINE>ViewHelper.setAlpha(mOverlayView, ScrollUtils.getFloat((float) scrollY / flexibleRange, 0, 1));<NEW_LINE>// Scale title text<NEW_LINE>float scale = 1 + ScrollUtils.getFloat((flexibleRange - scrollY) / flexibleRange, 0, MAX_TEXT_SCALE_DELTA);<NEW_LINE>ViewHelper.setPivotX(mTitleView, 0);<NEW_LINE>ViewHelper.setPivotY(mTitleView, 0);<NEW_LINE>ViewHelper.setScaleX(mTitleView, scale);<NEW_LINE>ViewHelper.setScaleY(mTitleView, scale);<NEW_LINE>// Translate title text<NEW_LINE>int maxTitleTranslationY = (int) (mFlexibleSpaceImageHeight - mTitleView.getHeight() * scale);<NEW_LINE>int titleTranslationY = maxTitleTranslationY - scrollY;<NEW_LINE>ViewHelper.setTranslationY(mTitleView, titleTranslationY);<NEW_LINE>// Translate FAB<NEW_LINE>int maxFabTranslationY = mFlexibleSpaceImageHeight - mFab.getHeight() / 2;<NEW_LINE>float fabTranslationY = ScrollUtils.getFloat(-scrollY + mFlexibleSpaceImageHeight - mFab.getHeight() / 2, mActionBarSize - mFab.getHeight() / 2, maxFabTranslationY);<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>// On pre-honeycomb, ViewHelper.setTranslationX/Y does not set margin,<NEW_LINE>// which causes FAB's OnClickListener not working.<NEW_LINE>FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mFab.getLayoutParams();<NEW_LINE>lp.leftMargin = mOverlayView.getWidth() - mFabMargin - mFab.getWidth();<NEW_LINE>lp.topMargin = (int) fabTranslationY;<NEW_LINE>mFab.requestLayout();<NEW_LINE>} else {<NEW_LINE>ViewHelper.setTranslationX(mFab, mOverlayView.getWidth() - mFabMargin - mFab.getWidth());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Show/hide FAB<NEW_LINE>if (fabTranslationY < mFlexibleSpaceShowFabOffset) {<NEW_LINE>hideFab();<NEW_LINE>} else {<NEW_LINE>showFab();<NEW_LINE>}<NEW_LINE>} | ViewHelper.setTranslationY(mFab, fabTranslationY); |
121,091 | private void messageWithRange(MessageType type, Exception message, String systemId, int oneBasedLine, int oneBasedColumn, int[] start) throws SAXException {<NEW_LINE>if (start != null && !sourceCode.getIsCss()) {<NEW_LINE>oneBasedColumn = oneBasedColumn + start[2];<NEW_LINE>}<NEW_LINE>systemId = batchMode ? systemId : null;<NEW_LINE>Location rangeLast = sourceCode.newLocatorLocation(oneBasedLine, oneBasedColumn);<NEW_LINE>if (!sourceCode.isWithinKnownSource(rangeLast)) {<NEW_LINE>messageWithoutExtract(type, message, null, oneBasedLine, oneBasedColumn);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Location rangeStart = sourceCode.rangeStartForRangeLast(rangeLast);<NEW_LINE>if (start != null) {<NEW_LINE>if (sourceCode.getIsCss()) {<NEW_LINE>rangeStart = sourceCode.newLocatorLocation(start[0], start[1]);<NEW_LINE>} else {<NEW_LINE>rangeStart = sourceCode.newLocatorLocation(start[0], start[1] + start[2]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>startMessage(type, scrub(shortenDataUri(systemId)), rangeStart.getLine() + 1, rangeStart.getColumn() + <MASK><NEW_LINE>messageText(message);<NEW_LINE>SourceHandler sourceHandler = emitter.startSource();<NEW_LINE>if (sourceHandler != null) {<NEW_LINE>if (start != null) {<NEW_LINE>sourceCode.addLocatorLocation(rangeStart.getLine() + 1, rangeStart.getColumn());<NEW_LINE>}<NEW_LINE>sourceCode.rangeEndError(rangeStart, rangeLast, sourceHandler);<NEW_LINE>}<NEW_LINE>emitter.endSource();<NEW_LINE>elaboration(message);<NEW_LINE>endMessage();<NEW_LINE>} | 1, oneBasedLine, oneBasedColumn, false); |
370,753 | private Node createHistoryView(History history) {<NEW_LINE>byte[] data = history.peek();<NEW_LINE>boolean isClass = ClassUtil.isClass(data);<NEW_LINE><MASK><NEW_LINE>BorderPane pane = new BorderPane();<NEW_LINE>// Content<NEW_LINE>int count = history.size() - 1;<NEW_LINE>String sub = count > 0 ? "[" + count + " states]" : "[Initial state]";<NEW_LINE>BorderPane display = new BorderPane();<NEW_LINE>display.setTop(new SubLabeled(history.name, sub));<NEW_LINE>display.setCenter(new VBox(new TextArea("Last updated: " + history.getMostRecentUpdate() + "\n" + "Content length: " + data.length + "\n" + "Content hash (MD5): " + DigestUtils.md5Hex(data) + "\n" + "Content hash (SHA1): " + DigestUtils.sha1Hex(data) + "\n" + "Content hash (SHA256): " + DigestUtils.sha256Hex(data))));<NEW_LINE>display.getCenter().getStyleClass().add("hist-data");<NEW_LINE>pane.setCenter(display);<NEW_LINE>// Buttons<NEW_LINE>HBox horizontal = new HBox();<NEW_LINE>horizontal.getStyleClass().add("hist-buttons");<NEW_LINE>horizontal.getChildren().addAll(new ActionButton(LangUtil.translate("ui.history.pop"), () -> {<NEW_LINE>pop(history, isClass);<NEW_LINE>// Update content sub-text<NEW_LINE>int updatedCount = history.size() - 1;<NEW_LINE>String updatedSub = updatedCount > 0 ? "[" + updatedCount + " states]" : "[Initial state]";<NEW_LINE>display.setTop(new SubLabeled(history.name, updatedSub));<NEW_LINE>// Update content data<NEW_LINE>byte[] updatedData = history.peek();<NEW_LINE>display.setCenter(new VBox(new Label("Last updated: " + history.getMostRecentUpdate()), new Label("Content length: " + updatedData.length), new Label("Content hash (MD5): " + DigestUtils.md5Hex(updatedData)), new Label("Content hash (SHA1): " + DigestUtils.sha1Hex(updatedData))));<NEW_LINE>display.getCenter().getStyleClass().add("monospaced");<NEW_LINE>}), new ActionButton(LangUtil.translate("ui.history.open." + type), () -> open(history, isClass)));<NEW_LINE>pane.setBottom(horizontal);<NEW_LINE>return pane;<NEW_LINE>} | String type = isClass ? "class" : "file"; |
188,668 | public DLedgerEntry appendAsLeader(DLedgerEntry entry) {<NEW_LINE>PreConditions.check(memberState.isLeader(), DLedgerResponseCode.NOT_LEADER);<NEW_LINE>PreConditions.check(!isDiskFull, DLedgerResponseCode.DISK_FULL);<NEW_LINE>ByteBuffer dataBuffer = localEntryBuffer.get();<NEW_LINE>ByteBuffer indexBuffer = localIndexBuffer.get();<NEW_LINE>DLedgerEntryCoder.encode(entry, dataBuffer);<NEW_LINE>int entrySize = dataBuffer.remaining();<NEW_LINE>synchronized (memberState) {<NEW_LINE>PreConditions.check(memberState.isLeader(), DLedgerResponseCode.NOT_LEADER, null);<NEW_LINE>PreConditions.check(memberState.getTransferee() == null, DLedgerResponseCode.LEADER_TRANSFERRING, null);<NEW_LINE>long nextIndex = ledgerEndIndex + 1;<NEW_LINE>entry.setIndex(nextIndex);<NEW_LINE>entry.setTerm(memberState.currTerm());<NEW_LINE>entry.setMagic(CURRENT_MAGIC);<NEW_LINE>DLedgerEntryCoder.setIndexTerm(dataBuffer, nextIndex, memberState.currTerm(), CURRENT_MAGIC);<NEW_LINE>long prePos = dataFileList.preAppend(dataBuffer.remaining());<NEW_LINE>entry.setPos(prePos);<NEW_LINE>PreConditions.check(prePos != -1, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>DLedgerEntryCoder.setPos(dataBuffer, prePos);<NEW_LINE>for (AppendHook writeHook : appendHooks) {<NEW_LINE>writeHook.doHook(entry, dataBuffer.slice(), DLedgerEntry.BODY_OFFSET);<NEW_LINE>}<NEW_LINE>long dataPos = dataFileList.append(dataBuffer.array(), 0, dataBuffer.remaining());<NEW_LINE>PreConditions.check(dataPos != -1, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>PreConditions.check(dataPos == <MASK><NEW_LINE>DLedgerEntryCoder.encodeIndex(dataPos, entrySize, CURRENT_MAGIC, nextIndex, memberState.currTerm(), indexBuffer);<NEW_LINE>long indexPos = indexFileList.append(indexBuffer.array(), 0, indexBuffer.remaining(), false);<NEW_LINE>PreConditions.check(indexPos == entry.getIndex() * INDEX_UNIT_SIZE, DLedgerResponseCode.DISK_ERROR, null);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.info("[{}] Append as Leader {} {}", memberState.getSelfId(), entry.getIndex(), entry.getBody().length);<NEW_LINE>}<NEW_LINE>ledgerEndIndex++;<NEW_LINE>ledgerEndTerm = memberState.currTerm();<NEW_LINE>if (ledgerBeginIndex == -1) {<NEW_LINE>ledgerBeginIndex = ledgerEndIndex;<NEW_LINE>}<NEW_LINE>updateLedgerEndIndexAndTerm();<NEW_LINE>return entry;<NEW_LINE>}<NEW_LINE>} | prePos, DLedgerResponseCode.DISK_ERROR, null); |
1,058,192 | public static String toHexString(byte[] byteSource, int bytes) {<NEW_LINE>StringBuffer result = null;<NEW_LINE>boolean truncated = false;<NEW_LINE>if (byteSource != null) {<NEW_LINE>if (bytes > byteSource.length) {<NEW_LINE>// If the number of bytes to display is larger than the available number of<NEW_LINE>// bytes, then reset the number of bytes to display to be the available<NEW_LINE>// number of bytes.<NEW_LINE>bytes = byteSource.length;<NEW_LINE>} else if (bytes < byteSource.length) {<NEW_LINE>// If we are displaying less bytes than are available then detect this<NEW_LINE>// 'truncation' condition.<NEW_LINE>truncated = true;<NEW_LINE>}<NEW_LINE>result = new StringBuffer(bytes * 2);<NEW_LINE>for (int i = 0; i < bytes; i++) {<NEW_LINE>result.append(_digits.charAt((byteSource[i] <MASK><NEW_LINE>result.append(_digits.charAt(byteSource[i] & 0xf));<NEW_LINE>}<NEW_LINE>if (truncated) {<NEW_LINE>result.append("... (" + bytes + "/" + byteSource.length + ")");<NEW_LINE>} else {<NEW_LINE>result.append("(" + bytes + ")");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = new StringBuffer("null");<NEW_LINE>}<NEW_LINE>return (result.toString());<NEW_LINE>} | >> 4) & 0xf)); |
1,665,728 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (controller != null && sourceObject != null) {<NEW_LINE>boolean result = true;<NEW_LINE>boolean doEffect = false;<NEW_LINE>Cost cost = <MASK><NEW_LINE>// check if any player is willing to pay<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player != null && player.canRespond() && cost.canPay(source, source, player.getId(), game) && player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + " for " + sourceObject.getLogName() + "?", source, game)) {<NEW_LINE>cost.clearPaid();<NEW_LINE>if (cost.pay(source, game, source, player.getId(), false, null)) {<NEW_LINE>if (!game.isSimulation()) {<NEW_LINE>game.informPlayers(player.getLogName() + " pays the cost for " + sourceObject.getLogName());<NEW_LINE>}<NEW_LINE>doEffect = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// do the effects if anybody paid<NEW_LINE>if (doEffect) {<NEW_LINE>controller.discard(3, false, false, source, game);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ManaUtil.createManaCost(2, false); |
1,040,883 | public static QueryHotlineSessionResponse unmarshall(QueryHotlineSessionResponse queryHotlineSessionResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryHotlineSessionResponse.setRequestId(_ctx.stringValue("QueryHotlineSessionResponse.RequestId"));<NEW_LINE>queryHotlineSessionResponse.setMessage<MASK><NEW_LINE>queryHotlineSessionResponse.setCode(_ctx.stringValue("QueryHotlineSessionResponse.Code"));<NEW_LINE>queryHotlineSessionResponse.setSuccess(_ctx.booleanValue("QueryHotlineSessionResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryHotlineSessionResponse.Data.PageSize"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("QueryHotlineSessionResponse.Data.PageNumber"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("QueryHotlineSessionResponse.Data.TotalCount"));<NEW_LINE>List<CallDetailRecordItem> callDetailRecord = new ArrayList<CallDetailRecordItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryHotlineSessionResponse.Data.CallDetailRecord.Length"); i++) {<NEW_LINE>CallDetailRecordItem callDetailRecordItem = new CallDetailRecordItem();<NEW_LINE>callDetailRecordItem.setCallResult(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallResult"));<NEW_LINE>callDetailRecordItem.setServicerName(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].ServicerName"));<NEW_LINE>callDetailRecordItem.setOutQueueTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].OutQueueTime"));<NEW_LINE>callDetailRecordItem.setCallContinueTime(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallContinueTime"));<NEW_LINE>callDetailRecordItem.setCreateTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CreateTime"));<NEW_LINE>callDetailRecordItem.setPickUpTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].PickUpTime"));<NEW_LINE>callDetailRecordItem.setRingContinueTime(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].RingContinueTime"));<NEW_LINE>callDetailRecordItem.setCalledNumber(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CalledNumber"));<NEW_LINE>callDetailRecordItem.setServicerId(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].ServicerId"));<NEW_LINE>callDetailRecordItem.setHangUpTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].HangUpTime"));<NEW_LINE>callDetailRecordItem.setEvaluationLevel(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].EvaluationLevel"));<NEW_LINE>callDetailRecordItem.setHangUpRole(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].HangUpRole"));<NEW_LINE>callDetailRecordItem.setMemberName(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].MemberName"));<NEW_LINE>callDetailRecordItem.setEvaluationScore(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].EvaluationScore"));<NEW_LINE>callDetailRecordItem.setAcid(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].Acid"));<NEW_LINE>callDetailRecordItem.setRingStartTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].RingStartTime"));<NEW_LINE>callDetailRecordItem.setCallType(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallType"));<NEW_LINE>callDetailRecordItem.setGroupName(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].GroupName"));<NEW_LINE>callDetailRecordItem.setGroupId(_ctx.longValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].GroupId"));<NEW_LINE>callDetailRecordItem.setRingEndTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].RingEndTime"));<NEW_LINE>callDetailRecordItem.setInQueueTime(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].InQueueTime"));<NEW_LINE>callDetailRecordItem.setCallingNumber(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].CallingNumber"));<NEW_LINE>callDetailRecordItem.setMemberId(_ctx.stringValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].MemberId"));<NEW_LINE>callDetailRecordItem.setQueueUpContinueTime(_ctx.integerValue("QueryHotlineSessionResponse.Data.CallDetailRecord[" + i + "].QueueUpContinueTime"));<NEW_LINE>callDetailRecord.add(callDetailRecordItem);<NEW_LINE>}<NEW_LINE>data.setCallDetailRecord(callDetailRecord);<NEW_LINE>queryHotlineSessionResponse.setData(data);<NEW_LINE>return queryHotlineSessionResponse;<NEW_LINE>} | (_ctx.stringValue("QueryHotlineSessionResponse.Message")); |
1,332,416 | // 3.299: [Full GC (Metadata GC Threshold) 3.299: [Tenured: 21006K->20933K(21888K), 0.0230475 secs] 29003K->20933K(31680K), [Metapace: 12111K->12111K(12672K)], 0.0231557 secs]<NEW_LINE>public void serialFull80(GCLogTrace trace, String line) {<NEW_LINE>FullGC collection = new FullGC(getClock(), trace.gcCause(), trace.getDoubleGroup(trace.groupCount()));<NEW_LINE>MemoryPoolSummary tenured = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(5);<NEW_LINE>MemoryPoolSummary heap = this.getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 12);<NEW_LINE>collection.add(heap.minus(tenured), tenured, heap);<NEW_LINE>collection.addPermOrMetaSpaceRecord(extractPermOrMetaspaceRecord(line));<NEW_LINE>collection<MASK><NEW_LINE>record(collection);<NEW_LINE>} | .add(extractCPUSummary(line)); |
1,372,048 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String routeFilterName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (routeFilterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, routeFilterName, apiVersion, this.client.getSubscriptionId(), context);<NEW_LINE>} | this.client.mergeContext(context); |
1,306,449 | protected void placeRegUnitIfNeeded(long tick, TraceThread thread, Register reg) throws CodeUnitInsertionException, CancelledException {<NEW_LINE>// NOTE: This is compensating for a TODO in the memory and code managers<NEW_LINE>// TODO: Consider convenience methods TraceThread#getMemorySpace(boolean), etc<NEW_LINE>TraceMemoryRegisterSpace mem = thread.getTrace().getMemoryManager().getMemoryRegisterSpace(thread, true);<NEW_LINE>// First check if the value was set at all<NEW_LINE>if (mem.getState(tick, reg) != TraceMemoryState.KNOWN) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The value may have been set, but not changed<NEW_LINE>RegisterValue oldValue = mem.getValue(tick - 1, reg);<NEW_LINE>RegisterValue newValue = mem.getValue(tick, reg);<NEW_LINE>if (Objects.equals(oldValue, newValue)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TraceCodeRegisterSpace code = thread.getTrace().getCodeManager().getCodeRegisterSpace(thread, true);<NEW_LINE>code.definedUnits().clear(Range.atLeast(tick), reg, TaskMonitor.DUMMY);<NEW_LINE>code.definedData().create(Range.atLeast(tick<MASK><NEW_LINE>} | ), reg, PointerDataType.dataType); |
983,356 | Iterator<Entry<E>> entryIterator() {<NEW_LINE>final Iterator<? extends Entry<? extends E>> iterator1 = multiset1.entrySet().iterator();<NEW_LINE>final Iterator<? extends Entry<? extends E>> iterator2 = multiset2<MASK><NEW_LINE>// TODO(lowasser): consider making the entries live views<NEW_LINE>return new AbstractIterator<Entry<E>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@CheckForNull<NEW_LINE>protected Entry<E> computeNext() {<NEW_LINE>if (iterator1.hasNext()) {<NEW_LINE>Entry<? extends E> entry1 = iterator1.next();<NEW_LINE>E element = entry1.getElement();<NEW_LINE>int count = Math.max(entry1.getCount(), multiset2.count(element));<NEW_LINE>return immutableEntry(element, count);<NEW_LINE>}<NEW_LINE>while (iterator2.hasNext()) {<NEW_LINE>Entry<? extends E> entry2 = iterator2.next();<NEW_LINE>E element = entry2.getElement();<NEW_LINE>if (!multiset1.contains(element)) {<NEW_LINE>return immutableEntry(element, entry2.getCount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return endOfData();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .entrySet().iterator(); |
1,485,472 | protected void collectOperations(TemplateOperation ops, Map<String, Object> params) {<NEW_LINE>String name = (<MASK><NEW_LINE>String packageBase = (String) params.get(PROP_PACKAGE_BASE);<NEW_LINE>String sp = (String) params.get(PROP_SUBPROJECTS);<NEW_LINE>Set<SubProject> subProjects = parseSubProjects(sp);<NEW_LINE>params.put(PROP_SUBPROJECTS, subProjects);<NEW_LINE>File loc = (File) params.get(CommonProjectActions.PROJECT_PARENT_FOLDER);<NEW_LINE>File root = new File(loc, name);<NEW_LINE>ops.createFolder(root);<NEW_LINE>// NOI18N<NEW_LINE>ops.// NOI18N<NEW_LINE>copyFromFile(// NOI18N<NEW_LINE>TEMPLATE_PROPS, // NOI18N<NEW_LINE>new File(root, "gradle.properties"), params);<NEW_LINE>// NOI18N<NEW_LINE>ops.// NOI18N<NEW_LINE>copyFromFile(// NOI18N<NEW_LINE>TEMPLATE_SETTINGS, // NOI18N<NEW_LINE>new File(root, "settings.gradle"), params);<NEW_LINE>// NOI18N<NEW_LINE>ops.// NOI18N<NEW_LINE>copyFromFile(// NOI18N<NEW_LINE>TEMPLATE_ROOT, // NOI18N<NEW_LINE>new File(root, "build.gradle"), params);<NEW_LINE>for (SubProject subProject : subProjects) {<NEW_LINE>HashMap<String, Object> subParams = new HashMap<>(params);<NEW_LINE>// NOI18N<NEW_LINE>subParams.put("subProject", subProject);<NEW_LINE>File projectDir = new File(root, subProject.path);<NEW_LINE>ops.createFolder(projectDir);<NEW_LINE>// NOI18N<NEW_LINE>ops.// NOI18N<NEW_LINE>copyFromFile(// NOI18N<NEW_LINE>TEMPLATE_BUILD, // NOI18N<NEW_LINE>new File(projectDir, "build.gradle"), subParams);<NEW_LINE>// NOI18N<NEW_LINE>File mainJava = new File(projectDir, "src/main/java");<NEW_LINE>if (!packageBase.isEmpty()) {<NEW_LINE>ops.createPackage(mainJava, packageBase + '.' + subProject.name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ops.addProjectPreload(root);<NEW_LINE>for (SubProject subProject : subProjects) {<NEW_LINE>File projectDir = new File(root, subProject.path);<NEW_LINE>ops.addProjectPreload(projectDir);<NEW_LINE>}<NEW_LINE>Boolean initWrapper = (Boolean) params.get(PROP_INIT_WRAPPER);<NEW_LINE>if (initWrapper == null || initWrapper) {<NEW_LINE>ops.addWrapperInit(root);<NEW_LINE>}<NEW_LINE>} | String) params.get(PROP_NAME); |
1,762,007 | protected static List<double[]> calculatePosteriorProbs(final List<double[]> genotypeLikelihoods, final double[] knownAlleleCountsByAllele, final int ploidy, final boolean useFlatPriors) {<NEW_LINE>if (ploidy != 2) {<NEW_LINE>throw new IllegalStateException("Genotype posteriors not yet implemented for ploidy != 2");<NEW_LINE>}<NEW_LINE>final double[] genotypePriorByAllele = getDirichletPrior(knownAlleleCountsByAllele, ploidy, useFlatPriors);<NEW_LINE>final List<double[]> posteriors = new ArrayList<>(genotypeLikelihoods.size());<NEW_LINE>for (final double[] likelihoods : genotypeLikelihoods) {<NEW_LINE>double[] posteriorProbabilities = null;<NEW_LINE>if (likelihoods != null) {<NEW_LINE>if (likelihoods.length != genotypePriorByAllele.length) {<NEW_LINE>throw new IllegalStateException(String.format("Likelihoods not of correct size: expected %d, observed %d", knownAlleleCountsByAllele.length * (knownAlleleCountsByAllele.length + 1) / 2, likelihoods.length));<NEW_LINE>}<NEW_LINE>posteriorProbabilities <MASK><NEW_LINE>for (int genoIdx = 0; genoIdx < likelihoods.length; genoIdx++) {<NEW_LINE>posteriorProbabilities[genoIdx] = likelihoods[genoIdx] + genotypePriorByAllele[genoIdx];<NEW_LINE>}<NEW_LINE>posteriorProbabilities = MathUtils.normalizeLog10(posteriorProbabilities);<NEW_LINE>}<NEW_LINE>posteriors.add(posteriorProbabilities);<NEW_LINE>}<NEW_LINE>return posteriors;<NEW_LINE>} | = new double[genotypePriorByAllele.length]; |
1,141,101 | private ReportResult createOutput(final JasperPrint jasperPrint, OutputType outputType) throws JRException, IOException {<NEW_LINE>if (outputType == null) {<NEW_LINE>outputType = DEFAULT_OutputType;<NEW_LINE>}<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>try {<NEW_LINE>if (OutputType.PDF == outputType) {<NEW_LINE>final byte[] data = JasperExportManager.exportReportToPdf(jasperPrint);<NEW_LINE>return ReportResult.builder().outputType(outputType).reportContentBase64(Util.encodeBase64(data)).reportFilename(buildReportFilename(jasperPrint, outputType)).build();<NEW_LINE>} else if (OutputType.HTML == outputType) {<NEW_LINE>final File file = File.createTempFile("JasperPrint", ".html");<NEW_LINE>JasperExportManager.exportReportToHtmlFile(jasperPrint, file.getAbsolutePath());<NEW_LINE>// TODO: handle image links<NEW_LINE><MASK><NEW_LINE>FileUtil.copy(file, out);<NEW_LINE>return ReportResult.builder().outputType(outputType).reportContentBase64(Util.encodeBase64(out.toByteArray())).reportFilename(buildReportFilename(jasperPrint, outputType)).build();<NEW_LINE>} else if (OutputType.XML == outputType) {<NEW_LINE>final ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>JasperExportManager.exportReportToXmlStream(jasperPrint, out);<NEW_LINE>return ReportResult.builder().outputType(outputType).reportContentBase64(Util.encodeBase64(out.toByteArray())).reportFilename(buildReportFilename(jasperPrint, outputType)).build();<NEW_LINE>} else if (OutputType.JasperPrint == outputType) {<NEW_LINE>return exportAsJasperPrint(jasperPrint);<NEW_LINE>} else if (OutputType.XLS == outputType) {<NEW_LINE>return exportAsExcel(jasperPrint);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Output type " + outputType + " not supported");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>logger.debug("Took {} to export report to {}", stopwatch.stop(), outputType);<NEW_LINE>}<NEW_LINE>} | final ByteArrayOutputStream out = new ByteArrayOutputStream(); |
1,071,968 | public boolean recognizes(String text) {<NEW_LINE>Bag<Integer> allPossibleStates = new Bag<>();<NEW_LINE>DirectedDFS directedDFS <MASK><NEW_LINE>for (int vertex = 0; vertex < digraph.vertices(); vertex++) {<NEW_LINE>if (directedDFS.marked(vertex)) {<NEW_LINE>allPossibleStates.add(vertex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>// Compute possible NFA states for text[i + 1]<NEW_LINE>Bag<Integer> states = new Bag<>();<NEW_LINE>for (int vertex : allPossibleStates) {<NEW_LINE>if (vertex < numberOfStates) {<NEW_LINE>if (setsMatchMap.contains(vertex)) {<NEW_LINE>recognizeSet(text, i, vertex, states);<NEW_LINE>} else if (regularExpression[vertex] == text.charAt(i) || regularExpression[vertex] == '.') {<NEW_LINE>states.add(vertex + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>allPossibleStates = new Bag<>();<NEW_LINE>directedDFS = new DirectedDFS(digraph, states);<NEW_LINE>for (int vertex = 0; vertex < digraph.vertices(); vertex++) {<NEW_LINE>if (directedDFS.marked(vertex)) {<NEW_LINE>allPossibleStates.add(vertex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Optimization if no states are reachable<NEW_LINE>if (allPossibleStates.size() == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int vertex : allPossibleStates) {<NEW_LINE>if (vertex == numberOfStates) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | = new DirectedDFS(digraph, 0); |
752,624 | public static synchronized Map<String, String> classLabelNames() throws Exception {<NEW_LINE>if (classLabelNames != null) {<NEW_LINE>return classLabelNames;<NEW_LINE>}<NEW_LINE>if (dataLocalPath == null)<NEW_LINE>dataLocalPath = DownloaderUtility.PATENTEXAMPLE.Download();<NEW_LINE>String s;<NEW_LINE>try {<NEW_LINE>s = FileUtils.readFileToString(new File(dataLocalPath, "PatentClassLabels.txt"), Charset.forName("UTF-8"));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>Map<String, String> m = new LinkedHashMap<>();<NEW_LINE>String[] lines = s.split("\n");<NEW_LINE>for (String line : lines) {<NEW_LINE>String key = line.substring(0, 3);<NEW_LINE>String name = line.substring(4);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>classLabelNames = m;<NEW_LINE>return classLabelNames;<NEW_LINE>} | m.put(key, name); |
724,641 | private int runPython(File pyFile, String[] stmts, String[] scriptPaths) {<NEW_LINE>int exitCode = 0;<NEW_LINE>String stmt = "";<NEW_LINE>try {<NEW_LINE>if (scriptPaths != null) {<NEW_LINE>// TODO implement compile only<NEW_LINE>if (isCompileOnly) {<NEW_LINE>log(lvl, "runPython: running COMPILE_ONLY");<NEW_LINE>interpreter.compile(pyFile.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>String scr;<NEW_LINE>if (scriptPaths.length > 1) {<NEW_LINE>scr = FileManager.slashify(scriptPaths[0], true) + scriptPaths[1] + ".sikuli";<NEW_LINE>log(lvl, "runPython: running script from IDE: \n" + scr);<NEW_LINE>interpreter.exec("sys.argv[0] = \"" + scr + "\"");<NEW_LINE>} else {<NEW_LINE>scr = FileManager.slashify(scriptPaths[0], false);<NEW_LINE>log(lvl, "runPython: running script: \n%s", scr);<NEW_LINE>interpreter.exec("sys.argv[0] = \"" + scr + "\"");<NEW_LINE>}<NEW_LINE>interpreter.execfile(pyFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log(-1, "runPython: invalid arguments");<NEW_LINE>exitCode = -1;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>java.util.regex.Pattern p = java.util.<MASK><NEW_LINE>Matcher matcher = p.matcher(e.toString());<NEW_LINE>// TODO error stop I18N<NEW_LINE>if (matcher.find()) {<NEW_LINE>exitCode = Integer.parseInt(matcher.group(1));<NEW_LINE>Debug.info("Exit code: " + exitCode);<NEW_LINE>} else {<NEW_LINE>// log(-1,_I("msgStopped"));<NEW_LINE>if (null != pyFile) {<NEW_LINE>exitCode = findErrorSource(e, pyFile.getAbsolutePath(), scriptPaths);<NEW_LINE>} else {<NEW_LINE>Debug.error("runPython: Python exception: %s with %s", e.getMessage(), stmt);<NEW_LINE>}<NEW_LINE>if (isFromIDE) {<NEW_LINE>exitCode *= -1;<NEW_LINE>} else {<NEW_LINE>exitCode = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (System.out.checkError()) {<NEW_LINE>Sikulix.popError("System.out is broken (console output)!" + "\nYou will not see any messages anymore!" + "\nSave your work and restart the IDE!", "Fatal Error");<NEW_LINE>}<NEW_LINE>return exitCode;<NEW_LINE>} | regex.Pattern.compile("SystemExit: (-?[0-9]+)"); |
1,326,512 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.impetus.kundera.client.Client#findAll(java.lang.Class,<NEW_LINE>* java.lang.Object[])<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public <E> List<E> findAll(Class<E> entityClass, String[] columnsToSelect, Object... keys) {<NEW_LINE>EntityMetadata entityMetadata = <MASK><NEW_LINE>log.debug("Fetching data from " + entityMetadata.getTableName() + " for Keys " + keys);<NEW_LINE>DBCollection dbCollection = mongoDb.getCollection(entityMetadata.getTableName());<NEW_LINE>BasicDBObject query = new BasicDBObject();<NEW_LINE>query.put("_id", new BasicDBObject("$in", keys));<NEW_LINE>DBCursor cursor = dbCollection.find(query);<NEW_LINE>KunderaCoreUtils.printQuery("Find collection:" + query, showQuery);<NEW_LINE>List entities = new ArrayList<E>();<NEW_LINE>while (cursor.hasNext()) {<NEW_LINE>DBObject fetchedDocument = cursor.next();<NEW_LINE>populateEntity(entityMetadata, entities, fetchedDocument);<NEW_LINE>}<NEW_LINE>return entities;<NEW_LINE>} | KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass); |
24,694 | public void marshall(NFSFileShareInfo nFSFileShareInfo, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (nFSFileShareInfo == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getNFSFileShareDefaults(), NFSFILESHAREDEFAULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getFileShareARN(), FILESHAREARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getFileShareId(), FILESHAREID_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getFileShareStatus(), FILESHARESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getGatewayARN(), GATEWAYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getKMSEncrypted(), KMSENCRYPTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getKMSKey(), KMSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getPath(), PATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getRole(), ROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getLocationARN(), LOCATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getDefaultStorageClass(), DEFAULTSTORAGECLASS_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getObjectACL(), OBJECTACL_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getClientList(), CLIENTLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getSquash(), SQUASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getReadOnly(), READONLY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getRequesterPays(), REQUESTERPAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getFileShareName(), FILESHARENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getCacheAttributes(), CACHEATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getNotificationPolicy(), NOTIFICATIONPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getVPCEndpointDNSName(), VPCENDPOINTDNSNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getBucketRegion(), BUCKETREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(nFSFileShareInfo.getAuditDestinationARN(), AUDITDESTINATIONARN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | nFSFileShareInfo.getGuessMIMETypeEnabled(), GUESSMIMETYPEENABLED_BINDING); |
1,546,532 | private void init() {<NEW_LINE>exceptionUnmarshallers<MASK><NEW_LINE>exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidTypeExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ValidationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new BaseExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ResourceAlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InternalExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.cloudsearchv2.model.AmazonCloudSearchException.class));<NEW_LINE>setServiceNameIntern(DEFAULT_SIGNING_NAME);<NEW_LINE>setEndpointPrefix(ENDPOINT_PREFIX);<NEW_LINE>// calling this.setEndPoint(...) will also modify the signer accordingly<NEW_LINE>this.setEndpoint("https://cloudsearch.us-east-1.amazonaws.com/");<NEW_LINE>HandlerChainFactory chainFactory = new HandlerChainFactory();<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudsearchv2/request.handlers"));<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudsearchv2/request.handler2s"));<NEW_LINE>requestHandler2s.addAll(chainFactory.getGlobalHandlers());<NEW_LINE>} | .add(new DisabledOperationExceptionUnmarshaller()); |
763,245 | private void addToProvideMap(Iterable<DependencyInfo> depInfos, Map<String, DependencyInfo> providesMap, boolean isFromDepsFile) {<NEW_LINE>for (DependencyInfo depInfo : depInfos) {<NEW_LINE>List<String> provides = new ArrayList<<MASK><NEW_LINE>// Add a munged symbol to the provides map so that lookups by path requires work as intended.<NEW_LINE>if (isFromDepsFile) {<NEW_LINE>// Don't add the dependency file itself but every file it says exists instead.<NEW_LINE>provides.add(loader.resolve(PathUtil.makeAbsolute(depInfo.getPathRelativeToClosureBase(), closurePathAbs)).toModuleName());<NEW_LINE>} else {<NEW_LINE>// ES6 modules already provide these munged symbols.<NEW_LINE>if (!"es6".equals(depInfo.getLoadFlags().get("module"))) {<NEW_LINE>provides.add(loader.resolve(depInfo.getName()).toModuleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Also add the relative closure path as a provide. At some point we'll swap out the munged<NEW_LINE>// symbols for these relative paths. So looks ups by either need to work.<NEW_LINE>provides.add(depInfo.getPathRelativeToClosureBase());<NEW_LINE>for (String provide : provides) {<NEW_LINE>DependencyInfo prevValue = providesMap.put(provide, depInfo);<NEW_LINE>// Check for duplicate provides.<NEW_LINE>if (prevValue != null) {<NEW_LINE>reportDuplicateProvide(provide, prevValue, depInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | >(depInfo.getProvides()); |
4,459 | private boolean tryStartingUntrustedTransaction(BTChipDongle.BTChipInput[] inputs, int i, TransactionInput currentInput, boolean isSegwit) throws BTChipException {<NEW_LINE>byte[] scriptBytes;<NEW_LINE>if (isSegwit) {<NEW_LINE>scriptBytes = currentInput.getScriptCode();<NEW_LINE>} else {<NEW_LINE>scriptBytes = currentInput.getScript().getScriptBytes();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>dongle.startUntrustedTransction(i == <MASK><NEW_LINE>} catch (BTChipException e) {<NEW_LINE>// If pin was not entered wait for pin being entered and try again.<NEW_LINE>if (e.getSW() == SW_PIN_NEEDED) {<NEW_LINE>if (isTee()) {<NEW_LINE>// if (dongle.hasScreenSupport()) {<NEW_LINE>// PIN request is prompted on screen<NEW_LINE>if (!waitForTeePin()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>dongle.startUntrustedTransction(i == 0, i, inputs, scriptBytes);<NEW_LINE>} else {<NEW_LINE>String pin = waitForPin();<NEW_LINE>try {<NEW_LINE>Log.d(LOG_TAG, "Reinitialize transport");<NEW_LINE>initialize();<NEW_LINE>Log.d(LOG_TAG, "Reinitialize transport done");<NEW_LINE>dongle.verifyPin(pin.getBytes());<NEW_LINE>dongle.startUntrustedTransction(i == 0, i, inputs, scriptBytes);<NEW_LINE>} catch (BTChipException e1) {<NEW_LINE>Log.d(LOG_TAG, "2fa error", e1);<NEW_LINE>postErrorMessage("Invalid second factor");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | 0, i, inputs, scriptBytes); |
236,632 | SeekableByteChannel open(GcsPath path, GoogleCloudStorageReadOptions readOptions) throws IOException {<NEW_LINE>HashMap<String, String> baseLabels = new HashMap<>();<NEW_LINE>baseLabels.put(MonitoringInfoConstants.Labels.PTRANSFORM, "");<NEW_LINE>baseLabels.put(MonitoringInfoConstants.Labels.SERVICE, "Storage");<NEW_LINE>baseLabels.put(<MASK><NEW_LINE>baseLabels.put(MonitoringInfoConstants.Labels.RESOURCE, GcpResourceIdentifiers.cloudStorageBucket(path.getBucket()));<NEW_LINE>baseLabels.put(MonitoringInfoConstants.Labels.GCS_PROJECT_ID, String.valueOf(googleCloudStorageOptions.getProjectId()));<NEW_LINE>baseLabels.put(MonitoringInfoConstants.Labels.GCS_BUCKET, path.getBucket());<NEW_LINE>ServiceCallMetric serviceCallMetric = new ServiceCallMetric(MonitoringInfoConstants.Urns.API_REQUEST_COUNT, baseLabels);<NEW_LINE>try {<NEW_LINE>SeekableByteChannel channel = googleCloudStorage.open(new StorageResourceId(path.getBucket(), path.getObject()), readOptions);<NEW_LINE>serviceCallMetric.call("ok");<NEW_LINE>return channel;<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (e.getCause() instanceof GoogleJsonResponseException) {<NEW_LINE>serviceCallMetric.call(((GoogleJsonResponseException) e.getCause()).getDetails().getCode());<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | MonitoringInfoConstants.Labels.METHOD, "GcsGet"); |
386,767 | public static WebTestClientFactory of(Object[] controllersOrConfigurersOrExchangeFilterFunctions) {<NEW_LINE>Map<Boolean, List<Object>> partitionedByConfigurer = Arrays.stream(controllersOrConfigurersOrExchangeFilterFunctions).collect(partitioningBy<MASK><NEW_LINE>List<Object> controllersAndExchangeFunctions = partitionedByConfigurer.get(false);<NEW_LINE>Map<Boolean, List<Object>> partitionedByExchangeFunction = controllersAndExchangeFunctions.stream().collect(partitioningBy(ExchangeFilterFunction.class::isInstance));<NEW_LINE>List<WebTestClientConfigurer> configurers = partitionedByConfigurer.get(true).stream().map(WebTestClientConfigurer.class::cast).collect(toList());<NEW_LINE>List<ExchangeFilterFunction> exchangeFilterFunctions = partitionedByExchangeFunction.get(true).stream().map(ExchangeFilterFunction.class::cast).collect(toList());<NEW_LINE>WebTestClient.Builder builder = WebTestClient.bindToController(partitionedByExchangeFunction.get(false).toArray()).configureClient();<NEW_LINE>configurers.forEach(builder::apply);<NEW_LINE>exchangeFilterFunctions.forEach(builder::filter);<NEW_LINE>return new BuilderBasedWebTestClientFactory(builder);<NEW_LINE>} | (WebTestClientConfigurer.class::isInstance)); |
1,459,621 | private List<ValidationEvent> validateExamples(Model model, OperationShape shape, ExamplesTrait trait) {<NEW_LINE>List<ValidationEvent> <MASK><NEW_LINE>List<ExamplesTrait.Example> examples = trait.getExamples();<NEW_LINE>for (ExamplesTrait.Example example : examples) {<NEW_LINE>model.getShape(shape.getInputShape()).ifPresent(input -> {<NEW_LINE>NodeValidationVisitor validator = createVisitor("input", example.getInput(), model, shape, example);<NEW_LINE>events.addAll(input.accept(validator));<NEW_LINE>});<NEW_LINE>model.getShape(shape.getOutputShape()).ifPresent(output -> {<NEW_LINE>NodeValidationVisitor validator = createVisitor("output", example.getOutput(), model, shape, example);<NEW_LINE>events.addAll(output.accept(validator));<NEW_LINE>});<NEW_LINE>if (example.getError().isPresent()) {<NEW_LINE>ExamplesTrait.ErrorExample errorExample = example.getError().get();<NEW_LINE>Optional<Shape> errorShape = model.getShape(errorExample.getShapeId());<NEW_LINE>if (errorShape.isPresent() && shape.getErrors().contains(errorExample.getShapeId())) {<NEW_LINE>NodeValidationVisitor validator = createVisitor("error", errorExample.getContent(), model, shape, example);<NEW_LINE>events.addAll(errorShape.get().accept(validator));<NEW_LINE>} else {<NEW_LINE>events.add(error(shape, trait, String.format("Error parameters provided for operation without the `%s` error: `%s`", errorExample.getShapeId(), example.getTitle())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return events;<NEW_LINE>} | events = new ArrayList<>(); |
1,310,788 | final ListRecoveryPointsByBackupVaultResult executeListRecoveryPointsByBackupVault(ListRecoveryPointsByBackupVaultRequest listRecoveryPointsByBackupVaultRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRecoveryPointsByBackupVaultRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListRecoveryPointsByBackupVaultRequest> request = null;<NEW_LINE>Response<ListRecoveryPointsByBackupVaultResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRecoveryPointsByBackupVaultRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRecoveryPointsByBackupVaultRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRecoveryPointsByBackupVault");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRecoveryPointsByBackupVaultResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRecoveryPointsByBackupVaultResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
118,855 | private void disable(boolean isMinimizing) {<NEW_LINE>Logger.D(TAG, "disable()+");<NEW_LINE>if (scanner != null) {<NEW_LINE>try {<NEW_LINE>if (isMinimizing && isEnabled) {<NEW_LINE>hasQueuedEnableTask = true;<NEW_LINE>}<NEW_LINE>if (!isMinimized) {<NEW_LINE>scannerConfig = defaultScannerConfig;<NEW_LINE>if (isEnabled)<NEW_LINE>scanner.disable();<NEW_LINE>if (isMinimizing)<NEW_LINE>isMinimized = true;<NEW_LINE>setAutoTab(Defaults.AUTOTAB, new MethodResult(false));<NEW_LINE>setAutoEnter(Defaults.AUTOENTER, new MethodResult(false));<NEW_LINE>setDecodeFrequency(Defaults.DECODE_FREQUENCY, new MethodResult(false));<NEW_LINE>setDecodeDuration(Defaults.DECODE_DURATION, new MethodResult(false));<NEW_LINE>setDecodeVolume(Defaults.DECODE_VOLUME, new MethodResult(false));<NEW_LINE>}<NEW_LINE>} catch (ScannerException e) {<NEW_LINE>Logger.E(TAG, "disable Scanner ERROR, cannot disable scanner: " + e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>if (!isMinimizing) {<NEW_LINE>propertyQueue.clear();<NEW_LINE>hasQueuedEnableTask = false;<NEW_LINE>}<NEW_LINE>if (// For some reason bluetooth scanners dont fire "DISABLED" on a disable call<NEW_LINE>isBluetooth) {<NEW_LINE>onStatus(StatusData.ScannerStates.DISABLED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isEnabled = false;<NEW_LINE><MASK><NEW_LINE>} | Logger.D(TAG, "disable()-"); |
73,524 | public synchronized Key generateKey(final String keyAlias) throws KeyNotGeneratedException {<NEW_LINE>try {<NEW_LINE>KeyStore <MASK><NEW_LINE>keyStore.load(null);<NEW_LINE>// If the keystore does not have keys for this alias, generate a new<NEW_LINE>// asymmetric AES/GCM/NoPadding key pair.<NEW_LINE>if (!keyStore.containsAlias(keyAlias)) {<NEW_LINE>KeyGenerator generator = KeyGenerator.getInstance(AES_KEY_ALGORITHM, ANDROID_KEY_STORE_NAME);<NEW_LINE>// setRandomizedEncryptionRequired(false) because Randomized Encryption<NEW_LINE>// does not work consistently in API levels 23-28.<NEW_LINE>generator.init(new KeyGenParameterSpec.Builder(keyAlias, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT).setBlockModes(KeyProperties.BLOCK_MODE_GCM).setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE).setKeySize(CIPHER_AES_GCM_NOPADDING_KEY_LENGTH_IN_BITS).setRandomizedEncryptionRequired(false).build());<NEW_LINE>Key key = generator.generateKey();<NEW_LINE>logger.info("Generated the encryption key identified by the keyAlias: " + keyAlias + " using " + ANDROID_KEY_STORE_NAME);<NEW_LINE>return key;<NEW_LINE>} else {<NEW_LINE>throw new KeyNotGeneratedException("Key already exists for the keyAlias: " + keyAlias + " in " + ANDROID_KEY_STORE_NAME);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new KeyNotGeneratedException("Cannot generate a key for alias: " + keyAlias + " in " + ANDROID_KEY_STORE_NAME, ex);<NEW_LINE>}<NEW_LINE>} | keyStore = KeyStore.getInstance(ANDROID_KEY_STORE_NAME); |
776,631 | public boolean apply(Game game, Ability source) {<NEW_LINE>Card evershrikeCard = game.getCard(source.getSourceId());<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null || evershrikeCard == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int xAmount = source.getManaCostsToPay().getX();<NEW_LINE>controller.moveCards(evershrikeCard, <MASK><NEW_LINE>Permanent evershrikePermanent = game.getPermanent(evershrikeCard.getId());<NEW_LINE>if (evershrikePermanent == null) {<NEW_LINE>if (game.getState().getZone(evershrikeCard.getId()) != Zone.EXILED) {<NEW_LINE>controller.moveCards(evershrikeCard, Zone.EXILED, source, game);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean exileSource = true;<NEW_LINE>FilterCard filterAuraCard = new FilterCard("Aura card with mana value X or less from your hand");<NEW_LINE>filterAuraCard.add(CardType.ENCHANTMENT.getPredicate());<NEW_LINE>filterAuraCard.add(SubType.AURA.getPredicate());<NEW_LINE>filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId()));<NEW_LINE>filterAuraCard.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, xAmount + 1));<NEW_LINE>int count = controller.getHand().count(filterAuraCard, game);<NEW_LINE>if (count > 0 && controller.chooseUse(Outcome.Benefit, "Put an Aura card from your hand onto the battlefield attached to " + evershrikeCard.getIdName() + "?", source, game)) {<NEW_LINE>TargetCard targetAura = new TargetCard(Zone.HAND, filterAuraCard);<NEW_LINE>if (controller.choose(Outcome.Benefit, controller.getHand(), targetAura, game)) {<NEW_LINE>Card aura = game.getCard(targetAura.getFirstTarget());<NEW_LINE>if (aura != null) {<NEW_LINE>game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent);<NEW_LINE>if (controller.moveCards(aura, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>evershrikePermanent.addAttachment(aura.getId(), source, game);<NEW_LINE>}<NEW_LINE>exileSource = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exileSource) {<NEW_LINE>controller.moveCards(evershrikeCard, Zone.EXILED, source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | Zone.BATTLEFIELD, source, game); |
1,421,579 | public StartJobRunResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartJobRunResult startJobRunResult = new StartJobRunResult();<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 startJobRunResult;<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("id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startJobRunResult.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startJobRunResult.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startJobRunResult.setArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("virtualClusterId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startJobRunResult.setVirtualClusterId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return startJobRunResult;<NEW_LINE>} | class).unmarshall(context)); |
1,844,867 | public static <T> Mono<T> from(Publisher<? extends T> source) {<NEW_LINE>// some sources can be considered already assembled monos<NEW_LINE>// all conversion methods (from, fromDirect, wrap) must accommodate for this<NEW_LINE>if (source instanceof Mono) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Mono<T> casted = (Mono<T>) source;<NEW_LINE>return casted;<NEW_LINE>}<NEW_LINE>if (source instanceof FluxSourceMono || source instanceof FluxSourceMonoFuseable) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>FluxFromMonoOperator<T, T> wrapper = (FluxFromMonoOperator<T, T>) source;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Mono<T> extracted = (<MASK><NEW_LINE>return extracted;<NEW_LINE>}<NEW_LINE>// we delegate to `wrap` and apply assembly hooks<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Publisher<T> downcasted = (Publisher<T>) source;<NEW_LINE>return onAssembly(wrap(downcasted, true));<NEW_LINE>} | Mono<T>) wrapper.source; |
498,612 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context MyTermByTimeout partition by p00 from SupportBean_S0, p10 from SupportBean_S1 terminated by pattern [SupportBean_S0(id<0) or SupportBean_S1(id<0)]", path);<NEW_LINE><MASK><NEW_LINE>env.addListener("s0");<NEW_LINE>String[] fields = "key,cnt".split(",");<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "A"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(0, "A"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(0, "B"));<NEW_LINE>env.milestone(0);<NEW_LINE>// stop B<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "B"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "B", 1L });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportBean_S1(0, "B"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "A"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "B"));<NEW_LINE>env.milestone(2);<NEW_LINE>// stop A<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "A"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A", 3L });<NEW_LINE>env.milestone(3);<NEW_LINE>// stop A<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "A"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(4);<NEW_LINE>// stop B<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "B"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "B", 2L });<NEW_LINE>env.milestone(5);<NEW_LINE>// stop B<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "B"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeploy("@name('s0') context MyTermByTimeout select coalesce(s0.p00, s1.p10) as key, count(*) as cnt from pattern [every (s0=SupportBean_S0 or s1=SupportBean_S1)] output last when terminated", path); |
1,651,401 | public void close() throws SQLException {<NEW_LINE>TraceComponent tc = getTracer();<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "close", this);<NEW_LINE>// Make sure we only get closed once.<NEW_LINE>synchronized (this) {<NEW_LINE>if (// already closed, just return<NEW_LINE>state == CLOSED) {<NEW_LINE>if (tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "Already closed.");<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "close");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>state = CLOSED;<NEW_LINE>}<NEW_LINE>if (tc.isEventEnabled())<NEW_LINE>Tr.event(<MASK><NEW_LINE>SQLException sqlX = closeWrapper();<NEW_LINE>if (sqlX == null) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "close");<NEW_LINE>} else {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "close", sqlX);<NEW_LINE>throw sqlX;<NEW_LINE>}<NEW_LINE>} | tc, "state --> " + getStateString()); |
1,621,315 | public GetEnvironmentTemplateVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetEnvironmentTemplateVersionResult getEnvironmentTemplateVersionResult = new GetEnvironmentTemplateVersionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getEnvironmentTemplateVersionResult;<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("environmentTemplateVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getEnvironmentTemplateVersionResult.setEnvironmentTemplateVersion(EnvironmentTemplateVersionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getEnvironmentTemplateVersionResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
111,351 | public void start() {<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Form hi = new Form("Hi World", BoxLayout.y());<NEW_LINE>hi.add(new Label("Hi World"));<NEW_LINE>Button btn = new Button("Show Dialog");<NEW_LINE>btn.addActionListener(e -> {<NEW_LINE>Dialog dlg = new Dialog("Hello Dialog", new BorderLayout());<NEW_LINE>dlg.add(BorderLayout.CENTER, BoxLayout.encloseY(new Label("Here is some text"), new Label("And Some More"), new Button("Cancel")));<NEW_LINE>int padding = 0;<NEW_LINE>if (!CN.isTablet()) {<NEW_LINE>// If it is a tablet, we just let the dialog keep its preferred size.<NEW_LINE>// If it is a phone then we want the dialog to stretch to the edge of the screen.<NEW_LINE>dlg.getContentPane().setPreferredW(hi.getWidth() - dlg.getStyle().getHorizontalPadding() - dlg.getContentPane().getStyle().getHorizontalMargins());<NEW_LINE>}<NEW_LINE>int w = dlg.getDialogPreferredSize().getWidth();<NEW_LINE>int h = dlg.getDialogPreferredSize().getHeight();<NEW_LINE>// Position the top so that it is just underneath the form's title area.<NEW_LINE>int top = hi.getTitleArea().getAbsoluteY() + hi.getTitleArea().getHeight() + hi.getTitleArea().getStyle().getMarginBottom() + padding;<NEW_LINE>int left = (hi.getWidth() - w) / 2;<NEW_LINE>int right = left;<NEW_LINE>int bottom = hi.getHeight() - top - h;<NEW_LINE>System.out.println("bottom=" + bottom);<NEW_LINE>bottom = Math.max(0, bottom);<NEW_LINE>top = Math.max(0, top);<NEW_LINE>dlg.show(<MASK><NEW_LINE>});<NEW_LINE>hi.add(btn);<NEW_LINE>hi.show();<NEW_LINE>} | top, bottom, left, right); |
253,049 | public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.roleId, convLabelName("Role Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.roleId, convLabelName("Role Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.functionKey, convLabelName("Function Key"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.functionKey, convLabelName("Function Key"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.rowId<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | , convLabelName("Row Id"), 64); |
1,625,203 | private String wsImport(URL wsdlLocation) throws IOException {<NEW_LINE>File classesDir = new File(System.getProperty("java.io.tmpdir"));<NEW_LINE>// create a dumy file to have a unique temporary name for a directory<NEW_LINE>classesDir = File.createTempFile("jax-ws", "tester", classesDir);<NEW_LINE>if (!classesDir.delete()) {<NEW_LINE>logger.log(Level.WARNING, LogUtils.DELETE_DIR_FAILED, classesDir);<NEW_LINE>}<NEW_LINE>if (!classesDir.mkdirs()) {<NEW_LINE>logger.log(Level.SEVERE, LogUtils.CREATE_DIR_FAILED, classesDir);<NEW_LINE>}<NEW_LINE>String[] wsimportArgs = new String[8];<NEW_LINE>if (JDK.getMajor() >= 9) {<NEW_LINE>wsimportArgs = new String[14];<NEW_LINE>}<NEW_LINE>wsimportArgs[0] = "-d";<NEW_LINE>wsimportArgs[1] = classesDir.getAbsolutePath();<NEW_LINE>wsimportArgs[2] = "-keep";<NEW_LINE>wsimportArgs[3] = wsdlLocation.toExternalForm();<NEW_LINE>wsimportArgs[4] = "-Xendorsed";<NEW_LINE>wsimportArgs[5] = "-target";<NEW_LINE>wsimportArgs[6] = "2.1";<NEW_LINE>wsimportArgs[7] = "-extension";<NEW_LINE>// If JDK version is 9 or higher, we need to add the JWS and related JARs<NEW_LINE>if (JDK.getMajor() >= 9) {<NEW_LINE>String modulesDir = System.getProperty("com.sun.aas.installRoot") + File.separator + "modules" + File.separator;<NEW_LINE>wsimportArgs[8] = modulesDir + "jakarta.jws-api.jar";<NEW_LINE>wsimportArgs[9] = modulesDir + "jakarta.xml.rpc-api.jar";<NEW_LINE>wsimportArgs[10] = modulesDir + "webservices-osgi.jar";<NEW_LINE>wsimportArgs[11] = modulesDir + "jaxb-osgi.jar";<NEW_LINE>wsimportArgs[12] = modulesDir + "jakarta.xml.ws-api.jar";<NEW_LINE>wsimportArgs[13] = modulesDir + "jakarta.activation-api.jar";<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>logger.log(Level.INFO, LogUtils.WSIMPORT_INVOKE, wsdlLocation);<NEW_LINE>boolean success = tools.wsimport(System.out, wsimportArgs);<NEW_LINE>if (success) {<NEW_LINE>logger.log(Level.INFO, LogUtils.WSIMPORT_OK);<NEW_LINE>} else {<NEW_LINE>logger.log(Level.SEVERE, LogUtils.WSIMPORT_FAILED);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return classesDir.getAbsolutePath();<NEW_LINE>} | WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance(); |
82,431 | public boolean signalBackgroundJobServerAlive(BackgroundJobServerStatus serverStatus) {<NEW_LINE>try (final Jedis jedis = getJedis()) {<NEW_LINE>final Map<String, String> valueMap = jedis.hgetAll(backgroundJobServerKey(keyPrefix, serverStatus));<NEW_LINE>if (valueMap.isEmpty()) {<NEW_LINE>throw new ServerTimedOutException(serverStatus, new StorageException("BackgroundJobServer with id " + serverStatus.getId() + " was not found"));<NEW_LINE>}<NEW_LINE>jedis.watch(backgroundJobServerKey(keyPrefix, serverStatus));<NEW_LINE>try (final Transaction t = jedis.multi()) {<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_LAST_HEARTBEAT, String.valueOf(serverStatus.getLastHeartbeat()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_FREE_MEMORY, String.valueOf(serverStatus.getSystemFreeMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_CPU_LOAD, String.valueOf(serverStatus.getSystemCpuLoad()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_FREE_MEMORY, String.valueOf(serverStatus.getProcessFreeMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_ALLOCATED_MEMORY, String.valueOf(serverStatus.getProcessAllocatedMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_CPU_LOAD, String.valueOf(serverStatus.getProcessCpuLoad()));<NEW_LINE>t.zadd(backgroundJobServersUpdatedKey(keyPrefix), toMicroSeconds(now()), serverStatus.getId().toString());<NEW_LINE>final Response<String> isRunningResponse = t.hget(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_IS_RUNNING);<NEW_LINE>t.exec();<NEW_LINE>return Boolean.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | parseBoolean(isRunningResponse.get()); |
154,385 | public RecommendationData unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RecommendationData recommendationData = new RecommendationData();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("document", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationData.setDocument(DocumentJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("recommendationId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationData.setRecommendationId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("relevanceLevel", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationData.setRelevanceLevel(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("relevanceScore", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendationData.setRelevanceScore(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return recommendationData;<NEW_LINE>} | class).unmarshall(context)); |
1,736,780 | public void visitReturn(SReturn userReturnNode, SemanticScope semanticScope) {<NEW_LINE>AExpression userValueNode = userReturnNode.getValueNode();<NEW_LINE>if (userValueNode == null) {<NEW_LINE>if (semanticScope.getReturnType() != void.class) {<NEW_LINE>throw userReturnNode.createError(new ClassCastException("cannot cast from " + "[" + semanticScope.getReturnCanonicalTypeName() + "] to " + "[" + PainlessLookupUtility.typeToCanonicalTypeName(void.class) + "]"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>semanticScope.setCondition(userValueNode, Read.class);<NEW_LINE>semanticScope.putDecoration(userValueNode, new TargetType<MASK><NEW_LINE>semanticScope.setCondition(userValueNode, Internal.class);<NEW_LINE>checkedVisit(userValueNode, semanticScope);<NEW_LINE>decorateWithCast(userValueNode, semanticScope);<NEW_LINE>}<NEW_LINE>semanticScope.setCondition(userReturnNode, MethodEscape.class);<NEW_LINE>semanticScope.setCondition(userReturnNode, LoopEscape.class);<NEW_LINE>semanticScope.setCondition(userReturnNode, AllEscape.class);<NEW_LINE>} | (semanticScope.getReturnType())); |
1,025,006 | protected void execute(Terminal terminal, OptionSet options, Environment env) throws UserException {<NEW_LINE>if (options.nonOptionArguments().isEmpty() == false) {<NEW_LINE>throw new UserException(ExitCodes.USAGE, "Positional arguments not allowed, found " + options.nonOptionArguments());<NEW_LINE>}<NEW_LINE>if (options.has(versionOption)) {<NEW_LINE>final String versionOutput = String.format(Locale.ROOT, "Version: %s, Build: %s/%s/%s, JVM: %s", Build.CURRENT.getQualifiedVersion(), Build.CURRENT.type().displayName(), Build.CURRENT.hash(), Build.CURRENT.date(), JvmInfo.jvmInfo().version());<NEW_LINE>terminal.println(versionOutput);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean daemonize = options.has(daemonizeOption);<NEW_LINE>final Path pidFile = pidfileOption.value(options);<NEW_LINE>final boolean quiet = options.has(quietOption);<NEW_LINE>// a misconfigured java.io.tmpdir can cause hard-to-diagnose problems later, so reject it immediately<NEW_LINE>try {<NEW_LINE>env.validateTmpFile();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UserException(ExitCodes.CONFIG, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>init(daemonize, pidFile, quiet, env);<NEW_LINE>} catch (NodeValidationException e) {<NEW_LINE>throw new UserException(ExitCodes.<MASK><NEW_LINE>}<NEW_LINE>} | CONFIG, e.getMessage()); |
1,819,809 | protected void updateBendPoints(InternalRelationship[] relationshipsToConsider) {<NEW_LINE>for (int i = 0; i < relationshipsToConsider.length; i++) {<NEW_LINE>InternalRelationship relationship = relationshipsToConsider[i];<NEW_LINE>List bendPoints = relationship.getBendPoints();<NEW_LINE>if (bendPoints.size() > 0) {<NEW_LINE>// We will assume that source/dest coordinates are for center of node<NEW_LINE>BendPoint[] externalBendPoints = new BendPoint[bendPoints.size() + 2];<NEW_LINE>InternalNode sourceNode = relationship.getSource();<NEW_LINE>externalBendPoints[0] = new BendPoint(sourceNode.getInternalX(), sourceNode.getInternalY());<NEW_LINE>InternalNode destNode = relationship.getDestination();<NEW_LINE>externalBendPoints[externalBendPoints.length - 1] = new BendPoint(destNode.getInternalX(), destNode.getInternalY());<NEW_LINE>for (int j = 0; j < bendPoints.size(); j++) {<NEW_LINE>BendPoint bp = (<MASK><NEW_LINE>externalBendPoints[j + 1] = new BendPoint(bp.x, bp.y, bp.getIsControlPoint());<NEW_LINE>}<NEW_LINE>relationship.getLayoutRelationship().setBendPoints(externalBendPoints);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | BendPoint) bendPoints.get(j); |
39,568 | public static Map<String, RoleDescriptor> parseRoleDescriptors(Path path, Logger logger, boolean resolvePermission, Settings settings, NamedXContentRegistry xContentRegistry) {<NEW_LINE>if (logger == null) {<NEW_LINE>logger = NoOpLogger.INSTANCE;<NEW_LINE>}<NEW_LINE>Map<String, RoleDescriptor> roles = new HashMap<>();<NEW_LINE>logger.trace("attempting to read roles file located at [{}]", path.toAbsolutePath());<NEW_LINE>if (Files.exists(path)) {<NEW_LINE>try {<NEW_LINE>List<<MASK><NEW_LINE>for (String segment : roleSegments) {<NEW_LINE>RoleDescriptor rd = parseRoleDescriptor(segment, path, logger, resolvePermission, settings, xContentRegistry);<NEW_LINE>if (rd != null) {<NEW_LINE>roles.put(rd.getName(), rd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>logger.error((Supplier<?>) () -> new ParameterizedMessage("failed to read roles file [{}]. skipping all roles...", path.toAbsolutePath()), ioe);<NEW_LINE>return emptyMap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return unmodifiableMap(roles);<NEW_LINE>} | String> roleSegments = roleSegments(path); |
1,070,624 | public static Instruction createDeclareByte(int b0, int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8, int b9, int b10, int b11, int b12, int b13, int b14, int b15) {<NEW_LINE>Instruction instruction = new Instruction();<NEW_LINE>instruction.setCode(Code.DECLAREBYTE);<NEW_LINE>instruction.setDeclareDataCount(16);<NEW_LINE>instruction.setDeclareByteValue(0, toByte(b0));<NEW_LINE>instruction.setDeclareByteValue(1, toByte(b1));<NEW_LINE>instruction.setDeclareByteValue(2, toByte(b2));<NEW_LINE>instruction.setDeclareByteValue(3, toByte(b3));<NEW_LINE>instruction.setDeclareByteValue(4, toByte(b4));<NEW_LINE>instruction.setDeclareByteValue(5, toByte(b5));<NEW_LINE>instruction.setDeclareByteValue(6, toByte(b6));<NEW_LINE>instruction.setDeclareByteValue(7, toByte(b7));<NEW_LINE>instruction.setDeclareByteValue(8, toByte(b8));<NEW_LINE>instruction.setDeclareByteValue(9, toByte(b9));<NEW_LINE>instruction.setDeclareByteValue(10, toByte(b10));<NEW_LINE>instruction.setDeclareByteValue(11, toByte(b11));<NEW_LINE>instruction.setDeclareByteValue(12, toByte(b12));<NEW_LINE>instruction.setDeclareByteValue(13, toByte(b13));<NEW_LINE>instruction.setDeclareByteValue<MASK><NEW_LINE>instruction.setDeclareByteValue(15, toByte(b15));<NEW_LINE>assert instruction.getOpCount() == 0 : instruction.getOpCount();<NEW_LINE>return instruction;<NEW_LINE>} | (14, toByte(b14)); |
1,343,450 | private Clip createClip(Path file, String id) throws IOException, UnsupportedAudioFileException, LineUnavailableException {<NEW_LINE>// getAudioInputStream() also accepts a File or InputStream<NEW_LINE>AudioInputStream ais = AudioSystem.getAudioInputStream(file.toFile());<NEW_LINE>DataLine.Info info = new DataLine.Info(Clip.class, ais.getFormat());<NEW_LINE>final Clip clip;<NEW_LINE>if (mixer != null) {<NEW_LINE>clip = (Clip) mixer.getLine(info);<NEW_LINE>} else {<NEW_LINE>clip = (Clip) AudioSystem.getLine(info);<NEW_LINE>}<NEW_LINE>clip.open(ais);<NEW_LINE>clip.addLineListener(event -> {<NEW_LINE>boolean simulateIssue = Debugging.isEnabled("soundNoStop") && ThreadLocalRandom.current().nextBoolean();<NEW_LINE>if (simulateIssue && event.getType() == LineEvent.Type.STOP) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.info("LineEvent[" + id + <MASK><NEW_LINE>if (event.getType() == LineEvent.Type.STOP) {<NEW_LINE>clip.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return clip;<NEW_LINE>} | "]: " + event.getType()); |
1,255,072 | private void singleScope(Scanner scanner, Scope expectedScope, int lineIx, String line, int length, Marker m, ArrayList<Scope> allScopes, ArrayList<Scope> closedScopes, ArrayList<Scope> removedScopes) {<NEW_LINE>Scope s = new Scope(this.mateText, m.pattern.name);<NEW_LINE>s.pattern = m.pattern;<NEW_LINE>s.openMatch = m.match;<NEW_LINE>setStartPosSafely(s, m, lineIx, length, 0);<NEW_LINE>setEndPosSafely(s, <MASK><NEW_LINE>s.isOpen = false;<NEW_LINE>s.isCapture = false;<NEW_LINE>// System.out.printf("beginMatchString '%s' %d - %d\n", new String(line.getBytes(), m.from, m.match.getCapture(0).end - m.from), m.from, m.match.getCapture(0).end);<NEW_LINE>// s.beginMatchString = new String(line.getBytes(), m.from, m.match.getCapture(0).end - m.from);<NEW_LINE>s.beginMatchString = line.substring(m.match.getCapture(0).start, m.match.getCapture(0).end);<NEW_LINE>s.parent = scanner.getCurrentScope();<NEW_LINE>Scope newScope = s;<NEW_LINE>if (expectedScope != null) {<NEW_LINE>if (s.surfaceIdenticalTo(expectedScope)) {<NEW_LINE>newScope = expectedScope;<NEW_LINE>for (Scope child : expectedScope.children) {<NEW_LINE>closedScopes.add(child);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handleCaptures(lineIx, length, line, s, m, allScopes, closedScopes);<NEW_LINE>if (s.overlapsWith(expectedScope)) {<NEW_LINE>if (expectedScope == scanner.getCurrentScope()) {<NEW_LINE>// we expected this scope to close, but it doesn't<NEW_LINE>} else {<NEW_LINE>scanner.getCurrentScope().removeChild(expectedScope);<NEW_LINE>// removed_scopes << expectedScope<NEW_LINE>removedScopes.add(expectedScope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>scanner.getCurrentScope().addChild(s);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handleCaptures(lineIx, length, line, s, m, allScopes, closedScopes);<NEW_LINE>scanner.getCurrentScope().addChild(s);<NEW_LINE>}<NEW_LINE>allScopes.add(newScope);<NEW_LINE>closedScopes.add(newScope);<NEW_LINE>} | m, lineIx, length, 0); |
1,854,707 | public void visitPostnet(POSTNETComponent postnet) {<NEW_LINE>POSTNETBean postnetBean = new POSTNETBean();<NEW_LINE>barcodeBean = postnetBean;<NEW_LINE>evaluatePOSTNET(postnet);<NEW_LINE>setBaseAttributes(postnet);<NEW_LINE>if (postnet.getShortBarHeight() != null) {<NEW_LINE>postnetBean.setShortBarHeight(UnitConv.pt2mm(postnet.getShortBarHeight()));<NEW_LINE>}<NEW_LINE>if (postnet.getBaselinePosition() != null) {<NEW_LINE>postnetBean.setBaselinePosition(BaselineAlignment.byName<MASK><NEW_LINE>}<NEW_LINE>if (postnet.getChecksumMode() != null) {<NEW_LINE>postnetBean.setChecksumMode(ChecksumMode.byName(postnet.getChecksumMode()));<NEW_LINE>}<NEW_LINE>if (postnet.getDisplayChecksum() != null) {<NEW_LINE>postnetBean.setDisplayChecksum(postnet.getDisplayChecksum());<NEW_LINE>}<NEW_LINE>if (postnet.getIntercharGapWidth() != null) {<NEW_LINE>postnetBean.setIntercharGapWidth(UnitConv.pt2mm(postnet.getIntercharGapWidth()));<NEW_LINE>}<NEW_LINE>evaluateBarcodeRenderable(postnet);<NEW_LINE>} | (postnet.getBaselinePosition())); |
265,998 | public Map<Long, List<String>> findDuplicates(Object doc) {<NEW_LINE>// duplicate validation<NEW_LINE>// the check on duplicates must be provided on raw data without apply the default label or auto generate the id<NEW_LINE>AtomicLong index = new AtomicLong(-1);<NEW_LINE>return getDocumentCollection(doc).stream().flatMap(e -> {<NEW_LINE>long lineDup = index.incrementAndGet();<NEW_LINE>return flatMapFields(e).map(ee -> new AbstractMap.SimpleEntry<Map, Long>(ee, lineDup));<NEW_LINE>}).collect(Collectors.groupingBy(Map.Entry::getKey, Collectors.mapping(Map.Entry::getValue, Collectors.toList()))).entrySet().stream().filter(e -> e.getValue().size() > 1).map(e -> {<NEW_LINE>long line = e.getValue().get(0);<NEW_LINE>String elem = formatDocument(e.getKey());<NEW_LINE>String dupLines = e.getValue().subList(1, e.getValue().size()).stream().map(ee -> String.valueOf(ee)).collect(Collectors.joining(","));<NEW_LINE>return new AbstractMap.SimpleEntry<>(line, String.format("The object `%s` has duplicate at lines [%s]", elem, dupLines));<NEW_LINE>}).collect(Collectors.groupingBy(Map.Entry::getKey, Collectors.mapping(Map.Entry::getValue, <MASK><NEW_LINE>} | Collectors.toList()))); |
21,332 | protected void runTenantManagementInitializer(InstanceDatasetTemplate template) throws SiteWhereException {<NEW_LINE>SiteWhereAuthentication previous = UserContext.getCurrentUser();<NEW_LINE>UserContext.setContext(getMicroservice().getSystemUser().getAuthentication());<NEW_LINE>try {<NEW_LINE>setTenantBootstrapState(BootstrapState.Bootstrapping);<NEW_LINE>ITenantManagement tenants = getMicroservice().getTenantManagement();<NEW_LINE>if (tenants instanceof IAsyncStartLifecycleComponent) {<NEW_LINE>getLogger().info("Waiting for tenant management to start before bootstrapping...");<NEW_LINE>((IAsyncStartLifecycleComponent) tenants).waitForComponentStarted();<NEW_LINE>}<NEW_LINE>String tenantManagement = template.getSpec().getDatasets().get(FA_TENANT_MANGEMENT);<NEW_LINE>if (tenantManagement != null) {<NEW_LINE>getLogger().info(String.format("Initializing tenant management from template '%s'.", template.getMetadata().getName()));<NEW_LINE>Binding binding = new Binding();<NEW_LINE>binding.setVariable(IScriptVariables.VAR_LOGGER, getLogger());<NEW_LINE>binding.setVariable(IScriptVariables.VAR_TENANT_MANAGEMENT_BUILDER, <MASK><NEW_LINE>ScriptingUtils.run(tenantManagement, binding);<NEW_LINE>getLogger().info(String.format("Completed execution of tenant management template '%s'.", template.getMetadata().getName()));<NEW_LINE>}<NEW_LINE>setTenantBootstrapState(BootstrapState.Bootstrapped);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>setTenantBootstrapState(BootstrapState.BootstrapFailed);<NEW_LINE>throw t;<NEW_LINE>} finally {<NEW_LINE>UserContext.setContext(previous);<NEW_LINE>}<NEW_LINE>} | new TenantManagementRequestBuilder(getTenantManagement())); |
1,795,954 | public com.amazonaws.services.certificatemanager.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.certificatemanager.model.ConflictException conflictException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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>} | certificatemanager.model.ConflictException(null); |
1,832,082 | public static void onceMoreGenerate(long duration, Class<? extends Diagram> type, FileFormat fileFormat) {<NEW_LINE>if (StatsUtils.fullEver == null || StatsUtils.historicalData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (formatCounterCurrent == null || formatCounterEver == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getByTypeCurrent(type).generated().addValue(duration);<NEW_LINE>final ParsedGenerated byTypeEver = getByTypeEver(type);<NEW_LINE>byTypeEver.generated().addValue(duration);<NEW_LINE>StatsUtils.fullEver.generated().addValue(duration);<NEW_LINE>StatsUtils.historicalData.current().generated().addValue(duration);<NEW_LINE>formatCounterCurrent.plusOne(fileFormat, duration);<NEW_LINE>formatCounterEver.plusOne(fileFormat, duration);<NEW_LINE>formatCounterEver.save(prefs, fileFormat);<NEW_LINE>StatsUtils.historicalData.current().generated().save(prefs);<NEW_LINE>StatsUtils.fullEver.<MASK><NEW_LINE>byTypeEver.generated().save(prefs);<NEW_LINE>realTimeExport();<NEW_LINE>} | generated().save(prefs); |
343,500 | public static void consumeRecipes(Consumer<FillingRecipe> consumer, IIngredientManager ingredientManager) {<NEW_LINE>Collection<FluidStack> fluidStacks = ingredientManager.getAllIngredients(VanillaTypes.FLUID);<NEW_LINE>for (ItemStack stack : ingredientManager.getAllIngredients(VanillaTypes.ITEM)) {<NEW_LINE>if (stack.getItem() instanceof PotionItem) {<NEW_LINE>FluidStack fluidFromPotionItem = PotionFluidHandler.getFluidFromPotionItem(stack);<NEW_LINE>Ingredient bottle = Ingredient.of(Items.GLASS_BOTTLE);<NEW_LINE>consumer.accept(new ProcessingRecipeBuilder<>(FillingRecipe::new, Create.asResource("potions")).withItemIngredients(bottle).withFluidIngredients(FluidIngredient.fromFluidStack(fluidFromPotionItem)).withSingleItemOutput(stack).build());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LazyOptional<IFluidHandlerItem> capability = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY);<NEW_LINE>if (!capability.isPresent())<NEW_LINE>continue;<NEW_LINE>for (FluidStack fluidStack : fluidStacks) {<NEW_LINE><MASK><NEW_LINE>copy.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY).ifPresent(fhi -> {<NEW_LINE>if (!GenericItemFilling.isFluidHandlerValid(copy, fhi))<NEW_LINE>return;<NEW_LINE>FluidStack fluidCopy = fluidStack.copy();<NEW_LINE>fluidCopy.setAmount(1000);<NEW_LINE>fhi.fill(fluidCopy, FluidAction.EXECUTE);<NEW_LINE>ItemStack container = fhi.getContainer();<NEW_LINE>if (container.sameItem(copy))<NEW_LINE>return;<NEW_LINE>if (container.isEmpty())<NEW_LINE>return;<NEW_LINE>Ingredient bucket = Ingredient.of(stack);<NEW_LINE>ResourceLocation itemName = stack.getItem().getRegistryName();<NEW_LINE>ResourceLocation fluidName = fluidCopy.getFluid().getRegistryName();<NEW_LINE>consumer.accept(new ProcessingRecipeBuilder<>(FillingRecipe::new, Create.asResource("fill_" + itemName.getNamespace() + "_" + itemName.getPath() + "_with_" + fluidName.getNamespace() + "_" + fluidName.getPath())).withItemIngredients(bucket).withFluidIngredients(FluidIngredient.fromFluidStack(fluidCopy)).withSingleItemOutput(container).build());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ItemStack copy = stack.copy(); |
415,257 | public Iterable<String> keysWithPrefix(String prefix) {<NEW_LINE>if (prefix == null) {<NEW_LINE>throw new IllegalArgumentException("Prefix cannot be null");<NEW_LINE>}<NEW_LINE>Queue<String> keysWithPrefix = new Queue<>();<NEW_LINE>if (prefix.length() == 1) {<NEW_LINE>char character1 = prefix.charAt(0);<NEW_LINE>// Check if key of size 1 is in the hybrid ternary search trie<NEW_LINE><MASK><NEW_LINE>// Also check for keys of size 2 or higher<NEW_LINE>for (char tst = 0; tst < R; tst++) {<NEW_LINE>getAllKeysInTST(character1, tst, keysWithPrefix);<NEW_LINE>}<NEW_LINE>} else if (prefix.length() > 1) {<NEW_LINE>char character1 = prefix.charAt(0);<NEW_LINE>char character2 = prefix.charAt(1);<NEW_LINE>getAllKeysInTST(character1, character2, keysWithPrefix);<NEW_LINE>}<NEW_LINE>return keysWithPrefix;<NEW_LINE>} | getAllKeysInTST(character1, NULL_CHAR_INDEX, keysWithPrefix); |
1,345,095 | public void promote(String targetRepo, ReleaseInfo releaseInfo) {<NEW_LINE>PromotionRequest request = getPromotionRequest(targetRepo);<NEW_LINE>String buildName = releaseInfo.getBuildName();<NEW_LINE><MASK><NEW_LINE>logger.info("Promoting " + buildName + "/" + buildNumber + " to " + request.getTargetRepo());<NEW_LINE>RequestEntity<PromotionRequest> requestEntity = RequestEntity.post(URI.create(PROMOTION_URL + buildName + "/" + buildNumber)).contentType(MediaType.APPLICATION_JSON).body(request);<NEW_LINE>try {<NEW_LINE>this.restTemplate.exchange(requestEntity, String.class);<NEW_LINE>logger.debug("Promotion complete");<NEW_LINE>} catch (HttpClientErrorException ex) {<NEW_LINE>boolean isAlreadyPromoted = isAlreadyPromoted(buildName, buildNumber, request.getTargetRepo());<NEW_LINE>if (isAlreadyPromoted) {<NEW_LINE>logger.info("Already promoted.");<NEW_LINE>} else {<NEW_LINE>logger.info("Promotion failed.");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String buildNumber = releaseInfo.getBuildNumber(); |
1,503,507 | void scheduleEntry(ExpiringEntry<K, V> entry) {<NEW_LINE>if (entry == null || entry.scheduled)<NEW_LINE>return;<NEW_LINE>Runnable runnable = null;<NEW_LINE>synchronized (entry) {<NEW_LINE>if (entry.scheduled)<NEW_LINE>return;<NEW_LINE>final WeakReference<ExpiringEntry<K, V>> entryReference = new WeakReference<ExpiringEntry<K, V>>(entry);<NEW_LINE>runnable = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>ExpiringEntry<K, V> entry = entryReference.get();<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>if (entry != null && entry.scheduled) {<NEW_LINE><MASK><NEW_LINE>notifyListeners(entry);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Expires entries and schedules the next entry<NEW_LINE>Iterator<ExpiringEntry<K, V>> iterator = entries.valuesIterator();<NEW_LINE>boolean schedulePending = true;<NEW_LINE>while (iterator.hasNext() && schedulePending) {<NEW_LINE>ExpiringEntry<K, V> nextEntry = iterator.next();<NEW_LINE>if (nextEntry.expectedExpiration.get() <= System.nanoTime()) {<NEW_LINE>iterator.remove();<NEW_LINE>notifyListeners(nextEntry);<NEW_LINE>} else {<NEW_LINE>scheduleEntry(nextEntry);<NEW_LINE>schedulePending = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NoSuchElementException ignored) {<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Future<?> entryFuture = EXPIRER.schedule(runnable, entry.expectedExpiration.get() - System.nanoTime(), TimeUnit.NANOSECONDS);<NEW_LINE>entry.schedule(entryFuture);<NEW_LINE>}<NEW_LINE>} | entries.remove(entry.key); |
1,017,264 | public Object visit(Object context1, FunctionCallExpression expr, boolean strict) {<NEW_LINE>ExecutionContext context = (ExecutionContext) context1;<NEW_LINE>Object ref = expr.getMemberExpression().accept(context, this, strict);<NEW_LINE>Object function = getValue(context, ref);<NEW_LINE>List<Expression<MASK><NEW_LINE>Object[] args = new Object[argExprs.size()];<NEW_LINE>int i = 0;<NEW_LINE>for (Expression each : argExprs) {<NEW_LINE>args[i] = getValue(context, each.accept(context, this, strict));<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>if (!(function instanceof JSFunction)) {<NEW_LINE>throw new ThrowException(context, context.createTypeError(expr.getMemberExpression() + " is not calllable"));<NEW_LINE>}<NEW_LINE>Object thisValue = null;<NEW_LINE>if (ref instanceof Reference) {<NEW_LINE>if (((Reference) ref).isPropertyReference()) {<NEW_LINE>thisValue = ((Reference) ref).getBase();<NEW_LINE>} else {<NEW_LINE>thisValue = ((EnvironmentRecord) ((Reference) ref).getBase()).implicitThisValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (context.call(ref, (JSFunction) function, thisValue, args));<NEW_LINE>} | > argExprs = expr.getArgumentExpressions(); |
1,041,254 | // ---------------------- visit draw:image<NEW_LINE>@Override<NEW_LINE>protected void visitImage(DrawImageElement ele, String href, byte[] imageStream) {<NEW_LINE>Collection<String> attributes = new ArrayList<String>();<NEW_LINE>// src<NEW_LINE>if (exportImageAsBase64 && imageStream != null) {<NEW_LINE>String mimeType = new MimetypesFileTypeMap().getContentType(new File(href));<NEW_LINE>StringBuilder src = new StringBuilder();<NEW_LINE>src.append(DATA_ATTR_TAG);<NEW_LINE>src.append(mimeType + ";base64,");<NEW_LINE>src.append(Base64Utility.encode(imageStream));<NEW_LINE>attributes.add(SRC_ATTR);<NEW_LINE>attributes.add(src.toString());<NEW_LINE>} else {<NEW_LINE>String src = ele.getXlinkHrefAttribute();<NEW_LINE>IURIResolver uriResolver = xhtml.getStyleEngine().getURIResolver();<NEW_LINE>src = uriResolver.resolve(src);<NEW_LINE>attributes.add(SRC_ATTR);<NEW_LINE>attributes.add(src);<NEW_LINE>}<NEW_LINE>// other attributes<NEW_LINE>Node parentNode = ele.getParentNode();<NEW_LINE>if (parentNode instanceof DrawFrameElement) {<NEW_LINE>DrawFrameElement frameElement = (DrawFrameElement) parentNode;<NEW_LINE>attributes.add(STYLE_ATTR);<NEW_LINE>StringBuilder styleAttr = new StringBuilder();<NEW_LINE>// width<NEW_LINE>styleAttr.append(WIDTH_ATTR);<NEW_LINE>styleAttr.append(':');<NEW_LINE>styleAttr.append(_100);<NEW_LINE>// height<NEW_LINE>styleAttr.append(HEIGHT_ATTR);<NEW_LINE>styleAttr.append(':');<NEW_LINE>styleAttr.append(_100);<NEW_LINE>String anchorType = frameElement.getTextAnchorTypeAttribute();<NEW_LINE>if (!CHARACTER.equals(anchorType)) {<NEW_LINE>styleAttr.append(DISPLAY_ATTR);<NEW_LINE>styleAttr.append(':');<NEW_LINE>styleAttr.append(BLOCK);<NEW_LINE>}<NEW_LINE>attributes.add(styleAttr.toString());<NEW_LINE>}<NEW_LINE>visit(IMG_ELEMENT, ele, null, null, attributes<MASK><NEW_LINE>} | .toArray(StringUtils.EMPTY_STRING_ARRAY)); |
1,045,580 | public static UserTrades adaptToUserTrades(List<CoindealTradeHistory> coindealTradeHistoryList) throws InvalidFormatException {<NEW_LINE>List<UserTrade> userTrades = new ArrayList<>();<NEW_LINE>for (CoindealTradeHistory coindealTradeHistory : coindealTradeHistoryList) {<NEW_LINE>CurrencyPair currencyPair = CurrencyPairDeserializer.<MASK><NEW_LINE>userTrades.add(new UserTrade.Builder().type((coindealTradeHistory.getSide().equals("BUY")) ? Order.OrderType.BID : Order.OrderType.ASK).originalAmount(coindealTradeHistory.getQuantity()).currencyPair(currencyPair).price(coindealTradeHistory.getPrice()).timestamp(DateUtils.fromRfc3339DateString(coindealTradeHistory.getTimestamp())).id(coindealTradeHistory.getId()).orderId(coindealTradeHistory.getOrderId()).feeAmount(coindealTradeHistory.getFee()).feeCurrency((coindealTradeHistory.getSide().equals("BUY") ? currencyPair.base : currencyPair.counter)).build());<NEW_LINE>}<NEW_LINE>return new UserTrades(userTrades, Trades.TradeSortType.SortByTimestamp);<NEW_LINE>} | getCurrencyPairFromString(coindealTradeHistory.getSymbol()); |
1,586,198 | private void removeCompileDependencies(Project prj, FileObject project_xml, final AntBuildExtender ext) throws IOException {<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(FileUtil.toFile(project_xml<MASK><NEW_LINE>String line = null;<NEW_LINE>boolean isOldVersion = false;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>if (line.contains("wsimport-client-compile") || line.contains("wsimport-service-compile") || line.contains("wsgen-service-compile")) {<NEW_LINE>// NOI18N<NEW_LINE>isOldVersion = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>br.close();<NEW_LINE>if (isOldVersion) {<NEW_LINE>TransformerUtils.transformClients(prj.getProjectDirectory(), WebBuildScriptExtensionProvider.JAX_WS_STYLESHEET_RESOURCE);<NEW_LINE>AntBuildExtender.Extension extension = ext.getExtension(JaxWsBuildScriptExtensionProvider.JAXWS_EXTENSION);<NEW_LINE>if (extension != null) {<NEW_LINE>// NOI18N<NEW_LINE>extension.removeDependency("-do-compile", "wsimport-client-compile");<NEW_LINE>// NOI18N<NEW_LINE>extension.removeDependency("-do-ws-compile", "wsimport-client-compile");<NEW_LINE>// NOI18N<NEW_LINE>extension.removeDependency("-do-compile-single", "wsimport-client-compile");<NEW_LINE>// NOI18N<NEW_LINE>extension.removeDependency("-do-compile", "wsimport-service-compile");<NEW_LINE>// NOI18N<NEW_LINE>extension.removeDependency("-do-compile-single", "wsimport-service-compile");<NEW_LINE>// NOI18N<NEW_LINE>extension.removeDependency("-post-compile", "wsgen-service-compile");<NEW_LINE>ProjectManager.getDefault().saveProject(prj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | )), StandardCharsets.UTF_8)); |
382,170 | static PwmDateFormat readDateFormatAndTimeZoneParams(final List<String> parameters) throws MacroParseException {<NEW_LINE>final String dateFormatStr;<NEW_LINE>if (parameters.size() > 0 && !parameters.get(0).isEmpty()) {<NEW_LINE>dateFormatStr = parameters.get(0);<NEW_LINE>} else {<NEW_LINE>dateFormatStr = PwmConstants.DEFAULT_DATETIME_FORMAT_STR;<NEW_LINE>}<NEW_LINE>final TimeZone tz;<NEW_LINE>if (parameters.size() > 1 && !parameters.get(1).isEmpty()) {<NEW_LINE>final String desiredTz = parameters.get(1);<NEW_LINE>final List<String> availableIDs = Arrays.asList(TimeZone.getAvailableIDs());<NEW_LINE>if (!availableIDs.contains(desiredTz)) {<NEW_LINE>throw new MacroParseException("unknown timezone");<NEW_LINE>}<NEW_LINE>tz = TimeZone.getTimeZone(desiredTz);<NEW_LINE>} else {<NEW_LINE>tz = PwmConstants.DEFAULT_TIMEZONE;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return PwmDateFormat.newPwmDateFormat(<MASK><NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>throw new MacroParseException(e.getMessage());<NEW_LINE>}<NEW_LINE>} | dateFormatStr, PwmConstants.DEFAULT_LOCALE, tz); |
1,036,635 | final UpdateByteMatchSetResult executeUpdateByteMatchSet(UpdateByteMatchSetRequest updateByteMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateByteMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateByteMatchSetRequest> request = null;<NEW_LINE>Response<UpdateByteMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateByteMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateByteMatchSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateByteMatchSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateByteMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateByteMatchSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF Regional"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.