idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,427,601 | private void onRotate(KeySeries series) {<NEW_LINE>mKeysMap.put(Numeric.toHexString(series.getID()), series);<NEW_LINE>long validFrom = Math.round(System.nanoTime() - 10 * Math.pow(10, 9));<NEW_LINE>byte[] signature = new Random().randomBytes(65);<NEW_LINE>List<Object> args = new ArrayList<>();<NEW_LINE>args.add(series.getID());<NEW_LINE>args.add(series.getAPIID());<NEW_LINE>args.add(series.getPrefix());<NEW_LINE>args.add(validFrom);<NEW_LINE>args.add(mAddr);<NEW_LINE>args.add(signature);<NEW_LINE>Map<String, Object> kwargs = new HashMap<>();<NEW_LINE>kwargs.put("price", series.getPrice());<NEW_LINE>kwargs.put("provider_id", Numeric.toHexStringWithPrefix(mECKey.getPublicKey()));<NEW_LINE>CompletableFuture<CallResult> future = mSession.call("xbr.marketmaker.place_offer", args, kwargs, new CallOptions(1000));<NEW_LINE>future.whenComplete((callResult, throwable) -> {<NEW_LINE>if (throwable != null) {<NEW_LINE>throwable.printStackTrace();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | System.out.println("Offer placed..."); |
623,232 | public void render(Component comp, Writer out) throws IOException {<NEW_LINE>final SmartWriter wh = new SmartWriter(out);<NEW_LINE>final Combobox self = (Combobox) comp;<NEW_LINE>final String uuid = self.getUuid();<NEW_LINE>final String zcls = self.getZclass();<NEW_LINE>final Execution exec = Executions.getCurrent();<NEW_LINE>String tableStyle = AEnv.isInternetExplorer() ? "display:inline" : "display:inline-block";<NEW_LINE>String inputAttrs = self.getInnerAttrs();<NEW_LINE>if (inputAttrs.indexOf("style") >= 0) {<NEW_LINE>inputAttrs = inputAttrs.substring(0, inputAttrs.indexOf("style"));<NEW_LINE>}<NEW_LINE>inputAttrs = inputAttrs.trim() + " style='width: 100%'";<NEW_LINE>wh.write("<span id=\"").write(uuid).write("\"").write(self.getOuterAttrs()).write(" z.type=\"zul.cb.Cmbox\" z.combo=\"true\">").write("<table border='0' cellspacing='0' cellpadding='0'").write(" width='").write(self.getWidth()).write("'").write(" style='").write(tableStyle).write("'>").write("<tr style='white-space:nowrap; border:none").write(self.getWidth<MASK><NEW_LINE>if (self.getWidth() != null && self.getWidth().trim().length() > 0 && !"auto".equals(self.getWidth())) {<NEW_LINE>wh.write("<td style='width: 100%; border:none'>");<NEW_LINE>} else {<NEW_LINE>wh.write("<td style='width: auto; border:none'>");<NEW_LINE>}<NEW_LINE>wh.write("<input id=\"").write(uuid).write("!real\" autocomplete=\"off\"").write(" class=\"").write(zcls).write("-inp\" ").write(inputAttrs).write("/></td><td style='width: 17px'><span id=\"").write(uuid).write("!btn\" class=\"").write(zcls).write("-btn\"");<NEW_LINE>if (!self.isButtonVisible())<NEW_LINE>wh.write(" style=\"display:none\"");<NEW_LINE>else<NEW_LINE>wh.write(" style=\"margin-left:2px\"");<NEW_LINE>wh.write("><img class=\"").write(zcls).write("-img\" onmousedown=\"return false;\"");<NEW_LINE>wh.write(" src=\"").write(exec.encodeURL("~./img/spacer.gif")).write("\"").write("\"/></span></td></tr></table><div id=\"").write(uuid).write("!pp\" class=\"").write(zcls).write("-pp\" style=\"display:none\" tabindex=\"-1\">").write("<table id=\"").write(uuid).write("!cave\" cellpadding=\"0\" cellspacing=\"0\">").writeChildren(self).write("</table></div></span>");<NEW_LINE>} | ()).write("'>"); |
512,942 | private void renderTracers(MatrixStack matrixStack, double partialTicks, int regionX, int regionZ) {<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionColorShader);<NEW_LINE>RenderSystem.setShaderColor(1, 1, 1, 1);<NEW_LINE>Matrix4f matrix = matrixStack<MASK><NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);<NEW_LINE>Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos()).subtract(regionX, 0, regionZ);<NEW_LINE>for (PlayerEntity e : players) {<NEW_LINE>Vec3d interpolationOffset = new Vec3d(e.getX(), e.getY(), e.getZ()).subtract(e.prevX, e.prevY, e.prevZ).multiply(1 - partialTicks);<NEW_LINE>Vec3d end = e.getBoundingBox().getCenter().subtract(interpolationOffset).subtract(regionX, 0, regionZ);<NEW_LINE>float r, g, b;<NEW_LINE>if (WURST.getFriends().contains(e.getEntityName())) {<NEW_LINE>r = 0;<NEW_LINE>g = 0;<NEW_LINE>b = 1;<NEW_LINE>} else {<NEW_LINE>float f = MC.player.distanceTo(e) / 20F;<NEW_LINE>r = MathHelper.clamp(2 - f, 0, 1);<NEW_LINE>g = MathHelper.clamp(f, 0, 1);<NEW_LINE>b = 0;<NEW_LINE>}<NEW_LINE>bufferBuilder.vertex(matrix, (float) start.x, (float) start.y, (float) start.z).color(r, g, b, 0.5F).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) end.x, (float) end.y, (float) end.z).color(r, g, b, 0.5F).next();<NEW_LINE>}<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>} | .peek().getPositionMatrix(); |
1,635,490 | protected void execute(final Event e) {<NEW_LINE>lastSpawned = null;<NEW_LINE>final Number v = velocity != null ? velocity.getSingle(e) : DEFAULT_SPEED;<NEW_LINE>if (v == null)<NEW_LINE>return;<NEW_LINE>final Direction dir = direction != null ? direction.getSingle(e) : Direction.IDENTITY;<NEW_LINE>if (dir == null)<NEW_LINE>return;<NEW_LINE>for (final Object shooter : shooters.getArray(e)) {<NEW_LINE>for (final EntityData<?> d : types.getArray(e)) {<NEW_LINE>if (shooter instanceof LivingEntity) {<NEW_LINE>final Vector vel = dir.getDirection(((LivingEntity) shooter).getLocation()).multiply(v.doubleValue());<NEW_LINE>final Class<? extends Entity> type = d.getType();<NEW_LINE>if (Fireball.class.isAssignableFrom(type)) {<NEW_LINE>// fireballs explode in the shooter's face by default<NEW_LINE>final Fireball projectile = (Fireball) ((LivingEntity) shooter).getWorld().spawn(((LivingEntity) shooter).getEyeLocation().add(vel.clone().normalize().multiply(0.5)), type);<NEW_LINE>projectile<MASK><NEW_LINE>projectile.setVelocity(vel);<NEW_LINE>lastSpawned = projectile;<NEW_LINE>} else if (Projectile.class.isAssignableFrom(type)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Projectile projectile = ((LivingEntity) shooter).launchProjectile((Class<? extends Projectile>) type);<NEW_LINE>set(projectile, d);<NEW_LINE>projectile.setVelocity(vel);<NEW_LINE>lastSpawned = projectile;<NEW_LINE>} else {<NEW_LINE>final Location loc = ((LivingEntity) shooter).getLocation();<NEW_LINE>loc.setY(loc.getY() + ((LivingEntity) shooter).getEyeHeight() / 2);<NEW_LINE>final Entity projectile = d.spawn(loc);<NEW_LINE>if (projectile != null)<NEW_LINE>projectile.setVelocity(vel);<NEW_LINE>lastSpawned = projectile;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Vector vel = dir.getDirection((Location) shooter).multiply(v.doubleValue());<NEW_LINE>final Entity projectile = d.spawn((Location) shooter);<NEW_LINE>if (projectile != null)<NEW_LINE>projectile.setVelocity(vel);<NEW_LINE>lastSpawned = projectile;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .setShooter((ProjectileSource) shooter); |
248,170 | public static ClientIdentity deserialize(byte[] input) throws IllegalArgumentException, IOException {<NEW_LINE>DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(input));<NEW_LINE>byte header = inputStream.readByte();<NEW_LINE>if (header != CLIENT_IDENTITY_HEADER) {<NEW_LINE>throw new IllegalArgumentException("Incorrect client hello message header");<NEW_LINE>}<NEW_LINE>byte[] ephemeralPublicKey = readFixedSizeArray(inputStream, EPHEMERAL_PUBLIC_KEY_LENGTH, "ephemeral public key");<NEW_LINE>byte[] transcriptSignature = readFixedSizeArray(inputStream, TRANSCRIPT_SIGNATURE_LENGTH, "transcript signature");<NEW_LINE>byte[] signingPublicKey = readFixedSizeArray(inputStream, SIGNING_PUBLIC_KEY_LENGTH, "signing key");<NEW_LINE>byte[] attestationInfo = readVariableSizeArray(inputStream, "attestation info");<NEW_LINE>ClientIdentity clientIdentity = new <MASK><NEW_LINE>clientIdentity.setTranscriptSignature(transcriptSignature);<NEW_LINE>return clientIdentity;<NEW_LINE>} | ClientIdentity(ephemeralPublicKey, signingPublicKey, attestationInfo); |
1,620,344 | public ByteBuf encrypt(ByteBuf message, ByteBufAllocator allocator) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, BadPaddingException, ShortBufferException, IllegalBlockSizeException {<NEW_LINE>Cipher cipher = Cipher.getInstance(algorithm);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);<NEW_LINE>int blockSize = cipher.getBlockSize();<NEW_LINE>int messageLength = message.readableBytes();<NEW_LINE>int encMessageLength = cipher.getOutputSize(messageLength);<NEW_LINE>ByteBuf paddedMessage = null;<NEW_LINE>if (!hasPadding && messageLength == encMessageLength && (encMessageLength % blockSize) != 0) {<NEW_LINE>int paddedMessageSize = messageLength + blockSize - (messageLength % blockSize);<NEW_LINE>paddedMessage = allocator.buffer(paddedMessageSize);<NEW_LINE>paddedMessage.setZero(0, paddedMessageSize);<NEW_LINE>paddedMessage.setBytes(0, message, messageLength);<NEW_LINE>paddedMessage.writerIndex(paddedMessageSize);<NEW_LINE>encMessageLength = cipher.getOutputSize(paddedMessageSize);<NEW_LINE>}<NEW_LINE>ByteBuf encMessage = allocator.buffer(encMessageLength);<NEW_LINE>ByteBuffer nioBuffer = encMessage.nioBuffer(0, encMessageLength);<NEW_LINE>cipher.doFinal(paddedMessage == null ? message.nioBuffer() : <MASK><NEW_LINE>encMessage.writerIndex(encMessageLength);<NEW_LINE>if (paddedMessage != null) {<NEW_LINE>paddedMessage.release();<NEW_LINE>}<NEW_LINE>if (isInitializationVectorRequired) {<NEW_LINE>byte[] ivBytes = cipher.getIV();<NEW_LINE>ByteBuf iv = allocator.buffer(1 + ivBytes.length);<NEW_LINE>iv.writeByte(ivBytes.length).writeBytes(ivBytes);<NEW_LINE>return Unpooled.wrappedBuffer(2, iv, encMessage);<NEW_LINE>} else {<NEW_LINE>return encMessage;<NEW_LINE>}<NEW_LINE>} | paddedMessage.nioBuffer(), nioBuffer); |
1,370,497 | public void testPersistentMessageReceive(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>JMSContext jmsContext = jmsQCFBindings.createContext();<NEW_LINE>JMSConsumer jmsConsumer1 = jmsContext.createConsumer(jmsQueue);<NEW_LINE>JMSConsumer <MASK><NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer();<NEW_LINE>TextMessage recMsg1 = (TextMessage) jmsConsumer1.receive(30000);<NEW_LINE>TextMessage recMsg2 = (TextMessage) jmsConsumer2.receive(30000);<NEW_LINE>if (((recMsg1 == null) || (recMsg1.getText() == null) || !recMsg1.getText().equals("testPersistentMessage_PersistentMsg")) || (recMsg2 != null)) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer1.close();<NEW_LINE>jmsConsumer2.close();<NEW_LINE>jmsContext.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testPersistentMessageReceive failed");<NEW_LINE>}<NEW_LINE>} | jmsConsumer2 = jmsContext.createConsumer(jmsQueue1); |
193,620 | // use our deserializer instead of results toXcontent because the source field is differnet from sourceAsMap.<NEW_LINE>public static XContentBuilder hitsAsXContentBuilder(SearchHits results, MetaSearchResult metaResults) throws IOException {<NEW_LINE>if (results == null)<NEW_LINE>return null;<NEW_LINE>Object[] searchHits;<NEW_LINE>searchHits = new Object[(int) results.getTotalHits().value];<NEW_LINE>int i = 0;<NEW_LINE>for (SearchHit hit : results) {<NEW_LINE>HashMap<String, Object> <MASK><NEW_LINE>value.put("_id", hit.getId());<NEW_LINE>value.put("_type", hit.getType());<NEW_LINE>value.put("_score", hit.getScore());<NEW_LINE>value.put("_source", hit.getSourceAsMap());<NEW_LINE>searchHits[i] = value;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> hits = new HashMap<>();<NEW_LINE>TotalHits totalHits = results.getTotalHits();<NEW_LINE>hits.put("total", ImmutableMap.of("value", totalHits.value, "relation", totalHits.relation == TotalHits.Relation.EQUAL_TO ? "eq" : "gte"));<NEW_LINE>hits.put("max_score", results.getMaxScore());<NEW_LINE>hits.put("hits", searchHits);<NEW_LINE>XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint();<NEW_LINE>builder.startObject();<NEW_LINE>builder.field("took", metaResults.getTookImMilli());<NEW_LINE>builder.field("timed_out", metaResults.isTimedOut());<NEW_LINE>builder.field("_shards", ImmutableMap.of("total", metaResults.getTotalNumOfShards(), "successful", metaResults.getSuccessfulShards(), "failed", metaResults.getFailedShards()));<NEW_LINE>builder.field("hits", hits);<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | value = new HashMap<>(); |
1,072,367 | String assembleLongPollRefreshUrl(String uri, String appId, String cluster, String dataCenter, Map<String, Long> notificationsMap) {<NEW_LINE>Map<String, String> queryParams = Maps.newHashMap();<NEW_LINE>queryParams.put("appId", queryParamEscaper.escape(appId));<NEW_LINE>queryParams.put("cluster", queryParamEscaper.escape(cluster));<NEW_LINE>queryParams.put("notifications", queryParamEscaper.<MASK><NEW_LINE>if (!Strings.isNullOrEmpty(dataCenter)) {<NEW_LINE>queryParams.put("dataCenter", queryParamEscaper.escape(dataCenter));<NEW_LINE>}<NEW_LINE>String localIp = m_configUtil.getLocalIp();<NEW_LINE>if (!Strings.isNullOrEmpty(localIp)) {<NEW_LINE>queryParams.put("ip", queryParamEscaper.escape(localIp));<NEW_LINE>}<NEW_LINE>String params = MAP_JOINER.join(queryParams);<NEW_LINE>if (!uri.endsWith("/")) {<NEW_LINE>uri += "/";<NEW_LINE>}<NEW_LINE>return uri + "notifications/v2?" + params;<NEW_LINE>} | escape(assembleNotifications(notificationsMap))); |
562,715 | public void exitCsz_edit(Csz_editContext ctx) {<NEW_LINE>// If edited item is valid, add/update the entry in VS map<NEW_LINE>String invalidReason = getZoneInvalidReason(_currentZone, _currentZoneNameValid, _c.getInterfaces().keySet());<NEW_LINE>if (invalidReason == null) {<NEW_LINE>// is valid<NEW_LINE>String name = _currentZone.getName();<NEW_LINE>_c.defineStructure(FortiosStructureType.ZONE, name, ctx);<NEW_LINE>_c.referenceStructure(FortiosStructureType.ZONE, name, FortiosStructureUsage.ZONE_SELF_REF, <MASK><NEW_LINE>_c.getZones().put(name, _currentZone);<NEW_LINE>_c.getRenameableObjects().put(_currentZone.getBatfishUUID(), _currentZone);<NEW_LINE>} else {<NEW_LINE>warn(ctx, String.format("Zone edit block ignored: %s", invalidReason));<NEW_LINE>}<NEW_LINE>_currentZone = null;<NEW_LINE>} | ctx.start.getLine()); |
1,117,692 | public void storeFirebaseMessage(RemoteMessage remoteMessage) {<NEW_LINE>try {<NEW_LINE>String remoteMessageString = reactToJSON(remoteMessageToWritableMap(remoteMessage)).toString();<NEW_LINE>// Log.d("storeFirebaseMessage", remoteMessageString);<NEW_LINE>UniversalFirebasePreferences preferences = UniversalFirebasePreferences.getSharedInstance();<NEW_LINE>preferences.setStringValue(remoteMessage.getMessageId(), remoteMessageString);<NEW_LINE>// save new notification id<NEW_LINE>String notifications = <MASK><NEW_LINE>// append to last<NEW_LINE>notifications += remoteMessage.getMessageId() + DELIMITER;<NEW_LINE>// check and remove old notifications message<NEW_LINE>List<String> allNotificationList = convertToArray(notifications);<NEW_LINE>if (allNotificationList.size() > MAX_SIZE_NOTIFICATIONS) {<NEW_LINE>String firstRemoteMessageId = allNotificationList.get(0);<NEW_LINE>preferences.remove(firstRemoteMessageId);<NEW_LINE>notifications = removeRemoteMessage(firstRemoteMessageId, notifications);<NEW_LINE>}<NEW_LINE>preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS, notifications);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, ""); |
282,387 | void configureTransition(@NonNull final ViewGroup container, @Nullable View from, @Nullable View to, @NonNull final Transition transition, boolean isPush) {<NEW_LINE>final View nonExistentView = new <MASK><NEW_LINE>List<View> fromSharedElements = new ArrayList<>();<NEW_LINE>List<View> toSharedElements = new ArrayList<>();<NEW_LINE>configureSharedElements(container, nonExistentView, to, from, isPush, fromSharedElements, toSharedElements);<NEW_LINE>List<View> exitingViews = exitTransition != null ? configureEnteringExitingViews(exitTransition, from, fromSharedElements, nonExistentView) : null;<NEW_LINE>if (exitingViews == null || exitingViews.isEmpty()) {<NEW_LINE>exitTransition = null;<NEW_LINE>}<NEW_LINE>if (enterTransition != null) {<NEW_LINE>enterTransition.addTarget(nonExistentView);<NEW_LINE>}<NEW_LINE>final List<View> enteringViews = new ArrayList<>();<NEW_LINE>scheduleRemoveTargets(transition, enterTransition, enteringViews, exitTransition, exitingViews, sharedElementTransition, toSharedElements);<NEW_LINE>scheduleTargetChange(container, to, nonExistentView, toSharedElements, enteringViews, exitingViews);<NEW_LINE>setNameOverrides(container, toSharedElements);<NEW_LINE>scheduleNameReset(container, toSharedElements);<NEW_LINE>} | View(container.getContext()); |
372,296 | public void marshall(CreateInstancesRequest createInstancesRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createInstancesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getInstanceNames(), INSTANCENAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getAvailabilityZone(), AVAILABILITYZONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getCustomImageName(), CUSTOMIMAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getBlueprintId(), BLUEPRINTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getBundleId(), BUNDLEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getUserData(), USERDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getKeyPairName(), KEYPAIRNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getAddOns(), ADDONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createInstancesRequest.getIpAddressType(), IPADDRESSTYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createInstancesRequest.getTags(), TAGS_BINDING); |
771,987 | private void markupDirectory(ResourceDirectory directory, Address directoryAddr, Address resourceBase, Program program, boolean isBinary, TaskMonitor monitor, MessageLog log) throws IOException, DuplicateNameException, CodeUnitInsertionException {<NEW_LINE>PeUtils.createData(program, directoryAddr, directory.toDataType(), log);<NEW_LINE>directoryAddr = <MASK><NEW_LINE>List<ResourceDirectoryEntry> entries = directory.getEntries();<NEW_LINE>for (ResourceDirectoryEntry entry : entries) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PeUtils.createData(program, directoryAddr, entry.toDataType(), log);<NEW_LINE>directoryAddr = directoryAddr.add(ResourceDirectoryEntry.SIZEOF);<NEW_LINE>ResourceDirectory subDirectory = entry.getSubDirectory();<NEW_LINE>if (subDirectory != null) {<NEW_LINE>Address subDirectoryAddr = resourceBase.add(entry.getOffsetToDirectory());<NEW_LINE>markupDirectory(subDirectory, subDirectoryAddr, resourceBase, program, isBinary, monitor, log);<NEW_LINE>}<NEW_LINE>ResourceDataEntry data = entry.getData();<NEW_LINE>if (data != null) {<NEW_LINE>Address dataAddr = resourceBase.add(entry.getOffsetToData());<NEW_LINE>PeUtils.createData(program, dataAddr, data.toDataType(), log);<NEW_LINE>}<NEW_LINE>ResourceDirectoryStringU string = entry.getDirectoryString();<NEW_LINE>if (string != null && string.getLength() > 0) {<NEW_LINE>Address strAddr = resourceBase.add(entry.getNameOffset() & 0x7fffffff);<NEW_LINE>PeUtils.createData(program, strAddr, string.toDataType(), log);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | directoryAddr.add(ResourceDirectory.SIZEOF); |
242,022 | public ResponseEntity<Void> updatePetWithHttpInfo(Pet body) throws RestClientException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");<NEW_LINE>}<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders localVarHeaderParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[<MASK><NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);<NEW_LINE>} | ] localVarContentTypes = { "application/json", "application/xml" }; |
925,925 | public Answer execute(CreateOrUpdateRecordAndReverseCommand cmd) {<NEW_LINE>boolean needsExport = false;<NEW_LINE>try {<NEW_LINE>Domain domain = searchDomain(cmd.getNetworkDomain(), false);<NEW_LINE>if (domain == null) {<NEW_LINE>domain = _globoDns.getDomainAPI().createDomain(cmd.getNetworkDomain(), cmd.getReverseTemplateId(), DEFAULT_AUTHORITY_TYPE);<NEW_LINE>s_logger.warn("Domain " + cmd.getNetworkDomain() + " doesn't exist, maybe someone removed it. It was automatically created with template " + cmd.getReverseTemplateId());<NEW_LINE>}<NEW_LINE>boolean created = createOrUpdateRecord(domain.getId(), cmd.getRecordName(), cmd.getRecordIp(), IPV4_RECORD_TYPE, cmd.isOverride());<NEW_LINE>if (!created) {<NEW_LINE>String msg = "Unable to create record " + cmd.getRecordName() + " at " + cmd.getNetworkDomain();<NEW_LINE>if (!cmd.isOverride()) {<NEW_LINE>msg += ". Override record option is false, maybe record already exist.";<NEW_LINE>}<NEW_LINE>return new Answer(cmd, false, msg);<NEW_LINE>} else {<NEW_LINE>needsExport = true;<NEW_LINE>}<NEW_LINE>String reverseRecordContent = cmd.getRecordName() + '.' + cmd.getNetworkDomain();<NEW_LINE>if (createOrUpdateReverse(cmd.getRecordIp(), reverseRecordContent, cmd.getReverseTemplateId(), cmd.isOverride())) {<NEW_LINE>needsExport = true;<NEW_LINE>} else {<NEW_LINE>if (!cmd.isOverride()) {<NEW_LINE>String msg = "Unable to create reverse record " + cmd.getRecordName() + " for ip " + cmd.getRecordIp();<NEW_LINE>msg += ". Override record option is false, maybe record already exist.";<NEW_LINE>return new Answer(cmd, false, msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Answer(cmd);<NEW_LINE>} catch (GloboDnsException e) {<NEW_LINE>return new Answer(cmd, <MASK><NEW_LINE>} finally {<NEW_LINE>if (needsExport) {<NEW_LINE>scheduleExportChangesToBind();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | false, e.getMessage()); |
391,097 | // Remove a consumer for a topic<NEW_LINE>public CompletableFuture<Void> removeConsumerAsync(String topicName) {<NEW_LINE>checkArgument(TopicName.isValid(topicName), "Invalid topic name:" + topicName);<NEW_LINE>if (getState() == State.Closing || getState() == State.Closed) {<NEW_LINE>return FutureUtil.failedFuture(new PulsarClientException.AlreadyClosedException("Topics Consumer was already closed"));<NEW_LINE>}<NEW_LINE>CompletableFuture<Void> unsubscribeFuture = new CompletableFuture<>();<NEW_LINE>String topicPartName = TopicName.get(topicName).getPartitionedTopicName();<NEW_LINE>List<ConsumerImpl<T>> consumersToClose = consumers.values().stream().filter(consumer -> {<NEW_LINE>String consumerTopicName = consumer.getTopic();<NEW_LINE>return TopicName.get(consumerTopicName).getPartitionedTopicName().equals(topicPartName);<NEW_LINE>}).<MASK><NEW_LINE>List<CompletableFuture<Void>> futureList = consumersToClose.stream().map(ConsumerImpl::closeAsync).collect(Collectors.toList());<NEW_LINE>FutureUtil.waitForAll(futureList).whenComplete((r, ex) -> {<NEW_LINE>if (ex == null) {<NEW_LINE>consumersToClose.forEach(consumer1 -> {<NEW_LINE>consumers.remove(consumer1.getTopic());<NEW_LINE>pausedConsumers.remove(consumer1);<NEW_LINE>allTopicPartitionsNumber.decrementAndGet();<NEW_LINE>});<NEW_LINE>removeTopic(topicName);<NEW_LINE>((UnAckedTopicMessageTracker) unAckedMessageTracker).removeTopicMessages(topicName);<NEW_LINE>unsubscribeFuture.complete(null);<NEW_LINE>log.info("[{}] [{}] [{}] Removed Topics Consumer, allTopicPartitionsNumber: {}", topicName, subscription, consumerName, allTopicPartitionsNumber);<NEW_LINE>} else {<NEW_LINE>unsubscribeFuture.completeExceptionally(ex);<NEW_LINE>setState(State.Failed);<NEW_LINE>log.error("[{}] [{}] [{}] Could not remove Topics Consumer", topicName, subscription, consumerName, ex.getCause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return unsubscribeFuture;<NEW_LINE>} | collect(Collectors.toList()); |
233,345 | private static Path prepareSandboxRunner(FileSystem fs, RemoteWorkerOptions remoteWorkerOptions) throws InterruptedException {<NEW_LINE>if (OS.getCurrent() != OS.LINUX) {<NEW_LINE>logger.atSevere().log("Sandboxing requested, but it is currently only available on Linux");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>if (remoteWorkerOptions.workPath == null) {<NEW_LINE>logger.atSevere().log("Sandboxing requested, but --work_path was not specified");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>InputStream sandbox = <MASK><NEW_LINE>if (sandbox == null) {<NEW_LINE>logger.atSevere().log("Sandboxing requested, but could not find bundled linux-sandbox binary. " + "Please rebuild a worker_deploy.jar on Linux to make this work");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>Path sandboxPath = null;<NEW_LINE>try {<NEW_LINE>sandboxPath = fs.getPath(remoteWorkerOptions.workPath).getChild("linux-sandbox");<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(sandboxPath.getPathString())) {<NEW_LINE>ByteStreams.copy(sandbox, fos);<NEW_LINE>}<NEW_LINE>sandboxPath.setExecutable(true);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.atSevere().withCause(e).log("Could not extract the bundled linux-sandbox binary to %s", sandboxPath);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>CommandResult cmdResult = null;<NEW_LINE>Command cmd = new Command(LinuxSandboxUtil.commandLineBuilder(sandboxPath, ImmutableList.of("true")).build().toArray(new String[0]), ImmutableMap.of(), sandboxPath.getParentDirectory().getPathFile());<NEW_LINE>try {<NEW_LINE>cmdResult = cmd.execute();<NEW_LINE>} catch (CommandException e) {<NEW_LINE>logger.atSevere().withCause(e).log("Sandboxing requested, but it failed to execute 'true' as a self-check: %s", new String(cmdResult.getStderr(), UTF_8));<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return sandboxPath;<NEW_LINE>} | RemoteWorker.class.getResourceAsStream("/main/tools/linux-sandbox"); |
665,805 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null || !param.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("long" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object result = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (result instanceof Long) {<NEW_LINE>return result;<NEW_LINE>} else if (result instanceof Number) {<NEW_LINE>return new Long(((Number) result).longValue());<NEW_LINE>} else if (result instanceof String) {<NEW_LINE>try {<NEW_LINE>return Long<MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (result instanceof Date) {<NEW_LINE>return new Long(((Date) result).getTime());<NEW_LINE>} else if (result == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("long" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>} | .parseLong((String) result); |
1,076,297 | public static DescribeDomainSrcBpsDataResponse unmarshall(DescribeDomainSrcBpsDataResponse describeDomainSrcBpsDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainSrcBpsDataResponse.setRequestId(_ctx.stringValue("DescribeDomainSrcBpsDataResponse.RequestId"));<NEW_LINE>describeDomainSrcBpsDataResponse.setDomainName<MASK><NEW_LINE>describeDomainSrcBpsDataResponse.setStartTime(_ctx.stringValue("DescribeDomainSrcBpsDataResponse.StartTime"));<NEW_LINE>describeDomainSrcBpsDataResponse.setEndTime(_ctx.stringValue("DescribeDomainSrcBpsDataResponse.EndTime"));<NEW_LINE>describeDomainSrcBpsDataResponse.setDataInterval(_ctx.stringValue("DescribeDomainSrcBpsDataResponse.DataInterval"));<NEW_LINE>List<DataModule> srcBpsDataPerInterval = new ArrayList<DataModule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainSrcBpsDataResponse.SrcBpsDataPerInterval.Length"); i++) {<NEW_LINE>DataModule dataModule = new DataModule();<NEW_LINE>dataModule.setTimeStamp(_ctx.stringValue("DescribeDomainSrcBpsDataResponse.SrcBpsDataPerInterval[" + i + "].TimeStamp"));<NEW_LINE>dataModule.setValue(_ctx.stringValue("DescribeDomainSrcBpsDataResponse.SrcBpsDataPerInterval[" + i + "].Value"));<NEW_LINE>srcBpsDataPerInterval.add(dataModule);<NEW_LINE>}<NEW_LINE>describeDomainSrcBpsDataResponse.setSrcBpsDataPerInterval(srcBpsDataPerInterval);<NEW_LINE>return describeDomainSrcBpsDataResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDomainSrcBpsDataResponse.DomainName")); |
978,260 | public ListHyperParameterTuningJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListHyperParameterTuningJobsResult listHyperParameterTuningJobsResult = new ListHyperParameterTuningJobsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listHyperParameterTuningJobsResult;<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("HyperParameterTuningJobSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listHyperParameterTuningJobsResult.setHyperParameterTuningJobSummaries(new ListUnmarshaller<HyperParameterTuningJobSummary>(HyperParameterTuningJobSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listHyperParameterTuningJobsResult.setNextToken(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 listHyperParameterTuningJobsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,610,786 | public static void aniket() {<NEW_LINE>Scanner scanner = new Scanner(System.in);<NEW_LINE>char[] alpha = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };<NEW_LINE>char turn = 'X';<NEW_LINE>int input;<NEW_LINE>while (true) {<NEW_LINE>do {<NEW_LINE>System.out.print("enter position:");<NEW_LINE>input = scanner.nextInt();<NEW_LINE>} while (alpha[input - 1] == 'X' || alpha[input - 1] == 'O');<NEW_LINE><MASK><NEW_LINE>System.out.println(" " + alpha[6] + " | " + alpha[7] + " | " + alpha[8] + " ");<NEW_LINE>System.out.println("---+---+-----");<NEW_LINE>System.out.println(" " + alpha[3] + " | " + alpha[4] + " | " + alpha[5] + " ");<NEW_LINE>System.out.println("---+---+-----");<NEW_LINE>System.out.println(" " + alpha[0] + " | " + alpha[1] + " | " + alpha[2] + " ");<NEW_LINE>if (alpha[0] == turn && alpha[1] == turn && alpha[2] == turn || alpha[1] == turn && alpha[4] == turn && alpha[7] == turn || alpha[0] == turn && alpha[3] == turn && alpha[6] == turn || alpha[0] == turn && alpha[4] == turn && alpha[8] == turn || alpha[2] == turn && alpha[5] == turn && alpha[8] == turn || alpha[2] == turn && alpha[4] == turn && alpha[6] == turn) {<NEW_LINE>System.out.println(turn + "\twins");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (turn == 'X') {<NEW_LINE>turn = 'O';<NEW_LINE>} else {<NEW_LINE>turn = 'X';<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | alpha[input - 1] = turn; |
233,386 | public static DateTime peekWatermark(BufferedInputStream xmlInput) throws IOException, XmlException {<NEW_LINE>xmlInput.mark(PEEK_SIZE);<NEW_LINE>byte[] peek = new byte[PEEK_SIZE];<NEW_LINE>if (xmlInput.read(peek) != PEEK_SIZE) {<NEW_LINE>throw new IOException(String.format("Failed to peek %,d bytes on input file", PEEK_SIZE));<NEW_LINE>}<NEW_LINE>xmlInput.reset();<NEW_LINE>String peekStr = new String(peek, UTF_8);<NEW_LINE>if (!peekStr.contains("urn:ietf:params:xml:ns:rde-1.0")) {<NEW_LINE>throw new XmlException(String.format("Does not appear to be an XML RDE deposit\n%s", dumpHex(peek)));<NEW_LINE>}<NEW_LINE>if (!peekStr.contains("type=\"FULL\"")) {<NEW_LINE>throw new XmlException("Only FULL XML RDE deposits suppported at this time");<NEW_LINE>}<NEW_LINE>Matcher watermarkMatcher = WATERMARK_PATTERN.matcher(peekStr);<NEW_LINE>if (!watermarkMatcher.find()) {<NEW_LINE>throw new XmlException("Could not find RDE watermark in XML");<NEW_LINE>}<NEW_LINE>return DATETIME_FORMATTER.parseDateTime<MASK><NEW_LINE>} | (watermarkMatcher.group(1)); |
521,890 | public static ImmutableListMultimap<LocalDate, LegalEntityCurveGroup> parse(Predicate<LocalDate> datePredicate, CharSource groupsCharSource, CharSource settingsCharSource, Collection<CharSource> curveValueCharSources) {<NEW_LINE>Map<CurveGroupName, Map<Pair<RepoGroup, Currency>, CurveName>> repoGroups = new LinkedHashMap<>();<NEW_LINE>Map<CurveGroupName, Map<Pair<LegalEntityGroup, Currency>, CurveName>> legalEntityGroups = new LinkedHashMap<>();<NEW_LINE>parseCurveMaps(groupsCharSource, repoGroups, legalEntityGroups);<NEW_LINE>Map<LocalDate, Map<CurveName, Curve>> allCurves = parseCurves(datePredicate, settingsCharSource, curveValueCharSources);<NEW_LINE>ImmutableListMultimap.Builder<LocalDate, LegalEntityCurveGroup<MASK><NEW_LINE>for (Map.Entry<LocalDate, Map<CurveName, Curve>> curveEntry : allCurves.entrySet()) {<NEW_LINE>LocalDate date = curveEntry.getKey();<NEW_LINE>Map<CurveName, Curve> curves = curveEntry.getValue();<NEW_LINE>for (Map.Entry<CurveGroupName, Map<Pair<RepoGroup, Currency>, CurveName>> repoEntry : repoGroups.entrySet()) {<NEW_LINE>CurveGroupName groupName = repoEntry.getKey();<NEW_LINE>Map<Pair<RepoGroup, Currency>, Curve> repoCurves = MapStream.of(repoEntry.getValue()).mapValues(name -> queryCurve(name, curves, date, groupName, "Repo")).toMap();<NEW_LINE>Map<Pair<LegalEntityGroup, Currency>, Curve> issuerCurves = MapStream.of(legalEntityGroups.get(groupName)).mapValues(name -> queryCurve(name, curves, date, groupName, "Issuer")).toMap();<NEW_LINE>builder.put(date, LegalEntityCurveGroup.of(groupName, repoCurves, issuerCurves));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | > builder = ImmutableListMultimap.builder(); |
1,545,507 | private void cmd_Ok() {<NEW_LINE>log.config("OK=" + true);<NEW_LINE>m_ok = true;<NEW_LINE>saveResultSelection(detail);<NEW_LINE>saveSelection(detail);<NEW_LINE>// Is Process ok<NEW_LINE>boolean isOk = false;<NEW_LINE>// Valid Process, Selected Keys and process parameters<NEW_LINE>if (getAD_Process_ID() > 0 && getSelectedKeys() != null) {<NEW_LINE>parameterPanel.getProcessInfo().setAD_PInstance_ID(-1);<NEW_LINE>// FR [ 265 ]<NEW_LINE>if (parameterPanel.validateParameters() == null) {<NEW_LINE>// Save Parameters<NEW_LINE>if (parameterPanel.saveParameters() == null) {<NEW_LINE>// Get Process Info<NEW_LINE>ProcessInfo pi = parameterPanel.getProcessInfo();<NEW_LINE>if (getFieldKey() != null && getFieldKey().get_ID() > 0) {<NEW_LINE>MViewDefinition viewDefinition = (MViewDefinition) getFieldKey().getAD_View_Column().getAD_View_Definition();<NEW_LINE>pi.<MASK><NEW_LINE>pi.setTableSelectionId(viewDefinition.getAD_Table_ID());<NEW_LINE>}<NEW_LINE>// Set Selected Values<NEW_LINE>pi.setSelectionValues(getSelectedValues());<NEW_LINE>//<NEW_LINE>setBrowseProcessInfo(pi);<NEW_LINE>// Execute Process<NEW_LINE>ProcessCtl worker = new ProcessCtl(this, pi.getWindowNo(), pi, null);<NEW_LINE>showBusyDialog();<NEW_LINE>worker.run();<NEW_LINE>hideBusyDialog();<NEW_LINE>setStatusLine(pi.getSummary(), pi.isError());<NEW_LINE>// For Valid Ok<NEW_LINE>isOk = !pi.isError();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// For when is ok the process<NEW_LINE>if (isOk) {<NEW_LINE>// Close<NEW_LINE>if (getParentWindowNo() > 0) {<NEW_LINE>// BR [ 394 ]<NEW_LINE>Env.clearWinContext(getWindowNo());<NEW_LINE>SessionManager.getAppDesktop().closeActiveWindow();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Else Reset<NEW_LINE>loadedOK = initBrowser();<NEW_LINE>collapsibleSeach.setOpen(true);<NEW_LINE>}<NEW_LINE>} | setAliasForTableSelection(viewDefinition.getTableAlias()); |
1,028,278 | public void run(TaskMonitor monitor) throws CancelledException {<NEW_LINE>FileSystemService fsService = FileSystemService.getInstance();<NEW_LINE>String locInfo = "\"" + projectLocator.toString() + "\" from \"" + projectArchiveFile.getAbsolutePath() + "\"";<NEW_LINE>if (projectFile.exists() || projectDir.exists()) {<NEW_LINE>Msg.showError(this, null, "Restore Archive Error", "Project already exists at: " + projectDir);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FSRL archiveFSRL = fsService.getLocalFSRL(projectArchiveFile);<NEW_LINE>try (GFileSystem fs = fsService.openFileSystemContainer(archiveFSRL, monitor)) {<NEW_LINE>verifyArchive(fs, monitor);<NEW_LINE>startExtract(fs, null, monitor);<NEW_LINE>createProjectMarkerFile();<NEW_LINE>openRestoredProject();<NEW_LINE>Msg.info(<MASK><NEW_LINE>} catch (CancelledException ce) {<NEW_LINE>plugin.cleanupRestoredProject(projectLocator);<NEW_LINE>Msg.info(this, "Restore Archive: " + locInfo + " was cancelled by user.");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>plugin.cleanupRestoredProject(projectLocator);<NEW_LINE>String eMsg = (e.getMessage() != null) ? ":\n\n" + e.getMessage() : "";<NEW_LINE>Msg.showError(this, null, "Restore Archive Failed", "An error occurred when restoring the project archive\n " + projectArchiveFile + " to \n " + projectDir + eMsg, e);<NEW_LINE>Msg.info(this, "Restore Archive: " + locInfo + " failed.");<NEW_LINE>}<NEW_LINE>} | this, "Restore Archive: " + locInfo + " succeeded."); |
1,090,459 | public I_PP_Order_Candidate execute() {<NEW_LINE>// Create PP Order Candidate<NEW_LINE>final I_PP_Order_Candidate ppOrderCandidateRecord = InterfaceWrapperHelper.newInstance(I_PP_Order_Candidate.class);<NEW_LINE>PPOrderCandidatePojoConverter.setMaterialDispoGroupId(ppOrderCandidateRecord, request.getMaterialDispoGroupId());<NEW_LINE>ppOrderCandidateRecord.setPP_Product_Planning_ID(ProductPlanningId.toRepoId(request.getProductPlanningId()));<NEW_LINE>ppOrderCandidateRecord.setAD_Org_ID(request.getClientAndOrgId().getOrgId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setS_Resource_ID(request.getPlantId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setM_Warehouse_ID(request.<MASK><NEW_LINE>ppOrderCandidateRecord.setM_Product_ID(request.getProductId().getRepoId());<NEW_LINE>final I_PP_Product_BOM bom = getBOM(request.getProductPlanningId());<NEW_LINE>ppOrderCandidateRecord.setPP_Product_BOM_ID(bom.getPP_Product_BOM_ID());<NEW_LINE>if (bom.getM_AttributeSetInstance_ID() > 0) {<NEW_LINE>ppOrderCandidateRecord.setM_AttributeSetInstance_ID(bom.getM_AttributeSetInstance_ID());<NEW_LINE>} else {<NEW_LINE>ppOrderCandidateRecord.setM_AttributeSetInstance_ID(request.getAttributeSetInstanceId().getRepoId());<NEW_LINE>}<NEW_LINE>ppOrderCandidateRecord.setDatePromised(TimeUtil.asTimestamp(request.getDatePromised()));<NEW_LINE>ppOrderCandidateRecord.setDateStartSchedule(TimeUtil.asTimestamp(request.getDateStartSchedule()));<NEW_LINE>final Quantity qtyRounded = request.getQtyRequired().roundToUOMPrecision();<NEW_LINE>ppOrderCandidateRecord.setQtyEntered(qtyRounded.toBigDecimal());<NEW_LINE>ppOrderCandidateRecord.setC_UOM_ID(qtyRounded.getUomId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setC_OrderLine_ID(OrderLineId.toRepoId(request.getSalesOrderLineId()));<NEW_LINE>ppOrderCandidateRecord.setM_ShipmentSchedule_ID(ShipmentScheduleId.toRepoId(request.getShipmentScheduleId()));<NEW_LINE>ppOrderCandidateDAO.save(ppOrderCandidateRecord);<NEW_LINE>Loggables.addLog("Created ppOrderCandidate; PP_Order_Candidate_ID={}", ppOrderCandidateRecord.getPP_Order_Candidate_ID());<NEW_LINE>return ppOrderCandidateRecord;<NEW_LINE>} | getWarehouseId().getRepoId()); |
1,497,642 | void checkConcreteInheritedMethod(MethodBinding concreteMethod, MethodBinding[] abstractMethods) {<NEW_LINE>super.checkConcreteInheritedMethod(concreteMethod, abstractMethods);<NEW_LINE>boolean analyseNullAnnotations = this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled;<NEW_LINE>// TODO (stephan): unclear if this srcMethod is actually needed<NEW_LINE>AbstractMethodDeclaration srcMethod = null;<NEW_LINE>if (// is currentMethod from the current type?<NEW_LINE>analyseNullAnnotations && this.type.equals(concreteMethod.declaringClass))<NEW_LINE>srcMethod = concreteMethod.sourceMethod();<NEW_LINE>boolean hasReturnNonNullDefault = analyseNullAnnotations && concreteMethod.hasNonNullDefaultForReturnType(srcMethod);<NEW_LINE>ParameterNonNullDefaultProvider hasParameterNonNullDefault = analyseNullAnnotations ? concreteMethod.hasNonNullDefaultForParameter(srcMethod) : ParameterNonNullDefaultProvider.FALSE_PROVIDER;<NEW_LINE>for (int i = 0, l = abstractMethods.length; i < l; i++) {<NEW_LINE>MethodBinding abstractMethod = abstractMethods[i];<NEW_LINE>if (concreteMethod.isVarargs() != abstractMethod.isVarargs())<NEW_LINE>problemReporter().varargsConflict(concreteMethod, abstractMethod, this.type);<NEW_LINE>// so the parameters are equal and the return type is compatible b/w the currentMethod & the substituted inheritedMethod<NEW_LINE><MASK><NEW_LINE>if (TypeBinding.notEquals(originalInherited.returnType, concreteMethod.returnType))<NEW_LINE>if (!isAcceptableReturnTypeOverride(concreteMethod, abstractMethod))<NEW_LINE>problemReporter().unsafeReturnTypeOverride(concreteMethod, originalInherited, this.type);<NEW_LINE>// check whether bridge method is already defined above for interface methods<NEW_LINE>// skip generation of bridge method for current class & method if an equivalent<NEW_LINE>// bridge will be/would have been generated in the context of the super class since<NEW_LINE>// the bridge itself will be inherited. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=298362<NEW_LINE>if (originalInherited.declaringClass.isInterface()) {<NEW_LINE>if ((TypeBinding.equalsEquals(concreteMethod.declaringClass, this.type.superclass) && this.type.superclass.isParameterizedType() && !areMethodsCompatible(concreteMethod, originalInherited)) || this.type.superclass.erasure().findSuperTypeOriginatingFrom(originalInherited.declaringClass) == null)<NEW_LINE>this.type.addSyntheticBridgeMethod(originalInherited, concreteMethod.original());<NEW_LINE>}<NEW_LINE>if (analyseNullAnnotations && !concreteMethod.isStatic() && !abstractMethod.isStatic()) {<NEW_LINE>checkNullSpecInheritance(concreteMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, true, abstractMethod, abstractMethods, this.type.scope, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | MethodBinding originalInherited = abstractMethod.original(); |
621,767 | public boolean onContextItemSelected(MenuItem item) {<NEW_LINE>ContextMenuAwareRecyclerView.RecyclerContextMenuInfo info = (ContextMenuAwareRecyclerView.RecyclerContextMenuInfo) item.getMenuInfo();<NEW_LINE>if (info.position >= mAdapter.getItemCount()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int id = item.getItemId();<NEW_LINE>GitHubEvent event = mAdapter.getItemFromAdapterPosition(info.position);<NEW_LINE>if (id >= MENU_DOWNLOAD_START && id <= MENU_DOWNLOAD_END) {<NEW_LINE>if (event.type() == GitHubEventType.ReleaseEvent) {<NEW_LINE>ReleasePayload payload = (ReleasePayload) event.payload();<NEW_LINE>ReleaseAsset asset = payload.release().assets(<MASK><NEW_LINE>DownloadUtils.enqueueDownloadWithPermissionCheck((BaseActivity) getActivity(), asset);<NEW_LINE>} else if (event.type() == GitHubEventType.DownloadEvent) {<NEW_LINE>DownloadPayload payload = (DownloadPayload) event.payload();<NEW_LINE>Download download = payload.download();<NEW_LINE>DownloadUtils.enqueueDownloadWithPermissionCheck((BaseActivity) getActivity(), download);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Intent intent = item.getIntent();<NEW_LINE>if (intent != null) {<NEW_LINE>getActivity().startActivity(intent);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ).get(id - MENU_DOWNLOAD_START); |
1,510,678 | private JTabbedPane createTabs() {<NEW_LINE>JTabbedPane tp = new JTabbedPane(JTabbedPane.BOTTOM) {<NEW_LINE><NEW_LINE>protected final void fireStateChanged() {<NEW_LINE>super.fireStateChanged();<NEW_LINE>fireViewOrIndexChanged();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>tp.setOpaque(false);<NEW_LINE>if (UIUtils.isAquaLookAndFeel()) {<NEW_LINE>tp.setBorder(BorderFactory.createEmptyBorder(-13, -11, 0, -10));<NEW_LINE>} else {<NEW_LINE>tp.<MASK><NEW_LINE>// NOI18N<NEW_LINE>Insets i = UIManager.getInsets("TabbedPane.contentBorderInsets");<NEW_LINE>int bottomOffset = 0;<NEW_LINE>if (UIUtils.isMetalLookAndFeel()) {<NEW_LINE>bottomOffset = -i.bottom + 1;<NEW_LINE>} else if (UIUtils.isWindowsLookAndFeel()) {<NEW_LINE>bottomOffset = -i.bottom;<NEW_LINE>}<NEW_LINE>if (i != null)<NEW_LINE>tp.setBorder(BorderFactory.createEmptyBorder(-i.top, -i.left, bottomOffset, -i.right));<NEW_LINE>}<NEW_LINE>// Fix for Issue 115062 (CTRL-PageUp/PageDown should move between snapshot tabs)<NEW_LINE>// NOI18N<NEW_LINE>tp.getActionMap().getParent().remove("navigatePageUp");<NEW_LINE>// NOI18N<NEW_LINE>tp.getActionMap().getParent().remove("navigatePageDown");<NEW_LINE>// support for traversing subtabs using Ctrl-Alt-PgDn/PgUp<NEW_LINE>getActionMap().put("PreviousViewAction", new // NOI18N<NEW_LINE>AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>selectPreviousFeature();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>getActionMap().put("NextViewAction", new // NOI18N<NEW_LINE>AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>selectNextFeature();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return tp;<NEW_LINE>} | setBorder(BorderFactory.createEmptyBorder()); |
1,020,024 | public RestLiResponse buildResponse(RoutingResult routingResult, RestLiResponseData<BatchCreateResponseEnvelope> responseData) {<NEW_LINE>List<BatchCreateResponseEnvelope.CollectionCreateResponseItem> collectionCreateResponses = responseData<MASK><NEW_LINE>List<CreateIdStatus<Object>> formattedResponses = new ArrayList<>(collectionCreateResponses.size());<NEW_LINE>// Iterate through the responses and generate the ErrorResponse with the appropriate override for exceptions.<NEW_LINE>// Otherwise, add the result as is.<NEW_LINE>for (BatchCreateResponseEnvelope.CollectionCreateResponseItem response : collectionCreateResponses) {<NEW_LINE>if (response.isErrorResponse()) {<NEW_LINE>RestLiServiceException exception = response.getException();<NEW_LINE>formattedResponses.add(new CreateIdStatus<>(exception.getStatus().getCode(), response.getId(), _errorResponseBuilder.buildErrorResponse(exception), ProtocolVersionUtil.extractProtocolVersion(responseData.getHeaders())));<NEW_LINE>} else {<NEW_LINE>formattedResponses.add((CreateIdStatus<Object>) response.getRecord());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RestLiResponse.Builder builder = new RestLiResponse.Builder();<NEW_LINE>BatchCreateIdResponse<Object> batchCreateIdResponse = new BatchCreateIdResponse<>(formattedResponses);<NEW_LINE>return builder.headers(responseData.getHeaders()).cookies(responseData.getCookies()).entity(batchCreateIdResponse).build();<NEW_LINE>} | .getResponseEnvelope().getCreateResponses(); |
122,186 | void ensureExistingComponentRemoved(ComponentInfo info) throws IOException {<NEW_LINE>String componentId = info.getId();<NEW_LINE>ComponentInfo oldInfo = input.getLocalRegistry().loadSingleComponent(componentId, true);<NEW_LINE>if (oldInfo == null) {<NEW_LINE>feedback.output("INSTALL_InstallNewComponent", info.getId(), info.getName(<MASK><NEW_LINE>} else {<NEW_LINE>Uninstaller uninstaller = new Uninstaller(feedback, input.getFileOperations(), oldInfo, input.getLocalRegistry());<NEW_LINE>uninstaller.setInstallPath(input.getGraalHomePath());<NEW_LINE>uninstaller.setDryRun(input.optValue(Commands.OPTION_DRY_RUN) != null);<NEW_LINE>uninstaller.setPreservePaths(new HashSet<>(input.getLocalRegistry().getPreservedFiles(oldInfo)));<NEW_LINE>feedback.output("INSTALL_RemoveExistingComponent", oldInfo.getId(), oldInfo.getName(), oldInfo.getVersionString(), info.getId(), info.getName(), info.getVersionString());<NEW_LINE>uninstaller.uninstall();<NEW_LINE>}<NEW_LINE>} | ), info.getVersionString()); |
1,059,343 | private static void addUtilityMethods(SrcClass clazz, JavascriptModel model, ClassNode classNode, String fqn) {<NEW_LINE>long uid = incUid();<NEW_LINE>IFile file = JavascriptProgram.loadSrcForName(model, fqn, JavascriptTypeManifold.JS);<NEW_LINE>String url;<NEW_LINE>try {<NEW_LINE>url = file.toURI()<MASK><NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>String content = ResourceFileTypeManifold.getContent(file);<NEW_LINE>content = ManEscapeUtil.escapeForJavaStringLiteral(content);<NEW_LINE>SrcMethod m = new SrcMethod().name("getScope").modifiers(Modifier.PRIVATE | Modifier.STATIC).returns(ScriptableObject.class).body("if(" + uid + "L != UID) {\n" + " synchronized(" + classNode.getName() + ".class) {\n" + " if(" + uid + "L != UID) {\n" + " UID = " + uid + "L;\n" + " SCOPE = " + JsRuntime.class.getSimpleName() + ".init(\"" + fqn + "\", \"" + content + "\", \"" + url + "\");\n" + " }\n" + " }\n" + " }\n" + " return SCOPE;");<NEW_LINE>clazz.addMethod(m);<NEW_LINE>} | .toURL().toString(); |
864,802 | protected JComponent createNorthPanel() {<NEW_LINE>final JPanel result = new JPanel();<NEW_LINE>result.setLayout(new BoxLayout(result, BoxLayout.Y_AXIS));<NEW_LINE>final List<NamedScope> scopeList = new ArrayList<NamedScope>();<NEW_LINE>final Project project = myManager.getProject();<NEW_LINE>final NamedScopesHolder[] scopeHolders = NamedScopeManager.getAllNamedScopeHolders(project);<NEW_LINE>for (final NamedScopesHolder scopeHolder : scopeHolders) {<NEW_LINE>final NamedScope[] scopes = scopeHolder.getScopes();<NEW_LINE>Collections.addAll(scopeList, scopes);<NEW_LINE>}<NEW_LINE>CustomScopesProviderEx.filterNoSettingsScopes(project, scopeList);<NEW_LINE>for (final NamedScope scope : scopeList) {<NEW_LINE>myScopeNames.put(scope.getName(), scope);<NEW_LINE>}<NEW_LINE>myScopeComboBox = new JComboBox(ArrayUtil.toStringArray(myScopeNames.keySet()));<NEW_LINE>myScopeComboBox.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>updateCustomButton();<NEW_LINE>updateOKButton();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final JPanel pathPanel = new JPanel();<NEW_LINE>pathPanel.setLayout(new BorderLayout());<NEW_LINE>final JLabel pathLabel = new JLabel("Scope:");<NEW_LINE>pathLabel.setDisplayedMnemonic('S');<NEW_LINE>pathLabel.setLabelFor(myScopeComboBox);<NEW_LINE>pathPanel.add(pathLabel, BorderLayout.WEST);<NEW_LINE>pathPanel.add(myScopeComboBox, BorderLayout.CENTER);<NEW_LINE>result.add(pathPanel);<NEW_LINE>final JPanel colorPanel = new JPanel();<NEW_LINE>colorPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));<NEW_LINE>colorPanel.setLayout(new BoxLayout(colorPanel, BoxLayout.X_AXIS));<NEW_LINE>final <MASK><NEW_LINE>colorPanel.add(colorLabel);<NEW_LINE>colorPanel.add(createColorButtonsPanel(myConfiguration));<NEW_LINE>colorPanel.add(Box.createHorizontalGlue());<NEW_LINE>result.add(colorPanel);<NEW_LINE>return result;<NEW_LINE>} | JLabel colorLabel = new JLabel("Color:"); |
1,556,029 | public void run(Debugger context, CommandArguments args, Document result) {<NEW_LINE>DebugTick tick = context.getRegisteredTick();<NEW_LINE>Element response = createResponse(args, result);<NEW_LINE>response.setAttribute("encoding", "base64");<NEW_LINE>String varName = args.get("n");<NEW_LINE>if (varName.startsWith("$")) {<NEW_LINE>varName = varName.substring(1);<NEW_LINE>}<NEW_LINE>ArrayMemory locals = tick.getLocals();<NEW_LINE>if (!locals.containsKey(varName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ContextValueProvider <MASK><NEW_LINE>if (provider.getMaxData() != 0 && args.containsKey("m")) {<NEW_LINE>try {<NEW_LINE>provider.setMaxData(Integer.parseInt(args.get("m")));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Element property = provider.getProperty(null, locals.valueOfIndex(varName));<NEW_LINE>response.setAttribute("size", property.getAttribute("size"));<NEW_LINE>response.appendChild(property.getFirstChild());<NEW_LINE>} | provider = getContextValueProvider(context, result); |
1,287,343 | public void marshall(StreamInfo streamInfo, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (streamInfo.getDeviceName() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("DeviceName");<NEW_LINE>jsonWriter.value(deviceName);<NEW_LINE>}<NEW_LINE>if (streamInfo.getStreamName() != null) {<NEW_LINE>String streamName = streamInfo.getStreamName();<NEW_LINE>jsonWriter.name("StreamName");<NEW_LINE>jsonWriter.value(streamName);<NEW_LINE>}<NEW_LINE>if (streamInfo.getStreamARN() != null) {<NEW_LINE>String streamARN = streamInfo.getStreamARN();<NEW_LINE>jsonWriter.name("StreamARN");<NEW_LINE>jsonWriter.value(streamARN);<NEW_LINE>}<NEW_LINE>if (streamInfo.getMediaType() != null) {<NEW_LINE>String mediaType = streamInfo.getMediaType();<NEW_LINE>jsonWriter.name("MediaType");<NEW_LINE>jsonWriter.value(mediaType);<NEW_LINE>}<NEW_LINE>if (streamInfo.getKmsKeyId() != null) {<NEW_LINE>String kmsKeyId = streamInfo.getKmsKeyId();<NEW_LINE>jsonWriter.name("KmsKeyId");<NEW_LINE>jsonWriter.value(kmsKeyId);<NEW_LINE>}<NEW_LINE>if (streamInfo.getVersion() != null) {<NEW_LINE>String version = streamInfo.getVersion();<NEW_LINE>jsonWriter.name("Version");<NEW_LINE>jsonWriter.value(version);<NEW_LINE>}<NEW_LINE>if (streamInfo.getStatus() != null) {<NEW_LINE>String status = streamInfo.getStatus();<NEW_LINE>jsonWriter.name("Status");<NEW_LINE>jsonWriter.value(status);<NEW_LINE>}<NEW_LINE>if (streamInfo.getCreationTime() != null) {<NEW_LINE>java.util.Date creationTime = streamInfo.getCreationTime();<NEW_LINE>jsonWriter.name("CreationTime");<NEW_LINE>jsonWriter.value(creationTime);<NEW_LINE>}<NEW_LINE>if (streamInfo.getDataRetentionInHours() != null) {<NEW_LINE>Integer dataRetentionInHours = streamInfo.getDataRetentionInHours();<NEW_LINE>jsonWriter.name("DataRetentionInHours");<NEW_LINE>jsonWriter.value(dataRetentionInHours);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | String deviceName = streamInfo.getDeviceName(); |
333,559 | public static void omitEmptyArrays(JsonArray clients) {<NEW_LINE>if (clients == null || clients.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<JsonObject> clientObjs = OidcOAuth20Util.getListOfJsonObjects(clients);<NEW_LINE>if (clientObjs == null || clientObjs.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (JsonObject clientObj : clientObjs) {<NEW_LINE>OidcBaseClient client = GSON.<MASK><NEW_LINE>if (OidcOAuth20Util.isNullEmpty(client.getRedirectUris())) {<NEW_LINE>clientObj.remove(OIDCConstants.OIDC_CLIENTREG_REDIRECT_URIS);<NEW_LINE>}<NEW_LINE>if (OidcOAuth20Util.isNullEmpty(client.getPostLogoutRedirectUris())) {<NEW_LINE>clientObj.remove(OIDCConstants.OIDC_CLIENTREG_POST_LOGOUT_URIS);<NEW_LINE>}<NEW_LINE>if (OidcOAuth20Util.isNullEmpty(client.getTrustedUriPrefixes())) {<NEW_LINE>clientObj.remove(OIDCConstants.JSA_CLIENTREG_TRUSTED_URI_PREFIXES);<NEW_LINE>}<NEW_LINE>if (OidcOAuth20Util.isNullEmpty(client.getFunctionalUserGroupIds())) {<NEW_LINE>clientObj.remove(OIDCConstants.JSA_CLIENTREG_FUNCTIONAL_USER_GROUP_IDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fromJson(clientObj, OidcBaseClient.class); |
938,674 | public AssociationStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociationStatus associationStatus = new AssociationStatus();<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>if (context.testExpression("Date", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AdditionalInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setAdditionalInfo(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 associationStatus;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,675,995 | public void registerExternalVocabValues(DatasetField df) {<NEW_LINE>DatasetFieldType dft = df.getDatasetFieldType();<NEW_LINE>logger.fine("Registering for field: " + dft.getName());<NEW_LINE>JsonObject cvocEntry = getCVocConf(false).get(dft.getId());<NEW_LINE>if (dft.isPrimitive()) {<NEW_LINE>for (DatasetFieldValue dfv : df.getDatasetFieldValues()) {<NEW_LINE>registerExternalTerm(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (df.getDatasetFieldType().isCompound()) {<NEW_LINE>DatasetFieldType termdft = findByNameOpt(cvocEntry.getString("term-uri-field"));<NEW_LINE>for (DatasetFieldCompoundValue cv : df.getDatasetFieldCompoundValues()) {<NEW_LINE>for (DatasetField cdf : cv.getChildDatasetFields()) {<NEW_LINE>logger.fine("Found term uri field type id: " + cdf.getDatasetFieldType().getId());<NEW_LINE>if (cdf.getDatasetFieldType().equals(termdft)) {<NEW_LINE>registerExternalTerm(cvocEntry, cdf.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | cvocEntry, dfv.getValue()); |
368,169 | public static ThreadFactory[] createThreadFactories(Supplier<ThreadLocalStreamBufferPool> bufferPoolSupplier) {<NEW_LINE>List<ThreadFactory> threadFactories = new LinkedList<>();<NEW_LINE>if (IS_BENCHMARK_DEBUG) {<NEW_LINE>// Simple threading for debug<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < Runtime.getRuntime().availableProcessors(); i++) {<NEW_LINE>threadFactories.add((runnable) -> new Thread(() -> {<NEW_LINE>ThreadLocalStreamBufferPool bufferPool = bufferPoolSupplier.get();<NEW_LINE>try {<NEW_LINE>bufferPool.activeThreadLocalPooling();<NEW_LINE>runnable.run();<NEW_LINE>} finally {<NEW_LINE>bufferPool.threadComplete();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Provide socket per thread with thread affinity<NEW_LINE>for (CpuCore cpuCore : CpuCore.getCores()) {<NEW_LINE>for (CpuCore.LogicalCpu logicalCpu : cpuCore.getCpus()) {<NEW_LINE>// Create thread factory for logical CPU<NEW_LINE>ThreadFactory boundThreadFactory = (runnable) -> new Thread(() -> {<NEW_LINE>ThreadLocalStreamBufferPool bufferPool = bufferPoolSupplier.get();<NEW_LINE>try {<NEW_LINE>// Bind thread to logical CPU<NEW_LINE>Affinity.setAffinity(logicalCpu.getCpuAffinity());<NEW_LINE>// Set up for thread local buffer pooling<NEW_LINE>bufferPool.activeThreadLocalPooling();<NEW_LINE>// Run logic for thread<NEW_LINE>runnable.run();<NEW_LINE>} finally {<NEW_LINE>bufferPool.threadComplete();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Add the thread factory<NEW_LINE>threadFactories.add(boundThreadFactory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return threadFactories.toArray(new ThreadFactory[0]);<NEW_LINE>} | System.out.println("\n\nWARNING: using debug mode so performance will suffer\n\n"); |
748,380 | private Unmarshaller createUnmarshaller() {<NEW_LINE>try {<NEW_LINE>Unmarshaller um = databinding.getJAXBUnmarshaller();<NEW_LINE>if (setEventHandler) {<NEW_LINE>um.setEventHandler(new WSUIDValidationHandler(veventHandler));<NEW_LINE>}<NEW_LINE>// If the unmarshaller has already been filled with all the initializing properties<NEW_LINE>// and attributes, we don't have to set again.<NEW_LINE>if (um.getAttachmentUnmarshaller() == null) {<NEW_LINE>if (databinding.getUnmarshallerListener() != null) {<NEW_LINE>um.setListener(databinding.getUnmarshallerListener());<NEW_LINE>}<NEW_LINE>if (databinding.getUnmarshallerProperties() != null) {<NEW_LINE>for (Map.Entry<String, Object> propEntry : databinding.getUnmarshallerProperties().entrySet()) {<NEW_LINE>try {<NEW_LINE>um.setProperty(propEntry.getKey(), propEntry.getValue());<NEW_LINE>} catch (PropertyException pe) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>um.setSchema(schema);<NEW_LINE>um.setAttachmentUnmarshaller(getAttachmentUnmarshaller());<NEW_LINE>return um;<NEW_LINE>} catch (JAXBException ex) {<NEW_LINE>if (ex instanceof javax.xml.bind.UnmarshalException) {<NEW_LINE>javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException) ex;<NEW_LINE>throw new Fault(new Message("UNMARSHAL_ERROR", LOG, unmarshalEx.getLinkedException().getMessage()), ex);<NEW_LINE>} else {<NEW_LINE>throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Level.INFO, "PropertyException setting Marshaller properties", pe); |
339,679 | private Predicate workCompletedPredicate_application(CriteriaBuilder cb, Root<WorkCompleted> root) throws Exception {<NEW_LINE>List<String> _application_ids = ListTools.extractField(this.applicationList, Application.id_FIELDNAME, String.class, true, true);<NEW_LINE>List<String> _application_names = ListTools.extractField(this.applicationList, Application.name_FIELDNAME, String.class, true, true);<NEW_LINE>List<String> _application_alias = ListTools.extractField(this.applicationList, Application.alias_FIELDNAME, String.class, true, true);<NEW_LINE>List<String> _process_ids = ListTools.extractField(this.processList, Process.id_FIELDNAME, String.class, true, true);<NEW_LINE>List<String> _process_names = ListTools.extractField(this.processList, Process.name_FIELDNAME, String.class, true, true);<NEW_LINE>List<String> _process_alias = ListTools.extractField(this.processList, Process.alias_FIELDNAME, String.class, true, true);<NEW_LINE>_application_ids = _application_ids.stream().filter(o -> {<NEW_LINE>return StringUtils.isNotEmpty(o);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>_application_names = _application_names.stream().filter(o -> {<NEW_LINE>return StringUtils.isNotEmpty(o);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>_application_alias = _application_alias.stream().filter(o -> {<NEW_LINE>return StringUtils.isNotEmpty(o);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>_process_ids = _process_ids.stream().filter(o -> {<NEW_LINE>return StringUtils.isNotEmpty(o);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>_process_names = _process_names.stream().filter(o -> {<NEW_LINE>return StringUtils.isNotEmpty(o);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>_process_alias = _process_alias.stream().filter(o -> {<NEW_LINE>return StringUtils.isNotEmpty(o);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>if (_application_ids.isEmpty() && _application_names.isEmpty() && _application_alias.isEmpty() && _process_ids.isEmpty() && _process_names.isEmpty() && _process_alias.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Predicate p = cb.disjunction();<NEW_LINE>if (!_application_ids.isEmpty()) {<NEW_LINE>p = cb.or(p, root.get(WorkCompleted_.application).in(_application_ids));<NEW_LINE>}<NEW_LINE>if (!_application_names.isEmpty()) {<NEW_LINE>p = cb.or(p, root.get(WorkCompleted_.applicationName).in(_application_names));<NEW_LINE>}<NEW_LINE>if (!_application_alias.isEmpty()) {<NEW_LINE>p = cb.or(p, root.get(WorkCompleted_.<MASK><NEW_LINE>}<NEW_LINE>if (!_process_ids.isEmpty()) {<NEW_LINE>p = cb.or(p, root.get(WorkCompleted_.process).in(_process_ids));<NEW_LINE>}<NEW_LINE>if (!_process_names.isEmpty()) {<NEW_LINE>p = cb.or(p, root.get(WorkCompleted_.processName).in(_process_names));<NEW_LINE>}<NEW_LINE>if (!_process_alias.isEmpty()) {<NEW_LINE>p = cb.or(p, root.get(WorkCompleted_.processAlias).in(_process_alias));<NEW_LINE>}<NEW_LINE>return p;<NEW_LINE>} | applicationAlias).in(_application_alias)); |
847,576 | private Leaf position_locate(TreeNode p_curr_node, Leaf p_leaf_to_insert) {<NEW_LINE>TreeNode curr_node = p_curr_node;<NEW_LINE>while (!(curr_node instanceof Leaf)) {<NEW_LINE>InnerNode curr_inner_node = (InnerNode) curr_node;<NEW_LINE>curr_inner_node.bounding_shape = p_leaf_to_insert.bounding_shape.union(curr_inner_node.bounding_shape);<NEW_LINE>// Choose the the child, so that the area increase of that child after taking the union<NEW_LINE>// with the shape of p_leaf_to_insert is minimal.<NEW_LINE>RegularTileShape first_child_shape = curr_inner_node.first_child.bounding_shape;<NEW_LINE>RegularTileShape union_with_first_child_shape = p_leaf_to_insert.bounding_shape.union(first_child_shape);<NEW_LINE>double first_area_increase = union_with_first_child_shape.area() - first_child_shape.area();<NEW_LINE>RegularTileShape second_child_shape = curr_inner_node.second_child.bounding_shape;<NEW_LINE>RegularTileShape union_with_second_child_shape = p_leaf_to_insert.bounding_shape.union(second_child_shape);<NEW_LINE>double second_area_increase = union_with_second_child_shape.area<MASK><NEW_LINE>if (first_area_increase <= second_area_increase) {<NEW_LINE>curr_node = curr_inner_node.first_child;<NEW_LINE>} else {<NEW_LINE>curr_node = curr_inner_node.second_child;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (Leaf) curr_node;<NEW_LINE>} | () - second_child_shape.area(); |
901,610 | final DescribeTargetGroupsResult executeDescribeTargetGroups(DescribeTargetGroupsRequest describeTargetGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeTargetGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeTargetGroupsRequest> request = null;<NEW_LINE>Response<DescribeTargetGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeTargetGroupsRequestMarshaller().marshall(super.beforeMarshalling(describeTargetGroupsRequest));<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, "DescribeTargetGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeTargetGroupsResult> responseHandler = new StaxResponseHandler<DescribeTargetGroupsResult>(new DescribeTargetGroupsResultStaxUnmarshaller());<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, "Elastic Load Balancing v2"); |
199,767 | public static void main(String[] args) {<NEW_LINE>String url;<NEW_LINE>if (args.length == 0)<NEW_LINE>url = "jdbc:virtuoso://localhost:1111";<NEW_LINE>else<NEW_LINE>url = args[0];<NEW_LINE>Node foo1 = Node.createURI("http://example.org/#foo1");<NEW_LINE>Node bar1 = Node.createURI("http://example.org/#bar1");<NEW_LINE>Node baz1 = Node.createURI("http://example.org/#baz1");<NEW_LINE>Node foo2 = Node.createURI("http://example.org/#foo2");<NEW_LINE>Node bar2 = Node.createURI("http://example.org/#bar2");<NEW_LINE>Node baz2 = Node.createURI("http://example.org/#baz2");<NEW_LINE>Node foo3 = Node.createURI("http://example.org/#foo3");<NEW_LINE>Node bar3 = Node.createURI("http://example.org/#bar3");<NEW_LINE>Node baz3 = Node.createURI("http://example.org/#baz3");<NEW_LINE>List triples1 = new ArrayList();<NEW_LINE>triples1.add(new Triple(foo1, bar1, baz1));<NEW_LINE>triples1.add(new Triple(foo2, bar2, baz2));<NEW_LINE>triples1.add(new Triple(foo3, bar3, baz3));<NEW_LINE>List triples2 = new ArrayList();<NEW_LINE>triples2.add(new Triple(foo1, bar1, baz1));<NEW_LINE>triples2.add(new Triple(foo2, bar2, baz2));<NEW_LINE>VirtGraph graph = new VirtGraph("Example7", url, "dba", "dba");<NEW_LINE>graph.clear();<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("Add List with 3 triples to graph <Example7> via BulkUpdateHandler.");<NEW_LINE>graph.getBulkUpdateHandler().add(triples1);<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("graph.getCount() = " + graph.getCount());<NEW_LINE>ExtendedIterator iter = graph.find(Node.ANY, <MASK><NEW_LINE>System.out.println("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");<NEW_LINE>for (; iter.hasNext(); ) System.out.println((Triple) iter.next());<NEW_LINE>System.out.println("\n\nDelete List of 2 triples from graph <Example7> via BulkUpdateHandler.");<NEW_LINE>graph.getBulkUpdateHandler().delete(triples2);<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("graph.getCount() = " + graph.getCount());<NEW_LINE>iter = graph.find(Node.ANY, Node.ANY, Node.ANY);<NEW_LINE>System.out.println("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");<NEW_LINE>for (; iter.hasNext(); ) System.out.println((Triple) iter.next());<NEW_LINE>graph.clear();<NEW_LINE>System.out.println("\nCLEAR graph <Example7>");<NEW_LINE>} | Node.ANY, Node.ANY); |
1,086,111 | public void submitTicket(LotteryService service, Scanner scanner) {<NEW_LINE>logger.info("What is your email address?");<NEW_LINE>var email = readString(scanner);<NEW_LINE>logger.info("What is your bank account number?");<NEW_LINE>var account = readString(scanner);<NEW_LINE>logger.info("What is your phone number?");<NEW_LINE>var phone = readString(scanner);<NEW_LINE>var details = new PlayerDetails(email, account, phone);<NEW_LINE>logger.info("Give 4 comma separated lottery numbers?");<NEW_LINE>var numbers = readString(scanner);<NEW_LINE>try {<NEW_LINE>var chosen = Arrays.stream(numbers.split(",")).map(Integer::parseInt).collect(Collectors.toSet());<NEW_LINE>var lotteryNumbers = LotteryNumbers.create(chosen);<NEW_LINE>var lotteryTicket = new LotteryTicket(new LotteryTicketId(), details, lotteryNumbers);<NEW_LINE>service.submitTicket(lotteryTicket).ifPresentOrElse((id) -> logger.info("Submitted lottery ticket with id: {}", id), () <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.info("Failed submitting lottery ticket - please try again.");<NEW_LINE>}<NEW_LINE>} | -> logger.info("Failed submitting lottery ticket - please try again.")); |
1,728,777 | private I_C_BPartner createNewBPartnerNoSave(final I_I_BPartner from) {<NEW_LINE>final I_C_BPartner bpartner = InterfaceWrapperHelper.newInstance(I_C_BPartner.class);<NEW_LINE>bpartner.setExternalId(from.getC_BPartner_ExternalId());<NEW_LINE>bpartner.setAD_Org_ID(from.getAD_Org_ID());<NEW_LINE>//<NEW_LINE>bpartner.setValue(extractBPValue(from));<NEW_LINE>bpartner.setName(extractBPName(from));<NEW_LINE>bpartner.setName2(from.getName2());<NEW_LINE>bpartner.setName3(from.getName3());<NEW_LINE>bpartner.setDescription(from.getDescription());<NEW_LINE>bpartner.setShortDescription(from.getShortDescription());<NEW_LINE>bpartner.setDUNS(from.getDUNS());<NEW_LINE>bpartner.setVATaxID(from.getTaxID());<NEW_LINE>bpartner.setC_InvoiceSchedule_ID(from.getC_InvoiceSchedule_ID());<NEW_LINE>bpartner.setPaymentRule(from.getPaymentRule());<NEW_LINE>bpartner.<MASK><NEW_LINE>bpartner.setPO_PaymentTerm_ID(from.getPO_PaymentTerm_ID());<NEW_LINE>bpartner.setC_PaymentTerm_ID(from.getC_PaymentTerm_ID());<NEW_LINE>bpartner.setNAICS(from.getNAICS());<NEW_LINE>bpartner.setC_BP_Group_ID(from.getC_BP_Group_ID());<NEW_LINE>bpartner.setAD_Language(from.getAD_Language());<NEW_LINE>bpartner.setIsSEPASigned(from.isSEPASigned());<NEW_LINE>bpartner.setIsActive(from.isActiveStatus());<NEW_LINE>if (from.getDebtorId() > 0) {<NEW_LINE>bpartner.setDebtorId(from.getDebtorId());<NEW_LINE>}<NEW_LINE>if (from.getCreditorId() > 0) {<NEW_LINE>bpartner.setCreditorId(from.getCreditorId());<NEW_LINE>}<NEW_LINE>bpartner.setMemo(from.getC_BPartner_Memo());<NEW_LINE>bpartner.setDeliveryViaRule(from.getDeliveryViaRule());<NEW_LINE>bpartner.setM_Shipper_ID(from.getM_Shipper_ID());<NEW_LINE>bpartner.setVendorCategory(from.getVendorCategory());<NEW_LINE>bpartner.setCustomerNoAtVendor(from.getCustomerNoAtVendor());<NEW_LINE>bpartner.setQualification(from.getQualification());<NEW_LINE>bpartner.setM_PricingSystem_ID(from.getM_PricingSystem_ID());<NEW_LINE>bpartner.setPO_PricingSystem_ID(from.getPO_PricingSystem_ID());<NEW_LINE>bpartner.setMemo_Delivery(from.getMemo_Delivery());<NEW_LINE>bpartner.setMemo_Invoicing(from.getMemo_Invoicing());<NEW_LINE>bpartner.setGlobalId(from.getGlobalId());<NEW_LINE>return bpartner;<NEW_LINE>} | setPaymentRulePO(from.getPaymentRulePO()); |
1,592,953 | public int crypto_kem_dec(byte[] k, byte[] c, byte[] sk) {<NEW_LINE>int i, fail;<NEW_LINE>byte[<MASK><NEW_LINE>byte[] buf = new byte[64];<NEW_LINE>// Will contain key, coins<NEW_LINE>byte[] kr = new byte[64];<NEW_LINE>byte[] pk = Arrays.copyOfRange(sk, SABER_INDCPA_SECRETKEYBYTES, sk.length);<NEW_LINE>// buf[0:31] <-- message<NEW_LINE>indcpa_kem_dec(sk, c, buf);<NEW_LINE>// Multitarget countermeasure for coins + contributory KEM<NEW_LINE>for (// Save hash by storing h(pk) in sk<NEW_LINE>// Save hash by storing h(pk) in sk<NEW_LINE>i = 0; // Save hash by storing h(pk) in sk<NEW_LINE>i < 32; i++) buf[32 + i] = sk[SABER_SECRETKEYBYTES - 64 + i];<NEW_LINE>SHA3Digest digest_256 = new SHA3Digest(256);<NEW_LINE>SHA3Digest digest_512 = new SHA3Digest(512);<NEW_LINE>digest_512.update(buf, 0, 64);<NEW_LINE>digest_512.doFinal(kr, 0);<NEW_LINE>indcpa_kem_enc(buf, Arrays.copyOfRange(kr, 32, kr.length), pk, cmp);<NEW_LINE>fail = verify(c, cmp, SABER_BYTES_CCA_DEC);<NEW_LINE>// overwrite coins in kr with h(c)<NEW_LINE>digest_256.update(c, 0, SABER_BYTES_CCA_DEC);<NEW_LINE>digest_256.doFinal(kr, 32);<NEW_LINE>cmov(kr, sk, SABER_SECRETKEYBYTES - SABER_KEYBYTES, SABER_KEYBYTES, (byte) fail);<NEW_LINE>// hash concatenation of pre-k and h(c) to k<NEW_LINE>// todo support 128 and 192 bit keys<NEW_LINE>byte[] temp_k = new byte[32];<NEW_LINE>digest_256.update(kr, 0, 64);<NEW_LINE>digest_256.doFinal(temp_k, 0);<NEW_LINE>System.arraycopy(temp_k, 0, k, 0, defaultKeySize / 8);<NEW_LINE>return 0;<NEW_LINE>} | ] cmp = new byte[SABER_BYTES_CCA_DEC]; |
1,079,293 | public void writeDesign(Element design, DesignContext context) {<NEW_LINE>super.writeDesign(design, context);<NEW_LINE>Window def = context.getDefaultInstance(this);<NEW_LINE>if (getState().centered) {<NEW_LINE>design.attr("center", true);<NEW_LINE>}<NEW_LINE>DesignAttributeHandler.writeAttribute("position", design.attributes(), getPosition(), def.getPosition(<MASK><NEW_LINE>// Process keyboard shortcuts<NEW_LINE>if (closeShortcuts.size() == 1 && hasCloseShortcut(KeyCode.ESCAPE)) {<NEW_LINE>// By default, we won't write anything if we're relying on default<NEW_LINE>// shortcut behavior<NEW_LINE>} else {<NEW_LINE>// Dump all close shortcuts to a string...<NEW_LINE>String attrString = "";<NEW_LINE>// TODO: add canonical support for array data in XML attributes<NEW_LINE>for (CloseShortcut shortcut : closeShortcuts) {<NEW_LINE>String shortcutString = DesignAttributeHandler.getFormatter().format(shortcut, CloseShortcut.class);<NEW_LINE>attrString += shortcutString + " ";<NEW_LINE>}<NEW_LINE>// Write everything except the last "," to the design<NEW_LINE>DesignAttributeHandler.writeAttribute("close-shortcut", design.attributes(), attrString.trim(), null, String.class, context);<NEW_LINE>}<NEW_LINE>for (Component c : getAssistiveDescription()) {<NEW_LINE>Element child = context.createElement(c).attr(":assistive-description", true);<NEW_LINE>design.appendChild(child);<NEW_LINE>}<NEW_LINE>} | ), String.class, context); |
721,398 | private void enqueueMessage(UUID uuid, DynmapPlayer player, EnterExitText txt, boolean isEnter) {<NEW_LINE>SendQueueRec rec = entersetsendqueue.get(uuid);<NEW_LINE>if (rec == null) {<NEW_LINE>rec = new SendQueueRec();<NEW_LINE>rec.player = player;<NEW_LINE>rec.tickdelay = 0;<NEW_LINE>entersetsendqueue.put(uuid, rec);<NEW_LINE>}<NEW_LINE>TextQueueRec txtrec = new TextQueueRec();<NEW_LINE>txtrec.isEnter = isEnter;<NEW_LINE>txtrec.txt = txt;<NEW_LINE><MASK><NEW_LINE>// If enter replaces exits, and we just added enter, purge exits<NEW_LINE>if (enterReplacesExits && isEnter) {<NEW_LINE>ArrayList<TextQueueRec> newlst = new ArrayList<TextQueueRec>();<NEW_LINE>for (TextQueueRec r : rec.queue) {<NEW_LINE>// Keep the enter records<NEW_LINE>if (r.isEnter)<NEW_LINE>newlst.add(r);<NEW_LINE>}<NEW_LINE>rec.queue = newlst;<NEW_LINE>}<NEW_LINE>} | rec.queue.add(txtrec); |
64,719 | private void writeValueNodeTriple(IndentedWriter out, Node value, boolean multiLine) {<NEW_LINE>Triple triple = value.getTriple();<NEW_LINE>print(out, quoteName(kType), ": ", quote(kTriple), " , ");<NEW_LINE>println(out);<NEW_LINE>// if ( multiLineValues )<NEW_LINE>// println(out);<NEW_LINE>print(out, quoteName(kValue), ": ");<NEW_LINE>// Allow for different multiline choice for triple components<NEW_LINE>boolean multiLineInnerValue = multiLine;<NEW_LINE>// Start of triple object.<NEW_LINE>// ----<NEW_LINE>println(out, "{");<NEW_LINE>incIndent(out);<NEW_LINE>// ---<NEW_LINE>print(out, quoteName(kSubject), ": ");<NEW_LINE>print(out, " ");<NEW_LINE>writeValue(out, triple.getSubject(), multiLineInnerValue);<NEW_LINE>println(out, " ,");<NEW_LINE>print(out<MASK><NEW_LINE>writeValue(out, triple.getPredicate(), multiLineInnerValue);<NEW_LINE>println(out, " ,");<NEW_LINE>print(out, quoteName(kObject), ": ");<NEW_LINE>print(out, " ");<NEW_LINE>writeValue(out, triple.getObject(), multiLineInnerValue);<NEW_LINE>// End of triple object.<NEW_LINE>decIndent(out);<NEW_LINE>println(out);<NEW_LINE>print(out, "}");<NEW_LINE>// ----<NEW_LINE>return;<NEW_LINE>} | , quoteName(kPredicate), ": "); |
315,134 | private static String figureThemeURL(final PwmRequest pwmRequest, final PwmThemeURL themeUrl) {<NEW_LINE>String themeURL = null;<NEW_LINE>String themeName <MASK><NEW_LINE>if (pwmRequest != null) {<NEW_LINE>final PwmDomain pwmDomain = pwmRequest.getPwmDomain();<NEW_LINE>themeName = figureThemeName(pwmRequest);<NEW_LINE>if ("custom".equals(themeName)) {<NEW_LINE>if (themeUrl == PwmThemeURL.MOBILE_THEME_URL) {<NEW_LINE>themeURL = pwmDomain.getConfig().readSettingAsString(PwmSetting.DISPLAY_CSS_CUSTOM_MOBILE_STYLE);<NEW_LINE>} else {<NEW_LINE>themeURL = pwmDomain.getConfig().readSettingAsString(PwmSetting.DISPLAY_CSS_CUSTOM_STYLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (themeURL == null || themeURL.length() < 1) {<NEW_LINE>themeURL = ResourceFileServlet.RESOURCE_PATH + themeUrl.getCssName();<NEW_LINE>themeURL = themeURL.replace(ResourceFileServlet.TOKEN_THEME, StringUtil.escapeHtml(themeName));<NEW_LINE>}<NEW_LINE>return themeURL;<NEW_LINE>} | = AppProperty.CONFIG_THEME.getDefaultValue(); |
1,803,269 | public void init(GameServer gameServer) {<NEW_LINE>IServerConfiguration configuration = gameServer.getConfig();<NEW_LINE>GameRegistry registry = gameServer.getRegistry();<NEW_LINE>listeners.add(new WorldCreationListener(configuration.getInt("settlement_spawn_rate")));<NEW_LINE>listeners.add(new CpuInitialisationListener());<NEW_LINE>listeners.add(new VaultWorldUpdateListener(configuration));<NEW_LINE>listeners.add(new VaultCompleteListener());<NEW_LINE>registry.registerGameObject(HarvesterNPC.class);<NEW_LINE>registry.registerGameObject(Factory.class);<NEW_LINE>registry.registerGameObject(RadioTower.class);<NEW_LINE>registry.registerGameObject(VaultDoor.class);<NEW_LINE>registry.registerGameObject(Obstacle.class);<NEW_LINE>registry.registerGameObject(ElectricBox.class);<NEW_LINE>registry.registerGameObject(Portal.class);<NEW_LINE>registry.registerGameObject(VaultExitPortal.class);<NEW_LINE>registry.registerGameObject(HackedNPC.class);<NEW_LINE>registry.registerHardware(RadioReceiverHardware.class);<NEW_LINE><MASK><NEW_LINE>registry.registerHardware(NpcInventory.class);<NEW_LINE>registry.registerTile(TileVaultFloor.ID, TileVaultFloor.class);<NEW_LINE>registry.registerTile(TileVaultWall.ID, TileVaultWall.class);<NEW_LINE>settlementMap = new ConcurrentHashMap<>();<NEW_LINE>LogManager.LOGGER.fine("(NPC Plugin) Loading default HackedNPC settings from" + " defaultHackedCubotHardware.json");<NEW_LINE>InputStream is = getClass().getClassLoader().getResourceAsStream("defaultHackedCubotHardware.json");<NEW_LINE>Scanner scanner = new Scanner(is).useDelimiter("\\A");<NEW_LINE>String json = scanner.next();<NEW_LINE>DEFAULT_HACKED_NPC = Document.parse(json);<NEW_LINE>LogManager.LOGGER.info("(NPC Plugin) Initialised NPC plugin");<NEW_LINE>} | registry.registerHardware(NpcBattery.class); |
807,235 | protected void createRepository() {<NEW_LINE>EditRepositoryDialog dialog = new EditRepositoryDialog(gitblit.getProtocolVersion());<NEW_LINE>dialog.setLocationRelativeTo(RepositoriesPanel.this);<NEW_LINE>dialog.setAccessRestriction(gitblit.getDefaultAccessRestriction());<NEW_LINE>dialog.setAuthorizationControl(gitblit.getDefaultAuthorizationControl());<NEW_LINE>dialog.setUsers(null, gitblit.getUsernames(), null);<NEW_LINE>dialog.setTeams(gitblit.getTeamnames(), null);<NEW_LINE>dialog.setRepositories(gitblit.getRepositories());<NEW_LINE>dialog.setFederationSets(gitblit.getFederationSets(), null);<NEW_LINE>dialog.setIndexedBranches(new ArrayList<String>(Arrays.asList(Constants.DEFAULT_BRANCH)), null);<NEW_LINE>dialog.setPreReceiveScripts(gitblit.getPreReceiveScriptsUnused(null), gitblit.getPreReceiveScriptsInherited(null), null);<NEW_LINE>dialog.setPostReceiveScripts(gitblit.getPostReceiveScriptsUnused(null), gitblit.getPostReceiveScriptsInherited(null), null);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>final RepositoryModel newRepository = dialog.getRepository();<NEW_LINE>final List<RegistrantAccessPermission<MASK><NEW_LINE>final List<RegistrantAccessPermission> permittedTeams = dialog.getTeamAccessPermissions();<NEW_LINE>if (newRepository == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GitblitWorker worker = new GitblitWorker(this, RpcRequest.CREATE_REPOSITORY) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Boolean doRequest() throws IOException {<NEW_LINE>boolean success = gitblit.createRepository(newRepository, permittedUsers, permittedTeams);<NEW_LINE>if (success) {<NEW_LINE>gitblit.refreshRepositories();<NEW_LINE>if (permittedUsers.size() > 0) {<NEW_LINE>gitblit.refreshUsers();<NEW_LINE>}<NEW_LINE>if (permittedTeams.size() > 0) {<NEW_LINE>gitblit.refreshTeams();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess() {<NEW_LINE>updateTable(false);<NEW_LINE>updateUsersTable();<NEW_LINE>updateTeamsTable();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onFailure() {<NEW_LINE>showFailure("Failed to execute request \"{0}\" for repository \"{1}\".", getRequestType(), newRepository.name);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>worker.execute();<NEW_LINE>} | > permittedUsers = dialog.getUserAccessPermissions(); |
329,860 | private boolean addRemoveJAR(File jar, POMModel mdl, String scope, boolean add) throws IOException {<NEW_LINE>if (!add) {<NEW_LINE>throw new UnsupportedOperationException("removing JARs not yet supported");<NEW_LINE>}<NEW_LINE>NBVersionInfo dep = null;<NEW_LINE>for (NBVersionInfo _dep : RepositoryQueries.findBySHA1Result(jar, RepositoryPreferences.getInstance().getRepositoryInfos()).getResults()) {<NEW_LINE>if (!"unknown.binary".equals(_dep.getGroupId())) {<NEW_LINE>dep = _dep;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dep == null) {<NEW_LINE>dep = new NBVersionInfo(null, "unknown.binary", jar.getName().replaceFirst("[.]jar$", ""), "SNAPSHOT", null, null, null, null, null);<NEW_LINE>addJarToPrivateRepo(jar, mdl, dep);<NEW_LINE>}<NEW_LINE>// if not found anywhere, add to a custom file:// based repository structure within the project's directory.<NEW_LINE>boolean added = false;<NEW_LINE>Dependency dependency = ModelUtils.checkModelDependency(mdl, dep.getGroupId(), dep.getArtifactId(), false);<NEW_LINE>if (dependency == null) {<NEW_LINE>dependency = ModelUtils.checkModelDependency(mdl, dep.getGroupId(), dep.getArtifactId(), true);<NEW_LINE>LOG.log(Level.FINE, "added new dep {0} as {1}", new Object<MASK><NEW_LINE>added = true;<NEW_LINE>}<NEW_LINE>if (!Utilities.compareObjects(dep.getVersion(), dependency.getVersion())) {<NEW_LINE>dependency.setVersion(dep.getVersion());<NEW_LINE>LOG.log(Level.FINE, "upgraded version on {0} as {1}", new Object[] { jar, dep });<NEW_LINE>added = true;<NEW_LINE>}<NEW_LINE>if (!Utilities.compareObjects(scope, dependency.getScope())) {<NEW_LINE>dependency.setScope(scope);<NEW_LINE>LOG.log(Level.FINE, "changed scope on {0} as {1}", new Object[] { jar, dep });<NEW_LINE>added = true;<NEW_LINE>}<NEW_LINE>return added;<NEW_LINE>} | [] { jar, dep }); |
925,655 | public void updateHandler(final RoutingContext ctx) {<NEW_LINE>final int queries = Helper.<MASK><NEW_LINE>final World[] worlds = new World[queries];<NEW_LINE>final boolean[] failed = { false };<NEW_LINE>final int[] queryCount = { 0 };<NEW_LINE>for (int i = 0; i < worlds.length; i++) {<NEW_LINE>int id = randomWorld();<NEW_LINE>client.preparedQuery(SELECT_WORLD).execute(Tuple.of(id), ar2 -> {<NEW_LINE>if (!failed[0]) {<NEW_LINE>if (ar2.failed()) {<NEW_LINE>failed[0] = true;<NEW_LINE>ctx.fail(ar2.cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Row row = ar2.result().iterator().next();<NEW_LINE>worlds[queryCount[0]++] = new World(row.getInteger(0), randomWorld());<NEW_LINE>if (queryCount[0] == worlds.length) {<NEW_LINE>Arrays.sort(worlds);<NEW_LINE>List<Tuple> batch = new ArrayList<>();<NEW_LINE>for (World world : worlds) {<NEW_LINE>batch.add(Tuple.of(world.getRandomNumber(), world.getId()));<NEW_LINE>}<NEW_LINE>client.preparedQuery(UPDATE_WORLD).executeBatch(batch, ar3 -> {<NEW_LINE>if (ar3.failed()) {<NEW_LINE>ctx.fail(ar3.cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ctx.response().putHeader(HttpHeaders.SERVER, SERVER).putHeader(HttpHeaders.DATE, date).putHeader(HttpHeaders.CONTENT_TYPE, "application/json").end(Json.encodeToBuffer(worlds));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | getQueries(ctx.request()); |
1,624,116 | public void reorder() throws ExpressionException {<NEW_LINE>ArrayList<Variable> newVars = new ArrayList<>();<NEW_LINE>ArrayList<Variable> deletedVars = new ArrayList<>(table.getVars());<NEW_LINE>for (String name : names) {<NEW_LINE>Variable found = null;<NEW_LINE>for (Variable v : deletedVars) if (v.getIdentifier().equals(name)) {<NEW_LINE>found = v;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (found != null) {<NEW_LINE>newVars.add(found);<NEW_LINE>deletedVars.remove(found);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newVars.size() < 2)<NEW_LINE>throw new ExpressionException<MASK><NEW_LINE>TruthTable oldTable = this.table.createDeepCopy();<NEW_LINE>table.clear(newVars);<NEW_LINE>for (int j = 0; j < oldTable.getResultCount(); j++) table.addResult(oldTable.getResultName(j));<NEW_LINE>ContextFiller fc = new ContextFiller(table.getVars());<NEW_LINE>for (Variable v : deletedVars) fc.set(v, false);<NEW_LINE>for (int row = 0; row < table.getRows(); row++) {<NEW_LINE>fc.setContextTo(row);<NEW_LINE>for (int t = 0; t < table.getResultCount(); t++) table.setByContext(t, fc, oldTable.getByContext(t, fc));<NEW_LINE>}<NEW_LINE>} | (Lang.get("err_tableBecomesToSmall")); |
603,906 | public void exitExtended_access_list_tail(Extended_access_list_tailContext ctx) {<NEW_LINE>LineAction action = toLineAction(ctx.ala);<NEW_LINE>AccessListAddressSpecifier srcAddressSpecifier = toAccessListAddressSpecifier(ctx.srcipr);<NEW_LINE>AccessListAddressSpecifier dstAddressSpecifier = toAccessListAddressSpecifier(ctx.dstipr);<NEW_LINE>AccessListServiceSpecifier serviceSpecifier = computeExtendedAccessListServiceSpecifier(ctx);<NEW_LINE>String name = getFullText(ctx).trim();<NEW_LINE>// reference tracking<NEW_LINE>{<NEW_LINE>int configLine = ctx.getStart().getLine();<NEW_LINE>String qualifiedName = aclLineName(<MASK><NEW_LINE>_configuration.defineSingleLineStructure(IPV4_ACCESS_LIST_LINE, qualifiedName, configLine);<NEW_LINE>_configuration.referenceStructure(IPV4_ACCESS_LIST_LINE, qualifiedName, IPV4_ACCESS_LIST_LINE_SELF_REF, configLine);<NEW_LINE>}<NEW_LINE>long seq = ctx.num != null ? toLong(ctx.num) : _currentIpv4Acl.getNextSeq();<NEW_LINE>Ipv4AccessListLine line = _currentIpv4AclLine.setName(name).setSeq(seq).setAction(action).setSrcAddressSpecifier(srcAddressSpecifier).setDstAddressSpecifier(dstAddressSpecifier).setServiceSpecifier(serviceSpecifier).build();<NEW_LINE>if (line.getAction() != LineAction.PERMIT && line.getNexthop1() != null) {<NEW_LINE>warn(ctx, "ACL based forwarding can only be configured on an ACL line with a permit action");<NEW_LINE>} else {<NEW_LINE>_currentIpv4Acl.addLine(line);<NEW_LINE>}<NEW_LINE>_currentIpv4AclLine = null;<NEW_LINE>} | _currentIpv4Acl.getName(), name); |
976,369 | public void process(InputStream in, ZipEntry zipEntry) throws IOException {<NEW_LINE>String root = <MASK><NEW_LINE>if (rootDir == null) {<NEW_LINE>rootDir = root;<NEW_LINE>} else if (!rootDir.equals(root)) {<NEW_LINE>throw new ZipException("Unwrapping with multiple roots is not supported, roots: " + rootDir + ", " + root);<NEW_LINE>}<NEW_LINE>String name = mapper.map(getUnrootedName(root, zipEntry.getName()));<NEW_LINE>if (name != null) {<NEW_LINE>File file = makeDestinationFile(outputDir, name);<NEW_LINE>if (zipEntry.isDirectory()) {<NEW_LINE>FileUtils.forceMkdir(file);<NEW_LINE>} else {<NEW_LINE>FileUtils.forceMkdir(file.getParentFile());<NEW_LINE>if (log.isDebugEnabled() && file.exists()) {<NEW_LINE>log.debug("Overwriting file '{}'.", zipEntry.getName());<NEW_LINE>}<NEW_LINE>FileUtils.copy(in, file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getRootName(zipEntry.getName()); |
402,012 | PNone initInPlace(VirtualFrame frame, SuperObject self, @SuppressWarnings("unused") PNone clsArg, @SuppressWarnings("unused") PNone objArg, @Cached("createRead(frame)") ReadLocalVariableNode readClass, @Cached("create(0)") ReadIndexedArgumentNode readArgument, @Cached ConditionProfile isCellProfile) {<NEW_LINE>Object <MASK><NEW_LINE>if (obj == PNone.NONE || obj == PNone.NO_VALUE) {<NEW_LINE>throw raise(PythonErrorType.RuntimeError, ErrorMessages.NO_ARGS, "super()");<NEW_LINE>}<NEW_LINE>Object cls = readClass.execute(frame);<NEW_LINE>if (isCellProfile.profile(cls instanceof PCell)) {<NEW_LINE>cls = getGetRefNode().execute((PCell) cls);<NEW_LINE>}<NEW_LINE>if (cls == null) {<NEW_LINE>// the cell is empty<NEW_LINE>throw raise(PythonErrorType.RuntimeError, ErrorMessages.SUPER_EMPTY_CLASS);<NEW_LINE>}<NEW_LINE>if (cls == PNone.NONE) {<NEW_LINE>throw raise(PythonErrorType.RuntimeError, ErrorMessages.SUPER_NO_CLASS);<NEW_LINE>}<NEW_LINE>return init(frame, self, cls, obj);<NEW_LINE>} | obj = readArgument.execute(frame); |
1,008,393 | ArrayTable.Representation chooseRep(int ordinal) {<NEW_LINE>Primitive primitive = Primitive.of(clazz);<NEW_LINE>Primitive boxPrimitive = Primitive.ofBox(clazz);<NEW_LINE>Primitive p = primitive != null ? primitive : boxPrimitive;<NEW_LINE>if (!containsNull && p != null) {<NEW_LINE>switch(p) {<NEW_LINE>case FLOAT:<NEW_LINE>case DOUBLE:<NEW_LINE>return new ArrayTable.PrimitiveArray(ordinal, p, p);<NEW_LINE>case OTHER:<NEW_LINE>case VOID:<NEW_LINE>throw new AssertionError("wtf?!");<NEW_LINE>}<NEW_LINE>if (canBeLong(min) && canBeLong(max)) {<NEW_LINE>return chooseFixedRep(ordinal, p, toLong(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We don't want to use a dictionary if:<NEW_LINE>// (a) there are so many values that an object pointer (with one<NEW_LINE>// indirection) has about as many bits as a code (with two<NEW_LINE>// indirections); or<NEW_LINE>// (b) if there are very few copies of each value.<NEW_LINE>// The condition kind of captures this, but needs to be tuned.<NEW_LINE>final int codeCount = map.size() + (containsNull ? 1 : 0);<NEW_LINE>final int codeBitCount = log2(nextPowerOf2(codeCount));<NEW_LINE>if (codeBitCount < 10 && values.size() > 2000) {<NEW_LINE>final ArrayTable.Representation representation = chooseFixedRep(-1, Primitive.INT, 0, codeCount - 1);<NEW_LINE>return new ArrayTable.ObjectDictionary(ordinal, representation);<NEW_LINE>}<NEW_LINE>return new ArrayTable.ObjectArray(ordinal);<NEW_LINE>} | min), toLong(max)); |
262,350 | public static Map<String, Map<String, String>> convertRegister(Map<String, Map<String, String>> register) {<NEW_LINE>Map<String, Map<String, String>> newRegister = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Map<String, String>> entry : register.entrySet()) {<NEW_LINE>String serviceName = entry.getKey();<NEW_LINE>Map<String, String> serviceUrls = entry.getValue();<NEW_LINE>if (StringUtils.isNotContains(serviceName, ':') && StringUtils.isNotContains(serviceName, '/')) {<NEW_LINE>for (Map.Entry<String, String> entry2 : serviceUrls.entrySet()) {<NEW_LINE>String serviceUrl = entry2.getKey();<NEW_LINE>String serviceQuery = entry2.getValue();<NEW_LINE>Map<String, String> <MASK><NEW_LINE>String group = params.get(GROUP_KEY);<NEW_LINE>String version = params.get(VERSION_KEY);<NEW_LINE>// params.remove("group");<NEW_LINE>// params.remove("version");<NEW_LINE>String name = serviceName;<NEW_LINE>if (StringUtils.isNotEmpty(group)) {<NEW_LINE>name = group + "/" + name;<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(version)) {<NEW_LINE>name = name + ":" + version;<NEW_LINE>}<NEW_LINE>Map<String, String> newUrls = newRegister.computeIfAbsent(name, k -> new HashMap<>());<NEW_LINE>newUrls.put(serviceUrl, StringUtils.toQueryString(params));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newRegister.put(serviceName, serviceUrls);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newRegister;<NEW_LINE>} | params = StringUtils.parseQueryString(serviceQuery); |
1,418,637 | private void drawStabilityInfo() {<NEW_LINE>String at;<NEW_LINE>// // at M=<NEW_LINE>at = trans.get("RocketInfo.at") + UnitGroup.UNITS_COEFFICIENT.getDefaultUnit().toStringUnit(Application.getPreferences().getDefaultMach());<NEW_LINE>if (!Double.isNaN(aoa)) {<NEW_LINE>at += " " + ALPHA + "=" + UnitGroup.UNITS_ANGLE.getDefaultUnit().toStringUnit(aoa);<NEW_LINE>}<NEW_LINE>if (!Double.isNaN(theta)) {<NEW_LINE>at += " " + THETA + "=" + UnitGroup.UNITS_ANGLE.getDefaultUnit().toStringUnit(theta);<NEW_LINE>}<NEW_LINE>GlyphVector cgValue = createText(getCg());<NEW_LINE>GlyphVector cpValue = createText(getCp());<NEW_LINE>GlyphVector stabValue = createText(getStability());<NEW_LINE>// // CG:<NEW_LINE>GlyphVector cgText = createText(trans.get("RocketInfo.cgText"));<NEW_LINE>// // CP:<NEW_LINE>GlyphVector cpText = createText(trans.get("RocketInfo.cpText"));<NEW_LINE>// // Stability:<NEW_LINE>GlyphVector stabText = createText(trans.get("RocketInfo.stabText"));<NEW_LINE>GlyphVector atText = createSmallText(at);<NEW_LINE>// GlyphVector visual bounds drops the spaces, so we'll add them<NEW_LINE>FontMetrics fontMetrics = g2.getFontMetrics(cgText.getFont());<NEW_LINE>int spaceWidth = fontMetrics.stringWidth(" ");<NEW_LINE>Rectangle2D cgRect = cgValue.getVisualBounds();<NEW_LINE>Rectangle2D cpRect = cpValue.getVisualBounds();<NEW_LINE>Rectangle2D cgTextRect = cgText.getVisualBounds();<NEW_LINE>Rectangle2D cpTextRect = cpText.getVisualBounds();<NEW_LINE>Rectangle2D stabRect = stabValue.getVisualBounds();<NEW_LINE>Rectangle2D stabTextRect = stabText.getVisualBounds();<NEW_LINE>Rectangle2D atTextRect = atText.getVisualBounds();<NEW_LINE>double unitWidth = MathUtil.max(cpRect.getWidth(), cgRect.getWidth(), stabRect.getWidth());<NEW_LINE>double textWidth = Math.max(cpTextRect.getWidth(), cgTextRect.getWidth());<NEW_LINE>// Add an extra space worth of width so the text doesn't run into the values<NEW_LINE>unitWidth = unitWidth + spaceWidth;<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawGlyphVector(stabValue, (float) (x2 - stabRect.getWidth()), y1);<NEW_LINE>g2.drawGlyphVector(cgValue, (float) (x2 - cgRect.getWidth()), y1 + line);<NEW_LINE>g2.drawGlyphVector(cpValue, (float) (x2 - cpRect.getWidth()), y1 + 2 * line);<NEW_LINE>g2.drawGlyphVector(stabText, (float) (x2 - unitWidth - stabTextRect.getWidth()), y1);<NEW_LINE>g2.drawGlyphVector(cgText, (float) (x2 - unitWidth - cgTextRect.getWidth()), y1 + line);<NEW_LINE>g2.drawGlyphVector(cpText, (float) (x2 - unitWidth - cpTextRect.getWidth()), y1 + 2 * line);<NEW_LINE>cgCaret.setPosition(x2 - unitWidth - textWidth - 10, y1 + line - 0.3 * line);<NEW_LINE>cgCaret.paint(g2, 1.7);<NEW_LINE>cpCaret.setPosition(x2 - unitWidth - textWidth - 10, y1 + 2 * line - 0.3 * line);<NEW_LINE>cpCaret.paint(g2, 1.7);<NEW_LINE>float atPos;<NEW_LINE>if (unitWidth + textWidth + 10 > atTextRect.getWidth()) {<NEW_LINE>atPos = (float) (x2 - (unitWidth + textWidth + 10 + atTextRect<MASK><NEW_LINE>} else {<NEW_LINE>atPos = (float) (x2 - atTextRect.getWidth());<NEW_LINE>}<NEW_LINE>g2.setColor(Color.GRAY);<NEW_LINE>g2.drawGlyphVector(atText, atPos, y1 + 3 * line);<NEW_LINE>} | .getWidth()) / 2); |
817,165 | public String annotatedDebugName() {<NEW_LINE>StringBuffer buffer = new StringBuffer(10);<NEW_LINE>buffer.<MASK><NEW_LINE>if (!this.inRecursiveFunction) {<NEW_LINE>this.inRecursiveFunction = true;<NEW_LINE>try {<NEW_LINE>if (this.superclass != null && TypeBinding.equalsEquals(this.firstBound, this.superclass)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buffer.append(" extends ").append(this.superclass.annotatedDebugName());<NEW_LINE>}<NEW_LINE>if (this.superInterfaces != null && this.superInterfaces != Binding.NO_SUPERINTERFACES) {<NEW_LINE>if (TypeBinding.notEquals(this.firstBound, this.superclass)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buffer.append(" extends ");<NEW_LINE>}<NEW_LINE>for (int i = 0, length = this.superInterfaces.length; i < length; i++) {<NEW_LINE>if (i > 0 || TypeBinding.equalsEquals(this.firstBound, this.superclass)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buffer.append(" & ");<NEW_LINE>}<NEW_LINE>buffer.append(this.superInterfaces[i].annotatedDebugName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.inRecursiveFunction = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>} | append(super.annotatedDebugName()); |
1,220,670 | private PropertyList makeConjunctions(PropertyList.Iterator[] iters, int currIndex, int[][] conjunctions, int j, int tsSize, @Var PropertyList newfs, int tsi, PropertyList[] oldfs, int[] iterIndices) {<NEW_LINE>if (iters.length == currIndex) {<NEW_LINE>// base case: add feature for current conjunction of iters<NEW_LINE>// avoid redundant doubling of feature space; include only upper triangle<NEW_LINE>if (redundant(conjunctions, j, iterIndices)) {<NEW_LINE>return newfs;<NEW_LINE>}<NEW_LINE>@Var<NEW_LINE>String newFeature = "";<NEW_LINE>@Var<NEW_LINE>double newValue = 1.0;<NEW_LINE>for (int i = 0; i < iters.length; i++) {<NEW_LINE>String s = iters[i].getKey();<NEW_LINE>if (featureRegex != null && !featureRegex.matcher(s).matches())<NEW_LINE>return newfs;<NEW_LINE>newFeature += (i == 0 ? "" : "_&_") + s + (conjunctions[j][i] == 0 ? "" : ("@" + conjunctions[j][i]));<NEW_LINE>newValue *= iters[i].getNumericValue();<NEW_LINE>}<NEW_LINE>// System.err.println ("Adding new feature " + newFeature);<NEW_LINE>newfs = PropertyList.<MASK><NEW_LINE>} else {<NEW_LINE>// recursive step<NEW_LINE>while (iters[currIndex].hasNext()) {<NEW_LINE>iters[currIndex].next();<NEW_LINE>iterIndices[currIndex]++;<NEW_LINE>newfs = makeConjunctions(iters, currIndex + 1, conjunctions, j, tsSize, newfs, tsi, oldfs, iterIndices);<NEW_LINE>}<NEW_LINE>// reset iterator at currIndex<NEW_LINE>iters[currIndex] = getOffsetIter(conjunctions, j, currIndex, tsSize, tsi, oldfs);<NEW_LINE>iterIndices[currIndex] = -1;<NEW_LINE>}<NEW_LINE>return newfs;<NEW_LINE>} | add(newFeature, newValue, newfs); |
1,783,289 | private void printTopicPartitionInfo(KafkaCluster cluster, PrintWriter writer, String topic) {<NEW_LINE>writer.print("<p> <h5>" + topic + "</h5></p>");<NEW_LINE>writer.print("<table class=\"table\">");<NEW_LINE>writer.print("<thead> <tr> <th> Partition</th> ");<NEW_LINE>writer.print("<th>In Max (Mb/s)</th> ");<NEW_LINE>writer.print("<th>Out max (Mb/s)</th>");<NEW_LINE>writer.print("</tr> </thead> <tbody>");<NEW_LINE>int zeroTrafficPartitions = 0;<NEW_LINE>TreeSet<TopicPartition> topicPartitions = new TreeSet(new KafkaUtils.TopicPartitionComparator());<NEW_LINE>topicPartitions.addAll(cluster.topicPartitions.get(topic));<NEW_LINE>for (TopicPartition topicPartition : topicPartitions) {<NEW_LINE>writer.print("<tr>");<NEW_LINE>double bytesInMax = cluster.<MASK><NEW_LINE>double bytesOutMax = cluster.getMaxBytesOut(topicPartition) / 1024.0 / 1024.0;<NEW_LINE>if (isZero(bytesInMax) && isZero(bytesOutMax)) {<NEW_LINE>zeroTrafficPartitions++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String partitionHtml = String.format("<td>%d</td>", topicPartition.partition());<NEW_LINE>String bytesInHtml = String.format("<td>%.2f</td>", bytesInMax);<NEW_LINE>String bytesOutHtml = String.format("<td>%.2f</td>", bytesOutMax);<NEW_LINE>writer.print(partitionHtml + bytesInHtml + bytesOutHtml);<NEW_LINE>writer.print("</tr>");<NEW_LINE>}<NEW_LINE>writer.print("<tr> <td colspan=\"8\">" + zeroTrafficPartitions + " zero traffic partitions </td> </tr>");<NEW_LINE>writer.print("</tbody> </table>");<NEW_LINE>} | getMaxBytesIn(topicPartition) / 1024.0 / 1024.0; |
532,695 | public void marshall(UpdateFileSystemOpenZFSConfiguration updateFileSystemOpenZFSConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateFileSystemOpenZFSConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateFileSystemOpenZFSConfiguration.getAutomaticBackupRetentionDays(), AUTOMATICBACKUPRETENTIONDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFileSystemOpenZFSConfiguration.getCopyTagsToBackups(), COPYTAGSTOBACKUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateFileSystemOpenZFSConfiguration.getDailyAutomaticBackupStartTime(), DAILYAUTOMATICBACKUPSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFileSystemOpenZFSConfiguration.getThroughputCapacity(), THROUGHPUTCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFileSystemOpenZFSConfiguration.getWeeklyMaintenanceStartTime(), WEEKLYMAINTENANCESTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFileSystemOpenZFSConfiguration.getDiskIopsConfiguration(), DISKIOPSCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateFileSystemOpenZFSConfiguration.getCopyTagsToVolumes(), COPYTAGSTOVOLUMES_BINDING); |
459,424 | public static ListServiceInstancesResponse unmarshall(ListServiceInstancesResponse listServiceInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listServiceInstancesResponse.setRequestId(_ctx.stringValue("ListServiceInstancesResponse.RequestId"));<NEW_LINE>listServiceInstancesResponse.setNextToken(_ctx.stringValue("ListServiceInstancesResponse.NextToken"));<NEW_LINE>listServiceInstancesResponse.setTotalCount(_ctx.longValue("ListServiceInstancesResponse.TotalCount"));<NEW_LINE>listServiceInstancesResponse.setMaxResults(_ctx.stringValue("ListServiceInstancesResponse.MaxResults"));<NEW_LINE>List<ServiceInstance> serviceInstances = new ArrayList<ServiceInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListServiceInstancesResponse.ServiceInstances.Length"); i++) {<NEW_LINE>ServiceInstance serviceInstance = new ServiceInstance();<NEW_LINE>serviceInstance.setStatus(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Status"));<NEW_LINE>serviceInstance.setOutputs(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Outputs"));<NEW_LINE>serviceInstance.setUpdateTime(_ctx.stringValue<MASK><NEW_LINE>serviceInstance.setParameters(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Parameters"));<NEW_LINE>serviceInstance.setServiceInstanceId(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].ServiceInstanceId"));<NEW_LINE>serviceInstance.setCreateTime(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].CreateTime"));<NEW_LINE>serviceInstance.setStatusDetail(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].StatusDetail"));<NEW_LINE>serviceInstance.setProgress(_ctx.longValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Progress"));<NEW_LINE>serviceInstance.setResources(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Resources"));<NEW_LINE>serviceInstance.setTemplateName(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].TemplateName"));<NEW_LINE>serviceInstance.setOperatedServiceInstanceId(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].OperatedServiceInstanceId"));<NEW_LINE>serviceInstance.setOperationStartTime(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].OperationStartTime"));<NEW_LINE>serviceInstance.setOperationEndTime(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].OperationEndTime"));<NEW_LINE>serviceInstance.setEnableInstanceOps(_ctx.booleanValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].EnableInstanceOps"));<NEW_LINE>Service service = new Service();<NEW_LINE>service.setStatus(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.Status"));<NEW_LINE>service.setPublishTime(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.PublishTime"));<NEW_LINE>service.setVersion(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.Version"));<NEW_LINE>service.setDeployType(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.DeployType"));<NEW_LINE>service.setServiceId(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceId"));<NEW_LINE>service.setSupplierUrl(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.SupplierUrl"));<NEW_LINE>service.setServiceType(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceType"));<NEW_LINE>service.setSupplierName(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.SupplierName"));<NEW_LINE>List<ServiceInfo> serviceInfos = new ArrayList<ServiceInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceInfos.Length"); j++) {<NEW_LINE>ServiceInfo serviceInfo = new ServiceInfo();<NEW_LINE>serviceInfo.setLocale(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceInfos[" + j + "].Locale"));<NEW_LINE>serviceInfo.setImage(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceInfos[" + j + "].Image"));<NEW_LINE>serviceInfo.setName(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceInfos[" + j + "].Name"));<NEW_LINE>serviceInfo.setShortDescription(_ctx.stringValue("ListServiceInstancesResponse.ServiceInstances[" + i + "].Service.ServiceInfos[" + j + "].ShortDescription"));<NEW_LINE>serviceInfos.add(serviceInfo);<NEW_LINE>}<NEW_LINE>service.setServiceInfos(serviceInfos);<NEW_LINE>serviceInstance.setService(service);<NEW_LINE>serviceInstances.add(serviceInstance);<NEW_LINE>}<NEW_LINE>listServiceInstancesResponse.setServiceInstances(serviceInstances);<NEW_LINE>return listServiceInstancesResponse;<NEW_LINE>} | ("ListServiceInstancesResponse.ServiceInstances[" + i + "].UpdateTime")); |
834,640 | public Request<DescribeImportImageTasksRequest> marshall(DescribeImportImageTasksRequest describeImportImageTasksRequest) {<NEW_LINE>if (describeImportImageTasksRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeImportImageTasksRequest> request = new DefaultRequest<DescribeImportImageTasksRequest>(describeImportImageTasksRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DescribeImportImageTasks");<NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>java.util.List<String> importTaskIdsList = describeImportImageTasksRequest.getImportTaskIds();<NEW_LINE>int importTaskIdsListIndex = 1;<NEW_LINE>for (String importTaskIdsListValue : importTaskIdsList) {<NEW_LINE>if (importTaskIdsListValue != null) {<NEW_LINE>request.addParameter("ImportTaskId." + importTaskIdsListIndex, StringUtils.fromString(importTaskIdsListValue));<NEW_LINE>}<NEW_LINE>importTaskIdsListIndex++;<NEW_LINE>}<NEW_LINE>if (describeImportImageTasksRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describeImportImageTasksRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (describeImportImageTasksRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger<MASK><NEW_LINE>}<NEW_LINE>java.util.List<Filter> filtersList = describeImportImageTasksRequest.getFilters();<NEW_LINE>int filtersListIndex = 1;<NEW_LINE>for (Filter filtersListValue : filtersList) {<NEW_LINE>Filter filterMember = filtersListValue;<NEW_LINE>if (filterMember != null) {<NEW_LINE>if (filterMember.getName() != null) {<NEW_LINE>request.addParameter("Filters." + filtersListIndex + ".Name", StringUtils.fromString(filterMember.getName()));<NEW_LINE>}<NEW_LINE>java.util.List<String> valuesList = filterMember.getValues();<NEW_LINE>int valuesListIndex = 1;<NEW_LINE>for (String valuesListValue : valuesList) {<NEW_LINE>if (valuesListValue != null) {<NEW_LINE>request.addParameter("Filters." + filtersListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));<NEW_LINE>}<NEW_LINE>valuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filtersListIndex++;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (describeImportImageTasksRequest.getMaxResults())); |
1,293,739 | protected void configure() {<NEW_LINE>// need to eagerly initialize<NEW_LINE>bind(<MASK><NEW_LINE>//<NEW_LINE>// override these in additional modules if necessary with Modules.override()<NEW_LINE>//<NEW_LINE>bind(EurekaInstanceConfig.class).toProvider(CloudInstanceConfigProvider.class).in(Scopes.SINGLETON);<NEW_LINE>bind(EurekaClientConfig.class).toProvider(DefaultEurekaClientConfigProvider.class).in(Scopes.SINGLETON);<NEW_LINE>// this is the self instanceInfo used for registration purposes<NEW_LINE>bind(InstanceInfo.class).toProvider(EurekaConfigBasedInstanceInfoProvider.class).in(Scopes.SINGLETON);<NEW_LINE>bind(EurekaClient.class).to(DiscoveryClient.class).in(Scopes.SINGLETON);<NEW_LINE>bind(EndpointRandomizer.class).toInstance(ResolverUtils::randomize);<NEW_LINE>// jersey2 support bindings<NEW_LINE>bind(AbstractDiscoveryClientOptionalArgs.class).to(Jersey2DiscoveryClientOptionalArgs.class).in(Scopes.SINGLETON);<NEW_LINE>} | ApplicationInfoManager.class).asEagerSingleton(); |
693,882 | public void updateValueFromChildren(TypeNodeData inData) {<NEW_LINE>DefaultMutableTreeNode localPartNode = (DefaultMutableTreeNode) this.getChildAt(0);<NEW_LINE>DefaultMutableTreeNode valueNode = (DefaultMutableTreeNode) this.getChildAt(1);<NEW_LINE>// TypeNodeData localPartData = (TypeNodeData) localPartNode.getUserObject();<NEW_LINE>TypeNodeData valueData = (TypeNodeData) valueNode.getUserObject();<NEW_LINE>Object value = valueData.getTypeValue();<NEW_LINE>String localPart = (String) localPartNode.getUserObject();<NEW_LINE>if (value != null && localPart != null) {<NEW_LINE>Object jaxBElement = ((TypeNodeData) this.getUserObject()).getTypeValue();<NEW_LINE>try {<NEW_LINE>if (jaxBElement != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>jaxBElement = ReflectionHelper.makeJAXBElement(valueData.getTypeClass(), localPart, value, urlClassLoader);<NEW_LINE>this.setUserObject(jaxBElement);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ErrorManager.getDefault().notify(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ReflectionHelper.setJAXBElementValue(jaxBElement, value); |
1,138,541 | private void downloadJdk(File jdkExtractDirectory, Jdk jdk) throws MojoExecutionException {<NEW_LINE>log.info(<MASK><NEW_LINE>Boolean interactiveMode = session.getSettings().getInteractiveMode();<NEW_LINE>session.getSettings().setInteractiveMode(false);<NEW_LINE>try {<NEW_LINE>String cacheDirectory = Paths.get(session.getSettings().getLocalRepository()).resolve(".cache/maven-download-plugin").toAbsolutePath().toString();<NEW_LINE>executeMojo(plugin("com.googlecode.maven-download-plugin", "download-maven-plugin", "1.6.7"), goal("wget"), configuration(element("uri", jdk.getUrl()), element("followRedirects", "true"), element("outputDirectory", jdkExtractDirectory.getAbsolutePath()), element("cacheDirectory", cacheDirectory)), executionEnvironment(project, session, pluginManager));<NEW_LINE>} finally {<NEW_LINE>session.getSettings().setInteractiveMode(interactiveMode);<NEW_LINE>}<NEW_LINE>} | "Downloading " + jdk.getUrl()); |
1,250,317 | public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig config, RenderRequest req, RenderResponse res) throws Exception {<NEW_LINE>try {<NEW_LINE>String cmd = ParamUtil.get(req, Constants.CMD, "dgar");<NEW_LINE>String[] groupNames = StringUtil.split(ParamUtil.getString(req, "config_groups"));<NEW_LINE>String[] roleNames = StringUtil.split(ParamUtil.getString(req, "config_roles"));<NEW_LINE>String[] ruid = StringUtil.split(ParamUtil.getString(req, "config_ruid"), "\n");<NEW_LINE>String[] ruea = StringUtil.split(ParamUtil.getString(req, "config_ruea"), "\n");<NEW_LINE>String[] mailHostNames = StringUtil.split(ParamUtil.getString(req, "config_mhn"), "\n");<NEW_LINE>boolean registrationEmailSend = ParamUtil.get(req, "config_re_send", true);<NEW_LINE>String registrationEmailSubject = ParamUtil.getString(req, "config_re_subject");<NEW_LINE>String registrationEmailBody = ParamUtil.getString(req, "config_re_body");<NEW_LINE>UserConfig userConfig = AdminConfigManagerUtil.getUserConfig(PortalUtil.getCompanyId(req));<NEW_LINE>if (cmd.equals("dgar")) {<NEW_LINE>userConfig.setGroupNames(groupNames);<NEW_LINE>userConfig.setRoleNames(roleNames);<NEW_LINE>} else if (cmd.equals("den")) {<NEW_LINE>userConfig.setRegistrationEmail(new EmailConfig<MASK><NEW_LINE>} else if (cmd.equals("ru")) {<NEW_LINE>userConfig.setReservedUserIds(ruid);<NEW_LINE>userConfig.setReservedUserEmailAddresses(ruea);<NEW_LINE>} else if (cmd.equals("mhn")) {<NEW_LINE>userConfig.setMailHostNames(mailHostNames);<NEW_LINE>}<NEW_LINE>// Update config<NEW_LINE>AdminConfigManagerUtil.updateUserConfig(userConfig);<NEW_LINE>// Session messages<NEW_LINE>SessionMessages.add(req, UpdateUserConfigAction.class.getName());<NEW_LINE>return mapping.findForward("portlet.admin.edit_user_config");<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e != null && e instanceof PrincipalException) {<NEW_LINE>SessionErrors.add(req, e.getClass().getName());<NEW_LINE>return mapping.findForward("portlet.admin.error");<NEW_LINE>} else {<NEW_LINE>req.setAttribute(PageContext.EXCEPTION, e);<NEW_LINE>return mapping.findForward(Constants.COMMON_ERROR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (registrationEmailSend, registrationEmailSubject, registrationEmailBody)); |
561,796 | public Object executeFunction() {<NEW_LINE>// symbolic receiver (new object)<NEW_LINE><MASK><NEW_LINE>// string argument<NEW_LINE>String conc_str = (String) this.getConcArgument(0);<NEW_LINE>ReferenceExpression symb_str = this.getSymbArgument(0);<NEW_LINE>// delim argument<NEW_LINE>String conc_delim = (String) this.getConcArgument(1);<NEW_LINE>ReferenceExpression symb_delim = this.getSymbArgument(1);<NEW_LINE>if (symb_str instanceof ReferenceConstant && symb_delim instanceof ReferenceConstant) {<NEW_LINE>ReferenceConstant non_null_symb_string = (ReferenceConstant) symb_str;<NEW_LINE>assert conc_str != null;<NEW_LINE>StringValue strExpr = env.heap.getField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_str, non_null_symb_string, conc_str);<NEW_LINE>ReferenceConstant non_null_symb_delim = (ReferenceConstant) symb_delim;<NEW_LINE>assert conc_delim != null;<NEW_LINE>StringValue delimExpr = env.heap.getField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_delim, non_null_symb_delim, conc_delim);<NEW_LINE>NewTokenizerExpr newTokenizerExpr = new NewTokenizerExpr(strExpr, delimExpr);<NEW_LINE>// update symbolic heap<NEW_LINE>env.heap.putField(Types.JAVA_UTIL_STRING_TOKENIZER, SymbolicHeap.$STRING_TOKENIZER_VALUE, null, symb_str_tokenizer, newTokenizerExpr);<NEW_LINE>}<NEW_LINE>// constructor returns void<NEW_LINE>return null;<NEW_LINE>} | ReferenceConstant symb_str_tokenizer = this.getSymbReceiver(); |
657,796 | double leftLabelPadding() {<NEW_LINE>double leftPadding = super.leftLabelPadding();<NEW_LINE>// RT-27167: we must take into account the disclosure node and the<NEW_LINE>// indentation (which is not taken into account by the LabeledSkinBase.<NEW_LINE>final double height = getCellSize();<NEW_LINE>TreeTableCell<S, T> cell = getSkinnable();<NEW_LINE>TreeTableColumn<S, T> tableColumn = cell.getTableColumn();<NEW_LINE>if (tableColumn == null)<NEW_LINE>return leftPadding;<NEW_LINE>// check if this column is the TreeTableView treeColumn (i.e. the<NEW_LINE>// column showing the disclosure node and graphic).<NEW_LINE>TreeTableView<S> treeTable = cell.getTreeTableView();<NEW_LINE>if (treeTable == null)<NEW_LINE>return leftPadding;<NEW_LINE>int <MASK><NEW_LINE>TreeTableColumn<S, ?> treeColumn = treeTable.getTreeColumn();<NEW_LINE>if ((treeColumn == null && columnIndex != 0) || (treeColumn != null && !tableColumn.equals(treeColumn))) {<NEW_LINE>return leftPadding;<NEW_LINE>}<NEW_LINE>TreeTableRow<S> treeTableRow = cell.getTreeTableRow();<NEW_LINE>if (treeTableRow == null)<NEW_LINE>return leftPadding;<NEW_LINE>TreeItem<S> treeItem = treeTableRow.getTreeItem();<NEW_LINE>if (treeItem == null)<NEW_LINE>return leftPadding;<NEW_LINE>int nodeLevel = treeTable.getTreeItemLevel(treeItem);<NEW_LINE>if (!treeTable.isShowRoot())<NEW_LINE>nodeLevel--;<NEW_LINE>double indentPerLevel = 13.0;<NEW_LINE>// if (treeTableRow.getSkin() instanceof javafx.scene.control.skin.TreeTableRowSkin) {<NEW_LINE>// indentPerLevel = ((javafx.scene.control.skin.TreeTableRowSkin<?>)treeTableRow.getSkin()).getIndentationPerLevel();<NEW_LINE>// }<NEW_LINE>leftPadding += 10 + nodeLevel * indentPerLevel;<NEW_LINE>// add in the width of the disclosure node, if one exists<NEW_LINE>Map<TableColumnBase<?, ?>, Double> mdwp = TableRowSkinBase.maxDisclosureWidthMap;<NEW_LINE>leftPadding += mdwp.containsKey(treeColumn) ? mdwp.get(treeColumn) : 0;<NEW_LINE>// adding in the width of the graphic on the tree item<NEW_LINE>Node graphic = treeItem.getGraphic();<NEW_LINE>leftPadding += graphic == null ? 0 : graphic.prefWidth(height);<NEW_LINE>return leftPadding;<NEW_LINE>} | columnIndex = treeTable.getVisibleLeafIndex(tableColumn); |
1,125,691 | public DescribeApplicationStateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeApplicationStateResult describeApplicationStateResult = new DescribeApplicationStateResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeApplicationStateResult;<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("ApplicationStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeApplicationStateResult.setApplicationStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LastUpdatedTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeApplicationStateResult.setLastUpdatedTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeApplicationStateResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
739,141 | public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) {<NEW_LINE>int type = getItemViewType(position);<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_ACTION_HEADER:<NEW_LINE>{<NEW_LINE>HeaderViewHolder headerViewHolder = (HeaderViewHolder) holder;<NEW_LINE>headerViewHolder.setAction(mMassOperationAction, BookmarkManager.INSTANCE.areAllCategoriesInvisible());<NEW_LINE>headerViewHolder.getText().setText(R.string.bookmark_lists);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_CATEGORY_ITEM:<NEW_LINE>{<NEW_LINE>final BookmarkCategory category = getCategoryByPosition(toCategoryPosition(position));<NEW_LINE>CategoryViewHolder categoryHolder = (CategoryViewHolder) holder;<NEW_LINE>categoryHolder.setCategory(category);<NEW_LINE>categoryHolder.setName(category.getName());<NEW_LINE>bindSize(categoryHolder, category);<NEW_LINE>categoryHolder.setVisibilityState(category.isVisible());<NEW_LINE>ToggleVisibilityClickListener visibilityListener = new ToggleVisibilityClickListener(categoryHolder);<NEW_LINE>categoryHolder.setVisibilityListener(visibilityListener);<NEW_LINE>CategoryItemMoreClickListener moreClickListener = new CategoryItemMoreClickListener(categoryHolder);<NEW_LINE>categoryHolder.setMoreButtonClickListener(moreClickListener);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_ACTION_ADD:<NEW_LINE>{<NEW_LINE>Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;<NEW_LINE>generalViewHolder.getImage().setImageResource(R.drawable.ic_checkbox_add);<NEW_LINE>generalViewHolder.getText().setText(R.string.bookmarks_create_new_group);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_ACTION_IMPORT:<NEW_LINE>{<NEW_LINE>Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;<NEW_LINE>generalViewHolder.getImage().setImageResource(R.drawable.ic_checkbox_add);<NEW_LINE>generalViewHolder.getText().<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Invalid item type: " + type);<NEW_LINE>}<NEW_LINE>} | setText(R.string.bookmarks_import); |
654,436 | final DescribeVpcAttributeResult executeDescribeVpcAttribute(DescribeVpcAttributeRequest describeVpcAttributeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeVpcAttributeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeVpcAttributeRequest> request = null;<NEW_LINE>Response<DescribeVpcAttributeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeVpcAttributeRequestMarshaller().marshall(super.beforeMarshalling(describeVpcAttributeRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeVpcAttribute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeVpcAttributeResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | DescribeVpcAttributeResult>(new DescribeVpcAttributeResultStaxUnmarshaller()); |
1,055,674 | protected void onCreate(final Bundle savedInstanceState) {<NEW_LINE>PrefsUtility.applyTheme(this);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setTitle(R.string.pm_send_actionbar);<NEW_LINE>final LinearLayout layout = (LinearLayout) getLayoutInflater().inflate(R.layout.pm_send, null);<NEW_LINE>usernameSpinner = layout.<MASK><NEW_LINE>recipientEdit = layout.findViewById(R.id.pm_send_recipient);<NEW_LINE>subjectEdit = layout.findViewById(R.id.pm_send_subject);<NEW_LINE>textEdit = layout.findViewById(R.id.pm_send_text);<NEW_LINE>final String initialRecipient;<NEW_LINE>final String initialSubject;<NEW_LINE>final String initialText;<NEW_LINE>if (savedInstanceState != null && savedInstanceState.containsKey(SAVED_STATE_TEXT)) {<NEW_LINE>initialRecipient = savedInstanceState.getString(SAVED_STATE_RECIPIENT);<NEW_LINE>initialSubject = savedInstanceState.getString(SAVED_STATE_SUBJECT);<NEW_LINE>initialText = savedInstanceState.getString(SAVED_STATE_TEXT);<NEW_LINE>} else {<NEW_LINE>final Intent intent = getIntent();<NEW_LINE>if (intent != null && intent.hasExtra(EXTRA_RECIPIENT)) {<NEW_LINE>initialRecipient = intent.getStringExtra(EXTRA_RECIPIENT);<NEW_LINE>} else {<NEW_LINE>initialRecipient = lastRecipient;<NEW_LINE>}<NEW_LINE>if (intent != null && intent.hasExtra(EXTRA_SUBJECT)) {<NEW_LINE>initialSubject = intent.getStringExtra(EXTRA_SUBJECT);<NEW_LINE>} else {<NEW_LINE>initialSubject = lastSubject;<NEW_LINE>}<NEW_LINE>if (intent != null && intent.hasExtra(EXTRA_TEXT)) {<NEW_LINE>initialText = intent.getStringExtra(EXTRA_TEXT);<NEW_LINE>} else {<NEW_LINE>initialText = lastText;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (initialRecipient != null) {<NEW_LINE>recipientEdit.setText(initialRecipient);<NEW_LINE>}<NEW_LINE>if (initialSubject != null) {<NEW_LINE>subjectEdit.setText(initialSubject);<NEW_LINE>}<NEW_LINE>if (initialText != null) {<NEW_LINE>textEdit.setText(initialText);<NEW_LINE>}<NEW_LINE>final ArrayList<RedditAccount> accounts = RedditAccountManager.getInstance(this).getAccounts();<NEW_LINE>final ArrayList<String> usernames = new ArrayList<>();<NEW_LINE>for (final RedditAccount account : accounts) {<NEW_LINE>if (!account.isAnonymous()) {<NEW_LINE>usernames.add(account.username);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (usernames.isEmpty()) {<NEW_LINE>General.quickToast(this, getString(R.string.error_toast_notloggedin));<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>usernameSpinner.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, usernames));<NEW_LINE>final ScrollView sv = new ScrollView(this);<NEW_LINE>sv.addView(layout);<NEW_LINE>setBaseActivityListing(sv);<NEW_LINE>} | findViewById(R.id.pm_send_username); |
1,318,853 | final DeleteInsightResult executeDeleteInsight(DeleteInsightRequest deleteInsightRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteInsightRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteInsightRequest> request = null;<NEW_LINE>Response<DeleteInsightResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteInsightRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteInsightRequest));<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, "SecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteInsight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteInsightResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteInsightResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,100,115 | public DescribeInsightRulesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeInsightRulesResult describeInsightRulesResult = new DescribeInsightRulesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeInsightRulesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>describeInsightRulesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("InsightRules", targetDepth)) {<NEW_LINE>describeInsightRulesResult.withInsightRules(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("InsightRules/member", targetDepth)) {<NEW_LINE>describeInsightRulesResult.withInsightRules(InsightRuleStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeInsightRulesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new ArrayList<InsightRule>()); |
963,634 | void createAnonymousFilter() {<NEW_LINE>Element anonymousElt = DomUtils.getChildElementByTagName(this.httpElt, Elements.ANONYMOUS);<NEW_LINE>if (anonymousElt != null && "false".equals(anonymousElt.getAttribute("enabled"))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String grantedAuthority = null;<NEW_LINE>String username = null;<NEW_LINE>String key = null;<NEW_LINE>Object source = this.pc.extractSource(this.httpElt);<NEW_LINE>if (anonymousElt != null) {<NEW_LINE>grantedAuthority = anonymousElt.getAttribute("granted-authority");<NEW_LINE>username = anonymousElt.getAttribute("username");<NEW_LINE>key = anonymousElt.getAttribute(ATT_KEY);<NEW_LINE>source = <MASK><NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(grantedAuthority)) {<NEW_LINE>grantedAuthority = "ROLE_ANONYMOUS";<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(username)) {<NEW_LINE>username = "anonymousUser";<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(key)) {<NEW_LINE>// Generate a random key for the Anonymous provider<NEW_LINE>key = createKey();<NEW_LINE>}<NEW_LINE>this.anonymousFilter = new RootBeanDefinition(AnonymousAuthenticationFilter.class);<NEW_LINE>this.anonymousFilter.getConstructorArgumentValues().addIndexedArgumentValue(0, key);<NEW_LINE>this.anonymousFilter.getConstructorArgumentValues().addIndexedArgumentValue(1, username);<NEW_LINE>this.anonymousFilter.getConstructorArgumentValues().addIndexedArgumentValue(2, AuthorityUtils.commaSeparatedStringToAuthorityList(grantedAuthority));<NEW_LINE>this.anonymousFilter.setSource(source);<NEW_LINE>RootBeanDefinition anonymousProviderBean = new RootBeanDefinition(AnonymousAuthenticationProvider.class);<NEW_LINE>anonymousProviderBean.getConstructorArgumentValues().addIndexedArgumentValue(0, key);<NEW_LINE>anonymousProviderBean.setSource(this.anonymousFilter.getSource());<NEW_LINE>String id = this.pc.getReaderContext().generateBeanName(anonymousProviderBean);<NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition(anonymousProviderBean, id));<NEW_LINE>this.anonymousProviderRef = new RuntimeBeanReference(id);<NEW_LINE>} | this.pc.extractSource(anonymousElt); |
14,399 | public void aesEncrypt(final byte[] key, InputStream in, OutputStream out, final byte[] iv, boolean useMac) throws CryptoError, IOException {<NEW_LINE>InputStream encrypted = null;<NEW_LINE>try {<NEW_LINE>Cipher cipher = Cipher.getInstance(AES_MODE_PADDING);<NEW_LINE>IvParameterSpec params = new IvParameterSpec(iv);<NEW_LINE>SubKeys subKeys = getSubKeys(bytesToKey(key), useMac);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, subKeys.cKey, params);<NEW_LINE>encrypted = getCipherInputStream(in, cipher);<NEW_LINE>ByteArrayOutputStream tempOut = new ByteArrayOutputStream();<NEW_LINE>tempOut.write(iv);<NEW_LINE>IOUtils.copy(encrypted, tempOut);<NEW_LINE>if (useMac) {<NEW_LINE>byte[] data = tempOut.toByteArray();<NEW_LINE>out.write(<MASK><NEW_LINE>out.write(data);<NEW_LINE>byte[] macBytes = hmac256(subKeys.mKey, data);<NEW_LINE>out.write(macBytes);<NEW_LINE>} else {<NEW_LINE>out.write(tempOut.toByteArray());<NEW_LINE>}<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>throw new CryptoError(e);<NEW_LINE>} catch (NoSuchPaddingException | InvalidAlgorithmParameterException | NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(in);<NEW_LINE>IOUtils.closeQuietly(encrypted);<NEW_LINE>IOUtils.closeQuietly(out);<NEW_LINE>}<NEW_LINE>} | new byte[] { 1 }); |
1,168,662 | private // pretty printer it would not help much.<NEW_LINE>String formatCssCode(Document doc, int baseIndent, int additionalIndent, String... lines) {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>int indentLevelSize = IndentUtils.indentLevelSize(doc);<NEW_LINE>for (String line : lines) {<NEW_LINE>// add base indent<NEW_LINE>b.append(IndentUtils.createIndentString(doc, baseIndent));<NEW_LINE>String indentString = IndentUtils.createIndentString(doc, indentLevelSize);<NEW_LINE>// append additional indents<NEW_LINE>for (int i = 0; i < additionalIndent; i++) {<NEW_LINE>b.append(indentString);<NEW_LINE>}<NEW_LINE>// replace each \t by proper indentation level size<NEW_LINE>// and copy the line to the buffer<NEW_LINE>for (int i = 0; i < line.length(); i++) {<NEW_LINE>char <MASK><NEW_LINE>if (c == '\t') {<NEW_LINE>// NOI18N<NEW_LINE>b.append(indentString);<NEW_LINE>} else if (c == '\n') {<NEW_LINE>// swallow the new lines if they were possibly present in the inlined css code<NEW_LINE>} else {<NEW_LINE>b.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// and new line at the end<NEW_LINE>// NOI18N<NEW_LINE>b.append('\n');<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>} | c = line.charAt(i); |
1,385,511 | protected void consumeEnterAnonymousClassBody(boolean qualified) {<NEW_LINE>// EnterAnonymousClassBody ::= $empty<NEW_LINE>if (this.indexOfAssistIdentifier() < 0) {<NEW_LINE>super.consumeEnterAnonymousClassBody(qualified);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// trick to avoid creating a selection on type reference<NEW_LINE>char[] oldIdent = assistIdentifier();<NEW_LINE>setAssistIdentifier(null);<NEW_LINE>TypeReference typeReference = getTypeReference(0);<NEW_LINE>setAssistIdentifier(oldIdent);<NEW_LINE>TypeDeclaration anonymousType = new TypeDeclaration(this.compilationUnit.compilationResult);<NEW_LINE>anonymousType.name = CharOperation.NO_CHAR;<NEW_LINE>anonymousType.bits |= (ASTNode.IsAnonymousType | ASTNode.IsLocalType);<NEW_LINE>QualifiedAllocationExpression alloc = new SelectionOnQualifiedAllocationExpression(anonymousType);<NEW_LINE>markEnclosingMemberWithLocalType();<NEW_LINE>pushOnAstStack(anonymousType);<NEW_LINE>// the position has been stored explicitly<NEW_LINE>alloc.sourceEnd = this.rParenPos;<NEW_LINE>int argumentLength;<NEW_LINE>if ((argumentLength = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>this.expressionPtr -= argumentLength;<NEW_LINE>System.arraycopy(this.expressionStack, this.expressionPtr + 1, alloc.arguments = new Expression[argumentLength], 0, argumentLength);<NEW_LINE>}<NEW_LINE>if (qualified) {<NEW_LINE>this.expressionLengthPtr--;<NEW_LINE>alloc.enclosingInstance = this.expressionStack[this.expressionPtr--];<NEW_LINE>}<NEW_LINE>alloc.type = typeReference;<NEW_LINE>anonymousType.sourceEnd = alloc.sourceEnd;<NEW_LINE>// position at the type while it impacts the anonymous declaration<NEW_LINE>anonymousType.sourceStart = anonymousType.declarationSourceStart = alloc.type.sourceStart;<NEW_LINE>alloc.sourceStart = this.intStack[this.intPtr--];<NEW_LINE>pushOnExpressionStack(alloc);<NEW_LINE>this.assistNode = alloc;<NEW_LINE>this.lastCheckPoint = alloc.sourceEnd + 1;<NEW_LINE>if (!this.diet) {<NEW_LINE>// force to restart in recovery mode<NEW_LINE>this.restartRecovery = true;<NEW_LINE>this.lastIgnoredToken = -1;<NEW_LINE>if (isIndirectlyInsideLambdaExpression())<NEW_LINE>this.ignoreNextOpeningBrace = true;<NEW_LINE>else<NEW_LINE>// opening brace already taken into account.<NEW_LINE>this.currentToken = 0;<NEW_LINE>this.hasReportedError = true;<NEW_LINE>}<NEW_LINE>anonymousType.bodyStart = this.scanner.currentPosition;<NEW_LINE>// will be updated when reading super-interfaces<NEW_LINE>this.listLength = 0;<NEW_LINE>// recovery<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>this.lastCheckPoint = anonymousType.bodyStart;<NEW_LINE>this.currentElement = this.<MASK><NEW_LINE>if (isIndirectlyInsideLambdaExpression())<NEW_LINE>this.ignoreNextOpeningBrace = true;<NEW_LINE>else<NEW_LINE>// opening brace already taken into account.<NEW_LINE>this.currentToken = 0;<NEW_LINE>this.lastIgnoredToken = -1;<NEW_LINE>}<NEW_LINE>} | currentElement.add(anonymousType, 0); |
1,399,949 | private String build() {<NEW_LINE>String options = deployState.getProperties().jvmGCOptions();<NEW_LINE>if (jvmGcOptions != null) {<NEW_LINE>options = jvmGcOptions;<NEW_LINE>String[] <MASK><NEW_LINE>List<String> invalidOptions = Arrays.stream(optionList).filter(option -> !option.isEmpty()).filter(option -> !Pattern.matches(validPattern.pattern(), option)).collect(Collectors.toList());<NEW_LINE>if (isHosted) {<NEW_LINE>// CMS GC options cannot be used in hosted, CMS is unsupported in JDK 17<NEW_LINE>invalidOptions.addAll(Arrays.stream(optionList).filter(option -> !option.isEmpty()).filter(option -> Pattern.matches(invalidCMSPattern.pattern(), option) || option.equals("-XX:+UseConcMarkSweepGC")).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>logOrFailInvalidOptions(invalidOptions);<NEW_LINE>}<NEW_LINE>if (options == null || options.isEmpty())<NEW_LINE>options = deployState.isHosted() ? ContainerCluster.PARALLEL_GC : ContainerCluster.G1GC;<NEW_LINE>return options;<NEW_LINE>} | optionList = options.split(" "); |
52,410 | public void resolveBuildDependencies(ConfigurationInternal configuration, ResolverResults result) {<NEW_LINE>ResolutionStrategyInternal resolutionStrategy = configuration.getResolutionStrategy();<NEW_LINE>ResolutionFailureCollector failureCollector = new ResolutionFailureCollector(componentSelectorConverter);<NEW_LINE>InMemoryResolutionResultBuilder resolutionResultBuilder = new InMemoryResolutionResultBuilder();<NEW_LINE>ResolvedLocalComponentsResultGraphVisitor localComponentsVisitor = new ResolvedLocalComponentsResultGraphVisitor(currentBuild);<NEW_LINE>CompositeDependencyGraphVisitor graphVisitor = new <MASK><NEW_LINE>DefaultResolvedArtifactsBuilder artifactsVisitor = new DefaultResolvedArtifactsBuilder(buildProjectDependencies, resolutionStrategy.getSortOrder());<NEW_LINE>resolver.resolve(configuration, ImmutableList.of(), metadataHandler, IS_LOCAL_EDGE, graphVisitor, artifactsVisitor, attributesSchema, artifactTypeRegistry, false);<NEW_LINE>result.graphResolved(resolutionResultBuilder.getResolutionResult(), localComponentsVisitor, new BuildDependenciesOnlyVisitedArtifactSet(failureCollector.complete(Collections.emptySet()), artifactsVisitor.complete(), artifactTransforms, configuration.getDependenciesResolver()));<NEW_LINE>} | CompositeDependencyGraphVisitor(failureCollector, resolutionResultBuilder, localComponentsVisitor); |
1,141,556 | static void runTriggerExample(TrafficFlowOptions options) throws IOException {<NEW_LINE>options.setStreaming(true);<NEW_LINE>ExampleUtils exampleUtils = new ExampleUtils(options);<NEW_LINE>exampleUtils.setup();<NEW_LINE>Pipeline pipeline = Pipeline.create(options);<NEW_LINE>TableReference tableRef = getTableReference(options.getProject(), options.getBigQueryDataset(), options.getBigQueryTable());<NEW_LINE>PCollectionList<TableRow> resultList = pipeline.apply("ReadMyFile", TextIO.read().from(options.getInput())).apply("InsertRandomDelays", ParDo.of(new InsertDelays())).apply(ParDo.of(new ExtractFlowInfo())).apply(new CalculateTotalFlow(options.getWindowDuration()));<NEW_LINE>for (int i = 0; i < resultList.size(); i++) {<NEW_LINE>resultList.get(i).apply("BigQuery Write Rows" + i, BigQueryIO.writeTableRows().to(tableRef)<MASK><NEW_LINE>}<NEW_LINE>PipelineResult result = pipeline.run();<NEW_LINE>// ExampleUtils will try to cancel the pipeline and the injector before the program exits.<NEW_LINE>exampleUtils.waitToFinish(result);<NEW_LINE>} | .withSchema(getSchema())); |
783,464 | private LogicalPlan withSelectHint(LogicalPlan logicalPlan, SelectHintContext hintContext) {<NEW_LINE>if (hintContext == null) {<NEW_LINE>return logicalPlan;<NEW_LINE>}<NEW_LINE>Map<String, SelectHint> hints = Maps.newLinkedHashMap();<NEW_LINE>for (HintStatementContext hintStatement : hintContext.hintStatements) {<NEW_LINE>String hintName = hintStatement.hintName.getText(<MASK><NEW_LINE>Map<String, Optional<String>> parameters = Maps.newLinkedHashMap();<NEW_LINE>for (HintAssignmentContext kv : hintStatement.parameters) {<NEW_LINE>String parameterName = kv.key.getText();<NEW_LINE>Optional<String> value = Optional.empty();<NEW_LINE>if (kv.constantValue != null) {<NEW_LINE>Literal literal = (Literal) visit(kv.constantValue);<NEW_LINE>value = Optional.ofNullable(literal.toLegacyLiteral().getStringValue());<NEW_LINE>} else if (kv.identifierValue != null) {<NEW_LINE>// maybe we should throw exception when the identifierValue is quoted identifier<NEW_LINE>value = Optional.ofNullable(kv.identifierValue.getText());<NEW_LINE>}<NEW_LINE>parameters.put(parameterName, value);<NEW_LINE>}<NEW_LINE>hints.put(hintName, new SelectHint(hintName, parameters));<NEW_LINE>}<NEW_LINE>return new LogicalSelectHint<>(hints, logicalPlan);<NEW_LINE>} | ).toLowerCase(Locale.ROOT); |
509,269 | private void doScheduleAsyncCleanupRequest(Backoff cleanupBackoff, Request request, String action) {<NEW_LINE>ListenableFuture future = httpClient.executeAsync(request, createFullJsonResponseHandler(taskInfoCodec));<NEW_LINE>Futures.addCallback(future, new FutureCallback<FullJsonResponseHandler.JsonResponse<TaskInfo>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(FullJsonResponseHandler.JsonResponse<TaskInfo> result) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable t) {<NEW_LINE>if (t instanceof RejectedExecutionException) {<NEW_LINE>// client has been shutdown<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// record failure<NEW_LINE>if (cleanupBackoff.failure()) {<NEW_LINE>logError(t, "Unable to %s task at %s", action, request.getUri());<NEW_LINE>// Update the taskInfo with the new taskStatus.<NEW_LINE>// This is required because the query state machine depends on TaskInfo (instead of task status)<NEW_LINE>// to transition its own state.<NEW_LINE>// Also, since this TaskInfo is updated in the client the "finalInfo" flag will not be set,<NEW_LINE>// indicating that the stats are stale.<NEW_LINE>// TODO: Update the query state machine and stage state machine to depend on TaskStatus instead<NEW_LINE>cleanupTaskInfo(getTaskInfo().withTaskStatus(getTaskStatus()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// reschedule<NEW_LINE>long delayMills = cleanupBackoff.getBackoffDelayMills();<NEW_LINE>if (delayMills == 0) {<NEW_LINE>doScheduleAsyncCleanupRequest(cleanupBackoff, request, action);<NEW_LINE>} else {<NEW_LINE>errorScheduledExecutor.schedule(() -> doScheduleAsyncCleanupRequest(cleanupBackoff, request, action), delayMills, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, executor);<NEW_LINE>} | cleanupTaskInfo(result.getValue()); |
1,421,484 | private void filterOutIgnoredFiles(final List<VcsDirtyScope> scopes) {<NEW_LINE>final Set<VirtualFile> refreshFiles = new HashSet<>();<NEW_LINE>try {<NEW_LINE>synchronized (myDataLock) {<NEW_LINE>final IgnoredFilesCompositeHolder fileHolder = myComposite.getIgnoredFileHolder();<NEW_LINE>for (Iterator<VcsDirtyScope> iterator = scopes.iterator(); iterator.hasNext(); ) {<NEW_LINE>final VcsModifiableDirtyScope scope = (VcsModifiableDirtyScope) iterator.next();<NEW_LINE>final VcsDirtyScopeModifier modifier = scope.getModifier();<NEW_LINE>if (modifier != null) {<NEW_LINE>fileHolder.notifyVcsStarted(scope.getVcs());<NEW_LINE>final Iterator<FilePath> filesIterator = modifier.getDirtyFilesIterator();<NEW_LINE>while (filesIterator.hasNext()) {<NEW_LINE>final FilePath dirtyFile = filesIterator.next();<NEW_LINE>if (dirtyFile.getVirtualFile() != null && isIgnoredFile(dirtyFile.getVirtualFile())) {<NEW_LINE>filesIterator.remove();<NEW_LINE>fileHolder.addFile(dirtyFile.getVirtualFile());<NEW_LINE>refreshFiles.add(dirtyFile.getVirtualFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Collection<VirtualFile<MASK><NEW_LINE>for (VirtualFile root : roots) {<NEW_LINE>final Iterator<FilePath> dirIterator = modifier.getDirtyDirectoriesIterator(root);<NEW_LINE>while (dirIterator.hasNext()) {<NEW_LINE>final FilePath dir = dirIterator.next();<NEW_LINE>if (dir.getVirtualFile() != null && isIgnoredFile(dir.getVirtualFile())) {<NEW_LINE>dirIterator.remove();<NEW_LINE>fileHolder.addFile(dir.getVirtualFile());<NEW_LINE>refreshFiles.add(dir.getVirtualFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>modifier.recheckDirtyKeys();<NEW_LINE>if (scope.isEmpty()) {<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error(ex);<NEW_LINE>} catch (AssertionError ex) {<NEW_LINE>LOG.error(ex);<NEW_LINE>}<NEW_LINE>for (VirtualFile file : refreshFiles) {<NEW_LINE>myFileStatusManager.fileStatusChanged(file);<NEW_LINE>}<NEW_LINE>} | > roots = modifier.getAffectedVcsRoots(); |
860,246 | public static List<GCList> searchBookmarkLists() {<NEW_LINE>final Parameters params = new Parameters();<NEW_LINE>params.add("skip", "0");<NEW_LINE>params.add("take", "100");<NEW_LINE>params.add("type", "bm");<NEW_LINE>final String page = GCLogin.getInstance().getRequestLogged("https://www.geocaching.com/api/proxy/web/v1/lists", params);<NEW_LINE>if (StringUtils.isBlank(page)) {<NEW_LINE>Log.e("GCParser.searchBookmarkLists: No data from server");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final JsonNode json = JsonUtils.reader.readTree<MASK><NEW_LINE>final List<GCList> list = new ArrayList<>();<NEW_LINE>for (Iterator<JsonNode> it = json.elements(); it.hasNext(); ) {<NEW_LINE>final JsonNode row = it.next();<NEW_LINE>final String name = row.get("name").asText();<NEW_LINE>final String guid = row.get("referenceCode").asText();<NEW_LINE>final int count = row.get("count").asInt();<NEW_LINE>Date date;<NEW_LINE>final String lastUpdateUtc = row.get("lastUpdateUtc").asText();<NEW_LINE>try {<NEW_LINE>date = DATE_JSON.parse(lastUpdateUtc);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>// if parsing with fractions of seconds failed, try short form<NEW_LINE>date = DATE_JSON_SHORT.parse(lastUpdateUtc);<NEW_LINE>Log.d("parsing bookmark list: fallback needed for '" + lastUpdateUtc + "'");<NEW_LINE>}<NEW_LINE>final GCList pocketQuery = new GCList(guid, name, count, true, date.getTime(), -1, true);<NEW_LINE>list.add(pocketQuery);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Log.e("GCParser.searchBookmarkLists: error parsing html page", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | (page).get("data"); |
1,538,565 | private void adaptFpsRange(int expectedFps, CaptureRequest.Builder builderInputSurface) {<NEW_LINE>List<Range<Integer>> fpsRanges = getSupportedFps(null, Facing.BACK);<NEW_LINE>if (fpsRanges != null && fpsRanges.size() > 0) {<NEW_LINE>Range<Integer> <MASK><NEW_LINE>int measure = Math.abs(closestRange.getLower() - expectedFps) + Math.abs(closestRange.getUpper() - expectedFps);<NEW_LINE>for (Range<Integer> range : fpsRanges) {<NEW_LINE>if (CameraHelper.discardCamera2Fps(range, facing))<NEW_LINE>continue;<NEW_LINE>if (range.getLower() <= expectedFps && range.getUpper() >= expectedFps) {<NEW_LINE>int curMeasure = Math.abs(((range.getLower() + range.getUpper()) / 2) - expectedFps);<NEW_LINE>if (curMeasure < measure) {<NEW_LINE>closestRange = range;<NEW_LINE>measure = curMeasure;<NEW_LINE>} else if (curMeasure == measure) {<NEW_LINE>if (Math.abs(range.getUpper() - expectedFps) < Math.abs(closestRange.getUpper() - expectedFps)) {<NEW_LINE>closestRange = range;<NEW_LINE>measure = curMeasure;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.i(TAG, "fps: " + closestRange.getLower() + " - " + closestRange.getUpper());<NEW_LINE>builderInputSurface.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, closestRange);<NEW_LINE>}<NEW_LINE>} | closestRange = fpsRanges.get(0); |
373,551 | public // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void initWithData(Offer offer) {<NEW_LINE>model.initWithData(offer);<NEW_LINE>if (model.dataModel.isSellOffer()) {<NEW_LINE>actionButton.setId("buy-button-big");<NEW_LINE>actionButton.updateText(Res.get("takeOffer.takeOfferButton", <MASK><NEW_LINE>nextButton.setId("buy-button");<NEW_LINE>volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.buy.volumeDescription", BSQ));<NEW_LINE>amountDescriptionLabel.setText(Res.get("takeOffer.amountPriceBox.sell.amountDescription"));<NEW_LINE>} else {<NEW_LINE>actionButton.setId("sell-button-big");<NEW_LINE>nextButton.setId("sell-button");<NEW_LINE>actionButton.updateText(Res.get("takeOffer.takeOfferButton", Res.get("shared.sell")));<NEW_LINE>volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.sell.volumeDescription", BSQ));<NEW_LINE>amountDescriptionLabel.setText(Res.get("takeOffer.amountPriceBox.buy.amountDescription"));<NEW_LINE>}<NEW_LINE>paymentMethodTextField.setText(PaymentMethod.BSQ_SWAP.getDisplayString());<NEW_LINE>currencyTextField.setText(CurrencyUtil.getNameByCode(BSQ));<NEW_LINE>if (model.isRange()) {<NEW_LINE>minAmountTextField.setText(model.amountRange);<NEW_LINE>minAmountHBox.setVisible(true);<NEW_LINE>minAmountHBox.setManaged(true);<NEW_LINE>} else {<NEW_LINE>amountTextField.setDisable(true);<NEW_LINE>}<NEW_LINE>priceTextField.setText(model.price);<NEW_LINE>if (!model.isRange()) {<NEW_LINE>model.dataModel.getMissingFunds().addListener(missingFundsListener);<NEW_LINE>checkForMissingFunds(model.dataModel.getMissingFunds().get());<NEW_LINE>}<NEW_LINE>} | Res.get("shared.buy"))); |
1,370,962 | public static DataTcpWebServer start(DataServer dataServer) throws Exception {<NEW_LINE>File dataBaseDir = new File(Config.base(), "local/repository/data");<NEW_LINE>FileUtils.forceMkdir(dataBaseDir);<NEW_LINE>Server tcpServer = null;<NEW_LINE>Server webServer = null;<NEW_LINE>String password = Config.token().getPassword();<NEW_LINE>String[] tcps = new String[9];<NEW_LINE>tcps[0] = "-tcp";<NEW_LINE>tcps[1] = "-tcpAllowOthers";<NEW_LINE>tcps[2] = "-tcpPort";<NEW_LINE>tcps[3] = dataServer.getTcpPort().toString();<NEW_LINE>tcps[4] = "-baseDir";<NEW_LINE>tcps[5] = dataBaseDir.getAbsolutePath();<NEW_LINE>tcps[6] = "-tcpPassword";<NEW_LINE>tcps[7] = password;<NEW_LINE>tcps[8] = "-ifNotExists";<NEW_LINE>tcpServer = Server.createTcpServer(tcps).start();<NEW_LINE>Integer webPort = dataServer.getWebPort();<NEW_LINE>if ((null != webPort) && (webPort > 0)) {<NEW_LINE>String[<MASK><NEW_LINE>webs[0] = "-web";<NEW_LINE>webs[1] = "-webAllowOthers";<NEW_LINE>webs[2] = "-webPort";<NEW_LINE>webs[3] = webPort.toString();<NEW_LINE>webServer = Server.createWebServer(webs).start();<NEW_LINE>}<NEW_LINE>System.out.println("****************************************");<NEW_LINE>System.out.println("* data server start completed.");<NEW_LINE>System.out.println("* port: " + dataServer.getTcpPort() + ".");<NEW_LINE>System.out.println("* web console port: " + dataServer.getWebPort() + ".");<NEW_LINE>System.out.println("****************************************");<NEW_LINE>return new DataTcpWebServer(tcpServer, webServer);<NEW_LINE>} | ] webs = new String[4]; |
617,866 | protected boolean isSetAfterPart(Key key, PartialKey part) {<NEW_LINE>if (key != null) {<NEW_LINE>switch(part) {<NEW_LINE>case ROW:<NEW_LINE>return key.getColumnFamilyData().length() > 0 || key.getColumnQualifierData().length() > 0 || key.getColumnVisibilityData().length() > 0 || key.getTimestamp() < Long.MAX_VALUE || key.isDeleted();<NEW_LINE>case ROW_COLFAM:<NEW_LINE>return key.getColumnQualifierData().length() > 0 || key.getColumnVisibilityData().length() > 0 || key.getTimestamp() < Long.MAX_VALUE || key.isDeleted();<NEW_LINE>case ROW_COLFAM_COLQUAL:<NEW_LINE>return key.getColumnVisibilityData().length() > 0 || key.getTimestamp() < Long<MASK><NEW_LINE>case ROW_COLFAM_COLQUAL_COLVIS:<NEW_LINE>return key.getTimestamp() < Long.MAX_VALUE || key.isDeleted();<NEW_LINE>case ROW_COLFAM_COLQUAL_COLVIS_TIME:<NEW_LINE>return key.isDeleted();<NEW_LINE>case ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .MAX_VALUE || key.isDeleted(); |
231,892 | final AddApplicationCloudWatchLoggingOptionResult executeAddApplicationCloudWatchLoggingOption(AddApplicationCloudWatchLoggingOptionRequest addApplicationCloudWatchLoggingOptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addApplicationCloudWatchLoggingOptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddApplicationCloudWatchLoggingOptionRequest> request = null;<NEW_LINE>Response<AddApplicationCloudWatchLoggingOptionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddApplicationCloudWatchLoggingOptionRequestProtocolMarshaller(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, "Kinesis Analytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddApplicationCloudWatchLoggingOption");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddApplicationCloudWatchLoggingOptionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddApplicationCloudWatchLoggingOptionResultJsonUnmarshaller());<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(addApplicationCloudWatchLoggingOptionRequest)); |
1,030,032 | public void operationComplete(CommandFuture<V> commandFuture) throws Exception {<NEW_LINE>if (commandFuture.isSuccess()) {<NEW_LINE>future().setSuccess(commandFuture.get());<NEW_LINE>} else {<NEW_LINE>if (!shouldRetry(commandFuture.cause())) {<NEW_LINE>logger.info("[opetationComplete][retry fail than max retry]{}", command);<NEW_LINE>future().setFailure(commandFuture.cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (future().isDone()) {<NEW_LINE>logger.info("[future cancel][skip retry]{}, cause:{}", command, future().cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ExceptionUtils.isStackTraceUnnecessary(commandFuture.cause())) {<NEW_LINE>logger.error("[operationComplete]{}, {}", command, commandFuture.cause().getMessage());<NEW_LINE>} else {<NEW_LINE>logger.error("[operationComplete]" + command, commandFuture.cause());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>logger.info("[retry]{},{},{}", executeCount.get(), waitMilli, command);<NEW_LINE>command.reset();<NEW_LINE>execute(waitMilli, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>} | int waitMilli = retryPolicy.retryWaitMilli(); |
1,218,626 | public static CodegenExpression codegen(IntervalComputerAfterWithDeltaExprForge forge, CodegenExpression leftStart, CodegenExpression leftEnd, CodegenExpression rightStart, CodegenExpression rightEnd, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChild(EPTypePremade.BOOLEANPRIMITIVE.getEPType(), IntervalComputerAfterWithDeltaExprEval.class, codegenClassScope).addParam(IntervalForgeCodegenNames.PARAMS);<NEW_LINE>CodegenBlock block = methodNode.getBlock().declareVar(EPTypePremade.LONGPRIMITIVE.getEPType(), "rangeStartDelta", forge.start.codegen(IntervalForgeCodegenNames.REF_RIGHTSTART, methodNode, exprSymbol, codegenClassScope)).declareVar(EPTypePremade.LONGPRIMITIVE.getEPType(), "rangeEndDelta", forge.finish.codegen(IntervalForgeCodegenNames.REF_RIGHTSTART, methodNode, exprSymbol, codegenClassScope));<NEW_LINE>block.ifCondition(relational(ref("rangeStartDelta"), GT, ref("rangeEndDelta"))).blockReturn(staticMethod(IntervalComputerConstantAfter.class, "computeIntervalAfter", IntervalForgeCodegenNames.REF_LEFTSTART, IntervalForgeCodegenNames.REF_RIGHTEND, ref("rangeEndDelta"<MASK><NEW_LINE>block.methodReturn(staticMethod(IntervalComputerConstantAfter.class, "computeIntervalAfter", IntervalForgeCodegenNames.REF_LEFTSTART, IntervalForgeCodegenNames.REF_RIGHTEND, ref("rangeStartDelta"), ref("rangeEndDelta")));<NEW_LINE>return localMethod(methodNode, leftStart, leftEnd, rightStart, rightEnd);<NEW_LINE>} | ), ref("rangeStartDelta"))); |
4,739 | public void writeToParcel(Parcel dest, int flags) {<NEW_LINE>dest.writeInt(cropShape.ordinal());<NEW_LINE>dest.writeFloat(snapRadius);<NEW_LINE>dest.writeFloat(touchRadius);<NEW_LINE>dest.<MASK><NEW_LINE>dest.writeInt(scaleType.ordinal());<NEW_LINE>dest.writeByte((byte) (showCropOverlay ? 1 : 0));<NEW_LINE>dest.writeByte((byte) (showProgressBar ? 1 : 0));<NEW_LINE>dest.writeByte((byte) (autoZoomEnabled ? 1 : 0));<NEW_LINE>dest.writeByte((byte) (multiTouchEnabled ? 1 : 0));<NEW_LINE>dest.writeInt(maxZoom);<NEW_LINE>dest.writeFloat(initialCropWindowPaddingRatio);<NEW_LINE>dest.writeByte((byte) (fixAspectRatio ? 1 : 0));<NEW_LINE>dest.writeInt(aspectRatioX);<NEW_LINE>dest.writeInt(aspectRatioY);<NEW_LINE>dest.writeFloat(borderLineThickness);<NEW_LINE>dest.writeInt(borderLineColor);<NEW_LINE>dest.writeFloat(borderCornerThickness);<NEW_LINE>dest.writeFloat(borderCornerOffset);<NEW_LINE>dest.writeFloat(borderCornerLength);<NEW_LINE>dest.writeInt(borderCornerColor);<NEW_LINE>dest.writeFloat(guidelinesThickness);<NEW_LINE>dest.writeInt(guidelinesColor);<NEW_LINE>dest.writeInt(backgroundColor);<NEW_LINE>dest.writeInt(minCropWindowWidth);<NEW_LINE>dest.writeInt(minCropWindowHeight);<NEW_LINE>dest.writeInt(minCropResultWidth);<NEW_LINE>dest.writeInt(minCropResultHeight);<NEW_LINE>dest.writeInt(maxCropResultWidth);<NEW_LINE>dest.writeInt(maxCropResultHeight);<NEW_LINE>dest.writeParcelable(outputUri, flags);<NEW_LINE>dest.writeString(outputCompressFormat.name());<NEW_LINE>dest.writeInt(outputCompressQuality);<NEW_LINE>dest.writeInt(outputRequestWidth);<NEW_LINE>dest.writeInt(outputRequestHeight);<NEW_LINE>dest.writeInt(outputRequestSizeOptions.ordinal());<NEW_LINE>dest.writeInt(noOutputImage ? 1 : 0);<NEW_LINE>dest.writeParcelable(initialCropWindowRectangle, flags);<NEW_LINE>dest.writeInt(initialRotation);<NEW_LINE>dest.writeByte((byte) (allowRotation ? 1 : 0));<NEW_LINE>dest.writeInt(rotationDegrees);<NEW_LINE>} | writeInt(guidelines.ordinal()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.