idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,395,489
static MethodDeclaration createSetter(TypeDeclaration parent, boolean deprecate, EclipseNode fieldNode, String name, char[] paramName, char[] booleanFieldToSet, boolean shouldReturnThis, int modifier, EclipseNode sourceNode, List<Annotation> onMethod, List<Annotation> onParam) {<NEW_LINE>ASTNode source = sourceNode.get();<NEW_LINE>int pS = source.sourceStart, pE = source.sourceEnd;<NEW_LINE>TypeReference returnType = null;<NEW_LINE>ReturnStatement returnThis = null;<NEW_LINE>if (shouldReturnThis) {<NEW_LINE><MASK><NEW_LINE>addCheckerFrameworkReturnsReceiver(returnType, source, getCheckerFrameworkVersion(sourceNode));<NEW_LINE>ThisReference thisRef = new ThisReference(pS, pE);<NEW_LINE>returnThis = new ReturnStatement(thisRef, pS, pE);<NEW_LINE>}<NEW_LINE>MethodDeclaration d = createSetter(parent, deprecate, fieldNode, name, paramName, booleanFieldToSet, returnType, returnThis, modifier, sourceNode, onMethod, onParam);<NEW_LINE>return d;<NEW_LINE>}
returnType = cloneSelfType(fieldNode, source);
820,921
public void removeSynchronizedRoles(OfflinePlayer player) {<NEW_LINE>String userId = DiscordSRV.getPlugin().getAccountLinkManager().getDiscordId(player.getUniqueId());<NEW_LINE>User user = DiscordUtil.getUserById(userId);<NEW_LINE>if (user != null) {<NEW_LINE>Map<Guild, Set<Role>> roles = new HashMap<>();<NEW_LINE>DiscordSRV.getPlugin().getGroupSynchronizables().values().stream().map(DiscordUtil::getRole).filter(Objects::nonNull).forEach(role -> roles.computeIfAbsent(role.getGuild(), guild -> new HashSet<>()).add(role));<NEW_LINE>try {<NEW_LINE>// remove user from linked role<NEW_LINE>String linkRole = DiscordSRV.config().getString("MinecraftDiscordAccountLinkedRoleNameToAddUserTo");<NEW_LINE>Role role = StringUtils.isNotBlank(linkRole) ? DiscordUtil.resolveRole(linkRole) : null;<NEW_LINE>if (role != null) {<NEW_LINE>roles.computeIfAbsent(role.getGuild(), guild -> new HashSet<><MASK><NEW_LINE>} else {<NEW_LINE>DiscordSRV.debug(Debug.GROUP_SYNC, "Couldn't remove user from null \"linked\" role");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>DiscordSRV.debug(Debug.GROUP_SYNC, "Failed to remove \"linked\" role from " + player.getName() + " during unlink: " + ExceptionUtils.getMessage(t));<NEW_LINE>}<NEW_LINE>for (Map.Entry<Guild, Set<Role>> entry : roles.entrySet()) {<NEW_LINE>Guild guild = entry.getKey();<NEW_LINE>Member member = guild.getMember(user);<NEW_LINE>if (member != null) {<NEW_LINE>if (guild.getSelfMember().canInteract(member)) {<NEW_LINE>DiscordUtil.removeRolesFromMember(member, entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
()).add(role);
744,561
public static void main(String[] args) {<NEW_LINE>if (args.length < minArgs) {<NEW_LINE>System.out.println(usage.toString());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>TreebankLangParserParams tlpp = new EnglishTreebankParserParams();<NEW_LINE>DiskTreebank tb = null;<NEW_LINE>String encoding = "UTF-8";<NEW_LINE>String puncTag = null;<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>if (args[i].startsWith("-")) {<NEW_LINE>switch(args[i]) {<NEW_LINE>case "-l":<NEW_LINE>Language lang = Language.valueOf(args[++i].trim());<NEW_LINE>tlpp = lang.params;<NEW_LINE>break;<NEW_LINE>case "-e":<NEW_LINE>encoding = args[++i];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println(usage.toString());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>puncTag = args[i++];<NEW_LINE>if (tb == null) {<NEW_LINE>if (tlpp == null) {<NEW_LINE>System.out.println(usage.toString());<NEW_LINE>System.exit(-1);<NEW_LINE>} else {<NEW_LINE>tlpp.setInputEncoding(encoding);<NEW_LINE>tlpp.setOutputEncoding(encoding);<NEW_LINE>tb = tlpp.diskTreebank();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tb.loadPath(args[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Counter<String> puncTypes = new ClassicCounter<>();<NEW_LINE>for (Tree t : tb) {<NEW_LINE>List<CoreLabel> yield = t.taggedLabeledYield();<NEW_LINE>for (CoreLabel word : yield) if (word.tag().equals(puncTag))<NEW_LINE>puncTypes.incrementCount(word.word());<NEW_LINE>}<NEW_LINE>List<String> biggestKeys = new ArrayList<>(puncTypes.keySet());<NEW_LINE>Collections.sort(biggestKeys, Counters.toComparatorDescending(puncTypes));<NEW_LINE>PrintWriter pw = tlpp.pw();<NEW_LINE>for (String wordType : biggestKeys) pw.printf("%s\t%d%n", wordType, (int<MASK><NEW_LINE>pw.close();<NEW_LINE>}
) puncTypes.getCount(wordType));
166,156
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {<NEW_LINE>ObjectInputStream.GetField f = s.readFields();<NEW_LINE>imageObserver = (ImageObserver) f.get("imageObserver", null);<NEW_LINE>description = (String) f.get("description", null);<NEW_LINE>width = f.get("width", -1);<NEW_LINE>height = f.get("height", -1);<NEW_LINE>accessibleContext = (AccessibleImageIcon) <MASK><NEW_LINE>int w = s.readInt();<NEW_LINE>int h = s.readInt();<NEW_LINE>int[] pixels = (int[]) (s.readObject());<NEW_LINE>if (pixels == null && (w != -1 || h != -1)) {<NEW_LINE>throw new IllegalStateException("Inconsistent width and height" + " for null image [" + w + ", " + h + "]");<NEW_LINE>}<NEW_LINE>if (pixels != null && (w < 0 || h < 0)) {<NEW_LINE>throw new IllegalStateException("Inconsistent width and height" + " for image [" + w + ", " + h + "]");<NEW_LINE>}<NEW_LINE>if (w != getIconWidth() || h != getIconHeight()) {<NEW_LINE>throw new IllegalStateException("Inconsistent width and height" + " for image [" + w + ", " + h + "]");<NEW_LINE>}<NEW_LINE>if (pixels != null) {<NEW_LINE>Toolkit tk = Toolkit.getDefaultToolkit();<NEW_LINE>ColorModel cm = ColorModel.getRGBdefault();<NEW_LINE>image = tk.createImage(new MemoryImageSource(w, h, cm, pixels, 0, w));<NEW_LINE>loadImage(image);<NEW_LINE>}<NEW_LINE>}
f.get("accessibleContext", null);
32,708
private static void loadAddOnHelpSet(AddOn addOn) {<NEW_LINE>addOn.getLoadedExtensions().forEach(ExtensionHelp::loadExtensionHelpSet);<NEW_LINE>AddOn.HelpSetData helpSetData = addOn.getHelpSetData();<NEW_LINE>if (helpSetData.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ClassLoader classLoader = addOn.getClassLoader();<NEW_LINE>URL helpSetUrl = LocaleUtils.findResource(helpSetData.getBaseName(), HELP_SET_FILE_EXTENSION, helpSetData.getLocaleToken(), Constant.getLocale(), classLoader::getResource);<NEW_LINE>if (helpSetUrl == null) {<NEW_LINE>logger.error("Declared helpset not found for '" + addOn.getId() + "' add-on, with base name: " + helpSetData.getBaseName() + (helpSetData.getLocaleToken().isEmpty() ? "" : " and locale token: " <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logger.debug("Loading help for '" + addOn.getId() + "' add-on and merging with core help.");<NEW_LINE>addHelpSet(addOn, new HelpSet(classLoader, helpSetUrl));<NEW_LINE>} catch (HelpSetException e) {<NEW_LINE>logger.error("An error occured while adding help for '" + addOn.getId() + "' add-on:", e);<NEW_LINE>}<NEW_LINE>}
+ helpSetData.getLocaleToken()));
263,073
private void showSeekbarSettingsDialog(Activity activity, final ApplicationMode mode) {<NEW_LINE>if (activity == null || mode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final OsmandApplication app = (OsmandApplication) activity.getApplication();<NEW_LINE>final float[] angleValue = new float[] { mode.getStrAngle() };<NEW_LINE>boolean nightMode = !app.<MASK><NEW_LINE>Context themedContext = UiUtilities.getThemedContext(activity, nightMode);<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(themedContext);<NEW_LINE>View sliderView = LayoutInflater.from(themedContext).inflate(R.layout.recalculation_angle_dialog, null, false);<NEW_LINE>builder.setView(sliderView);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>mode.setStrAngle(angleValue[0]);<NEW_LINE>updateAllSettings();<NEW_LINE>app.getRoutingHelper().onSettingsChanged(mode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>int selectedModeColor = mode.getProfileColor(nightMode);<NEW_LINE>setupAngleSlider(angleValue, sliderView, nightMode, selectedModeColor);<NEW_LINE>builder.show();<NEW_LINE>}
getSettings().isLightContentForMode(mode);
712,052
public static PDShading createLinearGradient(PdfBoxFastOutputDevice od, AffineTransform transform, FSLinearGradient gradient, Shape bounds) {<NEW_LINE>PDShadingType2 shading = new PDShadingType2(new COSDictionary());<NEW_LINE>shading.setShadingType(PDShading.SHADING_TYPE2);<NEW_LINE>shading.setColorSpace(PDDeviceRGB.INSTANCE);<NEW_LINE>Rectangle rect = bounds.getBounds();<NEW_LINE>Point2D ptStart = new Point2D.Float(gradient.getX1() + (float) rect.getMinX(), gradient.getY1() + (float) rect.getMinY());<NEW_LINE>Point2D ptEnd = new Point2D.Float(gradient.getX2() + (float) rect.getMinX(), gradient.getY2() + (<MASK><NEW_LINE>Point2D ptStartDevice = transform.transform(ptStart, null);<NEW_LINE>Point2D ptEndDevice = transform.transform(ptEnd, null);<NEW_LINE>float startX = (float) ptStartDevice.getX();<NEW_LINE>float startY = od.normalizeY((float) ptStartDevice.getY());<NEW_LINE>float endX = (float) ptEndDevice.getX();<NEW_LINE>float endY = od.normalizeY((float) ptEndDevice.getY());<NEW_LINE>COSArray coords = new COSArray();<NEW_LINE>coords.add(new COSFloat(startX));<NEW_LINE>coords.add(new COSFloat(startY));<NEW_LINE>coords.add(new COSFloat(endX));<NEW_LINE>coords.add(new COSFloat(endY));<NEW_LINE>shading.setCoords(coords);<NEW_LINE>PDFunctionType3 type3 = buildType3Function(gradient.getStopPoints(), (float) ptEnd.distance(ptStart));<NEW_LINE>COSArray extend = new COSArray();<NEW_LINE>extend.add(COSBoolean.FALSE);<NEW_LINE>extend.add(COSBoolean.FALSE);<NEW_LINE>shading.setFunction(type3);<NEW_LINE>shading.setExtend(extend);<NEW_LINE>return shading;<NEW_LINE>}
float) rect.getMinY());
357,413
public Node select(Node owner, Direction dir, TraversalContext context) {<NEW_LINE>T cell;<NEW_LINE>if (cells.isEmpty())<NEW_LINE>return null;<NEW_LINE>if (cells.contains(owner)) {<NEW_LINE>cell = (T) owner;<NEW_LINE>} else {<NEW_LINE>cell = findOwnerCell(owner);<NEW_LINE>Node next = context.selectInSubtree(cell, owner, dir);<NEW_LINE>if (next != null) {<NEW_LINE>return next;<NEW_LINE>}<NEW_LINE>if (dir == Direction.NEXT)<NEW_LINE>dir = Direction.NEXT_IN_LINE;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>switch(dir) {<NEW_LINE>case PREVIOUS:<NEW_LINE>return selectPreviousBeforeIndex(cellIndex, context);<NEW_LINE>case NEXT:<NEW_LINE>Node n = context.selectFirstInParent(cell);<NEW_LINE>if (n != null) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>// Intentional fall-through<NEW_LINE>case NEXT_IN_LINE:<NEW_LINE>return selectNextAfterIndex(cellIndex, context);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
int cellIndex = cell.getIndex();
1,375,435
private void exportTemplateAccounts(XmlSerializer xmlSerializer, Collection<Account> accountList) throws IOException {<NEW_LINE>for (Account account : accountList) {<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCOUNT);<NEW_LINE>xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_VERSION, GncXmlHelper.BOOK_VERSION);<NEW_LINE>// account name<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_NAME);<NEW_LINE>xmlSerializer.text(account.getName());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_NAME);<NEW_LINE>// account guid<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_ID);<NEW_LINE>xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_TYPE, GncXmlHelper.ATTR_VALUE_GUID);<NEW_LINE>xmlSerializer.text(account.getUID());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_ID);<NEW_LINE>// account type<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_TYPE);<NEW_LINE>xmlSerializer.text(account.getAccountType().name());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_TYPE);<NEW_LINE>// commodity<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_ACCT_COMMODITY);<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_COMMODITY_SPACE);<NEW_LINE>xmlSerializer.text("template");<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_COMMODITY_SPACE);<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_COMMODITY_ID);<NEW_LINE>String acctCurrencyCode = "template";<NEW_LINE>xmlSerializer.text(acctCurrencyCode);<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_COMMODITY_ID);<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_ACCT_COMMODITY);<NEW_LINE>// commodity scu<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_COMMODITY_SCU);<NEW_LINE>xmlSerializer.text("1");<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_COMMODITY_SCU);<NEW_LINE>if (account.getAccountType() != AccountType.ROOT && mRootTemplateAccount != null) {<NEW_LINE>xmlSerializer.startTag(null, GncXmlHelper.TAG_PARENT_UID);<NEW_LINE>xmlSerializer.attribute(null, GncXmlHelper.ATTR_KEY_TYPE, GncXmlHelper.ATTR_VALUE_GUID);<NEW_LINE>xmlSerializer.text(mRootTemplateAccount.getUID());<NEW_LINE>xmlSerializer.endTag(null, GncXmlHelper.TAG_PARENT_UID);<NEW_LINE>}<NEW_LINE>xmlSerializer.<MASK><NEW_LINE>}<NEW_LINE>}
endTag(null, GncXmlHelper.TAG_ACCOUNT);
1,293,782
public final void substitute(@Nonnull Element e, boolean caseSensitive, boolean recursively, @Nullable PathMacroFilter filter) {<NEW_LINE>for (Content child : e.getContent()) {<NEW_LINE>if (child instanceof Element) {<NEW_LINE>substitute((Element) child, caseSensitive, recursively, filter);<NEW_LINE>} else if (child instanceof Text) {<NEW_LINE>Text t = (Text) child;<NEW_LINE>if (filter == null || !filter.skipPathMacros(t)) {<NEW_LINE><MASK><NEW_LINE>String newText = (recursively || (filter != null && filter.recursePathMacros(t))) ? substituteRecursively(oldText, caseSensitive) : substitute(oldText, caseSensitive);<NEW_LINE>if (oldText != newText) {<NEW_LINE>t.setText(newText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (!(child instanceof Comment)) {<NEW_LINE>LOGGER.error("Wrong content: " + child.getClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Attribute attribute : e.getAttributes()) {<NEW_LINE>if (filter == null || !filter.skipPathMacros(attribute)) {<NEW_LINE>String oldValue = attribute.getValue();<NEW_LINE>String newValue = (recursively || (filter != null && filter.recursePathMacros(attribute))) ? substituteRecursively(oldValue, caseSensitive) : substitute(oldValue, caseSensitive);<NEW_LINE>if (oldValue != newValue) {<NEW_LINE>attribute.setValue(newValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String oldText = t.getText();
1,117,514
private void doPreLayoutAnimation(Animator.AnimatorListener listener) {<NEW_LINE>final AnimatorSet animatorSet = new AnimatorSet();<NEW_LINE>ArrayList<Long> deleteIds = new ArrayList<>();<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < mTopMap.size(); i++) {<NEW_LINE>long id = mTopMap.keyAt(i);<NEW_LINE>int newPos = getPositionForId(id);<NEW_LINE>if (newPos < 0) {<NEW_LINE>// delete<NEW_LINE>int oldPos = mPositionMap.get(id);<NEW_LINE>View child = getChildAt(oldPos);<NEW_LINE>final Animator anim = getDeleteAnimator(child);<NEW_LINE>mPositionMap.remove(id);<NEW_LINE>animatorSet.play(anim);<NEW_LINE>deleteIds.add(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (i = 0; i < deleteIds.size(); i++) {<NEW_LINE>mTopMap.remove(deleteIds.get(i));<NEW_LINE>}<NEW_LINE>if (mOpenChangeDisappearAnimation) {<NEW_LINE>for (i = 0; i < mPositionMap.size(); i++) {<NEW_LINE>View view = getChildAt(mPositionMap.valueAt(i));<NEW_LINE>ViewCompat.setHasTransientState(view, true);<NEW_LINE>mDetachViewsMap.put(mPositionMap<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!animatorSet.getChildAnimations().isEmpty()) {<NEW_LINE>animatorSet.addListener(listener);<NEW_LINE>animatorSet.start();<NEW_LINE>} else {<NEW_LINE>listener.onAnimationEnd(animatorSet);<NEW_LINE>}<NEW_LINE>}
.keyAt(i), view);
112,254
private void updateFocus(int new_focus_index, boolean quiet, boolean save, boolean auto_focus) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "updateFocus(): " + new_focus_index + " current_focus_index: " + current_focus_index);<NEW_LINE>// updates the Focus button, and Focus camera mode<NEW_LINE>if (this.supported_focus_values != null && new_focus_index != current_focus_index) {<NEW_LINE>current_focus_index = new_focus_index;<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, " current_focus_index is now " + current_focus_index);<NEW_LINE>String focus_value = supported_focus_values.get(current_focus_index);<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, " focus_value: " + focus_value);<NEW_LINE>if (!quiet) {<NEW_LINE>String focus_entry = findFocusEntryForValue(focus_value);<NEW_LINE>if (focus_entry != null) {<NEW_LINE>showToast(focus_toast, focus_entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.setFocusValue(focus_value, auto_focus);<NEW_LINE>if (save) {<NEW_LINE>// now save<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (this.supported_focus_values != null && current_focus_index != 0) {<NEW_LINE>// called when the user tries to deselect an selected focus value.<NEW_LINE>current_focus_index = 0;<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, " current_focus_index is now " + current_focus_index);<NEW_LINE>String focus_value = supported_focus_values.get(current_focus_index);<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, " focus_value: " + focus_value);<NEW_LINE>if (!quiet) {<NEW_LINE>String focus_entry = findFocusEntryForValue(focus_value);<NEW_LINE>if (focus_entry != null) {<NEW_LINE>showToast(focus_toast, focus_entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.setFocusValue(focus_value, auto_focus);<NEW_LINE>if (save) {<NEW_LINE>// now save<NEW_LINE>applicationInterface.setFocusPref(focus_value, is_video);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
applicationInterface.setFocusPref(focus_value, is_video);
435,323
public Class<?> run() {<NEW_LINE>int packageIndex = name.lastIndexOf('.');<NEW_LINE>if (packageIndex != -1) {<NEW_LINE>String packageName = name.substring(0, packageIndex);<NEW_LINE>PackageDefinitionStrategy.Definition definition = packageDefinitionStrategy.define(ByteArrayClassLoader.this, packageName, name);<NEW_LINE>if (definition.isDefined()) {<NEW_LINE>Package definedPackage = PACKAGE_LOOKUP_STRATEGY.apply(ByteArrayClassLoader.this, packageName);<NEW_LINE>if (definedPackage == null) {<NEW_LINE>definePackage(packageName, definition.getSpecificationTitle(), definition.getSpecificationVersion(), definition.getSpecificationVendor(), definition.getImplementationTitle(), definition.getImplementationVersion(), definition.getImplementationVendor(<MASK><NEW_LINE>} else if (!definition.isCompatibleTo(definedPackage)) {<NEW_LINE>throw new SecurityException("Sealing violation for package " + packageName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return defineClass(name, binaryRepresentation, FROM_BEGINNING, binaryRepresentation.length, protectionDomain);<NEW_LINE>}
), definition.getSealBase());
1,611,992
final DescribeFleetResult executeDescribeFleet(DescribeFleetRequest describeFleetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFleetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFleetRequest> request = null;<NEW_LINE>Response<DescribeFleetResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeFleetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFleetRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFleet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeFleetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFleetResultJsonUnmarshaller());<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.RequestMarshallTime);
494,505
static void parsed(final HtmlParserResult result, SchedulerEvent event) {<NEW_LINE>try {<NEW_LINE>FileObject file = result.getSnapshot().getSource().getFileObject();<NEW_LINE>if (file == null) {<NEW_LINE>LOGGER.log(LEVEL, "null file, exit");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!file.isValid()) {<NEW_LINE>LOGGER.log(LEVEL, "invalid file, exit");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final DataObject dobj = DataObject.find(file);<NEW_LINE>org.openide.nodes.Node dataObjectNode = dobj.getNodeDelegate();<NEW_LINE>if (!(dataObjectNode instanceof HtmlDataNode)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final HtmlDataNode htmlNode = (HtmlDataNode) dataObjectNode;<NEW_LINE>final int caretOffset;<NEW_LINE>if (event == null) {<NEW_LINE>LOGGER.log(LEVEL, "run() - NULL SchedulerEvent?!?!?!");<NEW_LINE>caretOffset = -1;<NEW_LINE>} else {<NEW_LINE>if (event instanceof CursorMovedSchedulerEvent) {<NEW_LINE>caretOffset = ((CursorMovedSchedulerEvent) event).getCaretOffset();<NEW_LINE>} else {<NEW_LINE>LOGGER.log(LEVEL, "run() - !(event instanceof CursorMovedSchedulerEvent)");<NEW_LINE>caretOffset = -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>runInEDT(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (DataObjectNotFoundException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}
result, htmlNode, dobj, caretOffset);
402,424
public void readData(BufferedReader in) throws IOException {<NEW_LINE>String line, value;<NEW_LINE>// skip old variables if still present<NEW_LINE>lexOptions.readData(in);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>try {<NEW_LINE>tlpParams = (TreebankLangParserParams) Class.forName(value).getDeclaredConstructor().newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>IOException ioe = new IOException("Problem instantiating parserParams: " + line);<NEW_LINE>ioe.initCause(e);<NEW_LINE>throw ioe;<NEW_LINE>}<NEW_LINE>line = in.readLine();<NEW_LINE>// ensure backwards compatibility<NEW_LINE>if (line.matches("^forceCNF.*")) {<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>forceCNF = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>}<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>doPCFG = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>doDep = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>freeDependencies = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>directional = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>genStop = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>distance = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>coarseDistance = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>value = line.substring(line<MASK><NEW_LINE>dcTags = Boolean.parseBoolean(value);<NEW_LINE>line = in.readLine();<NEW_LINE>if (!line.matches("^nPrune.*")) {<NEW_LINE>throw new RuntimeException("Expected nPrune, found: " + line);<NEW_LINE>}<NEW_LINE>value = line.substring(line.indexOf(' ') + 1);<NEW_LINE>nodePrune = Boolean.parseBoolean(value);<NEW_LINE>// get rid of last line<NEW_LINE>line = in.readLine();<NEW_LINE>if (line.length() != 0) {<NEW_LINE>throw new RuntimeException("Expected blank line, found: " + line);<NEW_LINE>}<NEW_LINE>}
.indexOf(' ') + 1);
721,464
public void apply(@Nullable MasterDetailsComponent configurable, boolean addedOnly) throws ConfigurationException {<NEW_LINE>String[] errorString = new String[1];<NEW_LINE>if (!canApply(errorString, configurable, addedOnly)) {<NEW_LINE>throw new ConfigurationException(errorString[0]);<NEW_LINE>}<NEW_LINE>final Sdk[] allFromTable = mySdkTableProvider.get().getAllSdks();<NEW_LINE>final ArrayList<Sdk> itemsInTable = new ArrayList<>();<NEW_LINE>// Delete removed and fill itemsInTable<NEW_LINE>ApplicationManager.getApplication().runWriteAction(() -> {<NEW_LINE>final SdkTable sdkTable = mySdkTableProvider.get();<NEW_LINE>for (final Sdk tableItem : allFromTable) {<NEW_LINE>if (mySdks.containsKey(tableItem)) {<NEW_LINE>itemsInTable.add(tableItem);<NEW_LINE>} else {<NEW_LINE>sdkTable.removeSdk(tableItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ApplicationManager.getApplication().runWriteAction(() -> {<NEW_LINE>// Now all removed items are deleted from table, itemsInTable contains all items in table<NEW_LINE>final SdkTable sdkTable = mySdkTableProvider.get();<NEW_LINE>for (Sdk originalSdk : itemsInTable) {<NEW_LINE>final Sdk modifiedSdk = mySdks.get(originalSdk);<NEW_LINE><MASK><NEW_LINE>sdkTable.updateSdk(originalSdk, modifiedSdk);<NEW_LINE>}<NEW_LINE>// Add new items to table<NEW_LINE>final Sdk[] allSdks = sdkTable.getAllSdks();<NEW_LINE>for (final Sdk sdk : mySdks.keySet()) {<NEW_LINE>LOG.assertTrue(sdk != null);<NEW_LINE>if (ArrayUtil.find(allSdks, sdk) == -1) {<NEW_LINE>sdkTable.addSdk(sdk);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myModified = false;<NEW_LINE>}
LOG.assertTrue(modifiedSdk != null);
1,642,491
public static ListConsumedServicesResponse unmarshall(ListConsumedServicesResponse listConsumedServicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listConsumedServicesResponse.setRequestId(_ctx.stringValue("ListConsumedServicesResponse.RequestId"));<NEW_LINE>listConsumedServicesResponse.setMessage(_ctx.stringValue("ListConsumedServicesResponse.Message"));<NEW_LINE>listConsumedServicesResponse.setTraceId(_ctx.stringValue("ListConsumedServicesResponse.TraceId"));<NEW_LINE>listConsumedServicesResponse.setErrorCode(_ctx.stringValue("ListConsumedServicesResponse.ErrorCode"));<NEW_LINE>listConsumedServicesResponse.setCode(_ctx.stringValue("ListConsumedServicesResponse.Code"));<NEW_LINE>listConsumedServicesResponse.setSuccess(_ctx.booleanValue("ListConsumedServicesResponse.Success"));<NEW_LINE>List<ListConsumedServices> data = new ArrayList<ListConsumedServices>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListConsumedServicesResponse.Data.Length"); i++) {<NEW_LINE>ListConsumedServices listConsumedServices = new ListConsumedServices();<NEW_LINE>listConsumedServices.setGroup2Ip(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].Group2Ip"));<NEW_LINE>listConsumedServices.setType(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].Type"));<NEW_LINE>listConsumedServices.setAppId(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].AppId"));<NEW_LINE>listConsumedServices.setVersion(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].Version"));<NEW_LINE>listConsumedServices.setName(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].Name"));<NEW_LINE>List<String> groups = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListConsumedServicesResponse.Data[" + i + "].Groups.Length"); j++) {<NEW_LINE>groups.add(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].Groups[" + j + "]"));<NEW_LINE>}<NEW_LINE>listConsumedServices.setGroups(groups);<NEW_LINE>List<String> ips <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListConsumedServicesResponse.Data[" + i + "].Ips.Length"); j++) {<NEW_LINE>ips.add(_ctx.stringValue("ListConsumedServicesResponse.Data[" + i + "].Ips[" + j + "]"));<NEW_LINE>}<NEW_LINE>listConsumedServices.setIps(ips);<NEW_LINE>data.add(listConsumedServices);<NEW_LINE>}<NEW_LINE>listConsumedServicesResponse.setData(data);<NEW_LINE>return listConsumedServicesResponse;<NEW_LINE>}
= new ArrayList<String>();
596,900
public static boolean isCopular(NLGElement element) {<NEW_LINE>boolean copular = false;<NEW_LINE>if (element instanceof InflectedWordElement) {<NEW_LINE>copular = // $NON-NLS-1$<NEW_LINE>"be".// $NON-NLS-1$<NEW_LINE>equalsIgnoreCase(((InflectedWordElement) element).getBaseForm());<NEW_LINE>} else if (element instanceof WordElement) {<NEW_LINE>copular = // $NON-NLS-1$<NEW_LINE>"be".// $NON-NLS-1$<NEW_LINE>equalsIgnoreCase(((WordElement) element).getBaseForm());<NEW_LINE>} else if (element instanceof PhraseElement) {<NEW_LINE>// get the head and check if it's "be"<NEW_LINE>NLGElement head = element instanceof SPhraseSpec ? ((SPhraseSpec) element).getVerb() : ((<MASK><NEW_LINE>if (head != null) {<NEW_LINE>copular = (head instanceof WordElement && "be".equals(((WordElement) head).getBaseForm()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return copular;<NEW_LINE>}
PhraseElement) element).getHead();
1,022,693
protected void layoutChildrenStatic(double contentX, double contentY, double contentWidth, double contentHeight) {<NEW_LINE>int lineCount = lines.size();<NEW_LINE>T dayView = getSkinnable();<NEW_LINE>LocalTime startTime = dayView.getStartTime();<NEW_LINE>LocalTime endTime = dayView.getEndTime();<NEW_LINE>boolean showEarlyHoursRegion = startTime.isAfter(LocalTime.MIN);<NEW_LINE>boolean showLateHoursRegion = endTime.isBefore(LocalTime.MAX);<NEW_LINE>earlyHoursRegion.setVisible(showEarlyHoursRegion);<NEW_LINE>lateHoursRegion.setVisible(showLateHoursRegion);<NEW_LINE>double earlyHoursY = dayView.getLocation(startTime);<NEW_LINE>double lateHoursY = dayView.getLocation(endTime);<NEW_LINE>earlyHoursRegion.resizeRelocate(snapPositionX(contentX), snapPositionY(contentY), snapSizeX(contentWidth), snapSizeY(earlyHoursY));<NEW_LINE>lateHoursRegion.resizeRelocate(snapPositionX(contentX), snapPositionY(lateHoursY), snapSizeX(contentWidth), snapSizeY(contentHeight - lateHoursY));<NEW_LINE>for (int i = 0; i < lineCount; i++) {<NEW_LINE>Line line = lines.get(i);<NEW_LINE>int hour = (i + 1) / 2;<NEW_LINE>int minute = 0;<NEW_LINE>boolean halfHourLine = (i % 2 == 0);<NEW_LINE>if (halfHourLine) {<NEW_LINE>minute = 30;<NEW_LINE>}<NEW_LINE>LocalTime time = LocalTime.of(hour, minute);<NEW_LINE>double yy = snapPositionY(contentY <MASK><NEW_LINE>line.setStartX(snapPositionX(contentX + 4));<NEW_LINE>line.setStartY(yy);<NEW_LINE>line.setEndX(snapPositionX(contentX + contentWidth - 4));<NEW_LINE>line.setEndY(yy);<NEW_LINE>}<NEW_LINE>// the dragged entry view<NEW_LINE>if (draggedEntryView != null) {<NEW_LINE>boolean showing = isRelevant(draggedEntryView.getEntry());<NEW_LINE>draggedEntryView.setVisible(showing);<NEW_LINE>}<NEW_LINE>layoutEntries(contentX, contentY, contentWidth, contentHeight);<NEW_LINE>layoutCurrentTime(contentX, contentY, contentWidth);<NEW_LINE>}
+ dayView.getLocation(time));
244,087
public Object[] valueArrayDeserialize(DataInput2 in, final int size) {<NEW_LINE>Object[] ret = new Object[size];<NEW_LINE>if (size == 0)<NEW_LINE>return ret;<NEW_LINE>int ss = in.unpackInt();<NEW_LINE>Object[] prevKey = new Object[ss];<NEW_LINE>for (int i = 0; i < ss; i++) {<NEW_LINE>prevKey[i] = serializer.deserialize(in, -1);<NEW_LINE>}<NEW_LINE>ret[0] = prevKey;<NEW_LINE>for (int i = 1; i < size; i++) {<NEW_LINE>// number of items shared with prev<NEW_LINE><MASK><NEW_LINE>// number of items unique to this array<NEW_LINE>int unq = in.unpackInt();<NEW_LINE>Object[] key = new Object[shared + unq];<NEW_LINE>// copy items from prev array<NEW_LINE>System.arraycopy(prevKey, 0, key, 0, shared);<NEW_LINE>// and read rest<NEW_LINE>for (; shared < key.length; shared++) {<NEW_LINE>key[shared] = serializer.deserialize(in, -1);<NEW_LINE>}<NEW_LINE>ret[i] = key;<NEW_LINE>prevKey = key;<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
int shared = in.unpackInt();
1,635,883
PrepareCore initFromGraph() {<NEW_LINE>ghStorage.freeze();<NEW_LINE>FlagEncoder prepareFlagEncoder = prepareWeighting.getFlagEncoder();<NEW_LINE>final EdgeFilter allFilter = DefaultEdgeFilter.allEdges(prepareFlagEncoder);<NEW_LINE>// filter by vehicle and level number<NEW_LINE>final EdgeFilter accessWithLevelFilter = new LevelEdgeFilter(prepareGraph) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public final boolean accept(EdgeIteratorState edgeState) {<NEW_LINE>if (!super.accept(edgeState))<NEW_LINE>return false;<NEW_LINE>return allFilter.accept(edgeState);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>maxLevel = prepareGraph.getNodes() + 1;<NEW_LINE>vehicleAllExplorer = prepareGraph.createEdgeExplorer(allFilter);<NEW_LINE>vehicleAllTmpExplorer = prepareGraph.createEdgeExplorer(allFilter);<NEW_LINE><MASK><NEW_LINE>restrictionExplorer = prepareGraph.createEdgeExplorer(DefaultEdgeFilter.outEdges(prepareFlagEncoder));<NEW_LINE>inEdgeExplorer = prepareGraph.getBaseGraph().createEdgeExplorer(DefaultEdgeFilter.inEdges(prepareFlagEncoder));<NEW_LINE>outEdgeExplorer = prepareGraph.getBaseGraph().createEdgeExplorer(DefaultEdgeFilter.outEdges(prepareFlagEncoder));<NEW_LINE>// Use an alternative to PriorityQueue as it has some advantages:<NEW_LINE>// 1. Gets automatically smaller if less entries are stored => less total RAM used.<NEW_LINE>// Important because Graph is increasing until the end.<NEW_LINE>// 2. is slightly faster<NEW_LINE>// but we need the additional oldPriorities array to keep the old value which is necessary for the update method<NEW_LINE>sortedNodes = new GHTreeMapComposed();<NEW_LINE>oldPriorities = new int[prepareGraph.getNodes()];<NEW_LINE>restrictedNodes = new boolean[prepareGraph.getNodes()];<NEW_LINE>nodeContractor = new CoreNodeContractor(dir, ghStorage, prepareGraph, prepareGraph.getCHProfile());<NEW_LINE>nodeContractor.setRestrictionFilter(restrictionFilter);<NEW_LINE>nodeContractor.initFromGraph();<NEW_LINE>return this;<NEW_LINE>}
calcPrioAllExplorer = prepareGraph.createEdgeExplorer(accessWithLevelFilter);
505,315
final UpdateQueueStatusResult executeUpdateQueueStatus(UpdateQueueStatusRequest updateQueueStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateQueueStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateQueueStatusRequest> request = null;<NEW_LINE>Response<UpdateQueueStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateQueueStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateQueueStatusRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateQueueStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateQueueStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateQueueStatusResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
1,076,460
private static void lazyVsEagerAnalysis() {<NEW_LINE>int n = 5000;<NEW_LINE>List<List<EagerPrimsAdjacencyList.Edge>> g1 = EagerPrimsAdjacencyList.createEmptyGraph(n);<NEW_LINE>List<List<LazyPrimsAdjacencyList.Edge>> g2 = LazyPrimsAdjacencyList.createEmptyGraph(n);<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = i + 1; j < n; j++) {<NEW_LINE>int r = random.nextInt() % 10;<NEW_LINE>EagerPrimsAdjacencyList.addUndirectedEdge(g1, i, j, r);<NEW_LINE>LazyPrimsAdjacencyList.addUndirectedEdge(g2, i, j, r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EagerPrimsAdjacencyList eagerSolver = new EagerPrimsAdjacencyList(g1);<NEW_LINE>LazyPrimsAdjacencyList lazySolver = new LazyPrimsAdjacencyList(g2);<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>Long eagerCost = eagerSolver.getMstCost();<NEW_LINE>long endTime = System.nanoTime();<NEW_LINE>System.out.println(<MASK><NEW_LINE>startTime = System.nanoTime();<NEW_LINE>Long lazyCost = lazySolver.getMstCost();<NEW_LINE>endTime = System.nanoTime();<NEW_LINE>System.out.println("Lazy: " + (endTime - startTime));<NEW_LINE>if (eagerCost.longValue() != lazyCost.longValue()) {<NEW_LINE>System.out.println("Oh dear. " + eagerCost + " != " + lazyCost);<NEW_LINE>}<NEW_LINE>}
"Eager: " + (endTime - startTime));
138,397
public Snippet createSnippet(Object projectIdOrPath, String title, String filename, String description, String content, Visibility visibility) throws GitLabApiException {<NEW_LINE>try {<NEW_LINE>GitLabApiForm form = new GitLabApiForm().withParam("title", title, true).withParam("file_name", filename, true).withParam("description", description).withParam("content", content, true).withParam("visibility", visibility, true);<NEW_LINE>Response response = post(Response.Status.CREATED, form, "projects", getProjectIdOrPath(projectIdOrPath), "snippets");<NEW_LINE>return (response.readEntity(Snippet.class));<NEW_LINE>} catch (GitLabApiException glae) {<NEW_LINE>// GitLab 12.8 and older will return HTTP status 400 if called with content instead of code<NEW_LINE>if (glae.getHttpStatus() != Response.Status.BAD_REQUEST.getStatusCode()) {<NEW_LINE>throw glae;<NEW_LINE>}<NEW_LINE>GitLabApiForm form = new GitLabApiForm().withParam("title", title, true).withParam("file_name", filename, true).withParam("description", description).withParam("code", content, true).<MASK><NEW_LINE>Response response = post(Response.Status.CREATED, form, "projects", getProjectIdOrPath(projectIdOrPath), "snippets");<NEW_LINE>return (response.readEntity(Snippet.class));<NEW_LINE>}<NEW_LINE>}
withParam("visibility", visibility, true);
1,009,633
public void onDownloadEmbeddedImagesEvent(DownloadEmbeddedImagesEvent event) {<NEW_LINE>if (event.getStatus().equals(Status.SUCCESS)) {<NEW_LINE>Timber.v("onDownloadEmbeddedImagesEvent %s", event.getStatus());<NEW_LINE>String content = composeMessageViewModel.getMessageDataResult().getContent();<NEW_LINE>String css = AppUtil.readTxt(this, R.raw.css_reset_with_custom_props);<NEW_LINE>String darkCss = "";<NEW_LINE>if (composeMessageViewModel.isAppInDarkMode(this)) {<NEW_LINE>darkCss = AppUtil.readTxt(this, R.raw.css_reset_dark_mode_only);<NEW_LINE>}<NEW_LINE>Transformer contentTransformer = new ViewportTransformer(renderDimensionsProvider.getRenderWidth(this), css, darkCss);<NEW_LINE>Document doc = Jsoup.parse(content);<NEW_LINE>doc.outputSettings().indentAmount(0).prettyPrint(false);<NEW_LINE>doc = contentTransformer.transform(doc);<NEW_LINE>content = doc.toString();<NEW_LINE>pmWebViewClient.blockRemoteResources(!composeMessageViewModel.<MASK><NEW_LINE>EmbeddedImagesThread mEmbeddedImagesTask = new EmbeddedImagesThread(new WeakReference<>(ComposeMessageActivity.this.quotedMessageWebView), event, content);<NEW_LINE>mEmbeddedImagesTask.execute();<NEW_LINE>}<NEW_LINE>}
getMessageDataResult().getShowRemoteContent());
482,282
public static ListConnectionsResponse unmarshall(ListConnectionsResponse listConnectionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listConnectionsResponse.setRequestId(_ctx.stringValue("ListConnectionsResponse.RequestId"));<NEW_LINE>listConnectionsResponse.setHttpStatusCode(_ctx.integerValue("ListConnectionsResponse.HttpStatusCode"));<NEW_LINE>listConnectionsResponse.setSuccess(_ctx.booleanValue("ListConnectionsResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListConnectionsResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListConnectionsResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListConnectionsResponse.Data.TotalCount"));<NEW_LINE>List<ConnectionsItem> connections = new ArrayList<ConnectionsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListConnectionsResponse.Data.Connections.Length"); i++) {<NEW_LINE>ConnectionsItem connectionsItem = new ConnectionsItem();<NEW_LINE>connectionsItem.setStatus(_ctx.integerValue<MASK><NEW_LINE>connectionsItem.setConnectionType(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].ConnectionType"));<NEW_LINE>connectionsItem.setProjectId(_ctx.integerValue("ListConnectionsResponse.Data.Connections[" + i + "].ProjectId"));<NEW_LINE>connectionsItem.setSubType(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].SubType"));<NEW_LINE>connectionsItem.setGmtModified(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].GmtModified"));<NEW_LINE>connectionsItem.setEnvType(_ctx.integerValue("ListConnectionsResponse.Data.Connections[" + i + "].EnvType"));<NEW_LINE>connectionsItem.setConnectStatus(_ctx.integerValue("ListConnectionsResponse.Data.Connections[" + i + "].ConnectStatus"));<NEW_LINE>connectionsItem.setSequence(_ctx.integerValue("ListConnectionsResponse.Data.Connections[" + i + "].Sequence"));<NEW_LINE>connectionsItem.setDescription(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].Description"));<NEW_LINE>connectionsItem.setGmtCreate(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].GmtCreate"));<NEW_LINE>connectionsItem.setDefaultEngine(_ctx.booleanValue("ListConnectionsResponse.Data.Connections[" + i + "].DefaultEngine"));<NEW_LINE>connectionsItem.setShared(_ctx.booleanValue("ListConnectionsResponse.Data.Connections[" + i + "].Shared"));<NEW_LINE>connectionsItem.setOperator(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].Operator"));<NEW_LINE>connectionsItem.setName(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].Name"));<NEW_LINE>connectionsItem.setContent(_ctx.stringValue("ListConnectionsResponse.Data.Connections[" + i + "].Content"));<NEW_LINE>connectionsItem.setId(_ctx.integerValue("ListConnectionsResponse.Data.Connections[" + i + "].Id"));<NEW_LINE>connectionsItem.setBindingCalcEngineId(_ctx.integerValue("ListConnectionsResponse.Data.Connections[" + i + "].BindingCalcEngineId"));<NEW_LINE>connectionsItem.setTenantId(_ctx.longValue("ListConnectionsResponse.Data.Connections[" + i + "].TenantId"));<NEW_LINE>connections.add(connectionsItem);<NEW_LINE>}<NEW_LINE>data.setConnections(connections);<NEW_LINE>listConnectionsResponse.setData(data);<NEW_LINE>return listConnectionsResponse;<NEW_LINE>}
("ListConnectionsResponse.Data.Connections[" + i + "].Status"));
1,046,940
private void sendInterestArea() {<NEW_LINE>log.info("R_InterestArea_ID=" + m_R_InterestArea_ID);<NEW_LINE>m_ia = MInterestArea.<MASK><NEW_LINE>String unsubscribe = null;<NEW_LINE>if (m_ia.isSelfService()) {<NEW_LINE>unsubscribe = "\n\n---------.----------.----------.----------.----------.----------\n" + Msg.getElement(getCtx(), "R_InterestArea_ID") + ": " + m_ia.getName() + "\n" + Msg.getMsg(getCtx(), "UnsubscribeInfo") + "\n";<NEW_LINE>MStore[] wstores = MStore.getOfClient(m_client);<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < wstores.length; i++) {<NEW_LINE>if (wstores[i].isDefault()) {<NEW_LINE>index = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (wstores.length > 0)<NEW_LINE>unsubscribe += wstores[index].getWebContext(true);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>String sql = "SELECT u.Name, u.EMail, u.AD_User_ID " + "FROM R_ContactInterest ci" + " INNER JOIN AD_User u ON (ci.AD_User_ID=u.AD_User_ID) " + "WHERE ci.IsActive='Y' AND u.IsActive='Y'" + " AND ci.OptOutDate IS NULL" + " AND u.EMail IS NOT NULL" + " AND ci.R_InterestArea_ID=?";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>pstmt.setInt(1, m_R_InterestArea_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>Boolean ok = sendIndividualMail(rs.getString(1), rs.getInt(3), unsubscribe);<NEW_LINE>if (ok == null)<NEW_LINE>;<NEW_LINE>else if (ok.booleanValue())<NEW_LINE>m_counter++;<NEW_LINE>else<NEW_LINE>m_errors++;<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>log.log(Level.SEVERE, sql, ex);<NEW_LINE>}<NEW_LINE>// Clean Up<NEW_LINE>try {<NEW_LINE>if (pstmt != null)<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException ex1) {<NEW_LINE>}<NEW_LINE>pstmt = null;<NEW_LINE>m_ia = null;<NEW_LINE>}
get(getCtx(), m_R_InterestArea_ID);
629,910
public Node newNode(Object object) {<NEW_LINE>if (object == null) {<NEW_LINE>return new NullNode();<NEW_LINE>} else if (object instanceof Map) {<NEW_LINE>return new ObjectNode((Map<String, Object>) object, this);<NEW_LINE>} else if (object instanceof Number) {<NEW_LINE>return new NumberNode((Number) object);<NEW_LINE>} else if (object instanceof String) {<NEW_LINE>return new StringNode((String) object);<NEW_LINE>} else if (object instanceof Boolean) {<NEW_LINE>return new BooleanNode((Boolean) object);<NEW_LINE>} else if (object instanceof Object[]) {<NEW_LINE>return new ArrayNode(Arrays.asList((Object<MASK><NEW_LINE>} else if (object instanceof int[]) {<NEW_LINE>return new ArrayNode(toIntList((int[]) object), this);<NEW_LINE>} else if (object instanceof double[]) {<NEW_LINE>return new ArrayNode(toDoubleList((double[]) object), this);<NEW_LINE>} else if (object instanceof boolean[]) {<NEW_LINE>return new ArrayNode(toBoolList((boolean[]) object), this);<NEW_LINE>} else if (object instanceof List) {<NEW_LINE>return new ArrayNode((List<?>) object, this);<NEW_LINE>} else if (object instanceof Node) {<NEW_LINE>return (Node) object;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported type " + object.getClass());<NEW_LINE>}<NEW_LINE>}
[]) object), this);
976,470
public ListDomainsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListDomainsResult listDomainsResult = new ListDomainsResult();<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 listDomainsResult;<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("domains", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDomainsResult.setDomains(new ListUnmarshaller<DomainSummary>(DomainSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDomainsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listDomainsResult;<NEW_LINE>}
class).unmarshall(context));
1,603,733
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>// Inflate the layout for this fragment<NEW_LINE>View rootView = inflater.inflate(R.layout.fragment_karma_info_bottom_sheet, container, false);<NEW_LINE>postKarma = getArguments().getInt(EXTRA_POST_KARMA, 0);<NEW_LINE>commentKarma = getArguments().getInt(EXTRA_COMMENT_KARMA, 0);<NEW_LINE>awarderKarma = getArguments().getInt(EXTRA_AWARDER_KARMA, 0);<NEW_LINE>awardeeKarma = getArguments().getInt(EXTRA_AWARDEE_KARMA, 0);<NEW_LINE>TextView postKarmaTextView = rootView.findViewById(R.id.post_karma_karma_info_bottom_sheet_fragment);<NEW_LINE>TextView commentKarmaTextView = rootView.findViewById(R.id.comment_karma_karma_info_bottom_sheet_fragment);<NEW_LINE>TextView awarderKarmaTextView = rootView.findViewById(R.id.awarder_karma_karma_info_bottom_sheet_fragment);<NEW_LINE>TextView awardeeKarmaTextView = rootView.findViewById(R.id.awardee_karma_karma_info_bottom_sheet_fragment);<NEW_LINE>postKarmaTextView.setText(Integer.toString(postKarma));<NEW_LINE>commentKarmaTextView.setText(Integer.toString(commentKarma));<NEW_LINE>awarderKarmaTextView.setText<MASK><NEW_LINE>awardeeKarmaTextView.setText(Integer.toString(awardeeKarma));<NEW_LINE>return rootView;<NEW_LINE>}
(Integer.toString(awarderKarma));
1,145,246
public void onMatch(RelOptRuleCall call) {<NEW_LINE>Filter filter = call.rel(0);<NEW_LINE>MergeSort mergeSort = call.rel(1);<NEW_LINE>LogicalView logicalView = call.rel(2);<NEW_LINE>if (PushFilterRule.doNotPush(filter, logicalView)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (null != mergeSort.fetch || null != mergeSort.offset) {<NEW_LINE>// Cannot transpose filter with limit<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Filter newLogicalFilter = filter.copy(filter.getTraitSet(), filter.getInput(), filter.getCondition());<NEW_LINE>LogicalView newLogicalView = logicalView.<MASK><NEW_LINE>newLogicalView.push(newLogicalFilter);<NEW_LINE>MergeSort newMergeSort = mergeSort.copy(mergeSort.getTraitSet(), newLogicalView, mergeSort.getCollation(), mergeSort.offset, mergeSort.fetch);<NEW_LINE>call.transformTo(newMergeSort);<NEW_LINE>}
copy(logicalView.getTraitSet());
724,579
void putObject(Object o) {<NEW_LINE>if (depth == 0) {<NEW_LINE>stack[0] = o;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object container = stack[depth - 1];<NEW_LINE>if (container.getClass() == HashMap.class) {<NEW_LINE>if (keyPendingInsert != null) {<NEW_LINE>if (o instanceof ByteBuffer)<NEW_LINE>o = buf2ary((ByteBuffer) o);<NEW_LINE>if (((HashMap<String, Object>) container).put(keyPendingInsert, o) != null)<NEW_LINE>throw new BDecodingException("duplicate key found in dictionary");<NEW_LINE>keyPendingInsert = null;<NEW_LINE>} else {<NEW_LINE>keyPendingInsert = buf2str((ByteBuffer) o);<NEW_LINE>}<NEW_LINE>} else if (container.getClass() == ArrayList.class) {<NEW_LINE>if (o instanceof ByteBuffer)<NEW_LINE>o <MASK><NEW_LINE>((ArrayList<Object>) container).add(o);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("this should not happen");<NEW_LINE>}<NEW_LINE>}
= buf2ary((ByteBuffer) o);
1,820,992
public void position(final JSONObject action, JSONObject data, final JSONObject event, final Context context) {<NEW_LINE>if (player != null) {<NEW_LINE>try {<NEW_LINE>int duration = player.getDuration();<NEW_LINE>int position = player.getCurrentPosition();<NEW_LINE>float ratio = position / duration;<NEW_LINE>JSONObject ret = new JSONObject();<NEW_LINE>ret.put("value", String.valueOf(ratio));<NEW_LINE>JasonHelper.next("success", action, ret, event, context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>try {<NEW_LINE>JSONObject err = new JSONObject();<NEW_LINE>err.put("message", "invalid position or duration");<NEW_LINE>JasonHelper.next("error", action, err, event, context);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>Log.d("Warning", e2.getStackTrace()[0].getMethodName() + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>JSONObject err = new JSONObject();<NEW_LINE>err.put("message", "player doesn't exist");<NEW_LINE>JasonHelper.next("error", action, err, event, context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.d("Warning", e.getStackTrace()[0].getMethodName() + " : " + e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
" : " + e2.toString());
954,046
// For the serialization format, see BridgeSerializationUtils::serializeReleaseRequestQueue<NEW_LINE>private static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueueWithTxHash(RLPList rlpList, NetworkParameters networkParameters) {<NEW_LINE>List<ReleaseRequestQueue.Entry> entries = new ArrayList<>();<NEW_LINE>int n = rlpList.size() / 3;<NEW_LINE>for (int k = 0; k < n; k++) {<NEW_LINE>byte[] addressBytes = rlpList.get(k * 3).getRLPData();<NEW_LINE>Address address <MASK><NEW_LINE>long amount = BigIntegers.fromUnsignedByteArray(rlpList.get(k * 3 + 1).getRLPData()).longValue();<NEW_LINE>Keccak256 txHash = new Keccak256(rlpList.get(k * 3 + 2).getRLPData());<NEW_LINE>entries.add(new ReleaseRequestQueue.Entry(address, Coin.valueOf(amount), txHash));<NEW_LINE>}<NEW_LINE>return entries;<NEW_LINE>}
= new Address(networkParameters, addressBytes);
1,151,680
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "create variable ExprDefineLocalService myService = new ExprDefineLocalService();\n" + "create expression doit {v -> myService.calc(v)};\n" + "@name('s0') select doit(theString) as c0 from SupportBean;\n";<NEW_LINE>ExprDefineLocalService.services.clear();<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>ExprDefineLocalService service = ExprDefineLocalService.services.get(0);<NEW_LINE>env.sendEventBean(new <MASK><NEW_LINE>env.assertEqualsNew("s0", "c0", 10);<NEW_LINE>assertEquals(1, service.getCalculations().size());<NEW_LINE>env.sendEventBean(new SupportBean("E10", -1));<NEW_LINE>env.assertEqualsNew("s0", "c0", 10);<NEW_LINE>assertEquals(2, service.getCalculations().size());<NEW_LINE>ExprDefineLocalService.services.clear();<NEW_LINE>env.undeployAll();<NEW_LINE>}
SupportBean("E10", -1));
1,754,711
public static GsonBuilder createGson() {<NEW_LINE>GsonFireBuilder fireBuilder = new GsonFireBuilder().registerTypeSelector(ThrottlePolicyDTO.class, new TypeSelector() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Class getClassForElement(JsonElement readElement) {<NEW_LINE>Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();<NEW_LINE>classByDiscriminatorValue.put("AdvancedThrottlePolicyInfo", AdvancedThrottlePolicyInfoDTO.class);<NEW_LINE>classByDiscriminatorValue.put("AdvancedThrottlePolicy", AdvancedThrottlePolicyDTO.class);<NEW_LINE>classByDiscriminatorValue.<MASK><NEW_LINE>classByDiscriminatorValue.put("SubscriptionThrottlePolicy", SubscriptionThrottlePolicyDTO.class);<NEW_LINE>classByDiscriminatorValue.put("CustomRule", CustomRuleDTO.class);<NEW_LINE>classByDiscriminatorValue.put("ThrottlePolicy", ThrottlePolicyDTO.class);<NEW_LINE>return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "type"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>GsonBuilder builder = fireBuilder.createGsonBuilder();<NEW_LINE>return builder;<NEW_LINE>}
put("ApplicationThrottlePolicy", ApplicationThrottlePolicyDTO.class);
315,629
public static void refresh() {<NEW_LINE>LOGGER.info("Ibatis sql map refresh ...");<NEW_LINE>parserState.getSqlIncludes().clear();<NEW_LINE>ReflectionHelper.invoke(parserState.getConfig().getDelegate(), IBatisTransformers.REFRESH_METHOD);<NEW_LINE>for (Resource configLocation : configLocations) {<NEW_LINE>try {<NEW_LINE>InputStream is = configLocation.getInputStream();<NEW_LINE>sqlMapConfigParser.parse(is, properties);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.error("Failed to parse config resource: " + configLocation, ex.getCause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SqlMapParser parser = new SqlMapParser(parserState);<NEW_LINE>for (Resource mappingLocation : mappingLocations) {<NEW_LINE>try {<NEW_LINE>parser.parse(mappingLocation.getInputStream());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.error("Failed to parse sql map resource: " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.info("Ibatis sql map refresh successful!!!");<NEW_LINE>}
mappingLocation, ex.getCause());
942,377
public static // amplitude triplet<NEW_LINE>FreqIndicesWithAmplitudes refinePeakEstimatesParabola(double[] powSpecdB, int[] freqInds) {<NEW_LINE>double alpha, beta, gamma, p;<NEW_LINE>FreqIndicesWithAmplitudes fiwa = new FreqIndicesWithAmplitudes(freqInds.length);<NEW_LINE>for (int i = 0; i < freqInds.length; i++) {<NEW_LINE>// Make sure the peak is not at the first or last freq bin<NEW_LINE>if (freqInds[i] > 0 && freqInds[i] < freqInds.length - 1) {<NEW_LINE>alpha = powSpecdB[freqInds[i] - 1];<NEW_LINE>beta = powSpecdB[freqInds[i]];<NEW_LINE>gamma = powSpecdB[freqInds[i] + 1];<NEW_LINE>p = 0.5 * (alpha - gamma) / (alpha - 2 * beta + gamma);<NEW_LINE>fiwa.freqIndsRefined[i] = (float) (freqInds[i] + p);<NEW_LINE>fiwa.ampsRefined[i] = (float) (beta - 0.25 * p * (alpha - gamma));<NEW_LINE>// fiwa.ampsRefined[i] = (float)((p*p*(alpha-beta)+p*2*(alpha-2*beta)-beta)/(2*(alpha-beta)));<NEW_LINE>} else // otherwise do not refine<NEW_LINE>{<NEW_LINE>fiwa.freqIndsRefined[i] <MASK><NEW_LINE>fiwa.ampsRefined[i] = (float) powSpecdB[freqInds[i]];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fiwa;<NEW_LINE>}
= (float) freqInds[i];
822,380
public String startBroker(String brokerStarterClassName, PinotConfiguration brokerConf) throws Exception {<NEW_LINE>LOGGER.info("Trying to start Pinot Broker...");<NEW_LINE>if (!brokerConf.containsKey(CommonConstants.Helix.CONFIG_OF_CLUSTER_NAME)) {<NEW_LINE>brokerConf.setProperty(<MASK><NEW_LINE>}<NEW_LINE>if (!brokerConf.containsKey(CommonConstants.Helix.CONFIG_OF_ZOOKEEPR_SERVER)) {<NEW_LINE>brokerConf.setProperty(CommonConstants.Helix.CONFIG_OF_ZOOKEEPR_SERVER, _zkAddress);<NEW_LINE>}<NEW_LINE>ServiceStartable brokerStarter;<NEW_LINE>try {<NEW_LINE>brokerStarter = getServiceStartable(brokerStarterClassName);<NEW_LINE>brokerStarter.init(brokerConf);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to initialize Pinot Broker Starter", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>brokerStarter.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to start Pinot Broker", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>String instanceId = brokerStarter.getInstanceId();<NEW_LINE>_runningInstanceMap.put(instanceId, brokerStarter);<NEW_LINE>LOGGER.info("Pinot Broker instance [{}] is Started...", instanceId);<NEW_LINE>return instanceId;<NEW_LINE>}
CommonConstants.Helix.CONFIG_OF_CLUSTER_NAME, _clusterName);
1,755,503
public Request<SelectRequest> marshall(SelectRequest selectRequest) {<NEW_LINE>if (selectRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<SelectRequest> request = new DefaultRequest<SelectRequest>(selectRequest, "AmazonSimpleDB");<NEW_LINE>request.addParameter("Action", "Select");<NEW_LINE>request.addParameter("Version", "2009-04-15");<NEW_LINE><MASK><NEW_LINE>if (selectRequest.getSelectExpression() != null) {<NEW_LINE>request.addParameter("SelectExpression", StringUtils.fromString(selectRequest.getSelectExpression()));<NEW_LINE>}<NEW_LINE>if (selectRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(selectRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (selectRequest.getConsistentRead() != null) {<NEW_LINE>request.addParameter("ConsistentRead", StringUtils.fromBoolean(selectRequest.getConsistentRead()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
192,390
private void exportCategories(HttpServletRequest request, HttpServletResponse response, String contextInode, String filter) throws ServletException, IOException {<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>response.setContentType("application/octet-stream");<NEW_LINE>response.setHeader("Content-Disposition", "attachment; filename=\"categories_" + UtilMethods.dateToHTMLDate(new Date(), "M_d_yyyy") + ".csv\"");<NEW_LINE>final PrintWriter out = response.getWriter();<NEW_LINE>final UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();<NEW_LINE>try {<NEW_LINE>final User user = uWebAPI.getLoggedInUser(request);<NEW_LINE>final CategoryAPI catAPI = APILocator.getCategoryAPI();<NEW_LINE>List<Category> categories = UtilMethods.isSet(contextInode) ? catAPI.findChildren(user, contextInode, false, filter) : catAPI.findTopLevelCategories(user, false, filter);<NEW_LINE>if (!categories.isEmpty()) {<NEW_LINE>out.print("\"name\",\"key\",\"variable\",\"sort\"");<NEW_LINE>out.print("\r\n");<NEW_LINE>for (Category category : categories) {<NEW_LINE>String catName = category.getCategoryName();<NEW_LINE>String catKey = category.getKey();<NEW_LINE>String catVar = category.getCategoryVelocityVarName();<NEW_LINE>String catSort = Integer.toString(category.getSortOrder());<NEW_LINE>catName = catName == null ? "" : catName;<NEW_LINE>catKey = catKey == null ? "" : catKey;<NEW_LINE>catVar = catVar == null ? "" : catVar;<NEW_LINE>catName = "\"" + catName + "\"";<NEW_LINE>catKey = "\"" + catKey + "\"";<NEW_LINE>catVar = "\"" + catVar + "\"";<NEW_LINE>out.print(catName + "," + catKey + "," + catVar + "," + catSort);<NEW_LINE>out.print("\r\n");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.print("There are no Categories to show");<NEW_LINE>out.print("\r\n");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.<MASK><NEW_LINE>} finally {<NEW_LINE>out.flush();<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>}
error(this, "Error exporting categories", e);
1,424,830
public com.amazonaws.services.ecs.model.ClusterContainsTasksException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.ecs.model.ClusterContainsTasksException clusterContainsTasksException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return clusterContainsTasksException;<NEW_LINE>}
ecs.model.ClusterContainsTasksException(null);
1,214,391
private void invokeSetter(Object target, Node node, String argument) {<NEW_LINE>Method method = getMethod(target, "set" + toPropertyName(cleanNodeName(node)), true);<NEW_LINE>if (method == null) {<NEW_LINE>throw new InvalidConfigurationException<MASK><NEW_LINE>}<NEW_LINE>Class<?> arg = method.getParameterTypes()[0];<NEW_LINE>Object coercedArg = arg == String.class ? argument : arg == int.class ? Integer.valueOf(argument) : arg == long.class ? Long.valueOf(argument) : arg == boolean.class ? getBooleanValue(argument) : null;<NEW_LINE>if (coercedArg == null) {<NEW_LINE>throw new HazelcastException(String.format("Method %s has unsupported argument type %s", method.getName(), arg.getSimpleName()));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>method.invoke(target, coercedArg);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new HazelcastException(e);<NEW_LINE>}<NEW_LINE>}
("Invalid element/attribute name in the configuration: " + cleanNodeName(node));
1,829,193
private XContentBuilder toXContentInternal(final XContentBuilder builder, final ToXContent.Params params) throws IOException {<NEW_LINE>builder.startObject(SNAPSHOT);<NEW_LINE>builder.field(<MASK><NEW_LINE>builder.field(UUID, snapshotId.getUUID());<NEW_LINE>assert version != null : "version must always be known when writing a snapshot metadata blob";<NEW_LINE>builder.field(VERSION_ID, version.id);<NEW_LINE>builder.startArray(INDICES);<NEW_LINE>for (String index : indices) {<NEW_LINE>builder.value(index);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>builder.startArray(DATA_STREAMS);<NEW_LINE>for (String dataStream : dataStreams) {<NEW_LINE>builder.value(dataStream);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>builder.field(STATE, state);<NEW_LINE>if (reason != null) {<NEW_LINE>builder.field(REASON, reason);<NEW_LINE>}<NEW_LINE>if (includeGlobalState != null) {<NEW_LINE>builder.field(INCLUDE_GLOBAL_STATE, includeGlobalState);<NEW_LINE>}<NEW_LINE>builder.field(USER_METADATA, userMetadata);<NEW_LINE>builder.field(START_TIME, startTime);<NEW_LINE>builder.field(END_TIME, endTime);<NEW_LINE>builder.field(TOTAL_SHARDS, totalShards);<NEW_LINE>builder.field(SUCCESSFUL_SHARDS, successfulShards);<NEW_LINE>builder.startArray(FAILURES);<NEW_LINE>for (SnapshotShardFailure shardFailure : shardFailures) {<NEW_LINE>shardFailure.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
NAME, snapshotId.getName());
1,133,104
public static DescribeSagPortRouteProtocolListResponse unmarshall(DescribeSagPortRouteProtocolListResponse describeSagPortRouteProtocolListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSagPortRouteProtocolListResponse.setRequestId(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.RequestId"));<NEW_LINE>List<Port> ports = new ArrayList<Port>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagPortRouteProtocolListResponse.Ports.Length"); i++) {<NEW_LINE>Port port = new Port();<NEW_LINE>port.setStatus(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].Status"));<NEW_LINE>port.setRemoteIp(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].RemoteIp"));<NEW_LINE>port.setPortName(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].PortName"));<NEW_LINE>port.setNeighborIp(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].NeighborIp"));<NEW_LINE>port.setRouteProtocol(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].RouteProtocol"));<NEW_LINE>port.setRemoteAs(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].RemoteAs"));<NEW_LINE>port.setVlan(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].Vlan"));<NEW_LINE>ports.add(port);<NEW_LINE>}<NEW_LINE>describeSagPortRouteProtocolListResponse.setPorts(ports);<NEW_LINE>List<TaskState> taskStates = new ArrayList<TaskState>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagPortRouteProtocolListResponse.TaskStates.Length"); i++) {<NEW_LINE>TaskState taskState = new TaskState();<NEW_LINE>taskState.setErrorMessage(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].ErrorMessage"));<NEW_LINE>taskState.setState(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].State"));<NEW_LINE>taskState.setErrorCode(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].ErrorCode"));<NEW_LINE>taskState.setCreateTime(_ctx.stringValue<MASK><NEW_LINE>taskStates.add(taskState);<NEW_LINE>}<NEW_LINE>describeSagPortRouteProtocolListResponse.setTaskStates(taskStates);<NEW_LINE>return describeSagPortRouteProtocolListResponse;<NEW_LINE>}
("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].CreateTime"));
155,047
private void updateWindowInsets(Activity targetActivity, Rect outInsets) {<NEW_LINE>outInsets.left = outInsets.top = outInsets.right = outInsets.bottom = 0;<NEW_LINE>if (targetActivity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ViewGroup decorView = (ViewGroup) targetActivity.getWindow().getDecorView();<NEW_LINE>Display display = targetActivity.getWindowManager().getDefaultDisplay();<NEW_LINE>boolean isTranslucent = isNavigationBarTranslucent(targetActivity);<NEW_LINE>boolean isHidden = isNavigationBarHidden(decorView);<NEW_LINE>Rect dispFrame = mDisplayFrame;<NEW_LINE>Point realDispSize = mRealDisplaySize;<NEW_LINE>Point dispSize = mDisplaySize;<NEW_LINE>decorView.getWindowVisibleDisplayFrame(dispFrame);<NEW_LINE>DisplayCompat.getRealSize(display, realDispSize);<NEW_LINE>DisplayCompat.getSize(display, dispSize);<NEW_LINE>if (dispSize.x < realDispSize.x) {<NEW_LINE>// navigation bar is placed on right side of the screen<NEW_LINE>if (isTranslucent || isHidden) {<NEW_LINE>int navBarWidth <MASK><NEW_LINE>int overlapWidth = realDispSize.x - dispFrame.right;<NEW_LINE>outInsets.right = Math.max(Math.min(navBarWidth, overlapWidth), 0);<NEW_LINE>}<NEW_LINE>} else if (dispSize.y < realDispSize.y) {<NEW_LINE>// navigation bar is placed on bottom side of the screen<NEW_LINE>if (isTranslucent || isHidden) {<NEW_LINE>int navBarHeight = realDispSize.y - dispSize.y;<NEW_LINE>int overlapHeight = realDispSize.y - dispFrame.bottom;<NEW_LINE>outInsets.bottom = Math.max(Math.min(navBarHeight, overlapHeight), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= realDispSize.x - dispSize.x;
690,952
private void gatewayLogin() {<NEW_LINE>String aUrl = null;<NEW_LINE>moziotToken = null;<NEW_LINE>if (mozIotIP.getSecure() != null && mozIotIP.getSecure())<NEW_LINE>aUrl = "https://";<NEW_LINE>else<NEW_LINE>aUrl = "http://";<NEW_LINE>headers = new NameValue[2];<NEW_LINE>headers[0] = new NameValue();<NEW_LINE>headers[0].setName("Content-Type");<NEW_LINE>headers[0].setValue("application/json");<NEW_LINE>headers[1] = new NameValue();<NEW_LINE>headers[1].setName("Accept");<NEW_LINE>headers[1].setValue("application/json");<NEW_LINE>aUrl = aUrl + mozIotIP.getIp() + ":" + mozIotIP.getPort() + "/login";<NEW_LINE><MASK><NEW_LINE>String commandData = "{\"email\": \"" + mozIotIP.getUsername() + "\", \"password\":\"" + mozIotIP.getPassword() + "\"}";<NEW_LINE>log.debug("The login body: {}", commandData);<NEW_LINE>String theData = anHttpClient.doHttpRequest(aUrl, HttpPost.METHOD_NAME, "application/json", commandData, headers);<NEW_LINE>if (theData != null) {<NEW_LINE>log.debug("GET Mozilla login - data: {}", theData);<NEW_LINE>try {<NEW_LINE>moziotToken = new Gson().fromJson(theData, JWT.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Cannot get login for Mozilla IOT {} Gson Parse Error.", mozIotIP.getName());<NEW_LINE>moziotToken = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warn("Could not login {} error: <<<{}>>>", mozIotIP.getName(), theData);<NEW_LINE>}<NEW_LINE>headers = null;<NEW_LINE>}
log.debug("gateway login URL: {}", aUrl);
778,578
public List<OAuthApproval> requestOAuthApprovals(String xSdsDateFormat, String sort, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/user/oauth/approvals";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));<NEW_LINE>if (xSdsDateFormat != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Date-Format", apiClient.parameterToString(xSdsDateFormat));<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<List<OAuthApproval>> localVarReturnType = new GenericType<List<OAuthApproval>>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
final String[] localVarContentTypes = {};
1,111,282
public byte[] toByteArray() {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "toByteArray");<NEW_LINE>// Just in case you're wondering, if two threads race to create the<NEW_LINE>// cached arrays, we may end up with two identical arrays, one of which<NEW_LINE>// is cached, while the other thread uses the second. Since the contents of<NEW_LINE>// the arrays are identical, this does not cause a problem!<NEW_LINE>if (_cachedBytes == null) {<NEW_LINE>_cachedBytes = new byte[16];<NEW_LINE>_cachedBytes[0] = (byte) ((_uuidHigh <MASK><NEW_LINE>_cachedBytes[1] = (byte) ((_uuidHigh & 0x00FF000000000000L) >>> 48);<NEW_LINE>_cachedBytes[2] = (byte) ((_uuidHigh & 0x0000FF0000000000L) >>> 40);<NEW_LINE>_cachedBytes[3] = (byte) ((_uuidHigh & 0x000000FF00000000L) >>> 32);<NEW_LINE>_cachedBytes[4] = (byte) ((_uuidHigh & 0x00000000FF000000L) >>> 24);<NEW_LINE>_cachedBytes[5] = (byte) ((_uuidHigh & 0x0000000000FF0000L) >>> 16);<NEW_LINE>_cachedBytes[6] = (byte) ((_uuidHigh & 0x000000000000FF00L) >>> 8);<NEW_LINE>_cachedBytes[7] = (byte) ((_uuidHigh & 0x00000000000000FFL) >>> 0);<NEW_LINE>_cachedBytes[8] = (byte) ((_uuidLow & 0xFF00000000000000L) >>> 56);<NEW_LINE>_cachedBytes[9] = (byte) ((_uuidLow & 0x00FF000000000000L) >>> 48);<NEW_LINE>_cachedBytes[10] = (byte) ((_uuidLow & 0x0000FF0000000000L) >>> 40);<NEW_LINE>_cachedBytes[11] = (byte) ((_uuidLow & 0x000000FF00000000L) >>> 32);<NEW_LINE>_cachedBytes[12] = (byte) ((_uuidLow & 0x00000000FF000000L) >>> 24);<NEW_LINE>_cachedBytes[13] = (byte) ((_uuidLow & 0x0000000000FF0000L) >>> 16);<NEW_LINE>_cachedBytes[14] = (byte) ((_uuidLow & 0x000000000000FF00L) >>> 8);<NEW_LINE>_cachedBytes[15] = (byte) ((_uuidLow & 0x00000000000000FFL) >>> 0);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "toByteArray", com.ibm.ejs.util.Util.toHexString(_cachedBytes));<NEW_LINE>return _cachedBytes;<NEW_LINE>}
& 0xFF00000000000000L) >>> 56);
1,370,180
public Object convert(Object src, Class destClass) {<NEW_LINE>if (src instanceof String) {<NEW_LINE>if (Timestamp.class == destClass) {<NEW_LINE>try {<NEW_LINE>return MySQLTimeTypeUtil.bytesToDatetime(((String) src).getBytes(), Types.TIMESTAMP, false);<NEW_LINE>} catch (IllegalArgumentException ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Date date = null;<NEW_LINE>String val = DateUtils.strToDateString((String) src);<NEW_LINE>String format = val.indexOf("-") <= 2 ? DateUtils.MYSQL_DATETIME_DEFAULT_FORMAT2 : DateUtils.MYSQL_DATETIME_DEFAULT_FORMAT1;<NEW_LINE>date = DateUtils.extractDateTime(val, format);<NEW_LINE>if (date == null) {<NEW_LINE>throw new ConvertorException("Unsupported convert: [" + src + "," + destClass.getName() + "]");<NEW_LINE>}<NEW_LINE>return ConvertorHelper.<MASK><NEW_LINE>}<NEW_LINE>throw new ConvertorException("Unsupported convert: [" + src + "," + destClass.getName() + "]");<NEW_LINE>}
dateToSql.convert(date, destClass);
1,747,050
private <T extends RecordTemplate> void checkRecordTemplate(T prevRec, T currRec) {<NEW_LINE>final Class<?> prevClass = prevRec.getClass();<NEW_LINE>if (prevClass == ResourceSchema.class) {<NEW_LINE>checkResourceSchema((ResourceSchema) prevRec, (ResourceSchema) currRec);<NEW_LINE>} else if (prevClass == CollectionSchema.class) {<NEW_LINE>checkCollectionSchema((CollectionSchema) prevRec, (CollectionSchema) currRec);<NEW_LINE>} else if (prevClass == IdentifierSchema.class) {<NEW_LINE>checkIdentifierSchema((IdentifierSchema) prevRec, (IdentifierSchema) currRec);<NEW_LINE>} else if (prevClass == FinderSchema.class) {<NEW_LINE>checkFinderSchema((FinderSchema<MASK><NEW_LINE>} else if (prevClass == BatchFinderSchema.class) {<NEW_LINE>checkBatchFinderSchema((BatchFinderSchema) prevRec, (BatchFinderSchema) currRec);<NEW_LINE>} else if (prevClass == ParameterSchema.class) {<NEW_LINE>checkParameterSchema((ParameterSchema) prevRec, (ParameterSchema) currRec);<NEW_LINE>} else if (prevClass == MetadataSchema.class) {<NEW_LINE>checkMetadataSchema((MetadataSchema) prevRec, (MetadataSchema) currRec);<NEW_LINE>} else if (prevClass == ActionSchema.class) {<NEW_LINE>checkActionSchema((ActionSchema) prevRec, (ActionSchema) currRec);<NEW_LINE>} else if (prevClass == EntitySchema.class) {<NEW_LINE>checkEntitySchema((EntitySchema) prevRec, (EntitySchema) currRec);<NEW_LINE>} else if (prevClass == AssociationSchema.class) {<NEW_LINE>checkAssociationSchema((AssociationSchema) prevRec, (AssociationSchema) currRec);<NEW_LINE>} else if (prevClass == SimpleSchema.class) {<NEW_LINE>checkSimpleSchema((SimpleSchema) prevRec, (SimpleSchema) currRec);<NEW_LINE>} else if (prevClass == AssocKeySchema.class) {<NEW_LINE>checkAssocKeySchema((AssocKeySchema) prevRec, (AssocKeySchema) currRec);<NEW_LINE>} else if (prevClass == ActionsSetSchema.class) {<NEW_LINE>checkActionsSetSchema((ActionsSetSchema) prevRec, (ActionsSetSchema) currRec);<NEW_LINE>} else if (prevClass == RestMethodSchema.class) {<NEW_LINE>checkRestMethodSchema((RestMethodSchema) prevRec, (RestMethodSchema) currRec);<NEW_LINE>} else if (prevClass == AlternativeKeySchema.class) {<NEW_LINE>checkAlternativeKeySchema((AlternativeKeySchema) prevRec, (AlternativeKeySchema) currRec);<NEW_LINE>} else {<NEW_LINE>_infoMap.addRestSpecInfo(CompatibilityInfo.Type.OTHER_ERROR, _infoPath, "Unknown schema type: \"" + prevRec.getClass() + "\"");<NEW_LINE>}<NEW_LINE>}
) prevRec, (FinderSchema) currRec);
753,734
public List<SourceGroup> keys() {<NEW_LINE>// parse SG<NEW_LINE>// update SG listeners<NEW_LINE>// XXX check if this is necessary<NEW_LINE>final SourceGroup[] sourceGroups = PhpProjectUtils.getSourceGroups(project);<NEW_LINE>final SourceGroup[] groups = new SourceGroup[sourceGroups.length];<NEW_LINE>System.arraycopy(sourceGroups, 0, groups, 0, sourceGroups.length);<NEW_LINE>List<SourceGroup> keysList = new <MASK><NEW_LINE>// Set<FileObject> roots = new HashSet<FileObject>();<NEW_LINE>FileObject fileObject;<NEW_LINE>for (int i = 0; i < groups.length; i++) {<NEW_LINE>fileObject = groups[i].getRootFolder();<NEW_LINE>DataFolder srcDir = getFolder(fileObject);<NEW_LINE>if (srcDir != null) {<NEW_LINE>keysList.add(groups[i]);<NEW_LINE>}<NEW_LINE>// roots.add(fileObject);<NEW_LINE>}<NEW_LINE>return keysList;<NEW_LINE>// Seems that we do not need to implement FileStatusListener<NEW_LINE>// to listen to source groups root folders changes.<NEW_LINE>// look at RubyLogicalViewRootNode for example.<NEW_LINE>// updateSourceRootsListeners(roots);<NEW_LINE>}
ArrayList<>(groups.length);
1,428,434
public OnSuccess unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OnSuccess onSuccess = new OnSuccess();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Destination", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>onSuccess.setDestination(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 onSuccess;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
254,378
public final Small_stmtContext small_stmt() throws RecognitionException {<NEW_LINE>Small_stmtContext _localctx = new Small_stmtContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>setState(593);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case STRING:<NEW_LINE>case LAMBDA:<NEW_LINE>case NOT:<NEW_LINE>case NONE:<NEW_LINE>case TRUE:<NEW_LINE>case FALSE:<NEW_LINE>case AWAIT:<NEW_LINE>case NAME:<NEW_LINE>case DECIMAL_INTEGER:<NEW_LINE>case OCT_INTEGER:<NEW_LINE>case HEX_INTEGER:<NEW_LINE>case BIN_INTEGER:<NEW_LINE>case FLOAT_NUMBER:<NEW_LINE>case IMAG_NUMBER:<NEW_LINE>case ELLIPSIS:<NEW_LINE>case STAR:<NEW_LINE>case OPEN_PAREN:<NEW_LINE>case OPEN_BRACK:<NEW_LINE>case ADD:<NEW_LINE>case MINUS:<NEW_LINE>case NOT_OP:<NEW_LINE>case OPEN_BRACE:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(584);<NEW_LINE>expr_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DEL:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(585);<NEW_LINE>del_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case PASS:<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(586);<NEW_LINE>_localctx.p = match(PASS);<NEW_LINE>int start = _localctx.p.getStartIndex();<NEW_LINE>push(new SimpleSSTNode(SimpleSSTNode.Type.PASS, start, start + 4));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RETURN:<NEW_LINE>case RAISE:<NEW_LINE>case YIELD:<NEW_LINE>case CONTINUE:<NEW_LINE>case BREAK:<NEW_LINE>enterOuterAlt(_localctx, 4);<NEW_LINE>{<NEW_LINE>setState(588);<NEW_LINE>flow_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FROM:<NEW_LINE>case IMPORT:<NEW_LINE>enterOuterAlt(_localctx, 5);<NEW_LINE>{<NEW_LINE>setState(589);<NEW_LINE>import_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GLOBAL:<NEW_LINE>enterOuterAlt(_localctx, 6);<NEW_LINE>{<NEW_LINE>setState(590);<NEW_LINE>global_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NONLOCAL:<NEW_LINE>enterOuterAlt(_localctx, 7);<NEW_LINE>{<NEW_LINE>setState(591);<NEW_LINE>nonlocal_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ASSERT:<NEW_LINE>enterOuterAlt(_localctx, 8);<NEW_LINE>{<NEW_LINE>setState(592);<NEW_LINE>assert_stmt();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
enterRule(_localctx, 40, RULE_small_stmt);
139,482
private static void runAssertionSingleMaxSimple(RegressionEnvironment env, SupportConditionHandlerFactory.SupportConditionHandler handler) {<NEW_LINE>String[] fields = new String[] { "a", "b" };<NEW_LINE>env.sendEventBean(new SupportBean_A("A1"));<NEW_LINE>env.sendEventBean(new SupportBean_A("A2"));<NEW_LINE>handler.getContexts().clear();<NEW_LINE>env.sendEventBean(new SupportBean_A("A3"));<NEW_LINE>assertContext(env, handler.getContexts(), 2);<NEW_LINE>env.sendEventBean(new SupportBean_B("B1"));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A1", "B1" }, { "A2", "B1" } });<NEW_LINE>env.sendEventBean(new SupportBean_A("A4"));<NEW_LINE>env.sendEventBean(new SupportBean_B("B2"));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A4", "B2" } });<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>for (int i = 5; i < 9; i++) {<NEW_LINE>env.sendEventBean(new SupportBean_A("A" + i));<NEW_LINE>if (i >= 7) {<NEW_LINE>assertContext(env, handler.getContexts(), 2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.sendEventBean(new SupportBean_B("B3"));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A5", "B3" }, { "A6", "B3" } });<NEW_LINE>env.sendEventBean(new SupportBean_B("B4"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.<MASK><NEW_LINE>env.sendEventBean(new SupportBean_A("A21"));<NEW_LINE>env.sendEventBean(new SupportBean_B("B5"));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A20", "B5" }, { "A21", "B5" } });<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>}
sendEventBean(new SupportBean_A("A20"));
1,071,683
final DeleteCustomRoutingEndpointGroupResult executeDeleteCustomRoutingEndpointGroup(DeleteCustomRoutingEndpointGroupRequest deleteCustomRoutingEndpointGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteCustomRoutingEndpointGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteCustomRoutingEndpointGroupRequest> request = null;<NEW_LINE>Response<DeleteCustomRoutingEndpointGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteCustomRoutingEndpointGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCustomRoutingEndpointGroupRequest));<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, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCustomRoutingEndpointGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteCustomRoutingEndpointGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCustomRoutingEndpointGroupResultJsonUnmarshaller());<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,802,741
public Feature fromStore(DynamoDbFeature item) {<NEW_LINE>Feature feature = new Feature(item.getFeatureUid());<NEW_LINE>feature.setEnable(item.isEnable());<NEW_LINE>feature.setDescription(item.getDescription());<NEW_LINE>feature.setGroup(item.getGroupName());<NEW_LINE><MASK><NEW_LINE>if (Util.hasLength(jsonFlippingStrategy)) {<NEW_LINE>feature.setFlippingStrategy(FeatureJsonParser.parseFlipStrategyAsJson(feature.getUid(), jsonFlippingStrategy));<NEW_LINE>}<NEW_LINE>Set<String> perms = item.getPermissions();<NEW_LINE>feature.setPermissions(perms == null ? new HashSet<>() : perms);<NEW_LINE>Map<String, String> props = item.getProperties();<NEW_LINE>if (props != null) {<NEW_LINE>Map<String, Property<?>> customProperties = new HashMap<>();<NEW_LINE>for (Map.Entry<String, String> propString : props.entrySet()) {<NEW_LINE>customProperties.put(propString.getKey(), PropertyJsonParser.parseProperty(propString.getValue()));<NEW_LINE>}<NEW_LINE>feature.setCustomProperties(customProperties);<NEW_LINE>}<NEW_LINE>return feature;<NEW_LINE>}
String jsonFlippingStrategy = item.getFlippingStrategy();
693,311
public static void partialReduceDoubleAdd(double[] inputArray, double[] outputArray, int gidx) {<NEW_LINE>int localIdx = OpenCLIntrinsics.get_local_id(0);<NEW_LINE>int <MASK><NEW_LINE>int groupID = OpenCLIntrinsics.get_group_id(0);<NEW_LINE>double[] localArray = (double[]) NewArrayNode.newUninitializedArray(double.class, LOCAL_WORK_GROUP_SIZE);<NEW_LINE>localArray[localIdx] = inputArray[gidx];<NEW_LINE>for (int stride = (localGroupSize / 2); stride > 0; stride /= 2) {<NEW_LINE>OpenCLIntrinsics.localBarrier();<NEW_LINE>if (localIdx < stride) {<NEW_LINE>localArray[localIdx] += localArray[localIdx + stride];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OpenCLIntrinsics.globalBarrier();<NEW_LINE>if (localIdx == 0) {<NEW_LINE>outputArray[groupID + 1] = localArray[0];<NEW_LINE>}<NEW_LINE>}
localGroupSize = OpenCLIntrinsics.get_local_size(0);
1,048,360
public byte[] toBytes() {<NEW_LINE>ByteBuffer <MASK><NEW_LINE>buf.putShort(MAGIC);<NEW_LINE>byte msgType = (byte) 0x00;<NEW_LINE>if (heartbeat) {<NEW_LINE>msgType = (byte) (msgType | 0x10);<NEW_LINE>}<NEW_LINE>if (gzip) {<NEW_LINE>msgType = (byte) (msgType | 0x08);<NEW_LINE>}<NEW_LINE>if (oneway) {<NEW_LINE>msgType = (byte) (msgType | 0x04);<NEW_LINE>}<NEW_LINE>if (proxy) {<NEW_LINE>msgType = (byte) (msgType | 0x02);<NEW_LINE>}<NEW_LINE>if (!request) {<NEW_LINE>msgType = (byte) (msgType | 0x01);<NEW_LINE>}<NEW_LINE>buf.put(msgType);<NEW_LINE>byte vs = 0x08;<NEW_LINE>if (version != 1) {<NEW_LINE>vs = (byte) ((version << 3) & 0xf8);<NEW_LINE>}<NEW_LINE>if (status != 0) {<NEW_LINE>vs = (byte) (vs | (status & 0x07));<NEW_LINE>}<NEW_LINE>buf.put(vs);<NEW_LINE>byte se = 0x08;<NEW_LINE>if (serialize != 1) {<NEW_LINE>se = (byte) ((serialize << 3) & 0xf8);<NEW_LINE>}<NEW_LINE>buf.put(se);<NEW_LINE>buf.putLong(requestId);<NEW_LINE>buf.flip();<NEW_LINE>return buf.array();<NEW_LINE>}
buf = ByteBuffer.allocate(13);
1,408,502
public BillingActionResponse startPurchaseAction(final Activity callingActivity, final int activityResultCode, final IInAppBillingService billingService, final DummySku sku) throws RemoteException {<NEW_LINE>if (callingActivity == null || billingService == null)<NEW_LINE>throw new IllegalArgumentException("activity and service argument must be non-null");<NEW_LINE>final Bundle purchaseIntentBundle = billingService.getBuyIntent(3, callingActivity.getPackageName(), sku.<MASK><NEW_LINE>final int responseCodeGetBuyIntent = purchaseIntentBundle.getInt(RESPONSE_KEY_RESPONSE_CODE);<NEW_LINE>switch(responseCodeGetBuyIntent) {<NEW_LINE>case BILLING_RESPONSE_RESULT_OK:<NEW_LINE>final PendingIntent pendingIntent = purchaseIntentBundle.getParcelable(RESPONSE_KEY_BUY_INTENT);<NEW_LINE>if (pendingIntent != null) {<NEW_LINE>try {<NEW_LINE>callingActivity.startIntentSenderForResult(pendingIntent.getIntentSender(), activityResultCode, null, 0, 0, 0);<NEW_LINE>return BillingActionResponse.DONE;<NEW_LINE>} catch (final SendIntentException sendIntentException) {<NEW_LINE>return BillingActionResponse.INTERNAL_ERROR;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return BillingActionResponse.INTERNAL_ERROR;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>return billingActionResponseCodeToEnum(responseCodeGetBuyIntent, BillingActionResponse.INTERNAL_ERROR);<NEW_LINE>}<NEW_LINE>}
getId(), "inapp", null);
963,918
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Portal portal = emc.find(id, Portal.class);<NEW_LINE>if (null == portal) {<NEW_LINE>throw new PortalNotExistedException(id);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, portal)) {<NEW_LINE>throw new PortalInvisibleException(effectivePerson.getDistinguishedName(), portal.getName(<MASK><NEW_LINE>}<NEW_LINE>List<String> ids = business.page().listWithPortal(portal.getId());<NEW_LINE>List<Wo> wos = Wo.copier.copy(emc.list(Page.class, ids));<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(Wo::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
), portal.getId());
896,812
public Object evaluate(DeferredObject[] arg0) throws HiveException {<NEW_LINE>Map hiveMap = mapInspector.getMap(arg0[0].get());<NEW_LINE>List keyValues = inspectList(keyListInspector.getList(arg0[1].get()));<NEW_LINE>// / Convert all the keys to standard keys<NEW_LINE>Map stdKeys = stdKeys(hiveMap);<NEW_LINE>Map retVal = (Map) retValInspector.create();<NEW_LINE>for (Object keyObj : keyValues) {<NEW_LINE>if (stdKeys.containsKey(keyObj)) {<NEW_LINE>Object hiveKey = stdKeys.get(keyObj);<NEW_LINE>Object hiveVal = hiveMap.get(hiveKey);<NEW_LINE>Object keyStd = ObjectInspectorUtils.copyToStandardObject(<MASK><NEW_LINE>Object valStd = ObjectInspectorUtils.copyToStandardObject(hiveVal, mapInspector.getMapValueObjectInspector());<NEW_LINE>retVal.put(keyStd, valStd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
hiveKey, mapInspector.getMapKeyObjectInspector());
1,371,617
final GetLicenseResult executeGetLicense(GetLicenseRequest getLicenseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLicenseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLicenseRequest> request = null;<NEW_LINE>Response<GetLicenseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLicenseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLicenseRequest));<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, "GetLicense");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLicenseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLicenseResultJsonUnmarshaller());<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,511,861
private void testMethodLevelPermitAll(final String baseUri) throws Exception {<NEW_LINE>LOG.entering(clz, "entered testMethodLevelPermitAll");<NEW_LINE>String url = baseUri + "/MethodPermitAll";<NEW_LINE>// create the resource instance to interact with<NEW_LINE>LOG.info("testMethodLevelPermitAll about to invoke the resource: " + url);<NEW_LINE><MASK><NEW_LINE>cb.connectTimeout(120000, TimeUnit.MILLISECONDS);<NEW_LINE>cb.readTimeout(120000, TimeUnit.MILLISECONDS);<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target(url);<NEW_LINE>CompletableFuture<Response> completableFuture = t.request().accept("text/plain").rx().get().toCompletableFuture();<NEW_LINE>try {<NEW_LINE>Response response = completableFuture.get();<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>assertEquals("remotely accessible to all through method level PermitAll", response.readEntity(String.class));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>LOG.info("testMethodLevelPermitAll SUCCEEDED");<NEW_LINE>LOG.exiting(clz, "exiting testMethodLevelPermitAll SUCCESS");<NEW_LINE>}
ClientBuilder cb = ClientBuilder.newBuilder();
1,055,226
public com.amazonaws.services.codecommit.model.InvalidParentCommitIdException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.InvalidParentCommitIdException invalidParentCommitIdException = new com.amazonaws.services.codecommit.model.InvalidParentCommitIdException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 invalidParentCommitIdException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,082,336
public Request<CreateExportJobRequest> marshall(CreateExportJobRequest createExportJobRequest) {<NEW_LINE>if (createExportJobRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(CreateExportJobRequest)");<NEW_LINE>}<NEW_LINE>Request<CreateExportJobRequest> request = new DefaultRequest<CreateExportJobRequest>(createExportJobRequest, "AmazonPinpoint");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/v1/apps/{application-id}/jobs/export";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{application-id}", (createExportJobRequest.getApplicationId() == null) ? "" : StringUtils.fromString(createExportJobRequest.getApplicationId()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>if (createExportJobRequest.getExportJobRequest() != null) {<NEW_LINE>ExportJobRequest exportJobRequest = createExportJobRequest.getExportJobRequest();<NEW_LINE>ExportJobRequestJsonMarshaller.getInstance().marshall(exportJobRequest, jsonWriter);<NEW_LINE>}<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
t.getMessage(), t);
681,827
public synchronized void reloadPartitionInfo(Connection conn, String schemaName, String tbName) {<NEW_LINE>if (!StringUtils.isEmpty(tbName)) {<NEW_LINE>tbName = tbName.toLowerCase();<NEW_LINE>}<NEW_LINE>TablePartitionConfig tbPartConf = TablePartitionConfigUtil.getPublicTablePartitionConfig(conn, schemaName, tbName, false);<NEW_LINE>if (tbPartConf == null) {<NEW_LINE>invalidatePartitionInfo(schemaName, tbName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Long tableGrpId = tbPartConf.getTableConfig().groupId;<NEW_LINE>PartInfoCtx partCtx = this.partInfoCtxCache.computeIfAbsent(tbName, (name) -> new PartInfoCtx(this, name, tableGrpId));<NEW_LINE>Long oldTableGrpId = partCtx.getTableGroupId();<NEW_LINE>partCtx.reload(conn, false);<NEW_LINE>rule.getTableGroupInfoManager().reloadTableGroupByGroupIdAndTableName(conn, tableGrpId, schemaName, tbName);<NEW_LINE>// remove tables in old table group<NEW_LINE>if (!Objects.equals(oldTableGrpId, tableGrpId)) {<NEW_LINE>rule.getTableGroupInfoManager(<MASK><NEW_LINE>}<NEW_LINE>}
).invalidate(oldTableGrpId, tbName);
235,591
public void write(DataOutput out) throws IOException {<NEW_LINE>// Add the type of load secondly<NEW_LINE>Text.writeString(out, jobType.name());<NEW_LINE>out.writeLong(id);<NEW_LINE>out.writeLong(dbId);<NEW_LINE>Text.writeString(out, label);<NEW_LINE>Text.writeString(out, state.name());<NEW_LINE>out.writeLong(timeoutSecond);<NEW_LINE>out.writeLong(loadMemLimit);<NEW_LINE>out.writeDouble(maxFilterRatio);<NEW_LINE>// reuse deleteFlag as partialUpdate<NEW_LINE>// out.writeBoolean(deleteFlag);<NEW_LINE>out.writeBoolean(partialUpdate);<NEW_LINE>out.writeLong(createTimestamp);<NEW_LINE>out.writeLong(loadStartTimestamp);<NEW_LINE>out.writeLong(finishTimestamp);<NEW_LINE>if (failMsg == null) {<NEW_LINE>out.writeBoolean(false);<NEW_LINE>} else {<NEW_LINE>out.writeBoolean(true);<NEW_LINE>failMsg.write(out);<NEW_LINE>}<NEW_LINE>out.writeInt(progress);<NEW_LINE>loadingStatus.write(out);<NEW_LINE>out.writeBoolean(strictMode);<NEW_LINE>out.writeLong(transactionId);<NEW_LINE>if (authorizationInfo == null) {<NEW_LINE>out.writeBoolean(false);<NEW_LINE>} else {<NEW_LINE>out.writeBoolean(true);<NEW_LINE>authorizationInfo.write(out);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
Text.writeString(out, timezone);
1,209,869
public void marshall(LoadBalancerTlsCertificate loadBalancerTlsCertificate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (loadBalancerTlsCertificate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSupportCode(), SUPPORTCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getLoadBalancerName(), LOADBALANCERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIsAttached(), ISATTACHED_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getDomainName(), DOMAINNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getDomainValidationRecords(), DOMAINVALIDATIONRECORDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getFailureReason(), FAILUREREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIssuedAt(), ISSUEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIssuer(), ISSUER_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getKeyAlgorithm(), KEYALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getNotAfter(), NOTAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getNotBefore(), NOTBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRenewalSummary(), RENEWALSUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRevocationReason(), REVOCATIONREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRevokedAt(), REVOKEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSerial(), SERIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSignatureAlgorithm(), SIGNATUREALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSubject(), SUBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
loadBalancerTlsCertificate.getSubjectAlternativeNames(), SUBJECTALTERNATIVENAMES_BINDING);
116,442
final ListHostsResult executeListHosts(ListHostsRequest listHostsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listHostsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListHostsRequest> request = null;<NEW_LINE>Response<ListHostsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListHostsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listHostsRequest));<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, "CodeStar connections");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListHosts");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListHostsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListHostsResultJsonUnmarshaller());<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,696,049
public Response listAreas(@Parameter(description = "Limit to root elements", required = false) @QueryParam("rootOnly") @DefaultValue("true") Boolean rootOnly, @Parameter(description = "Limit by parent area token", required = false) @QueryParam("parentAreaToken") String parentAreaToken, @Parameter(description = "Limit by area type token", required = false) @QueryParam("areaTypeToken") String areaTypeToken, @Parameter(description = "Include area type", required = false) @QueryParam("includeAreaType") @DefaultValue("false") boolean includeAreaType, @Parameter(description = "Include assignments", required = false) @QueryParam("includeAssignments") @DefaultValue("false") boolean includeAssignments, @Parameter(description = "Include zones", required = false) @QueryParam("includeZones") @DefaultValue("false") boolean includeZones, @Parameter(description = "Page number", required = false) @QueryParam("page") @DefaultValue("1") int page, @Parameter(description = "Page size", required = false) @QueryParam("pageSize") @DefaultValue("100") int pageSize) throws SiteWhereException {<NEW_LINE>// Build criteria.<NEW_LINE>AreaSearchCriteria criteria = buildAreaSearchCriteria(page, pageSize, rootOnly, parentAreaToken, areaTypeToken);<NEW_LINE>// Perform search.<NEW_LINE>ISearchResults<? extends IArea> matches = getDeviceManagement().listAreas(criteria);<NEW_LINE>AreaMarshalHelper helper = new AreaMarshalHelper(getDeviceManagement(), getAssetManagement());<NEW_LINE>helper.setIncludeAreaType(includeAreaType);<NEW_LINE>helper.setIncludeZones(includeZones);<NEW_LINE>helper.setIncludeAssignments(includeAssignments);<NEW_LINE>List<IArea> results <MASK><NEW_LINE>for (IArea area : matches.getResults()) {<NEW_LINE>results.add(helper.convert(area));<NEW_LINE>}<NEW_LINE>return Response.ok(new SearchResults<IArea>(results, matches.getNumResults())).build();<NEW_LINE>}
= new ArrayList<IArea>();
1,274,335
private void createSecretKeyNodes(DefaultMutableTreeNode parentNode, SecretKey secretKey) {<NEW_LINE>DefaultMutableTreeNode secretKeyNode = new DefaultMutableTreeNode<MASK><NEW_LINE>parentNode.add(secretKeyNode);<NEW_LINE>KeyInfo keyInfo = SecretKeyUtil.getKeyInfo(secretKey);<NEW_LINE>String keyAlg = keyInfo.getAlgorithm();<NEW_LINE>// Try and get friendly algorithm name for secret key<NEW_LINE>SecretKeyType secretKeyType = SecretKeyType.resolveJce(keyAlg);<NEW_LINE>if (secretKeyType != null) {<NEW_LINE>keyAlg = secretKeyType.friendly();<NEW_LINE>}<NEW_LINE>secretKeyNode.add(new DefaultMutableTreeNode(MessageFormat.format(res.getString("DProperties.properties.Algorithm"), keyAlg)));<NEW_LINE>Integer keySize = keyInfo.getSize();<NEW_LINE>if (keySize != null) {<NEW_LINE>secretKeyNode.add(new DefaultMutableTreeNode(MessageFormat.format(res.getString("DProperties.properties.KeySize"), "" + keyInfo.getSize())));<NEW_LINE>} else {<NEW_LINE>secretKeyNode.add(new DefaultMutableTreeNode(MessageFormat.format(res.getString("DProperties.properties.KeySize"), "?")));<NEW_LINE>}<NEW_LINE>String keyFormat = secretKey.getFormat();<NEW_LINE>secretKeyNode.add(new DefaultMutableTreeNode(MessageFormat.format(res.getString("DProperties.properties.Format"), keyFormat)));<NEW_LINE>String keyEncoded = "0x" + new BigInteger(1, secretKey.getEncoded()).toString(16).toUpperCase();<NEW_LINE>secretKeyNode.add(new DefaultMutableTreeNode(MessageFormat.format(res.getString("DProperties.properties.Encoded"), keyEncoded)));<NEW_LINE>}
(res.getString("DProperties.properties.SecretKey"));
1,196,211
public static void execute(ManagerConnection c, int numLines) {<NEW_LINE>ByteBuffer buffer = c.allocate();<NEW_LINE>// write header<NEW_LINE>buffer = header.write(buffer, c, true);<NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : fields) {<NEW_LINE>buffer = field.write(buffer, c, true);<NEW_LINE>}<NEW_LINE>// write eof<NEW_LINE>buffer = eof.write(buffer, c, true);<NEW_LINE>// write rows<NEW_LINE>byte packetId = eof.packetId;<NEW_LINE>String filename = SystemConfig.getHomePath() + File.separator + "logs" + File.separator + "mycat.log";<NEW_LINE>String[] lines = getLinesByLogFile(filename, numLines);<NEW_LINE>boolean linesIsEmpty = true;<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>String line = lines[i];<NEW_LINE>if (line != null) {<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode(line.substring(0, 19), c.getCharset()));<NEW_LINE>row.add(StringUtil.encode(line.substring(19, line.length()), c.getCharset()));<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.write(buffer, c, true);<NEW_LINE>linesIsEmpty = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (linesIsEmpty) {<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode("NULL", c.getCharset()));<NEW_LINE>row.add(StringUtil.encode("NULL"<MASK><NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.write(buffer, c, true);<NEW_LINE>}<NEW_LINE>// write last eof<NEW_LINE>EOFPacket lastEof = new EOFPacket();<NEW_LINE>lastEof.packetId = ++packetId;<NEW_LINE>buffer = lastEof.write(buffer, c, true);<NEW_LINE>// write buffer<NEW_LINE>c.write(buffer);<NEW_LINE>}
, c.getCharset()));
816,942
private void addConduitCores(List<CollidableComponent> result, IConduit con) {<NEW_LINE>CollidableCache cc = CollidableCache.instance;<NEW_LINE>Class<? extends IConduit> type = con.getCollidableType();<NEW_LINE>Set<CollidableComponent> components = new LinkedHashSet<>();<NEW_LINE>if (con.hasConnections()) {<NEW_LINE>for (EnumFacing dir : con.getExternalConnections()) {<NEW_LINE>components.addAll(cc.getCollidables(cc.createKey(type, getOffset(con.getBaseConduitType(), dir), null), con));<NEW_LINE>}<NEW_LINE>for (EnumFacing dir : con.getConduitConnections()) {<NEW_LINE>components.addAll(cc.getCollidables(cc.createKey(type, getOffset(con.getBaseConduitType(), dir), null), con));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>components.addAll(cc.getCollidables(cc.createKey(type, getOffset(con.getBaseConduitType(), null<MASK><NEW_LINE>}<NEW_LINE>result.addAll(components);<NEW_LINE>}
), null), con));
1,496,034
protected final void buildModels() {<NEW_LINE>int numListItemsToUse = isFirstBuildForList ? config().initialLoadSizeHint : config().pageSize;<NEW_LINE>if (!list.isEmpty()) {<NEW_LINE>isFirstBuildForList = false;<NEW_LINE>}<NEW_LINE>int numBoundViews = getAdapter()<MASK><NEW_LINE>if (!hasNotifiedInsufficientPageSize && numBoundViews > numListItemsToUse) {<NEW_LINE>onExceptionSwallowed(new IllegalStateException("The page size specified in your PagedList config is smaller than the number of items " + "shown on screen. Increase your page size and/or initial load size."));<NEW_LINE>hasNotifiedInsufficientPageSize = true;<NEW_LINE>}<NEW_LINE>// If we are scrolling towards one end of the list we can build more models in that<NEW_LINE>// direction in anticipation of needing to show more there soon<NEW_LINE>float ratioOfEndItems = scrollingTowardsEnd ? .7f : .3f;<NEW_LINE>int itemsToBuildTowardsEnd = (int) (numListItemsToUse * ratioOfEndItems);<NEW_LINE>int itemsToBuildTowardsStart = numListItemsToUse - itemsToBuildTowardsEnd;<NEW_LINE>int numItemsUntilEnd = list.size() - lastBoundPositionWithinList - 1;<NEW_LINE>int leftOverItemsAtEnd = itemsToBuildTowardsEnd - numItemsUntilEnd;<NEW_LINE>if (leftOverItemsAtEnd > 0) {<NEW_LINE>itemsToBuildTowardsStart += leftOverItemsAtEnd;<NEW_LINE>itemsToBuildTowardsEnd -= leftOverItemsAtEnd;<NEW_LINE>}<NEW_LINE>int numItemsUntilStart = lastBoundPositionWithinList;<NEW_LINE>int leftOverItemsAtStart = itemsToBuildTowardsStart - numItemsUntilStart;<NEW_LINE>if (leftOverItemsAtStart > 0) {<NEW_LINE>itemsToBuildTowardsStart -= leftOverItemsAtStart;<NEW_LINE>itemsToBuildTowardsEnd += leftOverItemsAtStart;<NEW_LINE>}<NEW_LINE>lastBuiltLowerBound = Math.max(lastBoundPositionWithinList - itemsToBuildTowardsStart, 0);<NEW_LINE>lastBuiltUpperBound = Math.min(lastBoundPositionWithinList + itemsToBuildTowardsEnd, list.size());<NEW_LINE>buildModels(list.subList(lastBuiltLowerBound, lastBuiltUpperBound));<NEW_LINE>}
.getBoundViewHolders().size();
1,765,450
public void run() {<NEW_LINE>StyledDocument doc = pane.getStyledDocument();<NEW_LINE>// NOI18N<NEW_LINE>Style hlStyle = doc.addStyle("regularBlue-findtype", defStyle);<NEW_LINE>hlStyle.addAttribute(HyperlinkSupport.TYPE_ATTRIBUTE, new TypeLink());<NEW_LINE>StyleConstants.setForeground(<MASK><NEW_LINE>StyleConstants.setUnderline(hlStyle, true);<NEW_LINE>List<Integer> l = Collections.emptyList();<NEW_LINE>try {<NEW_LINE>l = getHighlightOffsets(doc.getText(0, doc.getLength()));<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Support.LOG.log(Level.SEVERE, null, ex);<NEW_LINE>}<NEW_LINE>List<Highlight> highlights = new ArrayList<Highlight>(l.size());<NEW_LINE>for (int i = 0; i < l.size(); i++) {<NEW_LINE>highlights.add(new Highlight(l.get(i), l.get(++i)));<NEW_LINE>}<NEW_LINE>pane.putClientProperty(HIGHLIGHTS_PROPERTY, highlights);<NEW_LINE>pane.removeMouseMotionListener(FindTypesSupport.this);<NEW_LINE>pane.addMouseMotionListener(FindTypesSupport.this);<NEW_LINE>pane.removeMouseListener(FindTypesSupport.this);<NEW_LINE>pane.addMouseListener(FindTypesSupport.this);<NEW_LINE>}
hlStyle, UIUtils.getLinkColor());
864,988
public void checkData(final Resilience4JHandle resilience4JHandle) {<NEW_LINE>resilience4JHandle.setTimeoutDurationRate(resilience4JHandle.getTimeoutDurationRate() < 0 ? Constants.TIMEOUT_DURATION_RATE : resilience4JHandle.getTimeoutDurationRate());<NEW_LINE>resilience4JHandle.setLimitRefreshPeriod(resilience4JHandle.getLimitRefreshPeriod() < 0 ? Constants.LIMIT_REFRESH_PERIOD : resilience4JHandle.getLimitRefreshPeriod());<NEW_LINE>resilience4JHandle.setLimitForPeriod(resilience4JHandle.getLimitForPeriod() < 0 ? Constants.LIMIT_FOR_PERIOD : resilience4JHandle.getLimitForPeriod());<NEW_LINE>resilience4JHandle.setCircuitEnable(resilience4JHandle.getCircuitEnable() != Constants.CIRCUIT_ENABLE ? Constants.CIRCUIT_DISABLE : Constants.CIRCUIT_ENABLE);<NEW_LINE>resilience4JHandle.setTimeoutDuration(resilience4JHandle.getTimeoutDuration() < 0 ? Constants.TIMEOUT_DURATION : resilience4JHandle.getTimeoutDuration());<NEW_LINE>resilience4JHandle.setFallbackUri(!"0".equals(resilience4JHandle.getFallbackUri()) ? resilience4JHandle.getFallbackUri() : "");<NEW_LINE>resilience4JHandle.setSlidingWindowSize(resilience4JHandle.getSlidingWindowSize() < 0 ? Constants.SLIDING_WINDOW_SIZE : resilience4JHandle.getSlidingWindowSize());<NEW_LINE>resilience4JHandle.setSlidingWindowType(resilience4JHandle.getSlidingWindowType() < 0 ? Constants.SLIDING_WINDOW_TYPE : resilience4JHandle.getSlidingWindowType());<NEW_LINE>resilience4JHandle.setMinimumNumberOfCalls(resilience4JHandle.getMinimumNumberOfCalls() < 0 ? Constants.MINIMUM_NUMBER_OF_CALLS : resilience4JHandle.getMinimumNumberOfCalls());<NEW_LINE>resilience4JHandle.setWaitIntervalFunctionInOpenState(resilience4JHandle.getWaitIntervalFunctionInOpenState() < 0 ? Constants.WAIT_INTERVAL_FUNCTION_IN_OPEN_STATE : resilience4JHandle.getWaitIntervalFunctionInOpenState());<NEW_LINE>resilience4JHandle.setPermittedNumberOfCallsInHalfOpenState(resilience4JHandle.getPermittedNumberOfCallsInHalfOpenState() < 0 ? Constants.<MASK><NEW_LINE>resilience4JHandle.setFailureRateThreshold(resilience4JHandle.getFailureRateThreshold() < 0 || resilience4JHandle.getFailureRateThreshold() > 100 ? Constants.FAILURE_RATE_THRESHOLD : resilience4JHandle.getFailureRateThreshold());<NEW_LINE>}
PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE : resilience4JHandle.getPermittedNumberOfCallsInHalfOpenState());
1,097,946
private void fillInConnectionProperties(Connection connection, EntityDetail entity, List<Relationship> relationships, String methodName) throws PropertyServerException {<NEW_LINE>this.setUpElementHeader(connection, entity, OpenMetadataAPIMapper.CONNECTION_TYPE_NAME, methodName);<NEW_LINE>InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties());<NEW_LINE>connection.setQualifiedName(this.removeQualifiedName(instanceProperties));<NEW_LINE>connection.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties));<NEW_LINE>connection.setDisplayName(this.removeDisplayName(instanceProperties));<NEW_LINE>connection.setDescription<MASK><NEW_LINE>connection.setSecuredProperties(this.removeSecuredProperties(instanceProperties));<NEW_LINE>connection.setConfigurationProperties(this.removeConfigurationProperties(instanceProperties));<NEW_LINE>connection.setUserId(this.removeUserId(instanceProperties));<NEW_LINE>connection.setClearPassword(this.removeClearPassword(instanceProperties));<NEW_LINE>connection.setEncryptedPassword(this.removeEncryptedPassword(instanceProperties));<NEW_LINE>connection.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties));<NEW_LINE>if (relationships != null) {<NEW_LINE>for (Relationship relationship : relationships) {<NEW_LINE>if (relationship != null) {<NEW_LINE>if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataAPIMapper.ASSET_TO_CONNECTION_TYPE_NAME)) {<NEW_LINE>connection.setAssetSummary(this.getAssetSummary(instanceProperties));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(this.removeDescription(instanceProperties));
489,414
public void applyDelta(HollowBlobInput in, HollowSchema schema, ArraySegmentRecycler memoryRecycler) throws IOException {<NEW_LINE>if (shards.length > 1)<NEW_LINE>maxOrdinal = VarInt.readVInt(in);<NEW_LINE>for (int i = 0; i < shards.length; i++) {<NEW_LINE>HollowSetTypeDataElements deltaData = new HollowSetTypeDataElements(memoryMode, memoryRecycler);<NEW_LINE>deltaData.readDelta(in);<NEW_LINE>if (stateEngine.isSkipTypeShardUpdateWithNoAdditions() && deltaData.encodedAdditions.isEmpty()) {<NEW_LINE>if (!deltaData.encodedRemovals.isEmpty())<NEW_LINE>notifyListenerAboutDeltaChanges(deltaData.encodedRemovals, deltaData.encodedAdditions, i, shards.length);<NEW_LINE>HollowSetTypeDataElements currentData = shards[i].currentDataElements();<NEW_LINE>GapEncodedVariableLengthIntegerReader oldRemovals = currentData.encodedRemovals == null ? GapEncodedVariableLengthIntegerReader.EMPTY_READER : currentData.encodedRemovals;<NEW_LINE>if (oldRemovals.isEmpty()) {<NEW_LINE>currentData.encodedRemovals = deltaData.encodedRemovals;<NEW_LINE>oldRemovals.destroy();<NEW_LINE>} else {<NEW_LINE>if (!deltaData.encodedRemovals.isEmpty()) {<NEW_LINE>currentData.encodedRemovals = GapEncodedVariableLengthIntegerReader.combine(oldRemovals, deltaData.encodedRemovals, memoryRecycler);<NEW_LINE>oldRemovals.destroy();<NEW_LINE>}<NEW_LINE>deltaData.encodedRemovals.destroy();<NEW_LINE>}<NEW_LINE>deltaData.encodedAdditions.destroy();<NEW_LINE>} else {<NEW_LINE>HollowSetTypeDataElements nextData = new HollowSetTypeDataElements(memoryMode, memoryRecycler);<NEW_LINE>HollowSetTypeDataElements oldData = shards[i].currentDataElements();<NEW_LINE><MASK><NEW_LINE>shards[i].setCurrentData(nextData);<NEW_LINE>notifyListenerAboutDeltaChanges(deltaData.encodedRemovals, deltaData.encodedAdditions, i, shards.length);<NEW_LINE>oldData.destroy();<NEW_LINE>}<NEW_LINE>deltaData.destroy();<NEW_LINE>stateEngine.getMemoryRecycler().swap();<NEW_LINE>}<NEW_LINE>if (shards.length == 1)<NEW_LINE>maxOrdinal = shards[0].currentDataElements().maxOrdinal;<NEW_LINE>}
nextData.applyDelta(oldData, deltaData);
1,634,750
Map<DISPID, Method> createDispIdMap(Class<?> comEventCallbackInterface) {<NEW_LINE>Map<DISPID, Method> map = new HashMap<DISPID, Method>();<NEW_LINE>for (Method meth : comEventCallbackInterface.getMethods()) {<NEW_LINE>ComEventCallback callbackAnnotation = meth.getAnnotation(ComEventCallback.class);<NEW_LINE>ComMethod methodAnnotation = meth.getAnnotation(ComMethod.class);<NEW_LINE>if (methodAnnotation != null) {<NEW_LINE>int dispId = methodAnnotation.dispId();<NEW_LINE>if (-1 == dispId) {<NEW_LINE>dispId = this.fetchDispIdFromName(callbackAnnotation);<NEW_LINE>}<NEW_LINE>if (dispId == -1) {<NEW_LINE>CallbackProxy.this.comEventCallbackListener.errorReceivingCallbackEvent("DISPID for " + meth.getName() + " not found", null);<NEW_LINE>}<NEW_LINE>map.put(new DISPID(dispId), meth);<NEW_LINE>} else if (null != callbackAnnotation) {<NEW_LINE><MASK><NEW_LINE>if (-1 == dispId) {<NEW_LINE>dispId = this.fetchDispIdFromName(callbackAnnotation);<NEW_LINE>}<NEW_LINE>if (dispId == -1) {<NEW_LINE>CallbackProxy.this.comEventCallbackListener.errorReceivingCallbackEvent("DISPID for " + meth.getName() + " not found", null);<NEW_LINE>}<NEW_LINE>map.put(new DISPID(dispId), meth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
int dispId = callbackAnnotation.dispid();
1,146,747
public static APIUpdateVolumeEvent __example__() {<NEW_LINE>APIUpdateVolumeEvent event = new APIUpdateVolumeEvent();<NEW_LINE>String volumeUuid = uuid();<NEW_LINE>VolumeInventory vol = new VolumeInventory();<NEW_LINE>vol.setName("test-volume");<NEW_LINE>vol.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>vol.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>vol.setType(VolumeType.Root.toString());<NEW_LINE>vol.setUuid(volumeUuid);<NEW_LINE>vol.setSize(SizeUnit.GIGABYTE.toByte(100));<NEW_LINE>vol.setActualSize(SizeUnit.GIGABYTE.toByte(20));<NEW_LINE>vol.setDeviceId(0);<NEW_LINE>vol.setState(VolumeState.Enabled.toString());<NEW_LINE>vol.setFormat("qcow2");<NEW_LINE>vol.setDiskOfferingUuid(uuid());<NEW_LINE>vol.setInstallPath(String.format("/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-%s/%s.qcow2", volumeUuid, volumeUuid));<NEW_LINE>vol.setStatus(VolumeStatus.Ready.toString());<NEW_LINE><MASK><NEW_LINE>vol.setVmInstanceUuid(uuid());<NEW_LINE>vol.setRootImageUuid(uuid());<NEW_LINE>event.setInventory(vol);<NEW_LINE>return event;<NEW_LINE>}
vol.setPrimaryStorageUuid(uuid());
967,969
protected void doInit() {<NEW_LINE>try (MemoryWorkspace ws = Nd4j.getWorkspaceManager().scopeOutOfWorkspaces()) {<NEW_LINE>org.deeplearning4j.nn.conf.layers.samediff.SameDiffOutputLayer bl = layerConf();<NEW_LINE>sameDiff = SameDiff.create();<NEW_LINE>// Use SingleThreadArrayHolder so we can use views (also don't nede multithreading here, DL4J is not thread safe)<NEW_LINE>sameDiff.setArrayHolders(new SingleThreadArrayHolder(), new SingleThreadArrayHolder(), false);<NEW_LINE>Map<String, INDArray> p = paramTable();<NEW_LINE>long[] inputShape = input.shape().clone();<NEW_LINE>inputShape[0] = -1;<NEW_LINE>SDVariable inputVar = sameDiff.placeHolder(INPUT_KEY, dataType, inputShape);<NEW_LINE>SDVariable labelVar = null;<NEW_LINE>if (layerConf().labelsRequired()) {<NEW_LINE>long[] labelShape = labels == null ? new long[] { -1, -1 } : labels.shape().clone();<NEW_LINE>labelShape[0] = -1;<NEW_LINE>labelVar = sameDiff.placeHolder(LABELS_KEY, dataType, labelShape);<NEW_LINE>}<NEW_LINE>Map<String, long[]> paramShapes = layerConf().getLayerParams().getParamShapes();<NEW_LINE>Map<String, SDVariable> params = new LinkedHashMap<>();<NEW_LINE>for (String s : paramShapes.keySet()) {<NEW_LINE>val ps = paramShapes.get(s);<NEW_LINE>SDVariable v = sameDiff.var(s, dataType, ps);<NEW_LINE>params.put(s, v);<NEW_LINE>}<NEW_LINE>SDVariable layerOutput = bl.defineLayer(sameDiff, inputVar, labelVar, params);<NEW_LINE>Preconditions.checkNotNull(layerOutput, "Invalid output: layer output is null");<NEW_LINE>outputVar = layerOutput;<NEW_LINE>for (Map.Entry<String, INDArray> e : p.entrySet()) {<NEW_LINE>INDArray arr = e.getValue();<NEW_LINE>sameDiff.associateArrayWithVariable(arr, sameDiff.getVariable(e.getKey()));<NEW_LINE>}<NEW_LINE>this<MASK><NEW_LINE>}<NEW_LINE>}
.outputKey = layerOutput.name();
1,642,784
public void emitInvoke(Invoke x) {<NEW_LINE>LoweredCallTargetNode callTargetNode = (LoweredCallTargetNode) x.callTarget();<NEW_LINE>final Stamp stamp = x.asNode().stamp(NodeView.DEFAULT);<NEW_LINE>LIRKind lirKind = resolveStamp(stamp);<NEW_LINE>AllocatableValue result = Value.ILLEGAL;<NEW_LINE>if (lirKind != LIRKind.Illegal) {<NEW_LINE>result = gen.newVariable(lirKind);<NEW_LINE>} else if (stamp instanceof VoidStamp) {<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.SPIRV, "Generating Void Type Variable for function");<NEW_LINE>result = gen.newVariable(LIRKind<MASK><NEW_LINE>}<NEW_LINE>CallingConvention callingConvention = new CallingConvention(0, result);<NEW_LINE>gen.getResult().getFrameMapBuilder().callsMethod(callingConvention);<NEW_LINE>Value[] parameters = visitInvokeArguments(callingConvention, callTargetNode.arguments());<NEW_LINE>LIRFrameState callState = stateWithExceptionEdge(x, null);<NEW_LINE>if (callTargetNode instanceof DirectCallTargetNode) {<NEW_LINE>emitDirectCall((DirectCallTargetNode) callTargetNode, result, parameters, AllocatableValue.NONE, callState);<NEW_LINE>} else if (callTargetNode instanceof IndirectCallTargetNode) {<NEW_LINE>throw new RuntimeException("Not supported");<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Not supported");<NEW_LINE>}<NEW_LINE>if (isLegal(result)) {<NEW_LINE>setResult(x.asNode(), result);<NEW_LINE>}<NEW_LINE>}
.value(SPIRVKind.OP_TYPE_VOID));
1,807,651
protected void encodeContent(FacesContext context, ContentFlow cf) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String var = cf.getVar();<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", "flow", null);<NEW_LINE>if (var == null) {<NEW_LINE>for (UIComponent child : cf.getChildren()) {<NEW_LINE>if (child.isRendered()) {<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.<MASK><NEW_LINE>child.encodeAll(context);<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Map<String, Object> requestMap = context.getExternalContext().getRequestMap();<NEW_LINE>Collection<?> value = (Collection<?>) cf.getValue();<NEW_LINE>if (value != null) {<NEW_LINE>for (Iterator<?> it = value.iterator(); it.hasNext(); ) {<NEW_LINE>requestMap.put(var, it.next());<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", "item", null);<NEW_LINE>renderChildren(context, cf);<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement("div");<NEW_LINE>}
writeAttribute("class", "item", null);
622,015
void build(SerializableCallGraph scg, DefaultCallGraph cg) {<NEW_LINE>for (SerializableCallGraph.Node serializableNode : scg.nodes) {<NEW_LINE>nodes.add(new DefaultCallGraphNode(cg, serializableNode.method));<NEW_LINE>}<NEW_LINE>for (SerializableCallGraph.CallSite scs : scg.callSites) {<NEW_LINE>DefaultCallSite callSite;<NEW_LINE>if (scs.virtual) {<NEW_LINE>callSite = new DefaultCallSite(scs.method, mapNodes(scs.callers));<NEW_LINE>callSite.calledMethods.addAll<MASK><NEW_LINE>} else {<NEW_LINE>callSite = new DefaultCallSite(nodes.get(scs.calledMethods[0]), nodes.get(scs.callers[0]));<NEW_LINE>}<NEW_LINE>for (SerializableCallGraph.Location location : scs.locations) {<NEW_LINE>callSite.addLocation(nodes.get(location.caller), location.value);<NEW_LINE>}<NEW_LINE>callSites.add(callSite);<NEW_LINE>}<NEW_LINE>for (SerializableCallGraph.FieldAccess sfa : scg.fieldAccessList) {<NEW_LINE>fieldAccessList.add(new DefaultFieldAccessSite(sfa.location, nodes.get(sfa.callee), sfa.field));<NEW_LINE>}<NEW_LINE>for (int index : scg.nodeIndexes) {<NEW_LINE>DefaultCallGraphNode node = nodes.get(index);<NEW_LINE>cg.nodes.put(node.getMethod(), node);<NEW_LINE>}<NEW_LINE>for (int index : scg.fieldAccessIndexes) {<NEW_LINE>cg.addFieldAccess(fieldAccessList.get(index));<NEW_LINE>}<NEW_LINE>}
(mapNodes(scs.calledMethods));
130,613
public List<ReportReloadEntity> loadReport(long time) {<NEW_LINE>List<ReportReloadEntity> results = new ArrayList<ReportReloadEntity>();<NEW_LINE>Map<String, List<EventReport>> mergedReports = new HashMap<String, List<EventReport>>();<NEW_LINE>for (int i = 0; i < getAnalyzerCount(); i++) {<NEW_LINE>Map<String, EventReport> reports = m_reportManager.loadLocalReports(time, i);<NEW_LINE>for (Entry<String, EventReport> entry : reports.entrySet()) {<NEW_LINE>String domain = entry.getKey();<NEW_LINE>EventReport r = entry.getValue();<NEW_LINE>List<EventReport> rs = mergedReports.get(domain);<NEW_LINE>if (rs == null) {<NEW_LINE>rs = new ArrayList<EventReport>();<NEW_LINE>mergedReports.put(domain, rs);<NEW_LINE>}<NEW_LINE>rs.add(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<EventReport> reports = buildMergedReports(mergedReports);<NEW_LINE>for (EventReport r : reports) {<NEW_LINE>HourlyReport report = new HourlyReport();<NEW_LINE>report<MASK><NEW_LINE>report.setDomain(r.getDomain());<NEW_LINE>report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());<NEW_LINE>report.setName(getId());<NEW_LINE>report.setPeriod(new Date(time));<NEW_LINE>report.setType(1);<NEW_LINE>byte[] content = DefaultNativeBuilder.build(r);<NEW_LINE>ReportReloadEntity entity = new ReportReloadEntity(report, content);<NEW_LINE>results.add(entity);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
.setCreationDate(new Date());
1,664,686
Message toMessage(Consumer consumer, ConsumerRecord<?, ?> record) {<NEW_LINE>Map<String, Object> headersMap = toMap(record.headers());<NEW_LINE>// Leverage spring-kafka to add the headers<NEW_LINE>messagingMessageConverter.commonHeaders(null, consumer, headersMap, record.key(), record.topic(), record.partition(), record.offset(), record.timestampType() != null ? record.timestampType().name() : null, record.timestamp());<NEW_LINE>// commonHeaders() maps the record key under 'kafka_receivedMessageKey' - put<NEW_LINE>// under 'kafka_messageKey' as well to satisfy both client/server usages as there<NEW_LINE>// is not currently a way to set a header name based on client/server<NEW_LINE>headersMap.put(KafkaHeaders.MESSAGE_KEY, record.key());<NEW_LINE>// TODO explore using MessagingMessageConverter to do all of the conversion<NEW_LINE>// (ideally delete this entire method)<NEW_LINE><MASK><NEW_LINE>// sometimes it's a message sometimes just payload<NEW_LINE>if (textPayload instanceof String && ((String) textPayload).contains("payload") && ((String) textPayload).contains("headers")) {<NEW_LINE>try {<NEW_LINE>Object object = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE).parse((String) textPayload);<NEW_LINE>JSONObject jo = (JSONObject) object;<NEW_LINE>String payload = (String) jo.get("payload");<NEW_LINE>JSONObject headersInJson = (JSONObject) jo.get("headers");<NEW_LINE>headersMap.putAll(headersInJson);<NEW_LINE>return MessageBuilder.createMessage(unquoted(payload), new MessageHeaders(headersMap));<NEW_LINE>} catch (ParseException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return MessageBuilder.createMessage(unquoted(textPayload), new MessageHeaders(headersMap));<NEW_LINE>}
Object textPayload = record.value();
992,835
private void printTags(SootField f, String declaration, PrintWriter out) {<NEW_LINE>Type fieldType = f.getType();<NEW_LINE>if (fieldType instanceof DoubleType) {<NEW_LINE>DoubleConstantValueTag t = (DoubleConstantValueTag) f.getTag(DoubleConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + " = " + t.getDoubleValue() + ';');<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (fieldType instanceof FloatType) {<NEW_LINE>FloatConstantValueTag t = (FloatConstantValueTag) f.getTag(FloatConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + " = " + t.getFloatValue() + "f;");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (fieldType instanceof LongType) {<NEW_LINE>LongConstantValueTag t = (LongConstantValueTag) f.getTag(LongConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + " = " + t.getLongValue() + "l;");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (fieldType instanceof CharType) {<NEW_LINE>IntegerConstantValueTag t = (IntegerConstantValueTag) f.getTag(IntegerConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + " = '" + ((char) t<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (fieldType instanceof BooleanType) {<NEW_LINE>IntegerConstantValueTag t = (IntegerConstantValueTag) f.getTag(IntegerConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + (t.getIntValue() == 0 ? " = false;" : " = true;"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (fieldType instanceof IntType || fieldType instanceof ByteType || fieldType instanceof ShortType) {<NEW_LINE>IntegerConstantValueTag t = (IntegerConstantValueTag) f.getTag(IntegerConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + " = " + t.getIntValue() + ';');<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>StringConstantValueTag t = (StringConstantValueTag) f.getTag(StringConstantValueTag.NAME);<NEW_LINE>if (t != null) {<NEW_LINE>out.println(" " + declaration + " = \"" + t.getStringValue() + "\";");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("Couldn't find type of field: " + f.getDeclaration());<NEW_LINE>out.println(" " + declaration + ';');<NEW_LINE>}
.getIntValue()) + "';");
1,492,713
public static QueryLastestVersionInfoResponse unmarshall(QueryLastestVersionInfoResponse queryLastestVersionInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryLastestVersionInfoResponse.setRequestId(_ctx.stringValue("QueryLastestVersionInfoResponse.RequestId"));<NEW_LINE>List<VersionInfo> versionInfos = new ArrayList<VersionInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryLastestVersionInfoResponse.VersionInfos.Length"); i++) {<NEW_LINE>VersionInfo versionInfo = new VersionInfo();<NEW_LINE>versionInfo.setOS(_ctx.stringValue("QueryLastestVersionInfoResponse.VersionInfos[" + i + "].OS"));<NEW_LINE>versionInfo.setVersion(_ctx.stringValue("QueryLastestVersionInfoResponse.VersionInfos[" + i + "].Version"));<NEW_LINE>versionInfo.setProductID(_ctx.stringValue("QueryLastestVersionInfoResponse.VersionInfos[" + i + "].ProductID"));<NEW_LINE>versionInfo.setCreateTime(_ctx.stringValue<MASK><NEW_LINE>versionInfo.setContent(_ctx.stringValue("QueryLastestVersionInfoResponse.VersionInfos[" + i + "].Content"));<NEW_LINE>versionInfos.add(versionInfo);<NEW_LINE>}<NEW_LINE>queryLastestVersionInfoResponse.setVersionInfos(versionInfos);<NEW_LINE>return queryLastestVersionInfoResponse;<NEW_LINE>}
("QueryLastestVersionInfoResponse.VersionInfos[" + i + "].CreateTime"));
535,936
private static void tryAssertion15_16(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "volume", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsRem(1200, 0, null, null);<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 155L, 75d } });<NEW_LINE>expected.addResultInsRem(<MASK><NEW_LINE>expected.addResultInsRem(4200, 0, null, null);<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 150L, 97d } });<NEW_LINE>expected.addResultInsRem(6200, 0, null, new Object[][] { { "IBM", 100L, 72d } });<NEW_LINE>expected.addResultInsRem(7200, 0, null, null);<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
3200, 0, null, null);
517,840
protected String createJspId(JspVisitorInputMap inputMap) throws JspCoreException {<NEW_LINE>String jspIdPrefix = ((String) inputMap.get("JspIdConsumerPrefix"));<NEW_LINE>if (jspIdPrefix == null) {<NEW_LINE>JspResources jspFiles = (JspResources) inputMap.get("JspFiles");<NEW_LINE>// PM43852 start - change to use package name and class name instead of path to generated source.<NEW_LINE>String name = jspFiles.getPackageName() + "." + jspFiles.getClassName();<NEW_LINE>// PM43852 end<NEW_LINE>StringBuffer sb = new StringBuffer(32);<NEW_LINE>sb.append("jsp_").append(Math.abs(name.hashCode())).append('_');<NEW_LINE>jspIdPrefix = sb.toString();<NEW_LINE>inputMap.put("JspIdConsumerPrefix", jspIdPrefix);<NEW_LINE>}<NEW_LINE>Integer jspIdValue = ((Integer<MASK><NEW_LINE>jspIdValue += 1;<NEW_LINE>inputMap.put("JspIdConsumerCounter", jspIdValue);<NEW_LINE>return jspIdPrefix + (jspIdValue.toString());<NEW_LINE>}
) inputMap.get("JspIdConsumerCounter"));
1,655,576
public Id projectAddGraphs(Id id, Set<String> graphs) {<NEW_LINE>E.checkArgument(!CollectionUtils.isEmpty(graphs), "Failed to add graphs to project '%s', the graphs " + "parameter can't be empty", id);<NEW_LINE>LockUtil.Locks locks = new LockUtil.Locks(this.graph.name());<NEW_LINE>try {<NEW_LINE>locks.lockWrites(LockUtil.PROJECT_UPDATE, id);<NEW_LINE>HugeProject project = this.project.get(id);<NEW_LINE>Set<String> sourceGraphs = new HashSet<>(project.graphs());<NEW_LINE><MASK><NEW_LINE>sourceGraphs.addAll(graphs);<NEW_LINE>// Return if there is none graph been added<NEW_LINE>if (sourceGraphs.size() == oldSize) {<NEW_LINE>return id;<NEW_LINE>}<NEW_LINE>project.graphs(sourceGraphs);<NEW_LINE>return this.project.update(project);<NEW_LINE>} finally {<NEW_LINE>locks.unlock();<NEW_LINE>}<NEW_LINE>}
int oldSize = sourceGraphs.size();
1,133,104
public static DescribeSagPortRouteProtocolListResponse unmarshall(DescribeSagPortRouteProtocolListResponse describeSagPortRouteProtocolListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSagPortRouteProtocolListResponse.setRequestId(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.RequestId"));<NEW_LINE>List<Port> ports = new ArrayList<Port>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagPortRouteProtocolListResponse.Ports.Length"); i++) {<NEW_LINE>Port port = new Port();<NEW_LINE>port.setStatus(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].Status"));<NEW_LINE>port.setRemoteIp(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].RemoteIp"));<NEW_LINE>port.setPortName(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].PortName"));<NEW_LINE>port.setNeighborIp(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].NeighborIp"));<NEW_LINE>port.setRouteProtocol(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].RouteProtocol"));<NEW_LINE>port.setRemoteAs(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].RemoteAs"));<NEW_LINE>port.setVlan(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.Ports[" + i + "].Vlan"));<NEW_LINE>ports.add(port);<NEW_LINE>}<NEW_LINE>describeSagPortRouteProtocolListResponse.setPorts(ports);<NEW_LINE>List<TaskState> taskStates = new ArrayList<TaskState>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagPortRouteProtocolListResponse.TaskStates.Length"); i++) {<NEW_LINE>TaskState taskState = new TaskState();<NEW_LINE>taskState.setErrorMessage(_ctx.stringValue<MASK><NEW_LINE>taskState.setState(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].State"));<NEW_LINE>taskState.setErrorCode(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].ErrorCode"));<NEW_LINE>taskState.setCreateTime(_ctx.stringValue("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].CreateTime"));<NEW_LINE>taskStates.add(taskState);<NEW_LINE>}<NEW_LINE>describeSagPortRouteProtocolListResponse.setTaskStates(taskStates);<NEW_LINE>return describeSagPortRouteProtocolListResponse;<NEW_LINE>}
("DescribeSagPortRouteProtocolListResponse.TaskStates[" + i + "].ErrorMessage"));
1,468,925
private void prepareGatlingData(Operation operation, Set<Parameter> parameters, String parameterType) {<NEW_LINE>if (parameters.size() > 0) {<NEW_LINE>List<String> parameterNames = new ArrayList<>();<NEW_LINE>List<Object> vendorList = new ArrayList<>();<NEW_LINE>for (Parameter parameter : parameters) {<NEW_LINE>Map<String, Object> extensionMap = new HashMap<>();<NEW_LINE>extensionMap.put("gatlingParamName", parameter.getName());<NEW_LINE>extensionMap.put("gatlingParamValue", "${" + parameter.getName() + "}");<NEW_LINE>vendorList.add(extensionMap);<NEW_LINE>parameterNames.<MASK><NEW_LINE>}<NEW_LINE>operation.addExtension("x-gatling-" + parameterType.toLowerCase(Locale.ROOT) + "-params", vendorList);<NEW_LINE>operation.addExtension("x-gatling-" + parameterType.toLowerCase(Locale.ROOT) + "-feeder", operation.getOperationId() + parameterType.toUpperCase(Locale.ROOT) + "Feeder");<NEW_LINE>try {<NEW_LINE>FileUtils.writeStringToFile(new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + parameterType.toLowerCase(Locale.ROOT) + "Params.csv"), StringUtils.join(parameterNames, ","), StandardCharsets.UTF_8);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>LOGGER.error("Could not create feeder file for operationId" + operation.getOperationId(), ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
add(parameter.getName());
1,075,280
protected void addUserDefinedFunction(ActionEvent evt) {<NEW_LINE>MondrianGuiDef.Schema schema = (MondrianGuiDef.Schema) tree.getModel().getRoot();<NEW_LINE>MondrianGuiDef.UserDefinedFunction udf = new MondrianGuiDef.UserDefinedFunction();<NEW_LINE>udf.name = "";<NEW_LINE>udf.name = getNewName(getResourceConverter().getString("schemaExplorer.newUserDefinedFunction.title", "New User defined Function"), schema.userDefinedFunctions);<NEW_LINE>NodeDef[] temp = schema.userDefinedFunctions;<NEW_LINE>schema.userDefinedFunctions = new MondrianGuiDef.UserDefinedFunction[temp.length + 1];<NEW_LINE>for (int _i = 0; _i < temp.length; _i++) {<NEW_LINE>schema.userDefinedFunctions[_i] = (<MASK><NEW_LINE>}<NEW_LINE>schema.userDefinedFunctions[schema.userDefinedFunctions.length - 1] = udf;<NEW_LINE>tree.setSelectionPath(new TreePath(model.getRoot()).pathByAddingChild(udf));<NEW_LINE>refreshTree(tree.getSelectionPath());<NEW_LINE>setTableCellFocus(0);<NEW_LINE>}
MondrianGuiDef.UserDefinedFunction) temp[_i];
178,065
public boolean handleRequest(ZWaveController zController, SerialMessage lastSentMessage, SerialMessage incomingMessage) {<NEW_LINE>switch(incomingMessage.getMessagePayloadByte(1)) {<NEW_LINE>case REMOVE_NODE_STATUS_LEARN_READY:<NEW_LINE>logger.debug("Remove Node: Learn ready.");<NEW_LINE>zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.ExcludeStart));<NEW_LINE>break;<NEW_LINE>case REMOVE_NODE_STATUS_NODE_FOUND:<NEW_LINE>logger.debug("Remove Node: Node found for removal.");<NEW_LINE>break;<NEW_LINE>case REMOVE_NODE_STATUS_REMOVING_SLAVE:<NEW_LINE>logger.debug("NODE {}: Removing slave.", incomingMessage.getMessagePayloadByte(2));<NEW_LINE>zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.ExcludeSlaveFound, <MASK><NEW_LINE>break;<NEW_LINE>case REMOVE_NODE_STATUS_REMOVING_CONTROLLER:<NEW_LINE>logger.debug("NODE {}: Removing controller.", incomingMessage.getMessagePayloadByte(2));<NEW_LINE>zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.ExcludeControllerFound, incomingMessage.getMessagePayloadByte(2)));<NEW_LINE>break;<NEW_LINE>case REMOVE_NODE_STATUS_DONE:<NEW_LINE>logger.debug("NODE {}: Removed from network.", incomingMessage.getMessagePayloadByte(2));<NEW_LINE>zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.ExcludeDone, incomingMessage.getMessagePayloadByte(2)));<NEW_LINE>break;<NEW_LINE>case REMOVE_NODE_STATUS_FAILED:<NEW_LINE>logger.debug("Remove Node: Failed.");<NEW_LINE>zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.ExcludeFail));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.debug("Remove Node: Unknown request ({}).", incomingMessage.getMessagePayloadByte(1));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>checkTransactionComplete(lastSentMessage, incomingMessage);<NEW_LINE>return transactionComplete;<NEW_LINE>}
incomingMessage.getMessagePayloadByte(2)));
1,317,419
private static Map<ArtifactKey, List<String>> toArtifactMapList(String baseConfigKey, Properties properties, Mode mode) {<NEW_LINE>Properties profileProps = new Properties();<NEW_LINE>String profile = BootstrapProfile.getActiveProfile(mode);<NEW_LINE>for (Map.Entry<Object, Object> i : properties.entrySet()) {<NEW_LINE>String key = i.getKey().toString();<NEW_LINE>if (key.startsWith("%")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String profileKey = "%" + profile + "." + key;<NEW_LINE>if (properties.containsKey(profileKey)) {<NEW_LINE>profileProps.put(key, properties.getProperty(profileKey));<NEW_LINE>} else {<NEW_LINE>profileProps.put(key, i.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now we have a 'sanitised' map with the correct props for the profile.<NEW_LINE>Map<ArtifactKey, List<String>> ret = new HashMap<>();<NEW_LINE>for (Map.Entry<Object, Object> entry : profileProps.entrySet()) {<NEW_LINE>String key = entry.getKey().toString();<NEW_LINE>String value = entry<MASK><NEW_LINE>if (key.startsWith(baseConfigKey)) {<NEW_LINE>String artifactId = key.substring(baseConfigKey.length());<NEW_LINE>artifactId = artifactId.replace("\"", "");<NEW_LINE>List<String> resources = Arrays.asList(value.split(","));<NEW_LINE>ret.put(new GACT(artifactId.split(":")), resources);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
.getValue().toString();
1,450,319
public void onClose(Player who) {<NEW_LINE>ContainerClosePacket containerClosePacket = new ContainerClosePacket();<NEW_LINE>containerClosePacket.<MASK><NEW_LINE>who.dataPacket(containerClosePacket);<NEW_LINE>super.onClose(who);<NEW_LINE>BlockEnderChest chest = who.getViewingEnderChest();<NEW_LINE>if (chest != null && chest.getViewers().size() == 1) {<NEW_LINE>BlockEventPacket blockEventPacket = new BlockEventPacket();<NEW_LINE>blockEventPacket.x = (int) chest.getX();<NEW_LINE>blockEventPacket.y = (int) chest.getY();<NEW_LINE>blockEventPacket.z = (int) chest.getZ();<NEW_LINE>blockEventPacket.case1 = 1;<NEW_LINE>blockEventPacket.case2 = 0;<NEW_LINE>Level level = this.getHolder().getLevel();<NEW_LINE>if (level != null) {<NEW_LINE>level.addSound(this.getHolder().add(0.5, 0.5, 0.5), Sound.RANDOM_CHESTCLOSED);<NEW_LINE>level.addChunkPacket((int) this.getHolder().getX() >> 4, (int) this.getHolder().getZ() >> 4, blockEventPacket);<NEW_LINE>}<NEW_LINE>who.setViewingEnderChest(null);<NEW_LINE>}<NEW_LINE>super.onClose(who);<NEW_LINE>}
windowId = who.getWindowId(this);
901,583
private void initComponents() {<NEW_LINE>labelDescription = new JLabel("<html><body><p>" + Localization.getString("platform.plugin.setupwizard.connection.intro") + "</p></body></html>");<NEW_LINE>// Firmware options<NEW_LINE>firmwareCombo = new JComboBox<>();<NEW_LINE>firmwareCombo.addActionListener(a -> setFirmware());<NEW_LINE>labelFirmware = new JLabel("Firmware:");<NEW_LINE>// Baud rate options<NEW_LINE>baudCombo = new JComboBox<>();<NEW_LINE>baudCombo.setModel(new DefaultComboBoxModel<>(BaudRateEnum.getAllBaudRates()));<NEW_LINE>baudCombo.setSelectedIndex(6);<NEW_LINE>baudCombo.setToolTipText("Select baudrate to use for the serial port.");<NEW_LINE>baudCombo.addActionListener(e -> this.setBaudRate());<NEW_LINE>labelBaud = new JLabel(Localization.getString("platform.plugin.setupwizard.port-rate"));<NEW_LINE>portCombo = new JComboBox<>();<NEW_LINE>portCombo.addActionListener(e -> this.setPort());<NEW_LINE>labelPort = new JLabel(Localization.getString("platform.plugin.setupwizard.port"));<NEW_LINE>connectButton = new JButton(Localization.getString("platform.plugin.setupwizard.connect"));<NEW_LINE>connectButton.addActionListener((e) -> {<NEW_LINE>try {<NEW_LINE>Settings settings <MASK><NEW_LINE>getBackend().connect(settings.getFirmwareVersion(), settings.getPort(), Integer.parseInt(settings.getPortRate()));<NEW_LINE>} catch (Exception e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>labelVersion = new JLabel(Localization.getString("platform.plugin.setupwizard.unknown-version"));<NEW_LINE>labelVersion.setVisible(false);<NEW_LINE>labelNotSupported = new JLabel(Localization.getString("platform.plugin.setupwizard.connection.not-supported"));<NEW_LINE>labelNotSupported.setIcon(ImageUtilities.loadImageIcon("icons/information24.png", false));<NEW_LINE>labelNotSupported.setVisible(false);<NEW_LINE>}
= getBackend().getSettings();