idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,509,544
public void takeResult(Player player, ItemStack result, int amount) {<NEW_LINE>// local variable just to prevent race conditions if the field changes, though that is unlikely<NEW_LINE>CraftingRecipe recipe = this.lastRecipe;<NEW_LINE>if (recipe == null || this.level == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// fire crafting events<NEW_LINE>if (!recipe.isSpecial()) {<NEW_LINE>// unlock the recipe if it was not unlocked, so it shows in the recipe book<NEW_LINE>player.awardRecipes(Collections.singleton(recipe));<NEW_LINE>}<NEW_LINE>result.onCraftedBy(this.level, player, amount);<NEW_LINE>ForgeEventFactory.firePlayerCraftingEvent(player, result, this.craftingInventory);<NEW_LINE>// update all slots in the inventory<NEW_LINE>// remove remaining items<NEW_LINE>ForgeHooks.setCraftingPlayer(player);<NEW_LINE>NonNullList<ItemStack> remaining = recipe.getRemainingItems(craftingInventory);<NEW_LINE>ForgeHooks.setCraftingPlayer(null);<NEW_LINE>for (int i = 0; i < remaining.size(); ++i) {<NEW_LINE>ItemStack <MASK><NEW_LINE>ItemStack newStack = remaining.get(i);<NEW_LINE>// if empty or size 1, set directly (decreases by 1)<NEW_LINE>if (original.isEmpty() || original.getCount() == 1) {<NEW_LINE>this.setItem(i, newStack);<NEW_LINE>} else if (ItemStack.isSame(original, newStack) && ItemStack.tagMatches(original, newStack)) {<NEW_LINE>// if matching, merge (decreasing by 1<NEW_LINE>newStack.grow(original.getCount() - 1);<NEW_LINE>this.setItem(i, newStack);<NEW_LINE>} else {<NEW_LINE>// directly update the slot<NEW_LINE>this.setItem(i, ItemHandlerHelper.copyStackWithSize(original, original.getCount() - 1));<NEW_LINE>// otherwise, drop the item as the player<NEW_LINE>if (!newStack.isEmpty() && !player.getInventory().add(newStack)) {<NEW_LINE>player.drop(newStack, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
original = this.getItem(i);
752,697
public static PlayerInteractEvent callPlayerInteractEvent(ServerPlayerEntity who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, Hand hand) {<NEW_LINE>Player player = (who == null) ? null : (Player) ((IMixinServerEntityPlayer) who).getBukkitEntity();<NEW_LINE>CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack);<NEW_LINE>assert player != null;<NEW_LINE>WorldImpl WorldImpl = <MASK><NEW_LINE>CraftServer craftServer = (CraftServer) player.getServer();<NEW_LINE>Block blockClicked = null;<NEW_LINE>if (position != null) {<NEW_LINE>blockClicked = WorldImpl.getBlockAt(position.getX(), position.getY(), position.getZ());<NEW_LINE>} else {<NEW_LINE>switch(action) {<NEW_LINE>case LEFT_CLICK_BLOCK:<NEW_LINE>action = Action.LEFT_CLICK_AIR;<NEW_LINE>break;<NEW_LINE>case RIGHT_CLICK_BLOCK:<NEW_LINE>action = Action.RIGHT_CLICK_AIR;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BlockFace blockFace = CraftBlock.notchToBlockFace(direction);<NEW_LINE>if (itemInHand.getType() == Material.AIR || itemInHand.getAmount() == 0)<NEW_LINE>itemInHand = null;<NEW_LINE>PlayerInteractEvent event = new PlayerInteractEvent(player, action, itemInHand, blockClicked, blockFace, (hand == null) ? null : ((hand == Hand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND));<NEW_LINE>if (cancelledBlock)<NEW_LINE>event.setUseInteractedBlock(Event.Result.DENY);<NEW_LINE>craftServer.getPluginManager().callEvent(event);<NEW_LINE>return event;<NEW_LINE>}
(WorldImpl) player.getWorld();
12,512
public Optional<IdoResolvedResource> resolveCompactId(@Nonnull String compactId) {<NEW_LINE>String url = String.format("https://resolver.api.identifiers.org/%s", compactId);<NEW_LINE>HttpGet httpGet = new HttpGet(url);<NEW_LINE>try {<NEW_LINE>HttpResponse <MASK><NEW_LINE>if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>InputStream contentInputStream = response.getEntity().getContent();<NEW_LINE>IdoResponse idoResponse = objectMapper.readValue(contentInputStream, IdoResponse.class);<NEW_LINE>JsonNode payload = idoResponse.getPayload();<NEW_LINE>JsonNode resolvedResourcesNode = payload.path("resolvedResources");<NEW_LINE>List<IdoResolvedResource> resolvedResources = objectMapper.convertValue(resolvedResourcesNode, new TypeReference<List<IdoResolvedResource>>() {<NEW_LINE>});<NEW_LINE>return resolvedResources.stream().findFirst();<NEW_LINE>} else {<NEW_LINE>logger.debug("[IdentifiersDotOrg] Error code returned by identifiers.org {}", response.getStatusLine());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Error resolving compact id at identifiers.org", e);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
response = client.execute(httpGet);
306,234
public void onAnimationEnd(Animator animation) {<NEW_LINE>--mDismissAnimationRefCount;<NEW_LINE>if (mDismissAnimationRefCount == 0) {<NEW_LINE>// No active animations, process all pending dismisses.<NEW_LINE>// Sort by descending position<NEW_LINE>Collections.sort(mPendingDismisses);<NEW_LINE>int[] dismissPositions = new int[mPendingDismisses.size()];<NEW_LINE>for (int i = mPendingDismisses.size() - 1; i >= 0; i--) {<NEW_LINE>dismissPositions[i] = mPendingDismisses.get(i).position;<NEW_LINE>}<NEW_LINE>mCallbacks.onDismiss(mCardListView, dismissPositions);<NEW_LINE>// Reset mDownPosition to avoid MotionEvent.ACTION_UP trying to start a dismiss<NEW_LINE>// animation with a stale position<NEW_LINE>mDownPosition = ListView.INVALID_POSITION;<NEW_LINE>ViewGroup.LayoutParams lp;<NEW_LINE>for (PendingDismissData pendingDismiss : mPendingDismisses) {<NEW_LINE>// Reset view presentation<NEW_LINE>pendingDismiss.view.setAlpha(1f);<NEW_LINE>pendingDismiss.view.setTranslationX(0);<NEW_LINE>lp = pendingDismiss.view.getLayoutParams();<NEW_LINE>lp.height = 0;<NEW_LINE>pendingDismiss.view.setLayoutParams(lp);<NEW_LINE>}<NEW_LINE>// Send a cancel event<NEW_LINE>long time = SystemClock.uptimeMillis();<NEW_LINE>MotionEvent cancelEvent = MotionEvent.obtain(time, time, MotionEvent.<MASK><NEW_LINE>mCardListView.dispatchTouchEvent(cancelEvent);<NEW_LINE>mPendingDismisses.clear();<NEW_LINE>}<NEW_LINE>}
ACTION_CANCEL, 0, 0, 0);
1,086,547
final GetTestGridSessionResult executeGetTestGridSession(GetTestGridSessionRequest getTestGridSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTestGridSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTestGridSessionRequest> request = null;<NEW_LINE>Response<GetTestGridSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTestGridSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTestGridSessionRequest));<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, "GetTestGridSession");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTestGridSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTestGridSessionResultJsonUnmarshaller());<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, "Device Farm");
1,713,917
public Map<String, Object> toMap() {<NEW_LINE>Map<String, Object> m = new LinkedHashMap<String, Object>();<NEW_LINE>m.put("traceid", this.traceId);<NEW_LINE>m.put("spanid", this.spanId);<NEW_LINE>m.put("parentid", this.parentId);<NEW_LINE>m.put("eptype", this.endPointType.toString());<NEW_LINE>m.put("stime", this.startTime);<NEW_LINE>m.put("cost", this.cost);<NEW_LINE>m.put("ipport", this.appHostPort);<NEW_LINE>m.put("appid", this.appid);<NEW_LINE>m.<MASK><NEW_LINE>m.put("class", this.className);<NEW_LINE>m.put("method", this.methodName);<NEW_LINE>m.put("url", this.url);<NEW_LINE>m.put("state", this.state);<NEW_LINE>return m;<NEW_LINE>}
put("epinfo", this.endpointInfo);
1,169,042
public void update() {<NEW_LINE>Sandbox sandbox = Sandbox.getInstance();<NEW_LINE>OrthographicCamera camera = Sandbox.getInstance().getCamera();<NEW_LINE>int pixelPerWU = sandbox.sceneControl.sceneLoader.getRm().getProjectVO().pixelToWorld;<NEW_LINE>Vector2 position = Pools.obtain(Vector2.class);<NEW_LINE>position.x = 0;<NEW_LINE>position.y = 0;<NEW_LINE>TransformMathUtils.localToAscendantCoordinates(sandbox.getCurrentViewingEntity(), entity, position);<NEW_LINE>position = Sandbox.<MASK><NEW_LINE>setX((int) (position.x));<NEW_LINE>setY((int) (position.y));<NEW_LINE>if (// if we have a composite item ...<NEW_LINE>dimensionsComponent.boundBox != null) {<NEW_LINE>// .. we set the width to be the width of the AABB + the starting point of the AABB<NEW_LINE>// .. same for the height<NEW_LINE>setWidth(pixelPerWU * (dimensionsComponent.boundBox.x + dimensionsComponent.boundBox.width) * transformComponent.scaleX / camera.zoom);<NEW_LINE>setHeight(pixelPerWU * (dimensionsComponent.boundBox.y + dimensionsComponent.boundBox.height) * transformComponent.scaleY / camera.zoom);<NEW_LINE>} else {<NEW_LINE>setWidth(pixelPerWU * dimensionsComponent.width * transformComponent.scaleX / camera.zoom);<NEW_LINE>setHeight(pixelPerWU * dimensionsComponent.height * transformComponent.scaleY / camera.zoom);<NEW_LINE>}<NEW_LINE>Pools.free(position);<NEW_LINE>// setOrigin(transformComponent.originX, transformComponent.originY);<NEW_LINE>setRotation(transformComponent.rotation);<NEW_LINE>if (subFollowers != null) {<NEW_LINE>for (SubFollower follower : subFollowers) {<NEW_LINE>follower.update();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getInstance().worldToScreen(position);
818,715
public void updateModel(@NonNull Model model) {<NEW_LINE>this.shouldUpdate.set(true);<NEW_LINE>try {<NEW_LINE>modelLock.writeLock().lock();<NEW_LINE>if (replicatedModel instanceof MultiLayerNetwork) {<NEW_LINE>replicatedModel.setParams(model.params().unsafeDuplication(true));<NEW_LINE>Updater updater = ((MultiLayerNetwork) model).getUpdater();<NEW_LINE>INDArray view = updater.getStateViewArray();<NEW_LINE>if (view != null) {<NEW_LINE>updater = ((MultiLayerNetwork) replicatedModel).getUpdater();<NEW_LINE>INDArray viewD = view.dup();<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>updater.setStateViewArray((MultiLayerNetwork) replicatedModel, viewD, false);<NEW_LINE>}<NEW_LINE>} else if (replicatedModel instanceof ComputationGraph) {<NEW_LINE>replicatedModel.setParams(model.params().unsafeDuplication(true));<NEW_LINE>ComputationGraphUpdater updater = ((ComputationGraph) model).getUpdater();<NEW_LINE>INDArray view = updater.getStateViewArray();<NEW_LINE>if (view != null) {<NEW_LINE>INDArray viewD = view.dup();<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>updater = ((ComputationGraph) replicatedModel).getUpdater();<NEW_LINE>updater.setStateViewArray(viewD);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>} finally {<NEW_LINE>modelLock<MASK><NEW_LINE>}<NEW_LINE>}
.writeLock().unlock();
372,515
public int compareTo(beginBlobDownload_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = Boolean.valueOf(is_set_success()).<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_success()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_knf()).compareTo(other.is_set_knf());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_knf()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.knf, other.knf);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
compareTo(other.is_set_success());
157,466
public void handleChunkGenerate(ServerWorld world, Chunk chunk) {<NEW_LINE>if (!onchunkgenerate)<NEW_LINE>return;<NEW_LINE>FabricWorld fw = getWorld(world, false);<NEW_LINE>ChunkPos chunkPos = chunk.getPos();<NEW_LINE>int ymax = Integer.MIN_VALUE;<NEW_LINE>int ymin = Integer.MAX_VALUE;<NEW_LINE>ChunkSection[] sections = chunk.getSectionArray();<NEW_LINE>for (int i = 0; i < sections.length; i++) {<NEW_LINE>if ((sections[i] != null) && (!sections[i].isEmpty())) {<NEW_LINE>int sy = <MASK><NEW_LINE>if (sy < ymin)<NEW_LINE>ymin = sy;<NEW_LINE>if ((sy + 16) > ymax)<NEW_LINE>ymax = sy + 16;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ymax != Integer.MIN_VALUE) {<NEW_LINE>mapManager.touchVolume(fw.getName(), chunkPos.getStartX(), ymin, chunkPos.getStartZ(), chunkPos.getEndX(), ymax, chunkPos.getEndZ(), "chunkgenerate");<NEW_LINE>// Log.info("New generated chunk detected at %s[%s]".formatted(fw.getName(), chunkPos.getStartPos()));<NEW_LINE>}<NEW_LINE>}
sections[i].getYOffset();
691,667
public void transform() {<NEW_LINE>g = new int[8][8];<NEW_LINE>for (int i = 0; i < 8; i++) {<NEW_LINE>for (int j = 0; j < 8; j++) {<NEW_LINE>double ge = 0.0;<NEW_LINE>for (int x = 0; x < 8; x++) {<NEW_LINE>for (int y = 0; y < 8; y++) {<NEW_LINE>double cg1 = (2.0 * (double) x + 1.0) * (double) i * Math.PI / 16.0;<NEW_LINE>double cg2 = (2.0 * (double) y + 1.0) * (double) j * Math.PI / 16.0;<NEW_LINE>ge += ((double) f[x][y]) * Math.cos(cg1) * Math.cos(cg2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double ci = ((i == 0) ? 1.0 / Math.sqrt(2.0) : 1.0);<NEW_LINE>double cj = ((j == 0) ? 1.0 / Math.sqrt(2.0) : 1.0);<NEW_LINE>ge *= ci * cj * 0.25;<NEW_LINE>g[i][j] = (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int) Math.round(ge);
567,814
private void dealWithUnsatisifedXMLTimers(Map<String, List<com.ibm.ws.javaee.dd.ejb.Timer>> timers1ParmByMethodName, Map<String, List<com.ibm.ws.javaee.dd.ejb.Timer>> timers0ParmByMethodName, BeanMetaData bmd) throws EJBConfigurationException {<NEW_LINE>String oneMethodInError = null;<NEW_LINE>String last1ParmError = dealWithUnsatisfiedXMLTimers(timers1ParmByMethodName, bmd);<NEW_LINE>String last0ParmError = dealWithUnsatisfiedXMLTimers(timers0ParmByMethodName, bmd);<NEW_LINE>// We log all the methods-in-error, but we only explicitly callout one of them in the exception, and it doesn't matter which one we pick.<NEW_LINE>if (last1ParmError != null) {<NEW_LINE>oneMethodInError = last1ParmError;<NEW_LINE>} else {<NEW_LINE>if (last0ParmError != null) {<NEW_LINE>oneMethodInError = last0ParmError;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oneMethodInError != null) {<NEW_LINE>throw new EJBConfigurationException("CNTR0210: The " + bmd.j2eeName.getComponent() + " enterprise bean in the " + bmd.j2eeName.getModule(<MASK><NEW_LINE>}<NEW_LINE>}
) + " module has an automatic timer configured in the deployment descriptor for the " + oneMethodInError + " method, but no timeout callback method with that name was found.");
1,573,772
public static void addMapViewLanguageMenuItems(final Menu menu) {<NEW_LINE>final MenuItem parentMenu = menu.findItem(R.id.menu_select_language);<NEW_LINE>if (languages != null) {<NEW_LINE>final int currentLanguage = Settings.getMapLanguageId();<NEW_LINE>final SubMenu subMenu = parentMenu.getSubMenu();<NEW_LINE>subMenu.add(R.id.menu_group_map_languages, MAP_LANGUAGE_DEFAULT_ID, 0, R.string.switch_default).setCheckable(true).setChecked(MAP_LANGUAGE_DEFAULT_ID == currentLanguage);<NEW_LINE>for (int i = 0; i < languages.length; i++) {<NEW_LINE>final int languageId = <MASK><NEW_LINE>subMenu.add(R.id.menu_group_map_languages, languageId, i, languages[i]).setCheckable(true).setChecked(languageId == currentLanguage);<NEW_LINE>}<NEW_LINE>subMenu.setGroupCheckable(R.id.menu_group_map_languages, true, true);<NEW_LINE>parentMenu.setVisible(languages.length > 1);<NEW_LINE>} else {<NEW_LINE>parentMenu.setVisible(false);<NEW_LINE>}<NEW_LINE>}
languages[i].hashCode();
34,922
public void saveGpx(final String fileName) {<NEW_LINE>new SaveGpxAsyncTask(app, getGpx(), fileName, false).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>hasUnsavedChanges = false;<NEW_LINE>app.getMapMarkersHelper().addOrEnableGroup(getGpx());<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onPointsSaved();<NEW_LINE>}<NEW_LINE>snackbar = Snackbar.make(mainView, String.format(getString(R.string.shared_string_file_is_saved), fileName) + ".", Snackbar.LENGTH_LONG).setAction(R.string.shared_string_show, new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>TrackMenuFragment.openTrack(app, new File(getGpx<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>UiUtilities.setupSnackbar(snackbar, !lightTheme);<NEW_LINE>snackbar.show();<NEW_LINE>}
().path), null);
187,951
public static boolean matchesAqueryFilters(ActionAnalysisMetadata action, AqueryActionFilter actionFilters) {<NEW_LINE>NestedSet<Artifact> inputs = action.getInputs();<NEW_LINE>Iterable<Artifact> outputs = action.getOutputs();<NEW_LINE><MASK><NEW_LINE>if (actionFilters.hasFilterForFunction(MNEMONIC)) {<NEW_LINE>if (!actionFilters.matchesAllPatternsForFunction(MNEMONIC, mnemonic)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (actionFilters.hasFilterForFunction(INPUTS)) {<NEW_LINE>Boolean containsFile = inputs.toList().stream().anyMatch(artifact -> actionFilters.matchesAllPatternsForFunction(INPUTS, artifact.getExecPathString()));<NEW_LINE>if (!containsFile) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (actionFilters.hasFilterForFunction(OUTPUTS)) {<NEW_LINE>Boolean containsFile = Streams.stream(outputs).anyMatch(artifact -> actionFilters.matchesAllPatternsForFunction(OUTPUTS, artifact.getExecPathString()));<NEW_LINE>return containsFile;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
String mnemonic = action.getMnemonic();
98,986
public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException {<NEW_LINE>p_file.start_scope();<NEW_LINE>p_file.write("polygon ");<NEW_LINE>p_identifier_type.write(this.layer.name, p_file);<NEW_LINE>p_file.write(" ");<NEW_LINE>p_file.write((Integer.valueOf(0)).toString());<NEW_LINE>int corner_count = coor.length / 2;<NEW_LINE>for (int i = 0; i < corner_count; ++i) {<NEW_LINE>p_file.new_line();<NEW_LINE>Integer curr_coor = (int) Math.round(coor[2 * i]);<NEW_LINE>p_file.<MASK><NEW_LINE>p_file.write(" ");<NEW_LINE>curr_coor = (int) Math.round(coor[2 * i + 1]);<NEW_LINE>p_file.write(curr_coor.toString());<NEW_LINE>}<NEW_LINE>p_file.end_scope();<NEW_LINE>}
write(curr_coor.toString());
790,151
public void putFloats(long[] time, float[] value, BitMap bitMap, int start, int end) {<NEW_LINE>checkExpansion();<NEW_LINE>int idx = start;<NEW_LINE>// constraint: time.length + timeIdxOffset == value.length<NEW_LINE>int timeIdxOffset = 0;<NEW_LINE>if (bitMap != null && !bitMap.isAllUnmarked()) {<NEW_LINE>// time array is a reference, should clone necessary time values<NEW_LINE>long[] clonedTime = new long[end - start];<NEW_LINE>System.arraycopy(time, start, <MASK><NEW_LINE>time = clonedTime;<NEW_LINE>timeIdxOffset = start;<NEW_LINE>// drop null at the end of value array<NEW_LINE>int nullCnt = dropNullValThenUpdateMinTimeAndSorted(time, value, bitMap, start, end, timeIdxOffset);<NEW_LINE>end -= nullCnt;<NEW_LINE>} else {<NEW_LINE>updateMinTimeAndSorted(time, start, end);<NEW_LINE>}<NEW_LINE>while (idx < end) {<NEW_LINE>int inputRemaining = end - idx;<NEW_LINE>int arrayIdx = rowCount / ARRAY_SIZE;<NEW_LINE>int elementIdx = rowCount % ARRAY_SIZE;<NEW_LINE>int internalRemaining = ARRAY_SIZE - elementIdx;<NEW_LINE>if (internalRemaining >= inputRemaining) {<NEW_LINE>// the remaining inputs can fit the last array, copy all remaining inputs into last array<NEW_LINE>System.arraycopy(time, idx - timeIdxOffset, timestamps.get(arrayIdx), elementIdx, inputRemaining);<NEW_LINE>System.arraycopy(value, idx, values.get(arrayIdx), elementIdx, inputRemaining);<NEW_LINE>rowCount += inputRemaining;<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>// the remaining inputs cannot fit the last array, fill the last array and create a new<NEW_LINE>// one and enter the next loop<NEW_LINE>System.arraycopy(time, idx - timeIdxOffset, timestamps.get(arrayIdx), elementIdx, internalRemaining);<NEW_LINE>System.arraycopy(value, idx, values.get(arrayIdx), elementIdx, internalRemaining);<NEW_LINE>idx += internalRemaining;<NEW_LINE>rowCount += internalRemaining;<NEW_LINE>checkExpansion();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
clonedTime, 0, end - start);
822,227
public void serialize(XPathBodyDTO xPathBodyDTO, JsonGenerator jgen, SerializerProvider provider) throws IOException {<NEW_LINE>jgen.writeStartObject();<NEW_LINE>if (xPathBodyDTO.getNot() != null && xPathBodyDTO.getNot()) {<NEW_LINE>jgen.writeBooleanField("not", xPathBodyDTO.getNot());<NEW_LINE>}<NEW_LINE>if (xPathBodyDTO.getOptional() != null && xPathBodyDTO.getOptional()) {<NEW_LINE>jgen.writeBooleanField("optional", xPathBodyDTO.getOptional());<NEW_LINE>}<NEW_LINE>jgen.writeStringField("type", xPathBodyDTO.<MASK><NEW_LINE>jgen.writeStringField("xpath", xPathBodyDTO.getXPath());<NEW_LINE>if (xPathBodyDTO.getNamespacePrefixes() != null) {<NEW_LINE>jgen.writeObjectFieldStart("namespacePrefixes");<NEW_LINE>for (Map.Entry<String, String> entry : xPathBodyDTO.getNamespacePrefixes().entrySet()) {<NEW_LINE>jgen.writeStringField(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>}
getType().name());
630,124
public void execute(final EditorAdaptor editorAdaptor, final int count) throws CommandExecutionException {<NEW_LINE>final IWorkbenchPartSite site = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite();<NEW_LINE>final EPartService psvc = (EPartService) <MASK><NEW_LINE>final MPart p = (MPart) site.getService(MPart.class);<NEW_LINE>final MElementContainer<MUIElement> editorStack = p.getParent();<NEW_LINE>final List<MUIElement> tabs = editorStack.getChildren();<NEW_LINE>int newIdx;<NEW_LINE>if (count == NO_COUNT_GIVEN) {<NEW_LINE>//<NEW_LINE>// Just switch to the next/previous tab<NEW_LINE>//<NEW_LINE>final MUIElement selectedTab = editorStack.getSelectedElement();<NEW_LINE>final int selectedIdx = tabs.indexOf(selectedTab);<NEW_LINE>if (direction == SwitchTabDirection.NEXT) {<NEW_LINE>newIdx = (selectedIdx + 1) % tabs.size();<NEW_LINE>} else {<NEW_LINE>assert direction == SwitchTabDirection.PREVIOUS;<NEW_LINE>if (selectedIdx == 0) {<NEW_LINE>newIdx = tabs.size() - 1;<NEW_LINE>} else {<NEW_LINE>newIdx = selectedIdx - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>//<NEW_LINE>// Switch to a particular tab specified by the count<NEW_LINE>//<NEW_LINE>if (count < 1 || count > tabs.size()) {<NEW_LINE>// Invalid count, ignore<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>newIdx = count - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final MUIElement newTab = tabs.get(newIdx);<NEW_LINE>if (newTab instanceof MPart) {<NEW_LINE>psvc.activate((MPart) newTab, true);<NEW_LINE>}<NEW_LINE>}
site.getService(EPartService.class);
369,443
private void pushLaunchPopup() {<NEW_LINE>Config config = context.get(Config.class);<NEW_LINE>TelemetryConfig telemetryConfig = config.getTelemetryConfig();<NEW_LINE>TranslationSystem translationSystem = context.get(TranslationSystem.class);<NEW_LINE><MASK><NEW_LINE>if (!telemetryConfig.isLaunchPopupDisabled()) {<NEW_LINE>String telemetryTitle = translationSystem.translate("${engine:menu#telemetry-launch-popup-title}");<NEW_LINE>String telemetryMessage = translationSystem.translate("${engine:menu#telemetry-launch-popup-text}");<NEW_LINE>LaunchPopup telemetryConfirmPopup = nuiManager.pushScreen(LaunchPopup.ASSET_URI, LaunchPopup.class);<NEW_LINE>telemetryConfirmPopup.setMessage(telemetryTitle, telemetryMessage);<NEW_LINE>telemetryConfirmPopup.setYesHandler(() -> {<NEW_LINE>telemetryConfig.setTelemetryAndErrorReportingEnable(true);<NEW_LINE>// Enable error reporting<NEW_LINE>appender.start();<NEW_LINE>});<NEW_LINE>telemetryConfirmPopup.setNoHandler(() -> {<NEW_LINE>telemetryConfig.setTelemetryAndErrorReportingEnable(false);<NEW_LINE>// Disable error reporting<NEW_LINE>appender.stop();<NEW_LINE>});<NEW_LINE>telemetryConfirmPopup.setOptionButtonText(translationSystem.translate("${engine:menu#telemetry-button}"));<NEW_LINE>telemetryConfirmPopup.setOptionHandler(() -> {<NEW_LINE>nuiManager.pushScreen(TelemetryScreen.ASSET_URI, TelemetryScreen.class);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
TelemetryLogstashAppender appender = TelemetryUtils.fetchTelemetryLogstashAppender();
1,083,348
public VmServerAddress unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>VmServerAddress vmServerAddress = new VmServerAddress();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("vmManagerId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>vmServerAddress.setVmManagerId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("vmId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>vmServerAddress.setVmId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return vmServerAddress;<NEW_LINE>}
class).unmarshall(context));
1,374,021
protected boolean decodeMode(AztecPyramid locator, AztecCode marker) {<NEW_LINE>marker.locator.setTo(locator);<NEW_LINE>Structure type = locator.layers.size == 1 ? Structure.COMPACT : Structure.FULL;<NEW_LINE>// Read the pixel values once<NEW_LINE>readModeBitsFromImage(locator);<NEW_LINE>// Determine the orientation<NEW_LINE>int orientation = selectOrientationAndTranspose(type);<NEW_LINE>if (orientation < 0) {<NEW_LINE>marker.failure = AztecCode.Failure.ORIENTATION;<NEW_LINE>if (verbose != null)<NEW_LINE>verbose.println("failed to find a valid orientation");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// See if it needs to handle a transposed marker<NEW_LINE>marker.transposed = orientation >= 4;<NEW_LINE>if (marker.transposed) {<NEW_LINE>orientation -= 4;<NEW_LINE>transposeModeBitArray(imageBits, bits);<NEW_LINE>}<NEW_LINE>// Read data bits given known orientation<NEW_LINE>extractModeDataBits(orientation, type);<NEW_LINE>// Rotate the locator pattern so that it's in the canonical position. corner[0] is top left<NEW_LINE>for (int i = 0; i < orientation; i++) {<NEW_LINE>for (int layerIdx = 0; layerIdx < marker.locator.layers.size; layerIdx++) {<NEW_LINE>if (marker.transposed) {<NEW_LINE>UtilPolygons2D_F64.shiftDown(marker.locator.layers.get(layerIdx).square);<NEW_LINE>} else {<NEW_LINE>UtilPolygons2D_F64.shiftUp(marker.locator.layers<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Apply error correction and extract the mode<NEW_LINE>marker.structure = type;<NEW_LINE>if (!decoderMode.decodeMode(bits, marker)) {<NEW_LINE>marker.failure = AztecCode.Failure.MODE_ECC;<NEW_LINE>if (verbose != null)<NEW_LINE>verbose.println("error correction failed when decoding mode");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Sanity check the mode<NEW_LINE>if (marker.messageWordCount > marker.getCapacityWords()) {<NEW_LINE>if (verbose != null)<NEW_LINE>verbose.println("number of message words exceeds marker capacity");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.get(layerIdx).square);
1,233,183
public com.amazonaws.services.organizations.model.EffectivePolicyNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.organizations.model.EffectivePolicyNotFoundException effectivePolicyNotFoundException = new com.amazonaws.services.organizations.model.EffectivePolicyNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return effectivePolicyNotFoundException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,742,011
public void uncaughtException(Thread thread, Throwable ex) {<NEW_LINE>ShareTinkerLog.e(TAG, "TinkerUncaughtHandler catch exception:" + Log.getStackTraceString(ex));<NEW_LINE>ueh.uncaughtException(thread, ex);<NEW_LINE>if (crashFile != null) {<NEW_LINE>Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();<NEW_LINE>// only catch real uncaught Exception<NEW_LINE>if (handler instanceof TinkerUncaughtHandler) {<NEW_LINE>File parentFile = crashFile.getParentFile();<NEW_LINE>if (!parentFile.exists() && !parentFile.mkdirs()) {<NEW_LINE>ShareTinkerLog.e(TAG, "print crash file error: create directory fail!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PrintWriter pw = null;<NEW_LINE>try {<NEW_LINE>pw = new PrintWriter(new FileWriter(crashFile, false));<NEW_LINE>pw.println("process:" + ShareTinkerInternals.getProcessName(this.context));<NEW_LINE>pw.println(ShareTinkerInternals.getExceptionCauseString(ex));<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>ShareTinkerLog.e(TAG, "print crash file error:" + Log.getStackTraceString(e));<NEW_LINE>} finally {<NEW_LINE>SharePatchFileUtil.closeQuietly(pw);<NEW_LINE>}<NEW_LINE>android.os.Process.killProcess(android.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
os.Process.myPid());
174,913
private static String formatFolderListingTableHtml(String folderName, List<FileMetadata> fileMetadatas, String apiLocation, boolean originals) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(formatFolderListingTableHeaderHtml());<NEW_LINE>for (FileMetadata fileMetadata : fileMetadatas) {<NEW_LINE>String localFolder = fileMetadata.getDirectoryLabel() == null ? "" : fileMetadata.getDirectoryLabel();<NEW_LINE>if (folderName.equals(localFolder)) {<NEW_LINE>String accessUrl = getFileAccessUrl(fileMetadata, apiLocation, originals);<NEW_LINE>sb.append(formatFileListEntryHtml(fileMetadata, accessUrl));<NEW_LINE>sb.append("\n");<NEW_LINE>} else if (localFolder.startsWith(folderName)) {<NEW_LINE>String subFolder = "".equals(folderName) ? localFolder : localFolder.substring(folderName.length() + 1);<NEW_LINE>if (subFolder.indexOf('/') > 0) {<NEW_LINE>subFolder = subFolder.substring(0<MASK><NEW_LINE>}<NEW_LINE>String folderAccessUrl = getFolderAccessUrl(fileMetadata.getDatasetVersion(), folderName, subFolder, apiLocation, originals);<NEW_LINE>sb.append(formatFileListFolderHtml(subFolder, folderAccessUrl));<NEW_LINE>sb.append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return formatTable(sb.toString());<NEW_LINE>}
, subFolder.indexOf('/'));
528,051
protected synchronized // but it does not hurt. Just to be safe.<NEW_LINE>void initPool(ResourceAllocator allocator) throws PoolingException {<NEW_LINE>if (poolInitialized) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.allocator = allocator;<NEW_LINE>createResources(this.allocator, <MASK><NEW_LINE>// if the idle time out is 0, then don't schedule the resizer task<NEW_LINE>if (idletime > 0) {<NEW_LINE>scheduleResizerTask();<NEW_LINE>}<NEW_LINE>// Need to set the numConnFree of monitoring statistics to the steadyPoolSize<NEW_LINE>// as monitoring might be ON during the initialization of pool.<NEW_LINE>// Need not worry about the numConnUsed here as it would be initialized to<NEW_LINE>// 0 automatically.<NEW_LINE>if (poolLifeCycleListener != null) {<NEW_LINE>poolLifeCycleListener.connectionsFreed(steadyPoolSize);<NEW_LINE>}<NEW_LINE>poolInitialized = true;<NEW_LINE>}
steadyPoolSize - ds.getResourcesSize());
652,265
public UriBuilder queryParam(String name, Object... values) throws IllegalArgumentException {<NEW_LINE>if (values == null) {<NEW_LINE>throw new IllegalArgumentException("The values must not be null");<NEW_LINE>}<NEW_LINE>CharSequence ncs;<NEW_LINE>ncs = EncodeOrCheck.nameOrValue(name, true, "query parameter name");<NEW_LINE>final List<String> valuesStr = new ArrayList<String>();<NEW_LINE>for (final Object value : values) {<NEW_LINE>final String vcs = EncodeOrCheck.nameOrValue(value, true, "query parameter value");<NEW_LINE>valuesStr.add(vcs);<NEW_LINE>}<NEW_LINE>final Iterator<String> valueIter = valuesStr.iterator();<NEW_LINE>StringBuilder query;<NEW_LINE>if (this.query == null) {<NEW_LINE>query = new StringBuilder();<NEW_LINE>this.query = query;<NEW_LINE>} else if (this.query instanceof StringBuilder) {<NEW_LINE><MASK><NEW_LINE>query.append('&');<NEW_LINE>} else {<NEW_LINE>query = new StringBuilder(this.query.toString());<NEW_LINE>query.append('&');<NEW_LINE>}<NEW_LINE>query.append(ncs);<NEW_LINE>query.append('=');<NEW_LINE>query.append(valueIter.next());<NEW_LINE>while (valueIter.hasNext()) {<NEW_LINE>query.append('&');<NEW_LINE>query.append(ncs);<NEW_LINE>query.append('=');<NEW_LINE>query.append(valueIter.next());<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
query = (StringBuilder) this.query;
638,622
private <K, InputT> boolean isApplicable(Map<TupleTag<?>, PCollection<?>> inputs, GlobalCombineFn<InputT, ?, ?> fn) {<NEW_LINE>if (!(fn instanceof CombineFn)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (inputs.size() == 1) {<NEW_LINE>PCollection<KV<K, InputT>> input = (PCollection<KV<K, InputT>>) Iterables.getOnlyElement(inputs.values());<NEW_LINE>WindowingStrategy<?, ?> windowingStrategy = input.getWindowingStrategy();<NEW_LINE>boolean windowFnApplicable = !windowingStrategy.needsMerge();<NEW_LINE>// Triggering with count based triggers is not appropriately handled here. Disabling<NEW_LINE>// most triggers is safe, though more broad than is technically required.<NEW_LINE>boolean triggerApplicable = DefaultTrigger.of().equals(windowingStrategy.getTrigger());<NEW_LINE>boolean accumulatorCoderAvailable;<NEW_LINE>try {<NEW_LINE>if (input.getCoder() instanceof KvCoder) {<NEW_LINE>KvCoder<K, InputT> kvCoder = (KvCoder<K, InputT>) input.getCoder();<NEW_LINE>Coder<?> accumulatorCoder = fn.getAccumulatorCoder(input.getPipeline().getCoderRegistry(), kvCoder.getValueCoder());<NEW_LINE>accumulatorCoderAvailable = accumulatorCoder != null;<NEW_LINE>} else {<NEW_LINE>accumulatorCoderAvailable = false;<NEW_LINE>}<NEW_LINE>} catch (CannotProvideCoderException e) {<NEW_LINE>throw new RuntimeException(String.format("Could not construct an accumulator %s for %s. Accumulator %s for a %s may be" + " null, but may not throw an exception", Coder.class.getSimpleName(), fn, Coder.class.getSimpleName(), Combine.class<MASK><NEW_LINE>}<NEW_LINE>return windowFnApplicable && triggerApplicable && accumulatorCoderAvailable;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getSimpleName()), e);
1,334,090
final ListLicensesResult executeListLicenses(ListLicensesRequest listLicensesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLicensesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListLicensesRequest> request = null;<NEW_LINE>Response<ListLicensesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLicensesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLicensesRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLicenses");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLicensesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListLicensesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
341,861
private void snapshotScriptFileTo(String fileName, File sourceFile, File outputFile, boolean binary, boolean wrapped) throws IOException {<NEW_LINE>JSRealm realm = JavaScriptLanguage.getCurrentJSRealm();<NEW_LINE>JSContext context = realm.getContext();<NEW_LINE>Recording.logv("recording snapshot of %s", fileName);<NEW_LINE>Source.SourceBuilder builder = Source.newBuilder(JavaScriptLanguage.ID, realm.getEnv().getPublicTruffleFile(sourceFile.getPath())).name(fileName);<NEW_LINE>Source source = builder.build();<NEW_LINE>String prefix;<NEW_LINE>String suffix;<NEW_LINE>if (wrapped) {<NEW_LINE>// Wrapped source, i.e., source in the form<NEW_LINE>// delimiter + prefix + delimiter + body + delimiter + suffix<NEW_LINE>String code = source.getCharacters().toString();<NEW_LINE>char delimiter = code.charAt(0);<NEW_LINE>int prefixEnd = code.indexOf(delimiter, 1);<NEW_LINE>int suffixStart = code.indexOf(delimiter, prefixEnd + 1);<NEW_LINE>prefix = code.substring(1, prefixEnd);<NEW_LINE>String body = code.substring(prefixEnd + 1, suffixStart);<NEW_LINE>suffix = code.substring(suffixStart + 1);<NEW_LINE>source = Source.newBuilder(JavaScriptLanguage.ID, body, fileName).build();<NEW_LINE>} else {<NEW_LINE>prefix = "";<NEW_LINE>suffix = "";<NEW_LINE>}<NEW_LINE>try (TimerCloseable timer = timeStats.file(fileName)) {<NEW_LINE>final Recording rec = Recording.recordSource(source, context, false, prefix, suffix);<NEW_LINE>outputFile.getParentFile().mkdirs();<NEW_LINE>try (FileOutputStream outs = new FileOutputStream(outputFile)) {<NEW_LINE>rec.saveToStream(fileName, outs, binary);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new RuntimeException(fileName, e);
1,820,817
protected String handleOtherXCosts(Game game, Player controller) {<NEW_LINE>StringBuilder announceString = new StringBuilder();<NEW_LINE>for (VariableCost variableCost : this.costs.getVariableCosts()) {<NEW_LINE>if (!(variableCost instanceof VariableManaCost) && !((Cost) variableCost).isPaid()) {<NEW_LINE>int xValue = variableCost.announceXValue(this, game);<NEW_LINE>Cost fixedCost = variableCost.getFixedCostsFromAnnouncedValue(xValue);<NEW_LINE>if (fixedCost != null) {<NEW_LINE>costs.add(fixedCost);<NEW_LINE>}<NEW_LINE>// set the xcosts to paid<NEW_LINE>// no x events - rules from Unbound Flourishing:<NEW_LINE>// - Spells with additional costs that include X won't be affected by Unbound Flourishing. X must be in the spell's mana cost.<NEW_LINE>variableCost.setAmount(xValue, xValue, false);<NEW_LINE>((Cost) variableCost).setPaid();<NEW_LINE>String message = controller.getLogName() + " announces a value of " + xValue + " (" <MASK><NEW_LINE>announceString.append(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return announceString.toString();<NEW_LINE>}
+ variableCost.getActionText() + ')';
1,804,423
final GetResourceMetricsResult executeGetResourceMetrics(GetResourceMetricsRequest getResourceMetricsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getResourceMetricsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetResourceMetricsRequest> request = null;<NEW_LINE>Response<GetResourceMetricsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetResourceMetricsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getResourceMetricsRequest));<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, "PI");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetResourceMetrics");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetResourceMetricsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetResourceMetricsResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
1,593,620
public Serializable doTestWork(EntityManager em, UserTransaction tx, Object managedComponentObject) {<NEW_LINE>System.out.println("Begin Running TestWorkRequest.doTestWork(twr) on " + managedComponentObject + " ...");<NEW_LINE>try {<NEW_LINE>System.out.println("Finding SimpleVersionedEntity10(id=" + identity + ") ...");<NEW_LINE>SimpleVersionedEntity10 findEntity = em.find(SimpleVersionedEntity10.class, identity);<NEW_LINE>Assert.assertNotNull("Assert find did not return null.", findEntity);<NEW_LINE>Assert.assertTrue("Assert that the EntityManager is associated with a transaction.", em.isJoinedToTransaction());<NEW_LINE>Assert.assertSame("Assert that find did return the same entity.", entityContainer<MASK><NEW_LINE>Assert.assertSame("Assert that the delegate EntityManager used in components 1 and 2 are the same", emContainer.get(0), em.getDelegate());<NEW_LINE>} finally {<NEW_LINE>System.out.println("End Running TestWorkRequest.doTestWork() on " + managedComponentObject + " ...");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.get(0), findEntity);
619,934
// </editor-fold>//GEN-END:initComponents<NEW_LINE>private void chooseFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_chooseFolderButtonActionPerformed<NEW_LINE>JTextComponent comboEditor = ((JTextComponent) urlComboBox.getEditor().getEditorComponent());<NEW_LINE>File file = null;<NEW_LINE>try {<NEW_LINE>URI uri = new URI(comboEditor.getText());<NEW_LINE>file = new File(uri);<NEW_LINE>} catch (URISyntaxException | IllegalArgumentException ex) {<NEW_LINE>//<NEW_LINE>}<NEW_LINE>JFileChooser fileChooser = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>AccessibleJFileChooser(NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.FileChooser.Descritpion"), file);<NEW_LINE>// NOI18N<NEW_LINE>fileChooser.setDialogTitle(NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.FileChooser.Title"));<NEW_LINE>fileChooser.setMultiSelectionEnabled(false);<NEW_LINE>fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>fileChooser.showDialog(this, null);<NEW_LINE><MASK><NEW_LINE>if (f != null) {<NEW_LINE>comboEditor.setText(f.toURI().toString());<NEW_LINE>}<NEW_LINE>}
File f = fileChooser.getSelectedFile();
1,393,211
public void execute(AdminCommandContext adminCommandContext) {<NEW_LINE>Config targetConfig = targetUtil.getConfig(target);<NEW_LINE>if (targetConfig == null) {<NEW_LINE>adminCommandContext.getActionReport().setMessage("No such config name: " + targetUtil);<NEW_LINE>adminCommandContext.getActionReport().setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EjbInvokerConfiguration configuration = targetConfig.getExtensionByType(EjbInvokerConfiguration.class);<NEW_LINE>ColumnFormatter columnFormatter = new ColumnFormatter(OUTPUT_HEADERS);<NEW_LINE>Object[] outputValues = { configuration.getEnabled(), configuration.getEndpoint(), configuration.getVirtualServers(), configuration.getSecurityEnabled(), configuration.getRealmName(), configuration.getAuthType(), configuration.getAuthModule(), configuration.getAuthModuleClass(), configuration.getRoles() };<NEW_LINE>columnFormatter.addRow(outputValues);<NEW_LINE>adminCommandContext.getActionReport().appendMessage(columnFormatter.toString());<NEW_LINE>Map<String, Object> extraPropertiesMap = new HashMap<>();<NEW_LINE>extraPropertiesMap.put("enabled", configuration.getEnabled());<NEW_LINE>extraPropertiesMap.put("endpoint", configuration.getEndpoint());<NEW_LINE>extraPropertiesMap.put("virtualServers", configuration.getVirtualServers());<NEW_LINE>extraPropertiesMap.put("securityEnabled", configuration.getSecurityEnabled());<NEW_LINE>extraPropertiesMap.put("realmName", configuration.getRealmName());<NEW_LINE>extraPropertiesMap.put("authType", configuration.getAuthType());<NEW_LINE>extraPropertiesMap.put("authModule", configuration.getAuthModule());<NEW_LINE>extraPropertiesMap.put("authModuleClass", configuration.getAuthModuleClass());<NEW_LINE>extraPropertiesMap.put("roles", configuration.getRoles());<NEW_LINE>Properties extraProperties = new Properties();<NEW_LINE>extraProperties.put("ejbInvokerConfiguration", extraPropertiesMap);<NEW_LINE>adminCommandContext.<MASK><NEW_LINE>}
getActionReport().setExtraProperties(extraProperties);
900,741
private void uiTest() throws Exception {<NEW_LINE>screens = new Screens(new Framebuffer(config), config.teamName);<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>String input = screens.readQRCode();<NEW_LINE>if (!screens.approveAction("You are trying to transfer 10000 btc to hackers. Sounds cool?")) {<NEW_LINE>System.out.println("Rejected!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>screens.promptForOperatorCard("Please insert Operator Card and then press enter");<NEW_LINE>String passwordPrompt = "Please type your Operator Card password";<NEW_LINE>while (true) {<NEW_LINE>String password = screens.promptPassword(passwordPrompt);<NEW_LINE>if (password.equals("ponies")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>passwordPrompt = "Incorrect. Please type your Operator Card password";<NEW_LINE>}<NEW_LINE>screens.removeOperatorCard("Please remove Operator card and then hit <enter>.");<NEW_LINE>// Please wait screen should now be displayed<NEW_LINE>Thread.sleep(3000);<NEW_LINE>// Generate a big QR code:<NEW_LINE>String big = new String(new char[1999]).replace("\0", "M");<NEW_LINE>// return value ignored so exit doesn't work<NEW_LINE>screens.displayQRCode(big);<NEW_LINE>// reflect back the original scanned QR code:<NEW_LINE>Screens.ExitOrRestartOrPowerOff <MASK><NEW_LINE>if (command == Screens.ExitOrRestartOrPowerOff.Exit) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// otherwise command was restart, and we loop.<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>screens.exception(e);<NEW_LINE>}<NEW_LINE>}
command = screens.displayQRCode(input);
1,413,925
private synchronized void check() {<NEW_LINE>if (closeable.isClosing()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RequestHeaders headers;<NEW_LINE>final RequestHeadersBuilder builder = RequestHeaders.builder(useGet ? HttpMethod.GET : HttpMethod.HEAD, path).authority(authority);<NEW_LINE>if (maxLongPollingSeconds > 0) {<NEW_LINE>headers = builder.add(HttpHeaderNames.IF_NONE_MATCH, wasHealthy ? "\"healthy\"" : "\"unhealthy\"").add(HttpHeaderNames.PREFER, "wait=" + maxLongPollingSeconds).build();<NEW_LINE>} else {<NEW_LINE>headers = builder.build();<NEW_LINE>}<NEW_LINE>try (ClientRequestContextCaptor reqCtxCaptor = Clients.newContextCaptor()) {<NEW_LINE>lastResponse = webClient.execute(headers);<NEW_LINE>final ClientRequestContext reqCtx = reqCtxCaptor.get();<NEW_LINE>lastResponse.subscribe(new HealthCheckResponseSubscriber(reqCtx, lastResponse), reqCtx.eventLoop().<MASK><NEW_LINE>}<NEW_LINE>}
withoutContext(), SubscriptionOption.WITH_POOLED_OBJECTS);
1,614,301
static List<ClassNode> createDiffClasses(Heap h1, Heap h2, final boolean retained) {<NEW_LINE>if (retained) {<NEW_LINE>if (!DataType.RETAINED_SIZE.valuesAvailable(h1))<NEW_LINE><MASK><NEW_LINE>if (!DataType.RETAINED_SIZE.valuesAvailable(h2))<NEW_LINE>DataType.RETAINED_SIZE.computeValuesImmediately(h2);<NEW_LINE>}<NEW_LINE>Map<JavaClassID, DiffClassNode> classes = new HashMap();<NEW_LINE>List<JavaClass> classes1 = h1.getAllClasses();<NEW_LINE>for (JavaClass jc1 : classes1) {<NEW_LINE>JavaClassID id1 = JavaClassID.create(jc1);<NEW_LINE>DiffClassNode djc1 = classes.get(id1);<NEW_LINE>if (djc1 == null) {<NEW_LINE>djc1 = DiffClassNode.own(jc1, retained);<NEW_LINE>classes.put(id1, djc1);<NEW_LINE>} else {<NEW_LINE>djc1.mergeOwn(jc1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<JavaClass> classes2 = h2.getAllClasses();<NEW_LINE>for (JavaClass jc2 : classes2) {<NEW_LINE>JavaClassID id2 = JavaClassID.create(jc2);<NEW_LINE>DiffClassNode djc2 = classes.get(id2);<NEW_LINE>if (djc2 == null) {<NEW_LINE>djc2 = DiffClassNode.external(new ExternalJavaClass(jc2, retained), retained);<NEW_LINE>classes.put(id2, djc2);<NEW_LINE>} else {<NEW_LINE>djc2.mergeExternal(jc2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ArrayList(classes.values());<NEW_LINE>}
DataType.RETAINED_SIZE.computeValuesImmediately(h1);
176,409
public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) {<NEW_LINE>// EXTRACT(timeUnit FROM arg)<NEW_LINE><MASK><NEW_LINE>final RexLiteral flag = (RexLiteral) call.getOperands().get(0);<NEW_LINE>final TimeUnitRange calciteUnit = (TimeUnitRange) flag.getValue();<NEW_LINE>final RexNode arg = call.getOperands().get(1);<NEW_LINE>final DruidExpression input = Expressions.toDruidExpression(plannerContext, rowSignature, arg);<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final TimestampExtractExprMacro.Unit druidUnit = EXTRACT_UNIT_MAP.get(calciteUnit);<NEW_LINE>if (druidUnit == null) {<NEW_LINE>// Don't know how to extract this time unit.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return TimeExtractOperatorConversion.applyTimeExtract(input, druidUnit, plannerContext.getTimeZone());<NEW_LINE>}
final RexCall call = (RexCall) rexNode;
60,802
public DataStore initialize(Map<String, Object> dsInfos) {<NEW_LINE>String url = (String) dsInfos.get("url");<NEW_LINE>Long zoneId = (Long) dsInfos.get("zoneId");<NEW_LINE>String storagePoolName = (String) dsInfos.get("name");<NEW_LINE>String providerName = (<MASK><NEW_LINE>Long capacityBytes = (Long) dsInfos.get("capacityBytes");<NEW_LINE>Long capacityIops = (Long) dsInfos.get("capacityIops");<NEW_LINE>String tags = (String) dsInfos.get("tags");<NEW_LINE>Map<String, String> details = (Map<String, String>) dsInfos.get("details");<NEW_LINE>NexentaUtil.NexentaPluginParameters params = NexentaUtil.parseNexentaPluginUrl(url);<NEW_LINE>DataCenterVO zone = zoneDao.findById(zoneId);<NEW_LINE>String uuid = String.format("%s_%s_%s", NexentaUtil.PROVIDER_NAME, zone.getUuid(), params.getNmsUrl().getHost());<NEW_LINE>if (capacityBytes == null || capacityBytes <= 0) {<NEW_LINE>throw new IllegalArgumentException("'capacityBytes' must be present and greater than 0.");<NEW_LINE>}<NEW_LINE>if (capacityIops == null || capacityIops <= 0) {<NEW_LINE>throw new IllegalArgumentException("'capacityIops' must be present and greater than 0.");<NEW_LINE>}<NEW_LINE>PrimaryDataStoreParameters parameters = new PrimaryDataStoreParameters();<NEW_LINE>parameters.setHost(params.getStorageHost());<NEW_LINE>parameters.setPort(params.getStoragePort());<NEW_LINE>parameters.setPath(params.getStoragePath());<NEW_LINE>parameters.setType(params.getStorageType());<NEW_LINE>parameters.setUuid(uuid);<NEW_LINE>parameters.setZoneId(zoneId);<NEW_LINE>parameters.setName(storagePoolName);<NEW_LINE>parameters.setProviderName(providerName);<NEW_LINE>parameters.setManaged(true);<NEW_LINE>parameters.setCapacityBytes(capacityBytes);<NEW_LINE>parameters.setUsedBytes(0);<NEW_LINE>parameters.setCapacityIops(capacityIops);<NEW_LINE>parameters.setHypervisorType(Hypervisor.HypervisorType.Any);<NEW_LINE>parameters.setTags(tags);<NEW_LINE>details.put(NexentaUtil.NMS_URL, params.getNmsUrl().toString());<NEW_LINE>details.put(NexentaUtil.VOLUME, params.getVolume());<NEW_LINE>details.put(NexentaUtil.SPARSE_VOLUMES, params.isSparseVolumes().toString());<NEW_LINE>details.put(NexentaUtil.STORAGE_TYPE, params.getStorageType().toString());<NEW_LINE>details.put(NexentaUtil.STORAGE_HOST, params.getStorageHost());<NEW_LINE>details.put(NexentaUtil.STORAGE_PORT, params.getStoragePort().toString());<NEW_LINE>details.put(NexentaUtil.STORAGE_PATH, params.getStoragePath());<NEW_LINE>parameters.setDetails(details);<NEW_LINE>// this adds a row in the cloud.storage_pool table for this SolidFire cluster<NEW_LINE>return dataStoreHelper.createPrimaryDataStore(parameters);<NEW_LINE>}
String) dsInfos.get("providerName");
1,367,336
final PutEmailIdentityMailFromAttributesResult executePutEmailIdentityMailFromAttributes(PutEmailIdentityMailFromAttributesRequest putEmailIdentityMailFromAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putEmailIdentityMailFromAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutEmailIdentityMailFromAttributesRequest> request = null;<NEW_LINE>Response<PutEmailIdentityMailFromAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutEmailIdentityMailFromAttributesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putEmailIdentityMailFromAttributesRequest));<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, "SESv2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutEmailIdentityMailFromAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutEmailIdentityMailFromAttributesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutEmailIdentityMailFromAttributes");
920,759
public void validate(CreateTable createTable) {<NEW_LINE>for (ValidationCapability c : getCapabilities()) {<NEW_LINE>validateFeature(c, Feature.createTable);<NEW_LINE>validateFeature(c, createTable.isUnlogged(), Feature.createTableUnlogged);<NEW_LINE>validateOptionalFeature(c, createTable.getCreateOptionsStrings(), Feature.createTableCreateOptionStrings);<NEW_LINE>validateOptionalFeature(c, createTable.getTableOptionsStrings(), Feature.createTableTableOptionStrings);<NEW_LINE>validateFeature(c, createTable.isIfNotExists(), Feature.createTableIfNotExists);<NEW_LINE>validateOptionalFeature(c, createTable.getRowMovement(), Feature.createTableRowMovement);<NEW_LINE>validateOptionalFeature(c, createTable.getSelect(), Feature.createTableFromSelect);<NEW_LINE>if (isNotEmpty(createTable.getIndexes())) {<NEW_LINE>for (Index i : createTable.getIndexes()) {<NEW_LINE>validateName(c, NamedObject.index, i.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>validateName(c, NamedObject.table, createTable.getTable(<MASK><NEW_LINE>}<NEW_LINE>if (createTable.getSelect() != null) {<NEW_LINE>getValidator(StatementValidator.class).validate(createTable.getSelect());<NEW_LINE>}<NEW_LINE>}
).getFullyQualifiedName(), false);
1,819,061
public Iterator<ChangeSet> iterator() {<NEW_LINE>return new Iterator<ChangeSet>() {<NEW_LINE><NEW_LINE>private final IntSet recursionGuard = IntSets.newHashSet(1000);<NEW_LINE><NEW_LINE>private ChangeSetHolder currentBlock;<NEW_LINE><NEW_LINE>private ChangeSet next = fetchNext();<NEW_LINE><NEW_LINE>public boolean hasNext() {<NEW_LINE>return next != null;<NEW_LINE>}<NEW_LINE><NEW_LINE>public ChangeSet next() {<NEW_LINE>ChangeSet result = next;<NEW_LINE>next = fetchNext();<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE><NEW_LINE>private ChangeSet fetchNext() {<NEW_LINE>if (currentBlock == null) {<NEW_LINE>synchronized (ChangeList.this) {<NEW_LINE>if (myCurrentChangeSet != null) {<NEW_LINE>currentBlock = new ChangeSetHolder(-1, myCurrentChangeSet);<NEW_LINE>} else {<NEW_LINE>currentBlock = myStorage.readPrevious(-1, recursionGuard);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>synchronized (ChangeList.this) {<NEW_LINE>currentBlock = myStorage.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentBlock == null)<NEW_LINE>return null;<NEW_LINE>return currentBlock.changeSet;<NEW_LINE>}<NEW_LINE><NEW_LINE>public void remove() {<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
readPrevious(currentBlock.id, recursionGuard);
1,735,070
public boolean onTouchEvent(MotionEvent ev) {<NEW_LINE>boolean result;<NEW_LINE>MotionEvent event = MotionEvent.obtain(ev);<NEW_LINE>final int action = event.getActionMasked();<NEW_LINE>if (action == MotionEvent.ACTION_DOWN) {<NEW_LINE>mNestedOffsetY = 0;<NEW_LINE>}<NEW_LINE>int eventY = (int) event.getY();<NEW_LINE><MASK><NEW_LINE>switch(action) {<NEW_LINE>case MotionEvent.ACTION_DOWN:<NEW_LINE>mLastY = eventY;<NEW_LINE>startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL, ViewCompat.TYPE_TOUCH);<NEW_LINE>result = super.onTouchEvent(event);<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_MOVE:<NEW_LINE>int deltaY = mLastY - eventY;<NEW_LINE>if (dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset, ViewCompat.TYPE_TOUCH)) {<NEW_LINE>deltaY -= mScrollConsumed[1];<NEW_LINE>mLastY = eventY - mScrollOffset[1];<NEW_LINE>event.offsetLocation(0, -mScrollOffset[1]);<NEW_LINE>mNestedOffsetY += mScrollOffset[1];<NEW_LINE>}<NEW_LINE>result = super.onTouchEvent(event);<NEW_LINE>if (dispatchNestedScroll(0, mScrollOffset[1], 0, deltaY, mScrollOffset, ViewCompat.TYPE_TOUCH)) {<NEW_LINE>event.offsetLocation(0, mScrollOffset[1]);<NEW_LINE>mNestedOffsetY += mScrollOffset[1];<NEW_LINE>mLastY -= mScrollOffset[1];<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>stopNestedScroll(ViewCompat.TYPE_TOUCH);<NEW_LINE>result = super.onTouchEvent(event);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
event.offsetLocation(0, mNestedOffsetY);
1,228,180
public Log create(SessionID sessionID, String callerFQCN) {<NEW_LINE>String eventCategory = null;<NEW_LINE>String errorEventCategory = null;<NEW_LINE>String incomingMsgCategory = null;<NEW_LINE>String outgoingMsgCategory = null;<NEW_LINE>boolean prependSessionID = true;<NEW_LINE>boolean logHeartbeats = true;<NEW_LINE>try {<NEW_LINE>if (settings.isSetting(sessionID, SETTING_EVENT_CATEGORY)) {<NEW_LINE>eventCategory = settings.getString(sessionID, SETTING_EVENT_CATEGORY);<NEW_LINE>}<NEW_LINE>if (settings.isSetting(sessionID, SETTING_ERROR_EVENT_CATEGORY)) {<NEW_LINE>errorEventCategory = settings.getString(sessionID, SETTING_ERROR_EVENT_CATEGORY);<NEW_LINE>}<NEW_LINE>if (settings.isSetting(sessionID, SETTING_INMSG_CATEGORY)) {<NEW_LINE>incomingMsgCategory = settings.getString(sessionID, SETTING_INMSG_CATEGORY);<NEW_LINE>}<NEW_LINE>if (settings.isSetting(sessionID, SETTING_OUTMSG_CATEGORY)) {<NEW_LINE>outgoingMsgCategory = settings.getString(sessionID, SETTING_OUTMSG_CATEGORY);<NEW_LINE>}<NEW_LINE>if (settings.isSetting(sessionID, SETTING_PREPEND_SESSION_ID)) {<NEW_LINE>prependSessionID = <MASK><NEW_LINE>}<NEW_LINE>if (settings.isSetting(sessionID, SETTING_LOG_HEARTBEATS)) {<NEW_LINE>logHeartbeats = settings.getBool(sessionID, SETTING_LOG_HEARTBEATS);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return new SLF4JLog(sessionID, eventCategory, errorEventCategory, incomingMsgCategory, outgoingMsgCategory, prependSessionID, logHeartbeats, callerFQCN);<NEW_LINE>}
settings.getBool(sessionID, SETTING_PREPEND_SESSION_ID);
1,484,799
public static ClassPathEntry createEntryForUrl(TreeLogger logger, URL url) throws URISyntaxException, IOException {<NEW_LINE>if (url.getProtocol().equals("file")) {<NEW_LINE>File f = new File(url.toURI());<NEW_LINE>String lowerCaseFileName = f.getName(<MASK><NEW_LINE>if (f.isDirectory()) {<NEW_LINE>return new DirectoryClassPathEntry(f);<NEW_LINE>} else if (f.isFile() && lowerCaseFileName.endsWith(".jar")) {<NEW_LINE>return ZipFileClassPathEntry.get(f);<NEW_LINE>} else if (f.isFile() && lowerCaseFileName.endsWith(".zip")) {<NEW_LINE>return ZipFileClassPathEntry.get(f);<NEW_LINE>} else {<NEW_LINE>// It's a file ending in neither jar nor zip, speculatively try to<NEW_LINE>// open as jar/zip anyway.<NEW_LINE>try {<NEW_LINE>return ZipFileClassPathEntry.get(f);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(TreeLogger.TRACE)) {<NEW_LINE>logger.log(TreeLogger.TRACE, "Unexpected entry in classpath; " + f + " is neither a directory nor an archive (.jar or .zip)");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.log(TreeLogger.WARN, "Unknown URL type for " + url, null);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
).toLowerCase(Locale.ROOT);
557,641
private void loadNode96() {<NEW_LINE>UaObjectTypeNode node = new UaObjectTypeNode(this.context, Identifiers.ShelvedStateMachineType, new QualifiedName(0, "ShelvedStateMachineType"), new LocalizedText("en", "ShelvedStateMachineType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasProperty, Identifiers.ShelvedStateMachineType_UnshelveTime.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_Unshelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_TimedShelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_OneShotShelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_UnshelvedToTimedShelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_UnshelvedToOneShotShelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_TimedShelvedToUnshelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_TimedShelvedToOneShotShelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_OneShotShelvedToUnshelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_OneShotShelvedToTimedShelved.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_Unshelve.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_OneShotShelve.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasComponent, Identifiers.ShelvedStateMachineType_TimedShelve.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ShelvedStateMachineType, Identifiers.HasSubtype, Identifiers.FiniteStateMachineType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.valueOf(0), false);
73,049
public ClassHash computeHash(JavaClass javaClass) {<NEW_LINE>this.className = javaClass.getClassName();<NEW_LINE>Method[] methodList = new Method[javaClass.getMethods().length];<NEW_LINE>// Sort methods<NEW_LINE>System.arraycopy(javaClass.getMethods(), 0, methodList, 0, javaClass.getMethods().length);<NEW_LINE>Arrays.sort(methodList, (o1, o2) -> {<NEW_LINE>// sort by name, then signature<NEW_LINE>int cmp = o1.getName().compareTo(o2.getName());<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>return o1.getSignature().compareTo(o2.getSignature());<NEW_LINE>});<NEW_LINE>Field[] fieldList = new Field[javaClass.getFields().length];<NEW_LINE>// Sort fields<NEW_LINE>System.arraycopy(javaClass.getFields(), 0, fieldList, 0, <MASK><NEW_LINE>Arrays.sort(fieldList, (o1, o2) -> {<NEW_LINE>int cmp = o1.getName().compareTo(o2.getName());<NEW_LINE>if (cmp != 0) {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>return o1.getSignature().compareTo(o2.getSignature());<NEW_LINE>});<NEW_LINE>MessageDigest digest = Util.getMD5Digest();<NEW_LINE>// Compute digest of method names and signatures, in order.<NEW_LINE>// Also, compute method hashes.<NEW_LINE>CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();<NEW_LINE>for (Method method : methodList) {<NEW_LINE>work(digest, method.getName(), encoder);<NEW_LINE>work(digest, method.getSignature(), encoder);<NEW_LINE>MethodHash methodHash = new MethodHash().computeHash(method);<NEW_LINE>methodHashMap.put(XFactory.createXMethod(javaClass, method), methodHash);<NEW_LINE>}<NEW_LINE>// Compute digest of field names and signatures.<NEW_LINE>for (Field field : fieldList) {<NEW_LINE>work(digest, field.getName(), encoder);<NEW_LINE>work(digest, field.getSignature(), encoder);<NEW_LINE>}<NEW_LINE>classHash = digest.digest();<NEW_LINE>return this;<NEW_LINE>}
javaClass.getFields().length);
517,164
private void maskPayload(ByteBuffer buffer, Frame frame) {<NEW_LINE>byte[] mask = frame.getMask();<NEW_LINE>int maskInt = 0;<NEW_LINE>for (byte maskByte : mask) {<NEW_LINE>maskInt = (maskInt << 8) + (maskByte & 0xFF);<NEW_LINE>}<NEW_LINE>// perform data masking here<NEW_LINE>ByteBuffer payload = frame.getPayload();<NEW_LINE>if ((payload != null) && (payload.remaining() > 0)) {<NEW_LINE>int maskOffset = 0;<NEW_LINE><MASK><NEW_LINE>int end = payload.limit();<NEW_LINE>int remaining;<NEW_LINE>while ((remaining = end - start) > 0) {<NEW_LINE>if (remaining >= 4) {<NEW_LINE>buffer.putInt(payload.getInt(start) ^ maskInt);<NEW_LINE>start += 4;<NEW_LINE>} else {<NEW_LINE>buffer.put((byte) (payload.get(start) ^ mask[maskOffset & 3]));<NEW_LINE>++start;<NEW_LINE>++maskOffset;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int start = payload.position();
232,792
public boolean isValidSudoku(char[][] board) {<NEW_LINE>Character[][] column = new Character[9][9];<NEW_LINE>Character[][] sub = new Character[9][9];<NEW_LINE>Character[] row = new Character[9];<NEW_LINE>int m = board.length, n = board[0].length;<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>char num = board[i][j];<NEW_LINE>if (num == '.')<NEW_LINE>continue;<NEW_LINE>if (row[num - 49] == null)<NEW_LINE>row[num - 49] = num;<NEW_LINE>else<NEW_LINE>return false;<NEW_LINE>if (column[j][num - 49] == null)<NEW_LINE>column[j][num - 49] = num;<NEW_LINE>else<NEW_LINE>return false;<NEW_LINE>int subNum = (i / <MASK><NEW_LINE>if (sub[subNum][num - 49] == null)<NEW_LINE>sub[subNum][num - 49] = num;<NEW_LINE>else<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>row = new Character[9];<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
3) * 3 + j / 3;
1,342,821
private JPanel buildMainPanel(GhidraProgramTableModel<T> tableModel, GoToService gotoService) {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>threadedPanel = new GhidraThreadedTablePanel<>(tableModel);<NEW_LINE>GhidraTable table = threadedPanel.getTable();<NEW_LINE>table.getSelectionModel().addListSelectionListener(e -> {<NEW_LINE>if (e.getValueIsAdjusting()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tool.contextChanged(TableComponentProvider.this);<NEW_LINE>});<NEW_LINE>// only allow global actions through if we are derived from the connect/primary navigatable<NEW_LINE>table.setActionsEnabled(navigatable.isConnected());<NEW_LINE>if (gotoService != null) {<NEW_LINE>if (navigatable != null) {<NEW_LINE>navigatable.addNavigatableListener(this);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>panel.add(threadedPanel, BorderLayout.CENTER);<NEW_LINE>panel.add(createFilterFieldPanel(table, tableModel), BorderLayout.SOUTH);<NEW_LINE>return panel;<NEW_LINE>}
table.installNavigation(gotoService, navigatable);
1,771,590
protected void iterate2NetbeansActionMapping(Counter counter, Element parent, java.util.Collection list, java.lang.String childTag) {<NEW_LINE>Iterator it = list.iterator();<NEW_LINE>Iterator elIt = parent.getChildren(childTag, parent.getNamespace()).iterator();<NEW_LINE>if (!elIt.hasNext())<NEW_LINE>elIt = null;<NEW_LINE>Counter innerCount = new Counter(<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>NetbeansActionMapping value = (NetbeansActionMapping) it.next();<NEW_LINE>Element el;<NEW_LINE>if (elIt != null && elIt.hasNext()) {<NEW_LINE>el = (Element) elIt.next();<NEW_LINE>if (!elIt.hasNext())<NEW_LINE>elIt = null;<NEW_LINE>} else {<NEW_LINE>el = factory.element(childTag, parent.getNamespace());<NEW_LINE>insertAtPreferredLocation(parent, el, innerCount);<NEW_LINE>}<NEW_LINE>updateNetbeansActionMapping(value, childTag, innerCount, el);<NEW_LINE>innerCount.increaseCount();<NEW_LINE>}<NEW_LINE>if (elIt != null) {<NEW_LINE>while (elIt.hasNext()) {<NEW_LINE>elIt.next();<NEW_LINE>elIt.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
counter.getDepth() + 1);
1,027,963
private ClientResponse translate(final ClientRequest requestContext, final HttpResponseStatus status, final HttpResponseHeaders headers, final NonBlockingInputStream entityStream) {<NEW_LINE>final ClientResponse responseContext = new ClientResponse(new Response.StatusType() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getStatusCode() {<NEW_LINE>return status.getStatusCode();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Response.Status.Family getFamily() {<NEW_LINE>return Response.Status.Family.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getReasonPhrase() {<NEW_LINE>return status.getStatusText();<NEW_LINE>}<NEW_LINE>}, requestContext);<NEW_LINE>for (Map.Entry<String, List<String>> entry : headers.getHeaders().entrySet()) {<NEW_LINE>for (String value : entry.getValue()) {<NEW_LINE>responseContext.getHeaders().add(entry.getKey(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>responseContext.setEntityStream(entityStream);<NEW_LINE>return responseContext;<NEW_LINE>}
familyOf(status.getStatusCode());
766,545
public com.amazonaws.services.panorama.model.AccessDeniedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.panorama.model.AccessDeniedException accessDeniedException = new com.amazonaws.services.panorama.model.AccessDeniedException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return accessDeniedException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,363,435
public JobDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>JobDetails jobDetails = new JobDetails();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("isDefinedInJob", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>jobDetails.setIsDefinedInJob(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("isMonitoredByJob", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>jobDetails.setIsMonitoredByJob(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastJobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>jobDetails.setLastJobId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastJobRunTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>jobDetails.setLastJobRunTime(DateJsonUnmarshallerFactory.getInstance("iso8601").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 jobDetails;<NEW_LINE>}
class).unmarshall(context));
662,539
public void onModification(SecurityContext securityContext, ErrorBuffer errorBuffer, final ModificationQueue modificationQueue) throws FrameworkException {<NEW_LINE>super.onModification(securityContext, errorBuffer, modificationQueue);<NEW_LINE>if (Boolean.TRUE.equals(getProperty(deleteMethod))) {<NEW_LINE>StructrApp.getInstance().delete(this);<NEW_LINE>}<NEW_LINE>final String uuid = getUuid();<NEW_LINE>if (uuid != null) {<NEW_LINE>// acknowledge all events for this node when it is modified<NEW_LINE>RuntimeEventLog.getEvents(e -> uuid.equals(e.getData().get("id"))).stream().forEach(<MASK><NEW_LINE>}<NEW_LINE>// Ensure AbstractSchemaNode methodCache is invalidated when a schema method changes<NEW_LINE>if (!TransactionCommand.isDeleted(this.dbNode)) {<NEW_LINE>AbstractSchemaNode schemaNode = getProperty(SchemaMethod.schemaNode);<NEW_LINE>if (schemaNode != null) {<NEW_LINE>schemaNode.clearCachedSchemaMethodsForInstance();<NEW_LINE>this.clearMethodCacheOfExtendingNodes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
e -> e.acknowledge());
1,675,111
public Set keySet(Predicate predicate) {<NEW_LINE>checkTransactionState();<NEW_LINE>checkNotNull(predicate, "Predicate should not be null!");<NEW_LINE>checkNotInstanceOf(PagingPredicate.class, predicate, "Paging is not supported for Transactional queries!");<NEW_LINE>QueryEngine queryEngine = mapServiceContext.getQueryEngine(name);<NEW_LINE>Query query = Query.of().mapName(name).predicate(predicate).iterationType(IterationType.KEY).build();<NEW_LINE>QueryResult queryResult = queryEngine.execute(query, Target.ALL_NODES);<NEW_LINE>Set queryResultSet = QueryResultUtils.transformToSet(ss, queryResult, predicate, IterationType.KEY, true, tx.isOriginatedFromClient());<NEW_LINE>Extractors extractors = mapServiceContext.getExtractors(name);<NEW_LINE>Set<Object> returningKeySet = <MASK><NEW_LINE>CachedQueryEntry cachedQueryEntry = new CachedQueryEntry();<NEW_LINE>for (Map.Entry<Data, TxnValueWrapper> entry : txMap.entrySet()) {<NEW_LINE>if (entry.getValue().type == Type.REMOVED) {<NEW_LINE>// meanwhile remove keys which are not in txMap<NEW_LINE>returningKeySet.remove(toObjectIfNeeded(entry.getKey()));<NEW_LINE>} else {<NEW_LINE>Data keyData = entry.getKey();<NEW_LINE>if (predicate == Predicates.alwaysTrue()) {<NEW_LINE>returningKeySet.add(toObjectIfNeeded(keyData));<NEW_LINE>} else {<NEW_LINE>cachedQueryEntry.init(ss, keyData, entry.getValue().value, extractors);<NEW_LINE>// apply predicate on txMap<NEW_LINE>if (predicate.apply(cachedQueryEntry)) {<NEW_LINE>returningKeySet.add(toObjectIfNeeded(keyData));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returningKeySet;<NEW_LINE>}
new HashSet<Object>(queryResultSet);
678,686
protected void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {<NEW_LINE>for (Result result : results) {<NEW_LINE>log.debug("Query result: [{}]", result);<NEW_LINE>if (isNumeric(result.getValue())) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("serverAlias", server.getAlias());<NEW_LINE>map.put("server", server.getHost());<NEW_LINE>map.put("port", server.getPort());<NEW_LINE>map.put("objDomain", result.getObjDomain());<NEW_LINE>map.put("className", result.getClassName());<NEW_LINE>map.put("typeName", result.getTypeName());<NEW_LINE>map.put("attributeName", result.getAttributeName());<NEW_LINE>map.put("valuePath", Joiner.on('/').join(result.getValuePath()));<NEW_LINE>map.put("keyAlias", result.getKeyAlias());<NEW_LINE>map.put("value", Double.parseDouble(result.getValue().toString()));<NEW_LINE>map.put("timestamp", result.getEpoch());<NEW_LINE>log.debug("Insert into Elastic: Index: [{}] Type: [{}] Map: [{}]", indexName, ELASTIC_TYPE_NAME, map);<NEW_LINE>Index index = new Index.Builder(map).index(indexName).type(ELASTIC_TYPE_NAME).build();<NEW_LINE>JestResult <MASK><NEW_LINE>if (!addToIndex.isSucceeded()) {<NEW_LINE>throw new ElasticWriterException(String.format("Unable to write entry to elastic: %s", addToIndex.getErrorMessage()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warn("Unable to submit non-numeric value to Elastic: [{}] from result [{}]", result.getValue(), result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addToIndex = jestClient.execute(index);
95,662
public OSelectStatement copy() {<NEW_LINE>OSelectStatement result = null;<NEW_LINE>try {<NEW_LINE>result = getClass().getConstructor(Integer.TYPE).newInstance(-1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>result.originalStatement = originalStatement;<NEW_LINE>result.target = target == null ? null : target.copy();<NEW_LINE>result.projection = projection == null <MASK><NEW_LINE>result.whereClause = whereClause == null ? null : whereClause.copy();<NEW_LINE>result.groupBy = groupBy == null ? null : groupBy.copy();<NEW_LINE>result.orderBy = orderBy == null ? null : orderBy.copy();<NEW_LINE>result.unwind = unwind == null ? null : unwind.copy();<NEW_LINE>result.skip = skip == null ? null : skip.copy();<NEW_LINE>result.limit = limit == null ? null : limit.copy();<NEW_LINE>result.lockRecord = lockRecord;<NEW_LINE>result.fetchPlan = fetchPlan == null ? null : fetchPlan.copy();<NEW_LINE>result.letClause = letClause == null ? null : letClause.copy();<NEW_LINE>result.timeout = timeout == null ? null : timeout.copy();<NEW_LINE>result.parallel = parallel;<NEW_LINE>result.noCache = noCache;<NEW_LINE>return result;<NEW_LINE>}
? null : projection.copy();
719,027
// Run a random test between A* and Dijkstra<NEW_LINE>public static void main(String[] args) {<NEW_LINE>Random RANDOM = new Random();<NEW_LINE>int n = 20 * 20;<NEW_LINE>Map<Integer, List<Edge>> graph = new HashMap<>();<NEW_LINE>for (int i = 0; i < n; i++) graph.put(i, new ArrayList<>());<NEW_LINE>double[] X = new double[n];<NEW_LINE>double[] Y = new double[n];<NEW_LINE>int N = (int) Math.sqrt(n);<NEW_LINE>int connections = (n * (n - 1));<NEW_LINE>int[] locations = new int[connections * 2];<NEW_LINE>boolean[][] m = new boolean[n][n];<NEW_LINE>for (int k = 0; k < connections; k++) {<NEW_LINE>int i = RANDOM.nextInt(N);<NEW_LINE>int j = RANDOM.nextInt(N);<NEW_LINE>int ii = RANDOM.nextInt(N);<NEW_LINE>int jj = RANDOM.nextInt(N);<NEW_LINE>int node1 = i * N + j;<NEW_LINE>int node2 = ii * N + jj;<NEW_LINE>if (m[node1][node2])<NEW_LINE>continue;<NEW_LINE><MASK><NEW_LINE>locations[2 * k + 1] = node2;<NEW_LINE>X[node1] = i;<NEW_LINE>Y[node1] = j;<NEW_LINE>X[node2] = ii;<NEW_LINE>Y[node2] = jj;<NEW_LINE>addEdge(graph, node1, node2, i, j, ii, jj);<NEW_LINE>m[node1][node2] = true;<NEW_LINE>}<NEW_LINE>System.out.println(graph);<NEW_LINE>for (int i = 0; i < 10 * n; i++) {<NEW_LINE>int s = locations[RANDOM.nextInt(2 * connections)];<NEW_LINE>int e = locations[RANDOM.nextInt(2 * connections)];<NEW_LINE>double d = dijkstra(graph, s, e, n);<NEW_LINE>double a = astar(X, Y, graph, s, e, n);<NEW_LINE>// System.out.println(a + " " + d);<NEW_LINE>if (a != d) {<NEW_LINE>System.out.println("ERROR: " + a + " " + d + " " + s + " " + e);<NEW_LINE>// System.out.println(graph);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>}
locations[2 * k] = node1;
645,490
private Object calculateWithOpPriority(OResult iCurrentRecord, OCommandContext ctx) {<NEW_LINE>Deque valuesStack = new ArrayDeque<>();<NEW_LINE>Deque<Operator> operatorsStack = new ArrayDeque<Operator>();<NEW_LINE>OMathExpression nextExpression = childExpressions.get(0);<NEW_LINE>Object val = nextExpression.execute(iCurrentRecord, ctx);<NEW_LINE>valuesStack.push(<MASK><NEW_LINE>for (int i = 0; i < operators.size() && i + 1 < childExpressions.size(); i++) {<NEW_LINE>Operator nextOperator = operators.get(i);<NEW_LINE>Object rightValue = childExpressions.get(i + 1).execute(iCurrentRecord, ctx);<NEW_LINE>if (!operatorsStack.isEmpty() && operatorsStack.peek().getPriority() <= nextOperator.getPriority()) {<NEW_LINE>Object right = valuesStack.poll();<NEW_LINE>right = right == NULL_VALUE ? null : right;<NEW_LINE>Object left = valuesStack.poll();<NEW_LINE>left = left == NULL_VALUE ? null : left;<NEW_LINE>Object calculatedValue = operatorsStack.poll().apply(left, right);<NEW_LINE>valuesStack.push(calculatedValue == null ? NULL_VALUE : calculatedValue);<NEW_LINE>}<NEW_LINE>operatorsStack.push(nextOperator);<NEW_LINE>valuesStack.push(rightValue == null ? NULL_VALUE : rightValue);<NEW_LINE>}<NEW_LINE>return iterateOnPriorities(valuesStack, operatorsStack);<NEW_LINE>}
val == null ? NULL_VALUE : val);
266,649
static Version of(Stream<String> lines) {<NEW_LINE>final Iterator<String> it = lines.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>final String line = it.next();<NEW_LINE>final Matcher matcher = PATTERN.matcher(line);<NEW_LINE>if (matcher.find()) {<NEW_LINE>// GraalVM/Mandrel:<NEW_LINE>final String version = matcher.group("version");<NEW_LINE>final String distro = matcher.group("distro");<NEW_LINE>// JDK:<NEW_LINE>// e.g. JDK 17.0.1, feature: 17, interim: 0 (not used here), update: 1<NEW_LINE>final String jFeatureMatch = matcher.group("jfeature");<NEW_LINE>final // Old GraalVM versions, like 19, didn't report the Java version.<NEW_LINE>int // Old GraalVM versions, like 19, didn't report the Java version.<NEW_LINE>jFeature = jFeatureMatch == null ? <MASK><NEW_LINE>final String jUpdateMatch = matcher.group("jupdate");<NEW_LINE>final // Some JDK dev builds don't report full version string.<NEW_LINE>int // Some JDK dev builds don't report full version string.<NEW_LINE>jUpdate = jUpdateMatch == null ? UNDEFINED : Integer.parseInt(jUpdateMatch);<NEW_LINE>return new Version(line, version, jFeature, jUpdate, isMandrel(distro) ? Distribution.MANDREL : Distribution.ORACLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return UNVERSIONED;<NEW_LINE>}
11 : Integer.parseInt(jFeatureMatch);
460,181
public static RecognizeLogoResponse unmarshall(RecognizeLogoResponse recognizeLogoResponse, UnmarshallerContext _ctx) {<NEW_LINE>recognizeLogoResponse.setRequestId(_ctx.stringValue("RecognizeLogoResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<Element> elements = new ArrayList<Element>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("RecognizeLogoResponse.Data.Elements.Length"); i++) {<NEW_LINE>Element element = new Element();<NEW_LINE>element.setTaskId(_ctx.stringValue("RecognizeLogoResponse.Data.Elements[" + i + "].TaskId"));<NEW_LINE>element.setImageURL(_ctx.stringValue("RecognizeLogoResponse.Data.Elements[" + i + "].ImageURL"));<NEW_LINE>List<Result> results = new ArrayList<Result>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results.Length"); j++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setLabel(_ctx.stringValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].Label"));<NEW_LINE>result.setSuggestion(_ctx.stringValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].Suggestion"));<NEW_LINE>result.setRate(_ctx.floatValue("RecognizeLogoResponse.Data.Elements[" + i <MASK><NEW_LINE>List<LogoData> logosData = new ArrayList<LogoData>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData.Length"); k++) {<NEW_LINE>LogoData logoData = new LogoData();<NEW_LINE>logoData.setName(_ctx.stringValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData[" + k + "].Name"));<NEW_LINE>logoData.setType(_ctx.stringValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData[" + k + "].Type"));<NEW_LINE>logoData.setX(_ctx.floatValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData[" + k + "].X"));<NEW_LINE>logoData.setY(_ctx.floatValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData[" + k + "].Y"));<NEW_LINE>logoData.setH(_ctx.floatValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData[" + k + "].H"));<NEW_LINE>logoData.setW(_ctx.floatValue("RecognizeLogoResponse.Data.Elements[" + i + "].Results[" + j + "].LogosData[" + k + "].W"));<NEW_LINE>logosData.add(logoData);<NEW_LINE>}<NEW_LINE>result.setLogosData(logosData);<NEW_LINE>results.add(result);<NEW_LINE>}<NEW_LINE>element.setResults(results);<NEW_LINE>elements.add(element);<NEW_LINE>}<NEW_LINE>data.setElements(elements);<NEW_LINE>recognizeLogoResponse.setData(data);<NEW_LINE>return recognizeLogoResponse;<NEW_LINE>}
+ "].Results[" + j + "].Rate"));
701,498
protected Object doWork() {<NEW_LINE>if (roundDown && (staticQuantizationQuals == null || staticQuantizationQuals.isEmpty())) {<NEW_LINE>throw new CommandLineException.BadArgumentValue(ROUND_DOWN_QUANTIZED_LONG_NAME, <MASK><NEW_LINE>}<NEW_LINE>staticQuantizedMapping = constructStaticQuantizedMapping(staticQuantizationQuals, roundDown);<NEW_LINE>IOUtil.assertFileIsReadable(samFiles.get(0).toPath());<NEW_LINE>IOUtil.assertFileIsReadable(samFiles.get(1).toPath());<NEW_LINE>final SamReaderFactory factory = SamReaderFactory.makeDefault().validationStringency(VALIDATION_STRINGENCY);<NEW_LINE>final SamReader reader1 = factory.referenceSequence(REFERENCE_SEQUENCE).open(samFiles.get(0).toPath());<NEW_LINE>final SamReader reader2 = factory.referenceSequence(REFERENCE_SEQUENCE).open(samFiles.get(1).toPath());<NEW_LINE>final SecondaryOrSupplementarySkippingIterator it1 = new SecondaryOrSupplementarySkippingIterator(reader1.iterator());<NEW_LINE>final SecondaryOrSupplementarySkippingIterator it2 = new SecondaryOrSupplementarySkippingIterator(reader2.iterator());<NEW_LINE>final CompareMatrix finalMatrix = new CompareMatrix(staticQuantizedMapping);<NEW_LINE>final ProgressMeter progressMeter = new ProgressMeter(1.0);<NEW_LINE>progressMeter.start();<NEW_LINE>while (it1.hasCurrent() && it2.hasCurrent()) {<NEW_LINE>final SAMRecord read1 = it1.getCurrent();<NEW_LINE>final SAMRecord read2 = it2.getCurrent();<NEW_LINE>progressMeter.update(read1);<NEW_LINE>if (!read1.getReadName().equals(read2.getReadName())) {<NEW_LINE>throw new UserException.BadInput("files do not have the same exact order of reads:" + read1.getReadName() + " vs " + read2.getReadName());<NEW_LINE>}<NEW_LINE>finalMatrix.add(read1.getBaseQualities(), read2.getBaseQualities());<NEW_LINE>it1.advance();<NEW_LINE>it2.advance();<NEW_LINE>}<NEW_LINE>progressMeter.stop();<NEW_LINE>if (it1.hasCurrent() || it2.hasCurrent()) {<NEW_LINE>throw new UserException.BadInput("files do not have the same exact number of reads");<NEW_LINE>}<NEW_LINE>CloserUtil.close(reader1);<NEW_LINE>CloserUtil.close(reader2);<NEW_LINE>finalMatrix.printOutResults(outputFilename);<NEW_LINE>if (throwOnDiff && finalMatrix.hasNonDiagonalElements()) {<NEW_LINE>throw new UserException("Quality scores from the two BAMs do not match");<NEW_LINE>}<NEW_LINE>return finalMatrix.hasNonDiagonalElements() ? 1 : 0;<NEW_LINE>}
"true", "This option can only be used if " + STATIC_QUANTIZED_QUALS_LONG_NAME + " is also used.");
1,613,823
public LambdaCodeHook unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>LambdaCodeHook lambdaCodeHook = new LambdaCodeHook();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("lambdaARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>lambdaCodeHook.setLambdaARN(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("codeHookInterfaceVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>lambdaCodeHook.setCodeHookInterfaceVersion(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 lambdaCodeHook;<NEW_LINE>}
class).unmarshall(context));
899,712
public Map<String, Boolean> updateConfiguration(Map<String, String> propertiesMap) {<NEW_LINE>Map<String, Boolean> result = new HashMap<>();<NEW_LINE>int successCount = 0;<NEW_LINE>for (Map.Entry<String, String> entry : propertiesMap.entrySet()) {<NEW_LINE>try {<NEW_LINE>PropertyKey key = PropertyKey.fromString(entry.getKey());<NEW_LINE>if (ServerConfiguration.getBoolean(PropertyKey.CONF_DYNAMIC_UPDATE_ENABLED) && key.isDynamic()) {<NEW_LINE>Object oldValue = ServerConfiguration.get(key);<NEW_LINE>ServerConfiguration.set(key, entry.<MASK><NEW_LINE>result.put(entry.getKey(), true);<NEW_LINE>successCount++;<NEW_LINE>LOG.info("Property {} has been updated to \"{}\" from \"{}\"", key.getName(), entry.getValue(), oldValue);<NEW_LINE>} else {<NEW_LINE>LOG.debug("Update a non-dynamic property {} is not allowed", key.getName());<NEW_LINE>result.put(entry.getKey(), false);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.put(entry.getKey(), false);<NEW_LINE>LOG.error("Failed to update property {} to {}", entry.getKey(), entry.getValue(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.debug("Update {} properties, succeed {}.", propertiesMap.size(), successCount);<NEW_LINE>return result;<NEW_LINE>}
getValue(), Source.RUNTIME);
1,221,989
private static void saveRegisteredIndicesAndDropUnregisteredOnes(@Nonnull Collection<? extends ID<?, ?>> ids) {<NEW_LINE>if (ApplicationManager.getApplication().isDisposed() || !IndexInfrastructure.hasIndices()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final File registeredIndicesFile = new File(ContainerPathManager.get(<MASK><NEW_LINE>final Set<String> indicesToDrop = new HashSet<>();<NEW_LINE>boolean exceptionThrown = false;<NEW_LINE>if (registeredIndicesFile.exists()) {<NEW_LINE>try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(registeredIndicesFile)))) {<NEW_LINE>final int size = in.readInt();<NEW_LINE>for (int idx = 0; idx < size; idx++) {<NEW_LINE>indicesToDrop.add(IOUtil.readString(in));<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// workaround for IDEA-194253<NEW_LINE>LOG.info(e);<NEW_LINE>exceptionThrown = true;<NEW_LINE>ids.stream().map(ID::getName).forEach(indicesToDrop::add);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!exceptionThrown) {<NEW_LINE>for (ID<?, ?> key : ids) {<NEW_LINE>indicesToDrop.remove(key.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!indicesToDrop.isEmpty()) {<NEW_LINE>LOG.info("Dropping indices:" + StringUtil.join(indicesToDrop, ","));<NEW_LINE>for (String s : indicesToDrop) {<NEW_LINE>FileUtil.deleteWithRenaming(IndexInfrastructure.getIndexRootDir(ID.create(s)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileUtil.createIfDoesntExist(registeredIndicesFile);<NEW_LINE>try (DataOutputStream os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(registeredIndicesFile)))) {<NEW_LINE>os.writeInt(ids.size());<NEW_LINE>for (ID<?, ?> id : ids) {<NEW_LINE>IOUtil.writeString(id.getName(), os);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.info(e);<NEW_LINE>}<NEW_LINE>}
).getIndexRoot(), "registered");
150,540
public void onReceive(final Context context, Intent intent) {<NEW_LINE>// Only handle calls received<NEW_LINE>if (!"android.intent.action.PHONE_STATE".equals(intent.getAction())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DataHandler dataHandler = KissApplication.getApplication(context).getDataHandler();<NEW_LINE><MASK><NEW_LINE>// Stop if contacts are not enabled<NEW_LINE>if (contactsProvider == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING)) {<NEW_LINE>String phoneNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);<NEW_LINE>if (phoneNumber == null) {<NEW_LINE>// Skipping (private call)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ContactsPojo contactPojo = contactsProvider.findByPhone(phoneNumber);<NEW_LINE>if (contactPojo != null) {<NEW_LINE>dataHandler.addToHistory(contactPojo.getHistoryId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e("Phone Receive Error", " " + e);<NEW_LINE>}<NEW_LINE>}
ContactsProvider contactsProvider = dataHandler.getContactsProvider();
216,677
@ApiOperation(value = "Get a thread dump of the given node")<NEW_LINE>@RequiresPermissions(RestPermissions.THREADS_DUMP)<NEW_LINE>@Path("{nodeId}/threaddump")<NEW_LINE>public SystemThreadDumpResponse threadDump(@ApiParam(name = "nodeId", value = "The id of the node to get a thread dump.", required = true) @PathParam("nodeId") String nodeId) throws IOException, NodeNotFoundException {<NEW_LINE>final Node targetNode = nodeService.byNodeId(nodeId);<NEW_LINE>final RemoteSystemResource remoteSystemResource = remoteInterfaceProvider.get(targetNode, this.authenticationToken, RemoteSystemResource.class);<NEW_LINE>final Response<SystemThreadDumpResponse> response = remoteSystemResource<MASK><NEW_LINE>if (response.isSuccessful()) {<NEW_LINE>return response.body();<NEW_LINE>} else {<NEW_LINE>LOG.warn("Unable to get thread dump on node {}: {}", nodeId, response.message());<NEW_LINE>throw new WebApplicationException(response.message(), BAD_GATEWAY);<NEW_LINE>}<NEW_LINE>}
.threadDump().execute();
1,150,198
public ClientRepresentation update(String clientId, ClientRegistrationContext context) {<NEW_LINE>ClientRepresentation rep = context.getClient();<NEW_LINE>event.event(EventType.CLIENT_UPDATE).client(clientId);<NEW_LINE>ClientModel client = session.getContext().getRealm().getClientByClientId(clientId);<NEW_LINE>RegistrationAuth registrationAuth = auth.requireUpdate(context, client);<NEW_LINE>if (!client.getClientId().equals(rep.getClientId())) {<NEW_LINE>throw new ErrorResponseException(ErrorCodes.INVALID_CLIENT_METADATA, "Client Identifier modified", Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>RepresentationToModel.updateClient(rep, client);<NEW_LINE>RepresentationToModel.updateClientProtocolMappers(rep, client);<NEW_LINE>if (rep.getDefaultRoles() != null) {<NEW_LINE>client.updateDefaultRoles(rep.getDefaultRoles());<NEW_LINE>}<NEW_LINE>rep = ModelToRepresentation.toRepresentation(client, session);<NEW_LINE>rep.setSecret(client.getSecret());<NEW_LINE>Stream<String> defaultRolesNames = client.getDefaultRolesStream();<NEW_LINE>if (defaultRolesNames != null) {<NEW_LINE>rep.setDefaultRoles(defaultRolesNames.toArray(String[]::new));<NEW_LINE>}<NEW_LINE>if (auth.isRegistrationAccessToken()) {<NEW_LINE>String registrationAccessToken = ClientRegistrationTokenUtils.updateRegistrationAccessToken(session, client, auth.getRegistrationAuth());<NEW_LINE>rep.setRegistrationAccessToken(registrationAccessToken);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>session.getContext().setClient(client);<NEW_LINE>session.clientPolicy().triggerOnEvent(new DynamicClientUpdatedContext(session, client, auth.getJwt(), client.getRealm()));<NEW_LINE>} catch (ClientPolicyException cpe) {<NEW_LINE>throw new ErrorResponseException(cpe.getError(), cpe.getErrorDetail(), Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>ClientRegistrationPolicyManager.triggerAfterUpdate(context, registrationAuth, client);<NEW_LINE>event.client(client.<MASK><NEW_LINE>return rep;<NEW_LINE>}
getClientId()).success();
1,701,368
public static RBCompIntFloatMatrix blas2RBCompDense(BlasFloatMatrix mat, int subDim) {<NEW_LINE>int dim = mat.getNumCols();<NEW_LINE>int numRows = mat.getNumRows();<NEW_LINE>int numComp = (dim + subDim - 1) / subDim;<NEW_LINE>float[] data = mat.getData();<NEW_LINE>CompIntFloatVector[] rows = new CompIntFloatVector[numRows];<NEW_LINE>for (int row = 0; row < numRows; row++) {<NEW_LINE>IntFloatVector[] parts = new IntFloatVector[numComp];<NEW_LINE>for (int i = 0; i < numComp; i++) {<NEW_LINE>int thisSubDim;<NEW_LINE>if ((i + 1) * subDim > dim) {<NEW_LINE>thisSubDim = dim - i * subDim;<NEW_LINE>} else {<NEW_LINE>thisSubDim = subDim;<NEW_LINE>}<NEW_LINE>float[] part = new float[thisSubDim];<NEW_LINE>System.arraycopy(data, row * dim + i * <MASK><NEW_LINE>parts[i] = VFactory.denseFloatVector(part);<NEW_LINE>}<NEW_LINE>rows[row] = VFactory.compIntFloatVector(dim, parts);<NEW_LINE>}<NEW_LINE>return MFactory.rbCompIntFloatMatrix(rows);<NEW_LINE>}
subDim, part, 0, thisSubDim);
311,551
protected void parseBuffer(String itemName, Command aCommand, Direction theDirection, ByteBuffer byteBuffer) {<NEW_LINE>String theUpdate = "";<NEW_LINE>try {<NEW_LINE>theUpdate = new String(byteBuffer.array(), charset).split("\0")[0];<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>logger.warn("Exception while attempting an unsupported encoding scheme");<NEW_LINE>}<NEW_LINE>ProtocolBindingProvider provider = findFirstMatchingBindingProvider(itemName);<NEW_LINE>List<Class<? extends State>> stateTypeList = provider.getAcceptedDataTypes(itemName, aCommand);<NEW_LINE>String transformedResponse = transformResponse(provider.getProtocolCommand(itemName, aCommand), theUpdate);<NEW_LINE>State newState = createStateFromString(stateTypeList, transformedResponse);<NEW_LINE>if (newState != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>logger.warn("Cannot parse input " + theUpdate + " to match command {} on item {} ", aCommand, itemName);<NEW_LINE>}<NEW_LINE>}
eventPublisher.postUpdate(itemName, newState);
549,309
final DescribeSpotFleetInstancesResult executeDescribeSpotFleetInstances(DescribeSpotFleetInstancesRequest describeSpotFleetInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeSpotFleetInstancesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeSpotFleetInstancesRequest> request = null;<NEW_LINE>Response<DescribeSpotFleetInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeSpotFleetInstancesRequestMarshaller().marshall(super.beforeMarshalling(describeSpotFleetInstancesRequest));<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, "DescribeSpotFleetInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeSpotFleetInstancesResult> responseHandler = new StaxResponseHandler<DescribeSpotFleetInstancesResult>(new DescribeSpotFleetInstancesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,049,817
public static Map<String, String> populatePersistenceUnitProperties(PropertyReader reader) {<NEW_LINE>String dbType = reader.getProperty(EthConstants.DATABASE_TYPE);<NEW_LINE>String host = reader.getProperty(EthConstants.DATABASE_HOST);<NEW_LINE>String port = reader.getProperty(EthConstants.DATABASE_PORT);<NEW_LINE>String dbName = reader.getProperty(EthConstants.DATABASE_NAME);<NEW_LINE>propertyNullCheck(dbType, host, port, dbName);<NEW_LINE>String username = reader.getProperty(EthConstants.DATABASE_USERNAME);<NEW_LINE>String pswd = reader.getProperty(EthConstants.DATABASE_PASSWORD);<NEW_LINE>Map<String, String> props = new HashMap<>();<NEW_LINE>props.put(EthConstants.KUNDERA_CLIENT_LOOKUP_CLASS, getKunderaClientToLookupClass(dbType));<NEW_LINE>props.put(EthConstants.KUNDERA_NODES, host);<NEW_LINE>props.put(EthConstants.KUNDERA_PORT, port);<NEW_LINE>props.put(EthConstants.KUNDERA_KEYSPACE, dbName);<NEW_LINE>props.put(EthConstants.KUNDERA_DIALECT, dbType);<NEW_LINE>if (username != null && !username.isEmpty() && pswd != null) {<NEW_LINE>props.put(EthConstants.KUNDERA_USERNAME, username);<NEW_LINE>props.put(EthConstants.KUNDERA_PASSWORD, pswd);<NEW_LINE>}<NEW_LINE>if (dbType.equalsIgnoreCase(CASSANDRA)) {<NEW_LINE>props.put(CQL_VERSION, _3_0_0);<NEW_LINE>}<NEW_LINE>boolean schemaAutoGen = Boolean.parseBoolean(reader.getProperty(EthConstants.SCHEMA_AUTO_GENERATE));<NEW_LINE>boolean schemaDropExisting = Boolean.parseBoolean(reader.getProperty(EthConstants.SCHEMA_DROP_EXISTING));<NEW_LINE>if (schemaAutoGen) {<NEW_LINE>if (schemaDropExisting) {<NEW_LINE>props.put(EthConstants.KUNDERA_DDL_AUTO_PREPARE, "create");<NEW_LINE>} else {<NEW_LINE>props.put(EthConstants.KUNDERA_DDL_AUTO_PREPARE, "update");<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return props;<NEW_LINE>}
LOGGER.info("Kundera properties : " + props);
1,334,216
static List<IndexChange> readTransactionIndexChanges(OChannelDataInput channel, ORecordSerializerNetworkV37 serializer) throws IOException {<NEW_LINE>List<IndexChange> changes = new ArrayList<>();<NEW_LINE>int val = channel.readInt();<NEW_LINE>while (val-- > 0) {<NEW_LINE>String indexName = channel.readString();<NEW_LINE>boolean cleared = channel.readBoolean();<NEW_LINE>OTransactionIndexChanges entry = new OTransactionIndexChanges();<NEW_LINE>entry.cleared = cleared;<NEW_LINE>int changeCount = channel.readInt();<NEW_LINE>NavigableMap<Object, OTransactionIndexChangesPerKey> entries = new TreeMap<>();<NEW_LINE>while (changeCount-- > 0) {<NEW_LINE>byte bt = channel.readByte();<NEW_LINE>Object key;<NEW_LINE>if (bt == -1) {<NEW_LINE>key = null;<NEW_LINE>} else {<NEW_LINE>OType type = OType.getById(bt);<NEW_LINE>key = serializer.deserializeValue(channel.readBytes(), type);<NEW_LINE>}<NEW_LINE>OTransactionIndexChangesPerKey changesPerKey = new OTransactionIndexChangesPerKey(key);<NEW_LINE>int keyChangeCount = channel.readInt();<NEW_LINE>while (keyChangeCount-- > 0) {<NEW_LINE>int op = channel.readInt();<NEW_LINE>OTransactionIndexChanges.OPERATION oper = OTransactionIndexChanges.OPERATION.values()[op];<NEW_LINE>ORecordId id;<NEW_LINE>if (oper == OTransactionIndexChanges.OPERATION.CLEAR) {<NEW_LINE>oper = OTransactionIndexChanges.OPERATION.REMOVE;<NEW_LINE>id = null;<NEW_LINE>} else {<NEW_LINE>id = channel.readRID();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (key == null) {<NEW_LINE>entry.nullKeyChanges = changesPerKey;<NEW_LINE>} else {<NEW_LINE>entries.put(changesPerKey.key, changesPerKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>entry.changesPerKey = entries;<NEW_LINE>changes.add(new IndexChange(indexName, entry));<NEW_LINE>}<NEW_LINE>return changes;<NEW_LINE>}
changesPerKey.add(id, oper);
1,103,038
public static Class<?> _BaseMessageManager() {<NEW_LINE>Class<?> clz = load("com/tencent/mobileqq/app/message/BaseMessageManager");<NEW_LINE>if (clz != null) {<NEW_LINE>return clz;<NEW_LINE>}<NEW_LINE>clz = load("com/tencent/imcore/message/BaseMessageManager");<NEW_LINE>if (clz != null) {<NEW_LINE>return clz;<NEW_LINE>}<NEW_LINE>Class<?> ref = load("com/tencent/imcore/message/BaseMessageManager$1");<NEW_LINE>if (ref != null) {<NEW_LINE>try {<NEW_LINE>clz = ref.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clz != null) {<NEW_LINE>return clz;<NEW_LINE>}<NEW_LINE>ref = load("com/tencent/imcore/message/BaseMessageManager$2");<NEW_LINE>if (ref != null) {<NEW_LINE>try {<NEW_LINE>clz = ref.<MASK><NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return clz;<NEW_LINE>}
getDeclaredField("this$0").getType();
418,160
public boolean incrementToken() throws IOException {<NEW_LINE>if (!input.incrementToken()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>char[] buffer = charTermAttribute.buffer();<NEW_LINE>int length = charTermAttribute.length();<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < length; i++) {<NEW_LINE>if (buffer[i] == aa || buffer[i] == ae_se || buffer[i] == ae) {<NEW_LINE>buffer[i] = 'a';<NEW_LINE>} else if (buffer[i] == AA || buffer[i] == AE_se || buffer[i] == AE) {<NEW_LINE>buffer[i] = 'A';<NEW_LINE>} else if (buffer[i] == oe || buffer[i] == oe_se) {<NEW_LINE>buffer[i] = 'o';<NEW_LINE>} else if (buffer[i] == OE || buffer[i] == OE_se) {<NEW_LINE>buffer[i] = 'O';<NEW_LINE>} else if (length - 1 > i) {<NEW_LINE>if ((buffer[i] == 'a' || buffer[i] == 'A') && (buffer[i + 1] == 'a' || buffer[i + 1] == 'A' || buffer[i + 1] == 'e' || buffer[i + 1] == 'E' || buffer[i + 1] == 'o' || buffer[i + 1] == 'O')) {<NEW_LINE>length = StemmerUtil.delete(buffer, i + 1, length);<NEW_LINE>} else if ((buffer[i] == 'o' || buffer[i] == 'O') && (buffer[i + 1] == 'e' || buffer[i + 1] == 'E' || buffer[i + 1] == 'o' || buffer[i + 1] == 'O')) {<NEW_LINE>length = StemmerUtil.delete(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>charTermAttribute.setLength(length);<NEW_LINE>return true;<NEW_LINE>}
buffer, i + 1, length);
629,728
public static Wallet adaptWallet(GeminiBalancesResponse[] response) {<NEW_LINE>// {total, available}<NEW_LINE>Map<String, BigDecimal[]> balancesByCurrency = new HashMap<>();<NEW_LINE>// for each currency we have multiple balances types: exchange, trading, deposit.<NEW_LINE>// each of those may be partially frozen/available<NEW_LINE>for (GeminiBalancesResponse balance : response) {<NEW_LINE>String currencyName = balance.getCurrency().toUpperCase();<NEW_LINE>BigDecimal[] balanceDetail = balancesByCurrency.get(currencyName);<NEW_LINE>if (balanceDetail == null) {<NEW_LINE>balanceDetail = new BigDecimal[] { balance.getAmount(), balance.getAvailable() };<NEW_LINE>} else {<NEW_LINE>balanceDetail[0] = balanceDetail[0].<MASK><NEW_LINE>balanceDetail[1] = balanceDetail[1].add(balance.getAvailable());<NEW_LINE>}<NEW_LINE>balancesByCurrency.put(currencyName, balanceDetail);<NEW_LINE>}<NEW_LINE>List<Balance> balances = new ArrayList<>(balancesByCurrency.size());<NEW_LINE>for (Entry<String, BigDecimal[]> entry : balancesByCurrency.entrySet()) {<NEW_LINE>String currencyName = entry.getKey();<NEW_LINE>BigDecimal[] balanceDetail = entry.getValue();<NEW_LINE>BigDecimal balanceTotal = balanceDetail[0];<NEW_LINE>BigDecimal balanceAvailable = balanceDetail[1];<NEW_LINE>balances.add(new Balance(Currency.getInstance(currencyName), balanceTotal, balanceAvailable));<NEW_LINE>}<NEW_LINE>return Wallet.Builder.from(balances).build();<NEW_LINE>}
add(balance.getAmount());
1,294,337
public static byte[] serialize(Descriptors.Descriptor descriptor) {<NEW_LINE>byte[] schemaDataBytes;<NEW_LINE>try {<NEW_LINE>Map<String, FileDescriptorProto> fileDescriptorProtoCache = new HashMap<>();<NEW_LINE>// recursively cache all FileDescriptorProto<NEW_LINE>serializeFileDescriptor(descriptor.getFile(), fileDescriptorProtoCache);<NEW_LINE>// extract root message path<NEW_LINE>String rootMessageTypeName = descriptor.getFullName();<NEW_LINE>String rootFileDescriptorName = descriptor.getFile().getFullName();<NEW_LINE>// build FileDescriptorSet, this is equal to < protoc --include_imports --descriptor_set_out ><NEW_LINE>byte[] fileDescriptorSet = FileDescriptorSet.newBuilder().addAllFile(fileDescriptorProtoCache.values()).build().toByteArray();<NEW_LINE>// serialize to bytes<NEW_LINE>ProtobufNativeSchemaData schemaData = ProtobufNativeSchemaData.builder().fileDescriptorSet(fileDescriptorSet).rootFileDescriptorName(rootFileDescriptorName).<MASK><NEW_LINE>schemaDataBytes = new ObjectMapper().writeValueAsBytes(schemaData);<NEW_LINE>logger.debug("descriptor '{}' serialized to '{}'.", descriptor.getFullName(), schemaDataBytes);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new SchemaSerializationException(e);<NEW_LINE>}<NEW_LINE>return schemaDataBytes;<NEW_LINE>}
rootMessageTypeName(rootMessageTypeName).build();
1,766,621
private Mono<Response<AutomationAccountInner>> createOrUpdateWithResponseAsync(String resourceGroupName, String automationAccountName, AutomationAccountCreateOrUpdateParameters parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, automationAccountName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));
737,939
public Action service(AtmosphereRequest req, AtmosphereResponse res) throws IOException, ServletException {<NEW_LINE>Action action;<NEW_LINE>action = suspended(req, res);<NEW_LINE>if (action.type() == Action.TYPE.SUSPEND) {<NEW_LINE>req.setAttribute(SUSPEND, action);<NEW_LINE>} else if (action.type() == Action.TYPE.RESUME) {<NEW_LINE>req.setAttribute(SUSPEND, action);<NEW_LINE>// If resume occurs during a suspend operation, stop processing.<NEW_LINE>Boolean resumeOnBroadcast = (Boolean) req.getAttribute(ApplicationConfig.RESUME_ON_BROADCAST);<NEW_LINE>if (resumeOnBroadcast != null && resumeOnBroadcast) {<NEW_LINE>return action;<NEW_LINE>}<NEW_LINE>Action nextAction = resumed(req, res);<NEW_LINE>if (nextAction.type() == Action.TYPE.SUSPEND) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return action;<NEW_LINE>}
req.setAttribute(SUSPEND, action);
1,804,161
protected void paintIcon(Graphics2D g2) {<NEW_LINE>final int state = 0;<NEW_LINE>final var wh = scale(12);<NEW_LINE>var x = scale(state);<NEW_LINE>var y = scale(11) + scale(state);<NEW_LINE>final int[] xpos = { x, x + wh, scale(14), scale(3) };<NEW_LINE>final int[] ypos = { y, y, scale(14), scale(14) };<NEW_LINE>g2.setColor(Color.LIGHT_GRAY);<NEW_LINE>g2.fillPolygon(xpos, ypos, 4);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawPolygon(xpos, ypos, 4);<NEW_LINE><MASK><NEW_LINE>y = scale(state);<NEW_LINE>final int[] xpos1 = { x, x, scale(14), scale(14) };<NEW_LINE>final int[] ypos1 = { y, y + wh, scale(14), scale(3) };<NEW_LINE>g2.setColor(Color.LIGHT_GRAY);<NEW_LINE>g2.fillPolygon(xpos1, ypos1, 4);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawPolygon(xpos1, ypos1, 4);<NEW_LINE>g2.setColor(Color.WHITE);<NEW_LINE>g2.fillRect(scale(state), scale(state), wh, wh);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawRect(scale(state), scale(state), wh, wh);<NEW_LINE>final var s = "B";<NEW_LINE>final var f = g2.getFont().deriveFont((float) wh);<NEW_LINE>final var t = new TextLayout(s, f, g2.getFontRenderContext());<NEW_LINE>g2.setColor(Color.BLUE);<NEW_LINE>final var center = scale(state) + wh / 2;<NEW_LINE>t.draw(g2, center - (float) t.getBounds().getCenterX(), center - (float) t.getBounds().getCenterY());<NEW_LINE>}
x = wh + scale(state);
95,764
public void addPersistentProperty(P property) {<NEW_LINE>Assert.notNull(property, "Property must not be null!");<NEW_LINE>if (properties.contains(property)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>properties.add(property);<NEW_LINE>if (!property.isTransient() && !property.isAssociation()) {<NEW_LINE>persistentPropertiesCache.add(property);<NEW_LINE>}<NEW_LINE>propertyCache.computeIfAbsent(property.getName(), key -> property);<NEW_LINE>P candidate = returnPropertyIfBetterIdPropertyCandidateOrNull(property);<NEW_LINE>if (candidate != null) {<NEW_LINE>this.idProperty = candidate;<NEW_LINE>}<NEW_LINE>if (property.isVersionProperty()) {<NEW_LINE>P versionProperty = this.versionProperty;<NEW_LINE>if (versionProperty != null) {<NEW_LINE>throw new MappingException(String.format("Attempt to add version property %s but already have property %s registered " + "as version. Check your mapping configuration!", property.getField()<MASK><NEW_LINE>}<NEW_LINE>this.versionProperty = property;<NEW_LINE>}<NEW_LINE>}
, versionProperty.getField()));
1,097,711
public void preparedData() {<NEW_LINE>AlterTableGroupMovePartition alterTableGroupMovePartition = (AlterTableGroupMovePartition) relDdl;<NEW_LINE>String tableGroupName = alterTableGroupMovePartition.getTableGroupName();<NEW_LINE>SqlAlterTableGroup sqlAlterTableGroup = (SqlAlterTableGroup) alterTableGroupMovePartition.getAst();<NEW_LINE>assert sqlAlterTableGroup.getAlters().size() == 1;<NEW_LINE>assert sqlAlterTableGroup.getAlters().get(0) instanceof SqlAlterTableGroupMovePartition;<NEW_LINE>List<GroupDetailInfoExRecord> candidateGroupDetailInfoExRecords = TableGroupLocation.getOrderedGroupList(schemaName);<NEW_LINE>// todo support move multi-groups in one shot<NEW_LINE>String storageInstId = alterTableGroupMovePartition.getTargetPartitions().entrySet().iterator().next().getKey();<NEW_LINE>preparedData = new AlterTableGroupMovePartitionPreparedData();<NEW_LINE>List<GroupDetailInfoExRecord> targetGroupDetailInfoExRecords = candidateGroupDetailInfoExRecords.stream().filter(o -> o.storageInstId.equalsIgnoreCase(storageInstId)).collect(Collectors.toList());<NEW_LINE>if (GeneralUtil.isEmpty(targetGroupDetailInfoExRecords)) {<NEW_LINE>candidateGroupDetailInfoExRecords = TableGroupLocation.getOrderedGroupList(schemaName, true);<NEW_LINE>targetGroupDetailInfoExRecords = candidateGroupDetailInfoExRecords.stream().filter(o -> o.storageInstId.equalsIgnoreCase(storageInstId)).collect(Collectors.toList());<NEW_LINE>if (GeneralUtil.isEmpty(targetGroupDetailInfoExRecords)) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_DN_IS_NOT_READY, String.format("the dn[%s] is not ready, please retry this command later", storageInstId));<NEW_LINE>} else {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_PHYSICAL_TOPOLOGY_CHANGING, String.format("the physical group[%s] is changing, please retry this command later", targetGroupDetailInfoExRecords.get(0)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>preparedData.setTargetGroupDetailInfoExRecords(targetGroupDetailInfoExRecords);<NEW_LINE>preparedData.setSchemaName(schemaName);<NEW_LINE>preparedData.setWithHint(targetTablesHintCache != null);<NEW_LINE>preparedData.setTableGroupName(tableGroupName);<NEW_LINE>preparedData.setTargetPartitionsLocation(alterTableGroupMovePartition.getTargetPartitions());<NEW_LINE>List<String> newPartitionNames = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, Set<String>> entry : alterTableGroupMovePartition.getTargetPartitions().entrySet()) {<NEW_LINE>newPartitionNames.<MASK><NEW_LINE>}<NEW_LINE>preparedData.setNewPartitionNames(newPartitionNames);<NEW_LINE>preparedData.setOldPartitionNames(newPartitionNames);<NEW_LINE>preparedData.prepareInvisiblePartitionGroup();<NEW_LINE>preparedData.setTaskType(ComplexTaskMetaManager.ComplexTaskType.MOVE_PARTITION);<NEW_LINE>}
addAll(entry.getValue());
669,044
private List<Wo> list(Business business, Wi wi) throws Exception {<NEW_LINE>List<Wo> <MASK><NEW_LINE>List<Unit> os = business.unit().pick(wi.getUnitList());<NEW_LINE>List<String> unitIds = new ArrayList<>();<NEW_LINE>for (Unit o : os) {<NEW_LINE>unitIds.add(o.getId());<NEW_LINE>}<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Identity.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = root.get(Identity_.unit).in(unitIds);<NEW_LINE>List<String> identityIds = em.createQuery(cq.select(root.get(Identity_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<Identity> list = business.identity().pick(identityIds);<NEW_LINE>for (Identity o : list) {<NEW_LINE>wos.add(this.convert(business, o, Wo.class));<NEW_LINE>}<NEW_LINE>return wos;<NEW_LINE>}
wos = new ArrayList<>();
1,701,474
// Populate temporary data structures to build resource group specs and selectors from db<NEW_LINE>private synchronized void populateFromDbHelper(Map<Long, ResourceGroupSpecBuilder> recordMap, Set<Long> rootGroupIds, Map<Long, ResourceGroupIdTemplate> resourceGroupIdTemplateMap, Map<Long, Set<Long>> subGroupIdsToBuild) {<NEW_LINE>List<ResourceGroupSpecBuilder> <MASK><NEW_LINE>for (ResourceGroupSpecBuilder record : records) {<NEW_LINE>recordMap.put(record.getId(), record);<NEW_LINE>if (!record.getParentId().isPresent()) {<NEW_LINE>rootGroupIds.add(record.getId());<NEW_LINE>resourceGroupIdTemplateMap.put(record.getId(), new ResourceGroupIdTemplate(record.getNameTemplate().toString()));<NEW_LINE>} else {<NEW_LINE>subGroupIdsToBuild.computeIfAbsent(record.getParentId().get(), k -> new HashSet<>()).add(record.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
records = resourceGroupsDao.getResourceGroups(environment);
1,048,507
private String retrieveFlinkUserJar(FlinkEnv flinkEnv, Application app) {<NEW_LINE>switch(app.getDevelopmentMode()) {<NEW_LINE>case CUSTOMCODE:<NEW_LINE>switch(app.getApplicationType()) {<NEW_LINE>case STREAMPARK_FLINK:<NEW_LINE>return String.format("%s/%s", app.getAppLib(), app.getModule().concat(".jar"));<NEW_LINE>case APACHE_FLINK:<NEW_LINE>return String.format("%s/%s", app.getAppHome(), app.getJar());<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("[StreamPark] unsupported ApplicationType of custom code: " + app.getApplicationType());<NEW_LINE>}<NEW_LINE>case FLINKSQL:<NEW_LINE>String sqlDistJar = commonService.getSqlClientJar(flinkEnv);<NEW_LINE>if (app.getExecutionModeEnum() == ExecutionMode.YARN_APPLICATION) {<NEW_LINE>String clientPath = Workspace.remote().APP_CLIENT();<NEW_LINE>return String.<MASK><NEW_LINE>}<NEW_LINE>return Workspace.local().APP_CLIENT().concat("/").concat(sqlDistJar);<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("[StreamPark] unsupported JobType: " + app.getDevelopmentMode());<NEW_LINE>}<NEW_LINE>}
format("%s/%s", clientPath, sqlDistJar);
1,229,261
protected CompletableFuture<Void> initWpt() {<NEW_LINE>assert loc.getAddr() == null;<NEW_LINE>String what = parent.info.getWhat();<NEW_LINE>String exp = what.startsWith(LOC_PREFIX) ? what.substring(LOC_PREFIX.length()) : what;<NEW_LINE>int iid = Unique.assertOne(loc.getInferiorIds());<NEW_LINE>GdbModelTargetInferior inf = impl.session.inferiors.getTargetInferior(iid);<NEW_LINE>String addrSizeExp = String.format("{(long long)&(%s), (long long)sizeof(%s)}", exp, exp);<NEW_LINE>return inf.inferior.evaluate(addrSizeExp).thenAccept(result -> {<NEW_LINE>List<Long> vals;<NEW_LINE>try {<NEW_LINE>vals = GdbCValueParser.parseArray(result).expectLongs();<NEW_LINE>} catch (GdbParseError e) {<NEW_LINE>throw new AssertionError("Unexpected result type: " + result, e);<NEW_LINE>}<NEW_LINE>if (vals.size() != 2) {<NEW_LINE>throw new AssertionError("Unexpected result count: " + result);<NEW_LINE>}<NEW_LINE>address = impl.space.getAddress(vals.get(0));<NEW_LINE>length = vals.<MASK><NEW_LINE>doChangeAttributes("Initialized");<NEW_LINE>}).exceptionally(ex -> {<NEW_LINE>Msg.warn(this, "Could not evaluated breakpoint location and/or size: " + ex);<NEW_LINE>address = impl.space.getAddress(0);<NEW_LINE>length = 1;<NEW_LINE>doChangeAttributes("Defaulted for eval/parse error");<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
get(1).intValue();
1,002,231
public AuthenticationResult authenticate(HttpServletRequest req, HttpServletResponse resp, String authzHeader, SpnegoConfig spnegoConfig) {<NEW_LINE>AuthenticationResult result = CONTINUE;<NEW_LINE>try {<NEW_LINE>byte[] tokenByte = Base64Coder.base64Decode(Base64Coder.getBytes(spnegoUtil.extractAuthzTokenString(authzHeader)));<NEW_LINE>if (!spnegoUtil.isSpnegoOrKrb5Token(tokenByte)) {<NEW_LINE>return notSpnegoAndKerberosTokenError(resp, spnegoConfig);<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>result = krb5Util.processSpnegoToken(resp, tokenByte, reqHostName, spnegoConfig);<NEW_LINE>} catch (AuthenticationException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Unexpected exception:", new Object[] { e });<NEW_LINE>}<NEW_LINE>return spnegoAuthenticationErrorPage(resp, spnegoConfig, e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
reqHostName = getReqHostName(req, spnegoConfig);
717,642
private void loadNode118() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SamplingIntervalDiagnosticsArrayType_SamplingIntervalDiagnostics_SampledMonitoredItemsCount, new QualifiedName(0, "SampledMonitoredItemsCount"), new LocalizedText("en", "SampledMonitoredItemsCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SamplingIntervalDiagnosticsArrayType_SamplingIntervalDiagnostics_SampledMonitoredItemsCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SamplingIntervalDiagnosticsArrayType_SamplingIntervalDiagnostics_SampledMonitoredItemsCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SamplingIntervalDiagnosticsArrayType_SamplingIntervalDiagnostics_SampledMonitoredItemsCount, Identifiers.HasComponent, Identifiers.SamplingIntervalDiagnosticsArrayType_SamplingIntervalDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
816,889
// ----------------------------------------------------------------<NEW_LINE>static void doMatrix(String verb, String[] args, boolean doCij) {<NEW_LINE>Vector<Hash256> hashes1 = new Vector<Hash256>();<NEW_LINE>Vector<Hash256> hashes2 = new Vector<Hash256>();<NEW_LINE>if (args.length == 0) {<NEW_LINE>HashReaderUtil.loadHashesFromStdinOrDie(PROGNAME, hashes1);<NEW_LINE>hashes2 = hashes1;<NEW_LINE>} else if (args.length == 1) {<NEW_LINE>HashReaderUtil.loadHashesFromFileOrDie(PROGNAME, args[0], hashes1);<NEW_LINE>hashes2 = hashes1;<NEW_LINE>} else if (args.length == 2) {<NEW_LINE>HashReaderUtil.loadHashesFromFileOrDie(PROGNAME, args[0], hashes1);<NEW_LINE>HashReaderUtil.loadHashesFromFileOrDie(PROGNAME<MASK><NEW_LINE>} else {<NEW_LINE>usage(1);<NEW_LINE>}<NEW_LINE>int m = hashes1.size();<NEW_LINE>int n = hashes2.size();<NEW_LINE>if (doCij) {<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>System.out.printf("ci=%s,cj=%s,i=%d,j=%d,d=%d\n", hashes1.get(i).toString(), hashes2.get(j).toString(), i, j, hashes1.get(i).hammingDistance(hashes2.get(j)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>System.out.printf(" %3d", hashes1.get(i).hammingDistance(hashes2.get(j)));<NEW_LINE>}<NEW_LINE>System.out.printf("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, args[1], hashes2);
1,046,708
public void addBody(StringBuilder sb, AuthorList al, String tagName, DocBookVersion version) {<NEW_LINE>for (int i = 0; i < al.getNumberOfAuthors(); i++) {<NEW_LINE>sb.append('<').append(tagName).append('>');<NEW_LINE>if (version == DocBookVersion.DOCBOOK_5) {<NEW_LINE>sb.append("<personname>");<NEW_LINE>}<NEW_LINE>Author <MASK><NEW_LINE>a.getFirst().filter(first -> !first.isEmpty()).ifPresent(first -> sb.append("<firstname>").append(XML_CHARS.format(first)).append("</firstname>"));<NEW_LINE>a.getVon().filter(von -> !von.isEmpty()).ifPresent(von -> sb.append("<othername>").append(XML_CHARS.format(von)).append("</othername>"));<NEW_LINE>a.getLast().filter(last -> !last.isEmpty()).ifPresent(last -> {<NEW_LINE>sb.append("<surname>").append(XML_CHARS.format(last));<NEW_LINE>a.getJr().filter(jr -> !jr.isEmpty()).ifPresent(jr -> sb.append(' ').append(XML_CHARS.format(jr)));<NEW_LINE>sb.append("</surname>");<NEW_LINE>if (version == DocBookVersion.DOCBOOK_5) {<NEW_LINE>sb.append("</personname>");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (i < (al.getNumberOfAuthors() - 1)) {<NEW_LINE>sb.append("</").append(tagName).append(">\n ");<NEW_LINE>} else {<NEW_LINE>sb.append("</").append(tagName).append('>');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
a = al.getAuthor(i);
1,477,920
public Set<DebuggerMappingOffer> offersForEnv(TargetEnvironment env, TargetObject target, boolean includeOverrides) {<NEW_LINE>if (!(target instanceof TargetProcess)) {<NEW_LINE>return Set.of();<NEW_LINE>}<NEW_LINE>TargetProcess process = (TargetProcess) target;<NEW_LINE>if (!env.getDebugger().toLowerCase().contains("frida")) {<NEW_LINE>return Set.of();<NEW_LINE>}<NEW_LINE>String arch = env.getArchitecture();<NEW_LINE>boolean is32Bit = arch.contains("ia32") || arch.contains("x86-32") || arch.contains("i386") || arch.contains("x86_32");<NEW_LINE>boolean is64Bit = arch.contains("x64") || arch.contains("x86-64") || arch.contains("x64-32") || arch.contains("x86_64") || arch.contains("x64_32") || arch.contains("i686");<NEW_LINE>String os = env.getOperatingSystem();<NEW_LINE>if (os.contains("darwin")) {<NEW_LINE>if (is64Bit) {<NEW_LINE>Msg.info(this, "Using os=" + os + " arch=" + arch);<NEW_LINE>return Set.of(new FridaI386X86_64MacosOffer(process));<NEW_LINE>} else if (is32Bit) {<NEW_LINE>Msg.info(this, "Using os=" + os + " arch=" + arch);<NEW_LINE>return Set.of(new FridaI386MacosOffer(process));<NEW_LINE>} else {<NEW_LINE>return Set.of();<NEW_LINE>}<NEW_LINE>} else if (os.contains("Linux") || os.contains("linux")) {<NEW_LINE>if (is64Bit) {<NEW_LINE>Msg.info(this, "Using os=" + os + " arch=" + arch);<NEW_LINE>return Set.of(new FridaI386X86_64LinuxOffer(process));<NEW_LINE>} else if (is32Bit) {<NEW_LINE>Msg.info(this, "Using os=" + os + " arch=" + arch);<NEW_LINE>return Set.of(new FridaI386LinuxOffer(process));<NEW_LINE>} else {<NEW_LINE>return Set.of();<NEW_LINE>}<NEW_LINE>} else if (os.contains("windows")) {<NEW_LINE>if (is64Bit) {<NEW_LINE>Msg.info(this, <MASK><NEW_LINE>return Set.of(new FridaI386X86_64WindowsOffer(process));<NEW_LINE>} else if (is32Bit) {<NEW_LINE>Msg.info(this, "Using os=" + os + " arch=" + arch);<NEW_LINE>return Set.of(new FridaI386WindowsOffer(process));<NEW_LINE>} else {<NEW_LINE>return Set.of();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Set.of();<NEW_LINE>}
"Using os=" + os + " arch=" + arch);
1,022,705
final CreateContainerRecipeResult executeCreateContainerRecipe(CreateContainerRecipeRequest createContainerRecipeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createContainerRecipeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateContainerRecipeRequest> request = null;<NEW_LINE>Response<CreateContainerRecipeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateContainerRecipeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createContainerRecipeRequest));<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, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateContainerRecipe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateContainerRecipeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateContainerRecipeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,600,218
public int fetchRawData(final StringBuilder stringBuilder) {<NEW_LINE>while (trafficOpsUtils == null || trafficOpsUtils.getHostname() == null || trafficOpsUtils.getHostname().isEmpty()) {<NEW_LINE>LOGGER.error("No traffic ops hostname yet!");<NEW_LINE>try {<NEW_LINE>Thread.sleep(5000L);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.info("Interrupted while pausing for check of traffic ops config");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String certificatesUrl = trafficOpsUtils.getUrl("certificate.api.url", "https://${toHostname}/api/2.0/cdns/name/${cdnName}/sslkeys");<NEW_LINE>try {<NEW_LINE>final ProtectedFetcher fetcher = new ProtectedFetcher(trafficOpsUtils.getAuthUrl(), trafficOpsUtils.getAuthJSON().toString(), 15000);<NEW_LINE>return fetcher.getIfModifiedSince(certificatesUrl, 0L, stringBuilder);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Failed to fetch data for certificates from " + certificatesUrl + "(" + e.getClass().getSimpleName() + ") : " + <MASK><NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
e.getMessage(), e);
1,520,458
public CreateResponsePlanResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateResponsePlanResult createResponsePlanResult = new CreateResponsePlanResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createResponsePlanResult;<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("arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createResponsePlanResult.setArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createResponsePlanResult;<NEW_LINE>}
class).unmarshall(context));
1,530,483
@Timed<NEW_LINE>@ExceptionMetered<NEW_LINE>public CreateJobResponse post(@Valid final Job job, @RequestUser final String username) {<NEW_LINE>final Job.Builder clone = // If the job had a hash coming in, preserve it<NEW_LINE>job.toBuilder().setCreatingUser(username).setCreated(clock.now().getMillis()).setHash(job.<MASK><NEW_LINE>final Job actualJob = clone.build();<NEW_LINE>final Collection<String> errors = jobValidator.validate(actualJob);<NEW_LINE>final String jobIdString = actualJob.getId().toString();<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>throw badRequest(new CreateJobResponse(INVALID_JOB_DEFINITION, ImmutableList.copyOf(errors), jobIdString));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>model.addJob(actualJob);<NEW_LINE>} catch (JobExistsException e) {<NEW_LINE>throw badRequest(new CreateJobResponse(JOB_ALREADY_EXISTS, ImmutableList.<String>of(), jobIdString));<NEW_LINE>}<NEW_LINE>log.info("created job: {}", actualJob);<NEW_LINE>return new CreateJobResponse(CreateJobResponse.Status.OK, ImmutableList.<String>of(), jobIdString);<NEW_LINE>}
getId().getHash());
1,420,759
private void loadNode158() {<NEW_LINE>ServerDiagnosticsTypeNode node = new ServerDiagnosticsTypeNode(this.context, Identifiers.Server_ServerDiagnostics, new QualifiedName(0, "ServerDiagnostics"), new LocalizedText("en", "ServerDiagnostics"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasComponent, Identifiers.Server_ServerDiagnostics_ServerDiagnosticsSummary.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasComponent, Identifiers.Server_ServerDiagnostics_SamplingIntervalDiagnosticsArray.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasComponent, Identifiers.Server_ServerDiagnostics_SubscriptionDiagnosticsArray.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasComponent, Identifiers.Server_ServerDiagnostics_SessionsDiagnosticsSummary.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasProperty, Identifiers.Server_ServerDiagnostics_EnabledFlag<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasTypeDefinition, Identifiers.ServerDiagnosticsType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerDiagnostics, Identifiers.HasComponent, Identifiers.Server.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
38,124
Object postProcessInvocationResult(@Nullable Object result, int nestingLevel, ReturnTypeDescriptor descriptor) {<NEW_LINE>TypeDescriptor <MASK><NEW_LINE>if (returnTypeDescriptor == null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Class<?> expectedReturnType = returnTypeDescriptor.getType();<NEW_LINE>result = unwrapOptional(result);<NEW_LINE>if (QueryExecutionConverters.supports(expectedReturnType) || ReactiveWrapperConverters.supports(expectedReturnType)) {<NEW_LINE>// For a wrapper type, try nested resolution first<NEW_LINE>result = postProcessInvocationResult(result, nestingLevel + 1, descriptor);<NEW_LINE>if (conversionRequired(WRAPPER_TYPE, returnTypeDescriptor)) {<NEW_LINE>return conversionService.convert(new NullableWrapper(result), returnTypeDescriptor);<NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>TypeDescriptor source = TypeDescriptor.valueOf(result.getClass());<NEW_LINE>if (conversionRequired(source, returnTypeDescriptor)) {<NEW_LINE>return conversionService.convert(result, returnTypeDescriptor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>if (ReactiveWrapperConverters.supports(expectedReturnType)) {<NEW_LINE>return ReactiveWrapperConverters.toWrapper(result, expectedReturnType);<NEW_LINE>}<NEW_LINE>if (result instanceof Collection<?>) {<NEW_LINE>TypeDescriptor elementDescriptor = descriptor.getReturnTypeDescriptor(nestingLevel + 1);<NEW_LINE>boolean requiresConversion = requiresConversion((Collection<?>) result, expectedReturnType, elementDescriptor);<NEW_LINE>if (!requiresConversion) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TypeDescriptor resultDescriptor = TypeDescriptor.forObject(result);<NEW_LINE>return conversionService.canConvert(resultDescriptor, returnTypeDescriptor) ? conversionService.convert(result, returnTypeDescriptor) : result;<NEW_LINE>}<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>Map.class.equals(expectedReturnType) ? CollectionFactory.createMap(expectedReturnType, 0) : null;<NEW_LINE>}
returnTypeDescriptor = descriptor.getReturnTypeDescriptor(nestingLevel);
672,182
public Map<String, INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams) {<NEW_LINE>if (!(conf.getLayer() instanceof FeedForwardLayer))<NEW_LINE>throw new IllegalArgumentException("unsupported layer type: " + conf.getLayer().getClass().getName());<NEW_LINE>Map<String, INDArray> params = Collections.synchronizedMap(new LinkedHashMap<MASK><NEW_LINE>val length = numParams(conf);<NEW_LINE>if (paramsView.length() != length)<NEW_LINE>throw new IllegalStateException("Expected params view of length " + length + ", got length " + paramsView.length());<NEW_LINE>FeedForwardLayer layerConf = (FeedForwardLayer) conf.getLayer();<NEW_LINE>val nIn = layerConf.getNIn();<NEW_LINE>INDArray paramsViewReshape = paramsView.reshape(paramsView.length());<NEW_LINE>val nWeightParams = nIn;<NEW_LINE>INDArray weightView = paramsViewReshape.get(NDArrayIndex.interval(0, nWeightParams));<NEW_LINE>INDArray biasView = paramsViewReshape.get(NDArrayIndex.interval(nWeightParams, nWeightParams + nIn));<NEW_LINE>params.put(WEIGHT_KEY, createWeightMatrix(conf, weightView, initializeParams));<NEW_LINE>params.put(BIAS_KEY, createBias(conf, biasView, initializeParams));<NEW_LINE>conf.addVariable(WEIGHT_KEY);<NEW_LINE>conf.addVariable(BIAS_KEY);<NEW_LINE>return params;<NEW_LINE>}
<String, INDArray>());