idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
194,487
public DiskIopsConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DiskIopsConfiguration diskIopsConfiguration = new DiskIopsConfiguration();<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>if (context.testExpression("Mode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>diskIopsConfiguration.setMode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Iops", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>diskIopsConfiguration.setIops(context.getUnmarshaller(Long.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 diskIopsConfiguration;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,281,094
public static Range valueOf(String range) {<NEW_LINE>if (range.contains("${")) {<NEW_LINE>// unresolved<NEW_LINE>return new Range(0, 0, false, false, range);<NEW_LINE>}<NEW_LINE>range = range.trim();<NEW_LINE>// || range.endsWith("..");<NEW_LINE>boolean unspecified = range.length() == 0 || range.startsWith("..");<NEW_LINE>int min, max;<NEW_LINE>boolean variable;<NEW_LINE>int dots;<NEW_LINE>if ((dots = range.indexOf("..")) >= 0) {<NEW_LINE>min = parseInt(range.substring(0, dots), 0);<NEW_LINE>max = parseInt(range.substring(dots + 2), Integer.MAX_VALUE);<NEW_LINE>variable = max == Integer.MAX_VALUE;<NEW_LINE>} else {<NEW_LINE>max = parseInt(range, Integer.MAX_VALUE);<NEW_LINE>variable = !range.contains(<MASK><NEW_LINE>min = variable ? 0 : max;<NEW_LINE>}<NEW_LINE>return new Range(min, max, variable, unspecified, unspecified ? null : range);<NEW_LINE>}
"+") && max == Integer.MAX_VALUE;
611,409
public double rand() {<NEW_LINE>// faster calculation by inversion<NEW_LINE>boolean inv = p > 0.5;<NEW_LINE>double np = n * Math.min(p, 1.0 - p);<NEW_LINE>// Poisson approximation for extremely low np<NEW_LINE>int x;<NEW_LINE>if (np < 1E-6) {<NEW_LINE>x = PoissonDistribution.tinyLambdaRand(np);<NEW_LINE>} else {<NEW_LINE>RandomNumberGenerator rng;<NEW_LINE>if (np < 55) {<NEW_LINE>// inversion method, using chop-down search from 0<NEW_LINE>if (p <= 0.5) {<NEW_LINE>rng = new ModeSearch(p);<NEW_LINE>} else {<NEW_LINE>// faster calculation by inversion<NEW_LINE>rng <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// ratio of uniforms method<NEW_LINE>if (p <= 0.5) {<NEW_LINE>rng = new Patchwork(p);<NEW_LINE>} else {<NEW_LINE>// faster calculation by inversion<NEW_LINE>rng = new Patchwork(1.0 - p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>x = rng.rand();<NEW_LINE>}<NEW_LINE>// undo inversion<NEW_LINE>return inv ? n - x : x;<NEW_LINE>}
= new ModeSearch(1.0 - p);
1,303,122
DownloadPerAgeStats downloadsPerAgeStats() {<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>logger.debug("Calculating downloads per age percentages");<NEW_LINE>DownloadPerAgeStats result = new DownloadPerAgeStats();<NEW_LINE>String percentage = "SELECT CASE\n" + " WHEN (SELECT CAST(COUNT(*) AS FLOAT) AS COUNT\n" + " FROM INDEXERNZBDOWNLOAD\n" + " WHERE AGE > %d) > 0\n" + " THEN SELECT CAST(100 AS FLOAT) / (CAST(COUNT(i.*) AS FLOAT)/ x.COUNT)\n" + "FROM INDEXERNZBDOWNLOAD i,\n" <MASK><NEW_LINE>result.setPercentOlder1000(((Double) entityManager.createNativeQuery(String.format(percentage, 1000, 1000)).getResultList().get(0)).intValue());<NEW_LINE>result.setPercentOlder2000(((Double) entityManager.createNativeQuery(String.format(percentage, 2000, 2000)).getResultList().get(0)).intValue());<NEW_LINE>result.setPercentOlder3000(((Double) entityManager.createNativeQuery(String.format(percentage, 3000, 3000)).getResultList().get(0)).intValue());<NEW_LINE>result.setAverageAge((Integer) entityManager.createNativeQuery("SELECT AVG(AGE) FROM INDEXERNZBDOWNLOAD").getResultList().get(0));<NEW_LINE>logger.debug(LoggingMarkers.PERFORMANCE, "Calculated downloads per age percentages . Took {}ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));<NEW_LINE>result.setDownloadsPerAge(downloadsPerAge());<NEW_LINE>return result;<NEW_LINE>}
+ "( SELECT COUNT(*) AS COUNT\n" + "FROM INDEXERNZBDOWNLOAD\n" + "WHERE AGE > %d) AS x\n" + "ELSE 0 END";
1,695,862
public void actionPerformed(ActionEvent e) {<NEW_LINE>JTextComponent textArea = <MASK><NEW_LINE>Caret caret = textArea.getCaret();<NEW_LINE>int dot = caret.getDot();<NEW_LINE>EditorPane currentCodePane = SikulixIDE.get().getCurrentCodePane();<NEW_LINE>int lineNumberAtCaret = currentCodePane.getLineNumberAtCaret(dot);<NEW_LINE>Element line = currentCodePane.getLineAtCaret(dot);<NEW_LINE>int count = line.getElementCount();<NEW_LINE>if (!select) {<NEW_LINE>switch(direction) {<NEW_LINE>case SwingConstants.EAST:<NEW_LINE>currentCodePane.jumpTo(lineNumberAtCaret + 1);<NEW_LINE>caret.setDot(caret.getDot() - 1);<NEW_LINE>return;<NEW_LINE>case SwingConstants.WEST:<NEW_LINE>currentCodePane.jumpTo(lineNumberAtCaret);<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(direction) {<NEW_LINE>case SwingConstants.EAST:<NEW_LINE>try {<NEW_LINE>int startOffset = currentCodePane.getLineStartOffset(lineNumberAtCaret);<NEW_LINE>caret.moveDot(startOffset - 1);<NEW_LINE>} catch (BadLocationException e1) {<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>case SwingConstants.WEST:<NEW_LINE>try {<NEW_LINE>int startOffset = currentCodePane.getLineStartOffset(lineNumberAtCaret - 1);<NEW_LINE>caret.moveDot(startOffset);<NEW_LINE>} catch (BadLocationException e1) {<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(JTextComponent) e.getSource();
716,794
public void createFieldEditors() {<NEW_LINE>Composite appearanceComposite = getFieldEditorParent();<NEW_LINE>// Typing<NEW_LINE>Composite group = AptanaPreferencePage.createGroup(appearanceComposite, Messages.EditorsPreferencePage_Typing);<NEW_LINE>addField(new BooleanFieldEditor(IPreferenceConstants.ENABLE_CHARACTER_PAIR_COLORING, Messages.EditorsPreferencePage_Colorize_Matching_Character_Pairs, group));<NEW_LINE>addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_PEER_CHARACTER_CLOSE, Messages.EditorsPreferencePage_Close_Matching_Character_Pairs, group));<NEW_LINE>addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_WRAP_SELECTION, Messages.EditorsPreferencePage_Wrap_Selection, group));<NEW_LINE>addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_SUB_WORD_NAVIGATION<MASK><NEW_LINE>// Save Actions<NEW_LINE>group = AptanaPreferencePage.createGroup(appearanceComposite, Messages.EditorsPreferencePage_saveActionsGroup);<NEW_LINE>addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_REMOVE_TRAILING_WHITESPACE, Messages.EditorsPreferencePage_saveActionRemoveWhitespaceCharacters, group));<NEW_LINE>// Syntax coloring<NEW_LINE>group = AptanaPreferencePage.createGroup(appearanceComposite, Messages.EditorsPreferencePage_SyntaxColoring);<NEW_LINE>group.setLayout(GridLayoutFactory.swtDefaults().create());<NEW_LINE>group.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());<NEW_LINE>IntegerFieldEditor colEditor = new IntegerFieldEditor(IPreferenceConstants.EDITOR_MAX_COLORED_COLUMNS, StringUtil.makeFormLabel(Messages.EditorsPreferencePage_MaxColumnsLabel), group);<NEW_LINE>colEditor.setValidRange(-1, Integer.MAX_VALUE);<NEW_LINE>addField(colEditor);<NEW_LINE>// Word Wrap<NEW_LINE>addField(new BooleanFieldEditor(IPreferenceConstants.ENABLE_WORD_WRAP, Messages.EditorsPreferencePage_Enable_WordWrap, appearanceComposite));<NEW_LINE>createOpenWithEditor(appearanceComposite);<NEW_LINE>createTextEditorLink(appearanceComposite);<NEW_LINE>}
, Messages.EditorsPreferencePage_camelCaseSelection, group));
1,339,621
// End of class Row<T><NEW_LINE>Row<T>[] sortItems(final long threshold, final ErrorType errorType) {<NEW_LINE>final ArrayList<Row<T>> rowList = new ArrayList<>();<NEW_LINE>final ReversePurgeItemHashMap.Iterator<T> iter = hashMap.iterator();<NEW_LINE>if (errorType == ErrorType.NO_FALSE_NEGATIVES) {<NEW_LINE>while (iter.next()) {<NEW_LINE>final long est = getEstimate(iter.getKey());<NEW_LINE>final long ub = getUpperBound(iter.getKey());<NEW_LINE>final long lb = getLowerBound(iter.getKey());<NEW_LINE>if (ub >= threshold) {<NEW_LINE>final Row<T> row = new Row<>(iter.getKey(), est, ub, lb);<NEW_LINE>rowList.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// NO_FALSE_POSITIVES<NEW_LINE>while (iter.next()) {<NEW_LINE>final long est = getEstimate(iter.getKey());<NEW_LINE>final long ub = getUpperBound(iter.getKey());<NEW_LINE>final long lb = getLowerBound(iter.getKey());<NEW_LINE>if (lb >= threshold) {<NEW_LINE>final Row<T> row = new Row<>(iter.getKey(), est, ub, lb);<NEW_LINE>rowList.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// descending order<NEW_LINE>rowList.sort(new Comparator<Row<T>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(final Row<T> r1, final Row<T> r2) {<NEW_LINE>return r2.compareTo(r1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Row<T>[] rowsArr = rowList.toArray((Row<T>[]) Array.newInstance(Row.class<MASK><NEW_LINE>return rowsArr;<NEW_LINE>}
, rowList.size()));
1,789,631
private void parse(String[] args) {<NEW_LINE><MASK><NEW_LINE>parseFlags(parser);<NEW_LINE>fileNames = parser.getRemaining();<NEW_LINE>if (inputList != null && !inputList.isEmpty()) {<NEW_LINE>// append the file names to the end of the input list<NEW_LINE>inputList.addAll(Arrays.asList(fileNames));<NEW_LINE>fileNames = inputList.toArray(new String[inputList.size()]);<NEW_LINE>}<NEW_LINE>if (fileNames.length == 0) {<NEW_LINE>if (!emptyOk) {<NEW_LINE>context.err.println("no input files specified");<NEW_LINE>throw new UsageException();<NEW_LINE>}<NEW_LINE>} else if (emptyOk) {<NEW_LINE>context.out.println("ignoring input files");<NEW_LINE>}<NEW_LINE>if ((humanOutName == null) && (methodToDump != null)) {<NEW_LINE>humanOutName = "-";<NEW_LINE>}<NEW_LINE>if (outputIsDirectory) {<NEW_LINE>outName = new File(outName, DexFormat.DEX_IN_JAR_NAME).getPath();<NEW_LINE>}<NEW_LINE>makeOptionsObjects();<NEW_LINE>}
ArgumentsParser parser = new ArgumentsParser(args);
1,351,539
public Shipment unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Shipment shipment = new Shipment();<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("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>shipment.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TrackingNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>shipment.setTrackingNumber(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 shipment;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
684,616
public void addListener(@Nullable Activity activity, @Nullable Executor executor, @NonNull final ListenerTypeT listener) {<NEW_LINE>Preconditions.checkNotNull(listener);<NEW_LINE>boolean shouldFire = false;<NEW_LINE>SmartHandler handler;<NEW_LINE>synchronized (task.getSyncObject()) {<NEW_LINE>if ((task.getInternalState() & targetStates) != 0) {<NEW_LINE>shouldFire = true;<NEW_LINE>}<NEW_LINE>listenerQueue.add(listener);<NEW_LINE>handler = new SmartHandler(executor);<NEW_LINE>handlerMap.put(listener, handler);<NEW_LINE>if (activity != null) {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {<NEW_LINE>Preconditions.checkArgument(!<MASK><NEW_LINE>}<NEW_LINE>ActivityLifecycleListener.getInstance().runOnActivityStopped(activity, listener, () -> removeListener(listener));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shouldFire) {<NEW_LINE>final ResultT snappedState = task.snapState();<NEW_LINE>handler.callBack(() -> onRaise.raise(listener, snappedState));<NEW_LINE>}<NEW_LINE>}
activity.isDestroyed(), "Activity is already destroyed!");
1,457,339
public void start(Stage stage) {<NEW_LINE>stage.setTitle("TextBoxClipboard");<NEW_LINE>Scene scene = new Scene(new Group(), 600, 450);<NEW_LINE>scene.setFill(Color.GHOSTWHITE);<NEW_LINE>final Label copyFrom = new Label("Copy From: ");<NEW_LINE>final TextField copyFromText = new TextField("ABC 123");<NEW_LINE>final HBox cf = new HBox();<NEW_LINE>cf.getChildren().add(copyFrom);<NEW_LINE>cf.getChildren().add(copyFromText);<NEW_LINE>final Label copyTo = new Label("Copy To: ");<NEW_LINE>final TextField copyToText = new TextField();<NEW_LINE>final HBox ct = new HBox();<NEW_LINE>ct.getChildren().add(copyTo);<NEW_LINE>ct.getChildren().add(copyToText);<NEW_LINE>final HBox btns = new HBox();<NEW_LINE>final Button copy = new Button("Copy");<NEW_LINE>copy.setOnAction(e -> {<NEW_LINE>ClipboardContent content = new ClipboardContent();<NEW_LINE>content.putString(copyFromText.getText());<NEW_LINE>Clipboard.getSystemClipboard().setContent(content);<NEW_LINE>});<NEW_LINE>final Button paste = new Button("Paste");<NEW_LINE>paste.setOnAction(e -> {<NEW_LINE>Set<DataFormat> types = Clipboard<MASK><NEW_LINE>for (DataFormat type : types) {<NEW_LINE>System.out.println("TYPE: " + type);<NEW_LINE>}<NEW_LINE>copyToText.setText(Clipboard.getSystemClipboard().getString());<NEW_LINE>});<NEW_LINE>btns.getChildren().add(copy);<NEW_LINE>btns.getChildren().add(paste);<NEW_LINE>final VBox vbox = new VBox();<NEW_LINE>vbox.setPadding(new Insets(30, 0, 0, 0));<NEW_LINE>vbox.setSpacing(25);<NEW_LINE>vbox.getChildren().add(btns);<NEW_LINE>vbox.getChildren().add(cf);<NEW_LINE>vbox.getChildren().add(ct);<NEW_LINE>scene.setRoot(vbox);<NEW_LINE>stage.setScene(scene);<NEW_LINE>stage.show();<NEW_LINE>}
.getSystemClipboard().getContentTypes();
985,685
private static void showResults(final Project project, final List<VirtualFile> images, Map<Long, Set<VirtualFile>> duplicates, Map<Long, VirtualFile> all) {<NEW_LINE>final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();<NEW_LINE>if (indicator == null || indicator.isCanceled())<NEW_LINE>return;<NEW_LINE>indicator.setText("MD5 check");<NEW_LINE>int count = 0;<NEW_LINE>for (Set set : duplicates.values()) count += set.size();<NEW_LINE>final Map<String, Set<VirtualFile>> realDuplicates = new HashMap<String, Set<VirtualFile>>();<NEW_LINE>int seek = 0;<NEW_LINE>for (Set<VirtualFile> files : duplicates.values()) {<NEW_LINE>for (VirtualFile file : files) {<NEW_LINE>seek++;<NEW_LINE>indicator.setFraction((double) seek / (double) count);<NEW_LINE>try {<NEW_LINE>final String md5 = getMD5Checksum(file.getInputStream());<NEW_LINE>if (realDuplicates.containsKey(md5)) {<NEW_LINE>realDuplicates.get(md5).add(file);<NEW_LINE>} else {<NEW_LINE>final HashSet<VirtualFile> set = new HashSet<VirtualFile>();<NEW_LINE>set.add(file);<NEW_LINE>realDuplicates.put(md5, set);<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>count = 0;<NEW_LINE>for (String key : new ArrayList<String>(realDuplicates.keySet())) {<NEW_LINE>final int size = realDuplicates.get(key).size();<NEW_LINE>if (size == 1) {<NEW_LINE>realDuplicates.remove(key);<NEW_LINE>} else {<NEW_LINE>count += size;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ApplicationManager.getApplication().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>new ImageDuplicateResultsDialog(project, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
images, realDuplicates).show();
26,806
ArrayList<Object> new99() /* reduce AIfStatement */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<MASK><NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PStatement pstatementNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TIf tifNode2;<NEW_LINE>PBoolExpr pboolexprNode3;<NEW_LINE>PGotoStmt pgotostmtNode4;<NEW_LINE>tifNode2 = (TIf) nodeArrayList1.get(0);<NEW_LINE>pboolexprNode3 = (PBoolExpr) nodeArrayList2.get(0);<NEW_LINE>pgotostmtNode4 = (PGotoStmt) nodeArrayList3.get(0);<NEW_LINE>pstatementNode1 = new AIfStatement(tifNode2, pboolexprNode3, pgotostmtNode4);<NEW_LINE>}<NEW_LINE>nodeList.add(pstatementNode1);<NEW_LINE>return nodeList;<NEW_LINE>}
<Object> nodeArrayList3 = pop();
1,745,496
private StaticLayout createLayoutWithNumberOfLine(int lastLineStart, int width) {<NEW_LINE>if (mSpanned == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String text = mSpanned.toString();<NEW_LINE>SpannableStringBuilder temp = (SpannableStringBuilder) mSpanned.subSequence(0, text.length());<NEW_LINE>String ellipsizeStr = (String) TextUtils.ellipsize(text.substring(lastLineStart), sTextPaintInstance, width, TextUtils.TruncateAt.END);<NEW_LINE>String newString = text.subSequence(0, lastLineStart).toString() + truncate(ellipsizeStr, sTextPaintInstance, width, mTruncateAt);<NEW_LINE>int start = Math.max(newString.length() - 1, 0);<NEW_LINE>CharacterStyle[] hippyStyleSpans = temp.getSpans(start, text.<MASK><NEW_LINE>if (hippyStyleSpans != null && hippyStyleSpans.length > 0) {<NEW_LINE>for (CharacterStyle hippyStyleSpan : hippyStyleSpans) {<NEW_LINE>if (temp.getSpanStart(hippyStyleSpan) >= start) {<NEW_LINE>temp.removeSpan(hippyStyleSpan);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buildStaticLayout(temp.replace(start, text.length(), ELLIPSIS), sTextPaintInstance, width);<NEW_LINE>}
length(), CharacterStyle.class);
1,200,934
public boolean put(int key, boolean value) {<NEW_LINE>if (start == -1) {<NEW_LINE>start = key;<NEW_LINE>this.value = new boolean[] { value };<NEW_LINE>} else {<NEW_LINE>int offset = key - start;<NEW_LINE>if (offset >= 0 && offset < this.value.length) {<NEW_LINE>boolean <MASK><NEW_LINE>this.value[offset] = value;<NEW_LINE>return curr;<NEW_LINE>} else if (offset != this.value.length) {<NEW_LINE>throw new IndexOutOfBoundsException("Expected: " + (this.value.length + start) + ", got " + key);<NEW_LINE>}<NEW_LINE>boolean[] newValue = new boolean[offset + 1];<NEW_LINE>System.arraycopy(this.value, 0, newValue, 0, this.value.length);<NEW_LINE>this.value = newValue;<NEW_LINE>this.value[offset] = value;<NEW_LINE>}<NEW_LINE>return this.defRetValue;<NEW_LINE>}
curr = this.value[offset];
1,809,716
public GameButton recoverData(Context context, CallCustomizeKeyboard call, Controller controller, CkbManager manager) {<NEW_LINE>GameButton gb = new GameButton(context, call, controller, manager);<NEW_LINE>gb.setKeyMaps(this.keyMaps);<NEW_LINE>gb.setKeyTypes(this.keyTypes);<NEW_LINE>gb.setDesignIndex(this.designIndex);<NEW_LINE>gb.setCornerRadius(this.cornerRadius);<NEW_LINE>gb.setTextColor(this.textColor);<NEW_LINE>for (int a = 0; a < CkbThemeRecorder.COLOR_INDEX_LENGTH; a++) {<NEW_LINE>gb.getThemeRecorder().setColors(a, ColorUtils.hex2Int(this.themeColors[a]));<NEW_LINE>}<NEW_LINE>gb.setKeep(this.isKeep);<NEW_LINE><MASK><NEW_LINE>gb.setKeySize(this.keySize[0], this.keySize[1]);<NEW_LINE>gb.setKeyPos(this.keyPos[0], this.keyPos[1]);<NEW_LINE>gb.setAlphaSize(this.alphaSize);<NEW_LINE>gb.setKeyName(this.keyName);<NEW_LINE>gb.setTextSize(this.textSize);<NEW_LINE>gb.setViewerFollow(this.isViewerFollow);<NEW_LINE>gb.setShow(this.show);<NEW_LINE>gb.setChars(this.keyChars);<NEW_LINE>gb.setInputChars(this.isChars);<NEW_LINE>return gb;<NEW_LINE>}
gb.setHide(this.isHide);
713,275
private void transferProtocolHeadersToURLConnection(URLConnection connection) {<NEW_LINE>boolean addHeaders = MessageUtils.isTrue<MASK><NEW_LINE>for (String header : headers.keySet()) {<NEW_LINE>List<String> headerList = headers.get(header);<NEW_LINE>if (HttpHeaderHelper.CONTENT_TYPE.equalsIgnoreCase(header)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (addHeaders || HttpHeaderHelper.COOKIE.equalsIgnoreCase(header)) {<NEW_LINE>for (String s : headerList) {<NEW_LINE>connection.addRequestProperty(HttpHeaderHelper.COOKIE, s);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>for (int i = 0; i < headerList.size(); i++) {<NEW_LINE>b.append(headerList.get(i));<NEW_LINE>if (i + 1 < headerList.size()) {<NEW_LINE>b.append(',');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>connection.setRequestProperty(header, b.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// make sure we don't add more than one User-Agent header<NEW_LINE>if (connection.getRequestProperty("User-Agent") == null) {<NEW_LINE>connection.addRequestProperty("User-Agent", Version.getCompleteVersionString());<NEW_LINE>}<NEW_LINE>}
(message.getContextualProperty(ADD_HEADERS_PROPERTY));
1,543,771
private Map<String, Object> writeMapInternal(Map<?, ?> source, Map<String, Object> sink, TypeInformation<?> propertyType) {<NEW_LINE>for (Map.Entry<?, ?> entry : source.entrySet()) {<NEW_LINE>Object key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (isSimpleType(key.getClass())) {<NEW_LINE>String simpleKey = potentiallyConvertMapKey(key);<NEW_LINE>if (value == null || isSimpleType(value)) {<NEW_LINE>sink.put(simpleKey, getPotentiallyConvertedSimpleWrite(value, Object.class));<NEW_LINE>} else if (value instanceof Collection || value.getClass().isArray()) {<NEW_LINE>sink.put(simpleKey, writeCollectionInternal(asCollection(value), propertyType.getMapValueType(), <MASK><NEW_LINE>} else {<NEW_LINE>Map<String, Object> document = Document.create();<NEW_LINE>TypeInformation<?> valueTypeInfo = propertyType.isMap() ? propertyType.getMapValueType() : ClassTypeInformation.OBJECT;<NEW_LINE>writeInternal(value, document, valueTypeInfo);<NEW_LINE>sink.put(simpleKey, document);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new MappingException("Cannot use a complex object as a key value.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sink;<NEW_LINE>}
new ArrayList<>()));
1,047,221
protected void syncManifest() throws Exception {<NEW_LINE>Map<String, String> namedParams = getParameters().getNamed();<NEW_LINE>String appStr = null;<NEW_LINE>if (namedParams.containsKey("app")) {<NEW_LINE>// get --app-param<NEW_LINE>// appStr = ensureEndingSlash(namedParams.get("app"));<NEW_LINE>// no need to add slass to end<NEW_LINE>appStr = namedParams.get("app");<NEW_LINE>log.info(String.format("Loading manifest from 'app' parameter supplied: %s", appStr));<NEW_LINE>}<NEW_LINE>if (namedParams.containsKey("uri")) {<NEW_LINE>// get --uri-param<NEW_LINE>String uriStr = ensureEndingSlash(namedParams.get("uri"));<NEW_LINE>log.info(() -> String.format("Syncing files from 'uri' parameter supplied: %s", uriStr));<NEW_LINE>URI uri = URI.create(uriStr);<NEW_LINE>// load manifest from --app param if supplied, else default file at supplied uri<NEW_LINE>// We avoid using<NEW_LINE>URI app = (appStr != null) ? URI.create(appStr) : URI.create(uriStr + "app.xml");<NEW_LINE>// uri.resolve() here so<NEW_LINE>// as to not break UNC<NEW_LINE>// paths. See issue #143<NEW_LINE>manifest = FXManifest.load(app);<NEW_LINE>// set supplied uri in manifest<NEW_LINE>manifest.uri = uri;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (appStr != null) {<NEW_LINE>// --uri was not supplied, but --app was, so load manifest from that<NEW_LINE>manifest = FXManifest.load(new File(appStr).toURI());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>URL embeddedManifest = AbstractLauncher.class.getResource("/app.xml");<NEW_LINE>manifest = JAXB.unmarshal(embeddedManifest, FXManifest.class);<NEW_LINE>Path <MASK><NEW_LINE>Path manifestPath = manifest.getPath(cacheDir);<NEW_LINE>if (Files.exists(manifestPath))<NEW_LINE>manifest = JAXB.unmarshal(manifestPath.toFile(), FXManifest.class);<NEW_LINE>if (getParameters().getUnnamed().contains("--offline")) {<NEW_LINE>log.info("offline selected");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FXManifest remoteManifest = FXManifest.load(manifest.getFXAppURI());<NEW_LINE>if (remoteManifest == null) {<NEW_LINE>log.info(String.format("No remote manifest at %s", manifest.getFXAppURI()));<NEW_LINE>} else if (!remoteManifest.equals(manifest)) {<NEW_LINE>// Update to remote manifest if newer or we specifically accept downgrades<NEW_LINE>if (remoteManifest.isNewerThan(manifest) || manifest.acceptDowngrade) {<NEW_LINE>manifest = remoteManifest;<NEW_LINE>JAXB.marshal(manifest, manifestPath.toFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.log(Level.WARNING, String.format("Unable to update manifest from %s", manifest.getFXAppURI()), ex);<NEW_LINE>}<NEW_LINE>}
cacheDir = manifest.resolveCacheDir(namedParams);
462,553
public void update() {<NEW_LINE>int fontSize = 0;<NEW_LINE>try {<NEW_LINE>fontSize = Integer.parseInt(sizeSelector.getText().trim());<NEW_LINE>// System.out.println("'" + sizeSelector.getText() + "'");<NEW_LINE>} catch (NumberFormatException ignored) {<NEW_LINE>}<NEW_LINE>// if a deselect occurred, selection will be -1<NEW_LINE>if ((fontSize > 0) && (fontSize < 256) && (selection != -1)) {<NEW_LINE>// font = new Font(list[selection], Font.PLAIN, fontSize);<NEW_LINE>Font instance = nameToFont<MASK><NEW_LINE>// font = instance.deriveFont(Font.PLAIN, fontSize);<NEW_LINE>font = instance.deriveFont((float) fontSize);<NEW_LINE>// System.out.println("setting font to " + font);<NEW_LINE>sample.setFont(font);<NEW_LINE>String filenameSuggestion = fontNames[selection].replace(' ', '_');<NEW_LINE>filenameSuggestion += "-" + fontSize;<NEW_LINE>filenameField.setText(filenameSuggestion);<NEW_LINE>}<NEW_LINE>}
.get(fontNames[selection]);
351,605
private void updateData() {<NEW_LINE><MASK><NEW_LINE>contentView.setVisibility(View.GONE);<NEW_LINE>XTokenManager.getInstance().requestSessions(accountItem.getConnectionSettings().getXToken().getUid(), accountItem.getConnection(), new XTokenManager.SessionsListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResult(SessionVO currentSession, List<SessionVO> sessions) {<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE>contentView.setVisibility(View.VISIBLE);<NEW_LINE>setCurrentSession(currentSession);<NEW_LINE>adapter.setItems(sessions);<NEW_LINE>terminateAll.setVisibility(sessions.isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>tvActiveSessions.setVisibility(sessions.isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError() {<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE>Toast.makeText(ActiveSessionsActivity.this, R.string.account_active_sessions_error, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
progressBar.setVisibility(View.VISIBLE);
881,594
final DisassociateDomainResult executeDisassociateDomain(DisassociateDomainRequest disassociateDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateDomainRequest> request = null;<NEW_LINE>Response<DisassociateDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateDomainRequest));<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, "WorkLink");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateDomainResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateDomain");
449,343
public static void main(String[] args) {<NEW_LINE>Logo.print(true);<NEW_LINE>AgentBoot.boot();<NEW_LINE>System.out.println("Scouter Host Agent Version " + Version.getServerFullVersion());<NEW_LINE>Logger.println("A01", "Scouter Host Agent Version " + Version.getServerFullVersion());<NEW_LINE>File exit = new File(SysJMX.getProcessPID() + ".scouter");<NEW_LINE>try {<NEW_LINE>exit.createNewFile();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String tmp = System.getProperty("user.home", "/tmp");<NEW_LINE>exit = new File(tmp, <MASK><NEW_LINE>try {<NEW_LINE>exit.createNewFile();<NEW_LINE>} catch (Exception k) {<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>exit.deleteOnExit();<NEW_LINE>System.out.println("System JRE version : " + System.getProperty("java.version"));<NEW_LINE>while (true) {<NEW_LINE>if (exit.exists() == false) {<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>ThreadUtil.sleep(1000);<NEW_LINE>}<NEW_LINE>}
SysJMX.getProcessPID() + ".scouter.run");
899,738
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand3 = instruction.getOperands().get(2).getRootNode().<MASK><NEW_LINE>final String targetRegister = (registerOperand1.getValue());<NEW_LINE>final String sourceRegister1 = (registerOperand2.getValue());<NEW_LINE>final String sourceRegister2 = (registerOperand3.getValue());<NEW_LINE>final OperandSize wd = OperandSize.WORD;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final OperandSize qw = OperandSize.QWORD;<NEW_LINE>long baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>final String value = environment.getNextVariableString();<NEW_LINE>Helpers.signedMul(baseOffset, environment, instruction, instructions, dw, sourceRegister1, dw, sourceRegister2, qw, value);<NEW_LINE>baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>if (instruction.getMnemonic().contains("R")) {<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, qw, value, dw, String.valueOf(0x80000000L), dw, value));<NEW_LINE>}<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, qw, value, wd, String.valueOf(-32L), dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpVar1, dw, String.valueOf(0xFFFFFFFFL), dw, targetRegister));<NEW_LINE>}
getChildren().get(0);
1,587,985
public Object outBinding(Object contract, RpcBinding binding, Object target, SofaRuntimeContext sofaRuntimeContext) {<NEW_LINE>ApplicationContext applicationContext = sofaRuntimeContext<MASK><NEW_LINE>ProviderConfigContainer providerConfigContainer = applicationContext.getBean(ProviderConfigContainer.class);<NEW_LINE>ProcessorContainer processorContainer = applicationContext.getBean(ProcessorContainer.class);<NEW_LINE>String uniqueName = providerConfigContainer.createUniqueName((Contract) contract, binding);<NEW_LINE>ProviderConfig providerConfig = providerConfigContainer.getProviderConfig(uniqueName);<NEW_LINE>processorContainer.processorProvider(providerConfig);<NEW_LINE>if (providerConfig == null) {<NEW_LINE>throw new ServiceRuntimeException(LogCodes.getLog(LogCodes.INFO_SERVICE_METADATA_IS_NULL, uniqueName));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>providerConfig.export();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ServiceRuntimeException(LogCodes.getLog(LogCodes.ERROR_PROXY_PUBLISH_FAIL), e);<NEW_LINE>}<NEW_LINE>if (providerConfigContainer.isAllowPublish()) {<NEW_LINE>providerConfig.setRegister(true);<NEW_LINE>List<RegistryConfig> registrys = providerConfig.getRegistry();<NEW_LINE>for (RegistryConfig registryConfig : registrys) {<NEW_LINE>Registry registry = RegistryFactory.getRegistry(registryConfig);<NEW_LINE>registry.init();<NEW_LINE>registry.start();<NEW_LINE>registry.register(providerConfig);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Boolean.TRUE;<NEW_LINE>}
.getSofaRuntimeManager().getRootApplicationContext();
1,659,587
public ListStorageLensConfigurationsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ListStorageLensConfigurationsResult listStorageLensConfigurationsResult = new ListStorageLensConfigurationsResult();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return listStorageLensConfigurationsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>listStorageLensConfigurationsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("StorageLensConfiguration", targetDepth)) {<NEW_LINE>listStorageLensConfigurationsResult.withStorageLensConfigurationList(ListStorageLensConfigurationEntryStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return listStorageLensConfigurationsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
476,162
private static void tryOptimizableBoolean(RegressionEnvironment env, RegressionPath path, String epl) {<NEW_LINE>// test function returns lookup value and "equals"<NEW_LINE>int count = 10;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>EPCompiled compiled = env.compile("@name('s" + i + "')" + epl, path);<NEW_LINE>EPDeploymentService admin = env.runtime().getDeploymentService();<NEW_LINE>try {<NEW_LINE>admin.deploy(compiled);<NEW_LINE>} catch (EPDeployException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>fail();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>SupportUpdateListener listener = new SupportUpdateListener();<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>env.statement("s" + i).addListener(listener);<NEW_LINE>}<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>SupportStaticMethodLib.resetCountInvoked();<NEW_LINE>int loops = 10000;<NEW_LINE>for (int i = 0; i < loops; i++) {<NEW_LINE>String key = "E_" + i % 100;<NEW_LINE>env.sendEventBean(new SupportBean(key, 0));<NEW_LINE>if (key.equals("E_1")) {<NEW_LINE>assertEquals(count, listener.<MASK><NEW_LINE>listener.reset();<NEW_LINE>} else {<NEW_LINE>assertFalse(listener.isInvoked());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long delta = System.currentTimeMillis() - startTime;<NEW_LINE>assertEquals(loops, SupportStaticMethodLib.getCountInvoked());<NEW_LINE>assertTrue("Delta is " + delta, delta < 1000);<NEW_LINE>env.undeployAll();<NEW_LINE>}
getNewDataList().size());
908,909
public void process(String workID, byte[] data) {<NEW_LINE>ReplicationTarget target = DistributedWorkQueueWorkAssignerHelper.<MASK><NEW_LINE>String file = new String(data, UTF_8);<NEW_LINE>log.debug("Received replication work for {} to {}", file, target);<NEW_LINE>ReplicaSystem replica;<NEW_LINE>try {<NEW_LINE>replica = getReplicaSystem(target);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Could not instantiate ReplicaSystem for {}, waiting before returning the work", target, e);<NEW_LINE>try {<NEW_LINE>// TODO configurable<NEW_LINE>Thread.sleep(5000);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Status status;<NEW_LINE>try {<NEW_LINE>status = getStatus(file, target);<NEW_LINE>} catch (ReplicationTableOfflineException e) {<NEW_LINE>log.error("Could not look for replication record", e);<NEW_LINE>throw new IllegalStateException("Could not look for replication record", e);<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>log.error("Could not deserialize Status from Work section for {} and {}", file, target);<NEW_LINE>throw new RuntimeException("Could not parse Status for work record", e);<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>log.error("Assigned work for {} to {} but could not find work record", file, target);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.debug("Current status for {} replicating to {}: {}", file, target, ProtobufUtil.toString(status));<NEW_LINE>// We don't need to do anything (shouldn't have gotten this work record in the first place)<NEW_LINE>if (!StatusUtil.isWorkRequired(status)) {<NEW_LINE>log.info("Received work request for {} and {}, but it does not need replication. Ignoring...", file, target);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Sanity check that nothing bad happened and our replication source still exists<NEW_LINE>Path filePath = new Path(file);<NEW_LINE>try {<NEW_LINE>if (!doesFileExist(filePath, target)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Could not determine if file exists {}", filePath, e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>log.debug("Replicating {} to {} using {}", filePath, target, replica.getClass().getName());<NEW_LINE>Status newStatus = replica.replicate(filePath, status, target, getHelper());<NEW_LINE>log.debug("Finished replicating {}. Original status: {}, New status: {}", filePath, status, newStatus);<NEW_LINE>}
fromQueueKey(workID).getValue();
1,580,550
final ListLensReviewsResult executeListLensReviews(ListLensReviewsRequest listLensReviewsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLensReviewsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLensReviewsRequest> request = null;<NEW_LINE>Response<ListLensReviewsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLensReviewsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLensReviewsRequest));<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, "WellArchitected");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLensReviews");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLensReviewsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListLensReviewsResultJsonUnmarshaller());
1,705,519
private void generateColumnData() {<NEW_LINE>int[] numOfMonth = openScale.getCountsOfMonth(calYears.getYear());<NEW_LINE>LocalDate calMonths = LocalDate.of(calYears.getYear(), 1, 1);<NEW_LINE>List<IBarDataSet> dataSets = new ArrayList<>();<NEW_LINE>for (int i = 0; i < 12; i++) {<NEW_LINE>List<BarEntry> entries = new ArrayList<>();<NEW_LINE>entries.add(new BarEntry(calMonths.getMonthValue() - 1, numOfMonth[i]));<NEW_LINE>calMonths = calMonths.plusMonths(1);<NEW_LINE>BarDataSet set = new <MASK><NEW_LINE>set.setColor(ColorUtil.COLORS[i % 4]);<NEW_LINE>set.setDrawValues(false);<NEW_LINE>set.setValueFormatter(new StackedValueFormatter(true, "", 0));<NEW_LINE>dataSets.add(set);<NEW_LINE>}<NEW_LINE>BarData data = new BarData(dataSets);<NEW_LINE>chartTop.setData(data);<NEW_LINE>chartTop.setFitBars(true);<NEW_LINE>chartTop.invalidate();<NEW_LINE>}
BarDataSet(entries, "month " + i);
559,698
public Set<Map<String, List<String>>> searchForMultipleAttributeValues(String base, String filter, Object[] params, String[] attributeNames) {<NEW_LINE>// Escape the params acording to RFC2254<NEW_LINE>Object[] encodedParams = new String[params.length];<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>encodedParams[i] = LdapEncoder.filterEncode(params[i].toString());<NEW_LINE>}<NEW_LINE>String formattedFilter = MessageFormat.format(filter, encodedParams);<NEW_LINE>logger.trace(LogMessage.format("Using filter: %s", formattedFilter));<NEW_LINE>HashSet<Map<String, List<String>>> result = new HashSet<>();<NEW_LINE>ContextMapper roleMapper = (ctx) -> {<NEW_LINE>DirContextAdapter adapter = (DirContextAdapter) ctx;<NEW_LINE>Map<String, List<String>> record = new HashMap<>();<NEW_LINE>if (ObjectUtils.isEmpty(attributeNames)) {<NEW_LINE>try {<NEW_LINE>for (NamingEnumeration enumeration = adapter.getAttributes().getAll(); enumeration.hasMore(); ) {<NEW_LINE>Attribute attr = (Attribute) enumeration.next();<NEW_LINE>extractStringAttributeValues(adapter, record, attr.getID());<NEW_LINE>}<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>org.springframework.ldap.support.LdapUtils.convertLdapException(ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String attributeName : attributeNames) {<NEW_LINE>extractStringAttributeValues(adapter, record, attributeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>record.put(DN_KEY, Arrays.asList(getAdapterDN(adapter)));<NEW_LINE>result.add(record);<NEW_LINE>return null;<NEW_LINE>};<NEW_LINE>SearchControls ctls = new SearchControls();<NEW_LINE>ctls.setSearchScope(this.searchControls.getSearchScope());<NEW_LINE>ctls.setReturningAttributes((attributeNames != null && attributeNames.length <MASK><NEW_LINE>search(base, formattedFilter, ctls, roleMapper);<NEW_LINE>return result;<NEW_LINE>}
> 0) ? attributeNames : null);
731,231
public AccountLimit unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>AccountLimit accountLimit = new AccountLimit();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return accountLimit;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>accountLimit.setType(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>accountLimit.setValue(LongStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return accountLimit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
924,245
public void updateFactAcctEndingBalanceForTag(final String processingTag) {<NEW_LINE>final String sql = "SELECT " + DB_FUNC_Fact_Acct_EndingBalance_UpdateForTag + "(?)";<NEW_LINE>final Object[] sqlParams = new Object[] { processingTag };<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.<MASK><NEW_LINE>DB.setParameters(pstmt, sqlParams);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>final String resultStr = rs.getString(1);<NEW_LINE>Loggables.withLogger(logger, Level.DEBUG).addLog(resultStr);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw DBException.wrapIfNeeded(e).appendParametersToMessage().setParameter("sql", sql).setParameter("sqlParams", sqlParams);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>}
prepareStatement(sql, ITrx.TRXNAME_ThreadInherited);
16,429
final ClusterSecurityGroup executeAuthorizeClusterSecurityGroupIngress(AuthorizeClusterSecurityGroupIngressRequest authorizeClusterSecurityGroupIngressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(authorizeClusterSecurityGroupIngressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AuthorizeClusterSecurityGroupIngressRequest> request = null;<NEW_LINE>Response<ClusterSecurityGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AuthorizeClusterSecurityGroupIngressRequestMarshaller().marshall(super.beforeMarshalling(authorizeClusterSecurityGroupIngressRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AuthorizeClusterSecurityGroupIngress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ClusterSecurityGroup> responseHandler = new StaxResponseHandler<ClusterSecurityGroup>(new ClusterSecurityGroupStaxUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
527,831
private void initDeviceView() {<NEW_LINE>main = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.numColumns = 1;<NEW_LINE>layout.marginTop = 4;<NEW_LINE>layout.marginBottom = 4;<NEW_LINE>layout.marginHeight = 4;<NEW_LINE>layout.marginWidth = 4;<NEW_LINE>main.setLayout(layout);<NEW_LINE>GridData grid_data;<NEW_LINE>main.setLayoutData(Utils.getFilledFormData());<NEW_LINE>// control<NEW_LINE>Composite control = new Composite(main, SWT.NONE);<NEW_LINE>layout = new GridLayout();<NEW_LINE>layout.numColumns = 3;<NEW_LINE>layout.marginLeft = 0;<NEW_LINE>control.setLayout(layout);<NEW_LINE>// browse to local dir<NEW_LINE>grid_data = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>grid_data.horizontalSpan = 1;<NEW_LINE>control.setLayoutData(grid_data);<NEW_LINE>Label dir_lab = new Label(control, SWT.NONE);<NEW_LINE>dir_lab.setText("Local directory: " + device.getWorkingDirectory().getAbsolutePath());<NEW_LINE>Button show_folder_button = new Button(control, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(show_folder_button, "MyTorrentsView.menu.explore");<NEW_LINE>show_folder_button.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>ManagerUtils.open(device.getWorkingDirectory());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new Label(control, SWT.NONE);<NEW_LINE>if (device.canFilterFilesView()) {<NEW_LINE>final Button show_xcode_button = new Button(control, SWT.CHECK);<NEW_LINE>Messages.setLanguageText(show_xcode_button, "devices.xcode.only.show");<NEW_LINE>show_xcode_button.<MASK><NEW_LINE>show_xcode_button.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>device.setFilterFilesView(show_xcode_button.getSelection());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>final Button btnReset = new Button(main, SWT.PUSH);<NEW_LINE>btnReset.setText("Forget Default Profile Choice");<NEW_LINE>btnReset.addSelectionListener(new SelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>device.setDefaultTranscodeProfile(null);<NEW_LINE>btnReset.setEnabled(false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetDefaultSelected(SelectionEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>btnReset.setEnabled(device.getDefaultTranscodeProfile() != null);<NEW_LINE>} catch (TranscodeException e1) {<NEW_LINE>btnReset.setEnabled(false);<NEW_LINE>}<NEW_LINE>btnReset.setLayoutData(new GridData());<NEW_LINE>parent.getParent().layout();<NEW_LINE>}
setSelection(device.getFilterFilesView());
1,227,808
void cscan(int[] arr, int head, int size, int disk_size) {<NEW_LINE>int seek_count = 0;<NEW_LINE>int distance, cur_track;<NEW_LINE>Vector<Integer> l3 = new Vector<Integer>();<NEW_LINE>Vector<Integer> r3 = new Vector<Integer>();<NEW_LINE>Vector<Integer> arr3 = new Vector<Integer>();<NEW_LINE>// appending end values which has to be visited before reversing the direction<NEW_LINE>l3.add(0);<NEW_LINE>r3.add(disk_size - 1);<NEW_LINE>// tracks on the left of the head will be serviced when<NEW_LINE>// once the head comes back to the left<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (arr[i] < head)<NEW_LINE>l3.add(arr[i]);<NEW_LINE>if (arr[i] > head)<NEW_LINE>r3.add(arr[i]);<NEW_LINE>}<NEW_LINE>Collections.sort(l3);<NEW_LINE>Collections.sort(r3);<NEW_LINE>for (int i = 0; i < r3.size(); i++) {<NEW_LINE>cur_track = r3.get(i);<NEW_LINE>// appending current track to seek sequence<NEW_LINE>arr3.add(cur_track);<NEW_LINE>distance = Math.abs(cur_track - head);<NEW_LINE>System.out.println("Head movement: " + cur_track + "-" + head + " = " + distance);<NEW_LINE>seek_count += distance;<NEW_LINE>// accessed track is now new head<NEW_LINE>head = cur_track;<NEW_LINE>}<NEW_LINE>// Now service the requests again<NEW_LINE>// which are left.<NEW_LINE>for (int i = 0; i < l3.size(); i++) {<NEW_LINE>cur_track = l3.get(i);<NEW_LINE>// appending current track to seek sequence<NEW_LINE>arr3.add(cur_track);<NEW_LINE>// calculate absolute distance<NEW_LINE>distance = <MASK><NEW_LINE>System.out.println("Head movement: " + cur_track + "-" + head + " = " + distance);<NEW_LINE>// increase the total count<NEW_LINE>seek_count += distance;<NEW_LINE>// accessed track is now the new head<NEW_LINE>head = cur_track;<NEW_LINE>}<NEW_LINE>System.out.println(" ");<NEW_LINE>System.out.println("Total Seek Time : " + seek_count);<NEW_LINE>System.out.println(" ");<NEW_LINE>System.out.print("Seek Sequence is : " + " ");<NEW_LINE>for (int i = 0; i < arr3.size(); i++) {<NEW_LINE>System.out.print(arr3.get(i) + " ");<NEW_LINE>}<NEW_LINE>System.out.println(" ");<NEW_LINE>}
Math.abs(cur_track - head);
1,212,520
final String PrintVersion(String str) {<NEW_LINE>try {<NEW_LINE>StringBuffer buf = new StringBuffer(str.length());<NEW_LINE>for (int i = 0; i < str.length(); i++) {<NEW_LINE>switch(str.charAt(i)) {<NEW_LINE>case '\"':<NEW_LINE>buf.append("\\\"");<NEW_LINE>break;<NEW_LINE>case '\\':<NEW_LINE>buf.append("\\\\");<NEW_LINE>break;<NEW_LINE>case '\t':<NEW_LINE>buf.append("\\t");<NEW_LINE>break;<NEW_LINE>case '\n':<NEW_LINE>buf.append("\\n");<NEW_LINE>break;<NEW_LINE>case '\f':<NEW_LINE>buf.append("\\f");<NEW_LINE>break;<NEW_LINE>case '\r':<NEW_LINE>buf.append("\\r");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>buf.append(str.charAt(i));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// switch<NEW_LINE>}<NEW_LINE>// for<NEW_LINE>return buf.toString();<NEW_LINE>} catch (RuntimeException | OutOfMemoryError e) {<NEW_LINE>if (hasSource()) {<NEW_LINE>throw <MASK><NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
FingerprintException.getNewHead(this, e);
502,143
public Object clone() {<NEW_LINE>Object o = null;<NEW_LINE>try {<NEW_LINE>o = super.clone();<NEW_LINE>} catch (Exception e) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.cache.CacheConfig", "314");<NEW_LINE>}<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>// Since the DistributedObjectCacheFactory is cloning baseBase config,<NEW_LINE>// we have to reset a few config items to prevent problems creating<NEW_LINE>// the new cache. The clone will contain everthing else from the<NEW_LINE>// donor.<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>((<MASK><NEW_LINE>((CacheConfig) o).jndiName = null;<NEW_LINE>((CacheConfig) o).cache = null;<NEW_LINE>((CacheConfig) o).distributedObjectCache = null;<NEW_LINE>((CacheConfig) o).enableServletSupport = false;<NEW_LINE>((CacheConfig) o).enableDiskOffload = false;<NEW_LINE>((CacheConfig) o).flushToDiskOnStop = false;<NEW_LINE>((CacheConfig) o).disableDependencyId = false;<NEW_LINE>((CacheConfig) o).disableTemplatesSupport = false;<NEW_LINE>return o;<NEW_LINE>}
CacheConfig) o).cacheName = null;
1,730,659
public void onMediaClick(Album album, ArrayList<Media> media, int position) {<NEW_LINE>if (!pickMode) {<NEW_LINE>Intent intent = new Intent(<MASK><NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_ALBUM, album);<NEW_LINE>try {<NEW_LINE>intent.setAction(SingleMediaActivity.ACTION_OPEN_ALBUM);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_MEDIA, media);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_POSITION, position);<NEW_LINE>startActivity(intent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Putting too much data into the Bundle<NEW_LINE>// TODO: Find a better way to pass data between the activities - possibly a key to<NEW_LINE>// access a HashMap or a unique value of a singleton Data Repository of some sort.<NEW_LINE>intent.setAction(SingleMediaActivity.ACTION_OPEN_ALBUM_LAZY);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_MEDIA, media.get(position));<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Media m = media.get(position);<NEW_LINE>Uri uri = LegacyCompatFileProvider.getUri(getApplicationContext(), m.getFile());<NEW_LINE>Intent res = new Intent();<NEW_LINE>res.setData(uri);<NEW_LINE>res.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>setResult(RESULT_OK, res);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>}
getApplicationContext(), SingleMediaActivity.class);
1,835,375
private QualifierKind findLub(@UnderInitialization DefaultQualifierKindHierarchy this, QualifierKind qual1, QualifierKind qual2) {<NEW_LINE>if (qual1 == qual2) {<NEW_LINE>return qual1;<NEW_LINE>} else if (qual1.isSubtypeOf(qual2)) {<NEW_LINE>return qual2;<NEW_LINE>} else if (qual2.isSubtypeOf(qual1)) {<NEW_LINE>return qual1;<NEW_LINE>}<NEW_LINE>Set<QualifierKind> allSuperTypes = new TreeSet<>(qual1.getStrictSuperTypes());<NEW_LINE>Set<? extends QualifierKind> qual2StrictSuperTypes = qual2.getStrictSuperTypes();<NEW_LINE>allSuperTypes.retainAll(qual2StrictSuperTypes);<NEW_LINE>Set<? extends <MASK><NEW_LINE>if (lubs.size() != 1) {<NEW_LINE>throw new TypeSystemError("lub(%s, %s) should have size 1: [%s]", qual1, qual2, StringsPlume.join(", ", lubs));<NEW_LINE>}<NEW_LINE>QualifierKind lub = lubs.iterator().next();<NEW_LINE>if (lub.isPoly() && !qual1.isPoly() && !qual2.isPoly()) {<NEW_LINE>throw new TypeSystemError("lub(%s, %s) can't be poly: %s", qual1, qual2, lub);<NEW_LINE>}<NEW_LINE>return lub;<NEW_LINE>}
QualifierKind> lubs = findLowestQualifiers(allSuperTypes);
911,573
public Request<CreateSAMLProviderRequest> marshall(CreateSAMLProviderRequest createSAMLProviderRequest) {<NEW_LINE>if (createSAMLProviderRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateSAMLProviderRequest> request = new DefaultRequest<CreateSAMLProviderRequest>(createSAMLProviderRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "CreateSAMLProvider");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createSAMLProviderRequest.getSAMLMetadataDocument() != null) {<NEW_LINE>request.addParameter("SAMLMetadataDocument", StringUtils.fromString(createSAMLProviderRequest.getSAMLMetadataDocument()));<NEW_LINE>}<NEW_LINE>if (createSAMLProviderRequest.getName() != null) {<NEW_LINE>request.addParameter("Name", StringUtils.fromString(createSAMLProviderRequest.getName()));<NEW_LINE>}<NEW_LINE>if (!createSAMLProviderRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) createSAMLProviderRequest.getTags()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) createSAMLProviderRequest.getTags();<NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Key", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(tagsListValue.getKey()));
245,494
public void processElement(ProcessContext context) throws Exception {<NEW_LINE>Query query = context.element();<NEW_LINE><MASK><NEW_LINE>int userLimit = query.hasLimit() ? query.getLimit().getValue() : Integer.MAX_VALUE;<NEW_LINE>boolean moreResults = true;<NEW_LINE>QueryResultBatch currentBatch = null;<NEW_LINE>while (moreResults) {<NEW_LINE>Query.Builder queryBuilder = query.toBuilder();<NEW_LINE>queryBuilder.setLimit(Int32Value.newBuilder().setValue(Math.min(userLimit, QUERY_BATCH_LIMIT)));<NEW_LINE>if (currentBatch != null && !currentBatch.getEndCursor().isEmpty()) {<NEW_LINE>queryBuilder.setStartCursor(currentBatch.getEndCursor());<NEW_LINE>}<NEW_LINE>RunQueryRequest request = makeRequest(queryBuilder.build(), namespace);<NEW_LINE>RunQueryResponse response = runQueryWithRetries(request);<NEW_LINE>currentBatch = response.getBatch();<NEW_LINE>// MORE_RESULTS_AFTER_LIMIT is not implemented yet:<NEW_LINE>// https://groups.google.com/forum/#!topic/gcd-discuss/iNs6M1jA2Vw, so<NEW_LINE>// use result count to determine if more results might exist.<NEW_LINE>int numFetch = currentBatch.getEntityResultsCount();<NEW_LINE>if (query.hasLimit()) {<NEW_LINE>verify(userLimit >= numFetch, "Expected userLimit %s >= numFetch %s, because query limit %s must be <= userLimit", userLimit, numFetch, query.getLimit());<NEW_LINE>userLimit -= numFetch;<NEW_LINE>}<NEW_LINE>// output all the entities from the current batch.<NEW_LINE>for (EntityResult entityResult : currentBatch.getEntityResultsList()) {<NEW_LINE>context.output(entityResult.getEntity());<NEW_LINE>}<NEW_LINE>// Check if we have more entities to be read.<NEW_LINE>// User-limit does not exist (so userLimit == MAX_VALUE) and/or has not been satisfied<NEW_LINE>moreResults = // All indications from the API are that there are/may be more results.<NEW_LINE>(userLimit > 0) && ((numFetch == QUERY_BATCH_LIMIT) || (currentBatch.getMoreResults() == NOT_FINISHED));<NEW_LINE>}<NEW_LINE>}
String namespace = options.getNamespace();
870,885
protected void createPasswordSection(Composite parent) {<NEW_LINE>passwordLabel = new Label(parent, SWT.NONE);<NEW_LINE>passwordLabel.setLayoutData(GridDataFactory.swtDefaults().hint(new PixelConverter(passwordLabel).convertHorizontalDLUsToPixels(IDialogConstants.LABEL_WIDTH), SWT.DEFAULT).create());<NEW_LINE>passwordLabel.setText(StringUtil.makeFormLabel(Messages.FTPConnectionPointPropertyDialog_LBL_Password));<NEW_LINE>passwordText = new Text(parent, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER);<NEW_LINE>passwordText.setLayoutData(GridDataFactory.fillDefaults().hint(new PixelConverter(passwordText).convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT).grab(true, false).create());<NEW_LINE>savePasswordButton = new <MASK><NEW_LINE>savePasswordButton.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>savePasswordButton.setText(Messages.FTPConnectionPointPropertyDialog_LBL_Save);<NEW_LINE>}
Button(parent, SWT.CHECK);
1,401,389
private void waitForFutureCompletion(GroupByQuery query, List<ListenableFuture<AggregateResult>> futures, boolean hasTimeout, long timeout) {<NEW_LINE>ListenableFuture<List<AggregateResult>> future = Futures.allAsList(futures);<NEW_LINE>try {<NEW_LINE>if (queryWatcher != null) {<NEW_LINE>queryWatcher.registerQueryFuture(query, future);<NEW_LINE>}<NEW_LINE>if (hasTimeout && timeout <= 0) {<NEW_LINE>throw new QueryTimeoutException();<NEW_LINE>}<NEW_LINE>final List<AggregateResult> results = hasTimeout ? future.get(timeout, TimeUnit.<MASK><NEW_LINE>for (AggregateResult result : results) {<NEW_LINE>if (!result.isOk()) {<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>throw new ResourceLimitExceededException(result.getReason());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId());<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>throw new QueryInterruptedException(e);<NEW_LINE>} catch (CancellationException e) {<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>throw new QueryInterruptedException(e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>log.info("Query timeout, cancelling pending results for query id [%s]", query.getId());<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>throw new QueryTimeoutException();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
MILLISECONDS) : future.get();
1,568,139
private static <T> T runExternalAttach(long pid, String methodName, InputStreamProcessor<T> processor, @Nullable File glowrootJarFile) throws Exception {<NEW_LINE>List<String> command = buildCommand(pid, methodName, glowrootJarFile);<NEW_LINE>ProcessBuilder processBuilder = new ProcessBuilder(command);<NEW_LINE>Process process = processBuilder.start();<NEW_LINE>Closer closer = Closer.create();<NEW_LINE>ErrorStreamReader errorStreamReader;<NEW_LINE>T result = null;<NEW_LINE>Exception processingException = null;<NEW_LINE>try {<NEW_LINE>InputStream in = closer.register(process.getInputStream());<NEW_LINE>InputStream err = closer.<MASK><NEW_LINE>errorStreamReader = new ErrorStreamReader(err);<NEW_LINE>Thread errorStreamReaderThread = new Thread(errorStreamReader);<NEW_LINE>errorStreamReaderThread.setName("Glowroot-JVM-Tool-Error-Stream-Reader");<NEW_LINE>errorStreamReaderThread.setDaemon(true);<NEW_LINE>errorStreamReaderThread.start();<NEW_LINE>try {<NEW_LINE>result = processAndClose(in, processor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>processingException = e;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>processingException = new RuntimeException(t);<NEW_LINE>}<NEW_LINE>errorStreamReaderThread.join();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw closer.rethrow(t);<NEW_LINE>} finally {<NEW_LINE>closer.close();<NEW_LINE>}<NEW_LINE>int status = process.waitFor();<NEW_LINE>if (status == UNAVAILABLE_DUE_TO_RUNNING_IN_JRE_STATUS) {<NEW_LINE>throw new UnavailableDueToRunningInJreException();<NEW_LINE>} else if (status == UNAVAILABLE_PROBABLY_DUE_TO_DOCKER_PID_ONE_STATUS) {<NEW_LINE>throw new UnavailableDueToDockerAlpinePidOneException();<NEW_LINE>} else if (status != 0) {<NEW_LINE>logger.error("error occurred while trying to run jvm tool:\n{}\n{}", Joiner.on(' ').join(command), errorStreamReader.getOutput().trim());<NEW_LINE>throw new IllegalStateException("Error occurred while trying to run jvm tool");<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>throw checkNotNull(processingException);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
register(process.getErrorStream());
1,660,728
protected void downloadArtifactTo(final URL artifactUrl, final File pluginFile, final IAsyncResultHandler<File> handler) {<NEW_LINE>URI artifactUri;<NEW_LINE>try {<NEW_LINE>artifactUri = artifactUrl.toURI();<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IllegalArgumentException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>int port = artifactUrl.getPort();<NEW_LINE>boolean isTls = false;<NEW_LINE>// Configure http client options following artifact url<NEW_LINE>if (artifactUrl.getProtocol().equalsIgnoreCase("https")) {<NEW_LINE>// If port is not defined, set to https default port 443<NEW_LINE>if (port == -1)<NEW_LINE>port = 443;<NEW_LINE>isTls = true;<NEW_LINE>} else {<NEW_LINE>// If port is not defined, set to http default port 80<NEW_LINE>if (port == -1)<NEW_LINE>port = 80;<NEW_LINE>}<NEW_LINE>HttpClientOptions options = createVertxClientOptions(artifactUri, isTls);<NEW_LINE>LOG.trace("Will attempt to download artifact {0} using options {1} to {2}", artifactUrl, options, pluginFile);<NEW_LINE>HttpClient client = vertx.createHttpClient(options);<NEW_LINE>CircuitBreaker breaker = CircuitBreaker.create("download-plugin-circuit-breaker", vertx, // number of failure before opening the circuit<NEW_LINE>new CircuitBreakerOptions().// number of failure before opening the circuit<NEW_LINE>setMaxFailures(// consider a failure if the operation does not succeed in time<NEW_LINE>2).// consider a failure if the operation does not succeed in time<NEW_LINE>setTimeout(// time spent in open state before attempting to re-try<NEW_LINE>20000).// time spent in open state before attempting to re-try<NEW_LINE>setResetTimeout(// Increase backoff on each retry<NEW_LINE>10000)).// Increase backoff on each retry<NEW_LINE>retryPolicy(retryCount -> retryCount * 10L);<NEW_LINE>int finalPort = port;<NEW_LINE>breaker.<File>execute(promise -> {<NEW_LINE>LOG.info("Will attempt to download plugin from: {0}", artifactUrl);<NEW_LINE>tryDownloadingArtifact(client, finalPort, artifactUrl, pluginFile, promise);<NEW_LINE>}).onSuccess(file -> {<NEW_LINE>LOG.debug("Successfully downloaded plugin artifact: {0}", artifactUrl);<NEW_LINE>handler.handle(AsyncResultImpl.create(pluginFile));<NEW_LINE>}).onFailure(failure -> {<NEW_LINE><MASK><NEW_LINE>handler.handle(AsyncResultImpl.create(failure));<NEW_LINE>});<NEW_LINE>}
LOG.error("Failed to downloaded plugin artifact", failure);
772,788
protected void actionPerformed(OWLEntity selectedEntity) {<NEW_LINE>OWLEntityRenamer owlEntityRenamer = new OWLEntityRenamer(getOWLModelManager().getOWLOntologyManager(), getOWLModelManager().getOntologies());<NEW_LINE>final IRI iri = RenameEntityPanel.showDialog(getOWLEditorKit(), selectedEntity);<NEW_LINE>if (iri == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<OWLOntologyChange> changes;<NEW_LINE>if (RenameEntityPanel.isAutoRenamePuns()) {<NEW_LINE>changes = owlEntityRenamer.changeIRI(selectedEntity.getIRI(), iri);<NEW_LINE>} else {<NEW_LINE>changes = owlEntityRenamer.changeIRI(selectedEntity, iri);<NEW_LINE>}<NEW_LINE>getOWLModelManager().applyChanges(changes);<NEW_LINE>selectedEntity.accept(new OWLEntityVisitor() {<NEW_LINE><NEW_LINE>public void visit(OWLClass cls) {<NEW_LINE>ensureSelected(getOWLDataFactory<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLObjectProperty property) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLObjectProperty(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLDataProperty property) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLDataProperty(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLAnnotationProperty owlAnnotationProperty) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLAnnotationProperty(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLNamedIndividual individual) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLNamedIndividual(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLDatatype dataType) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLDatatype(iri));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
().getOWLClass(iri));
244,458
public static void clear(int WindowNo, Container c, String ParseString) {<NEW_LINE>log.info("Dialog.clear: " + ParseString);<NEW_LINE>Properties ctx = Env.getCtx();<NEW_LINE>String parse = Env.parseContext(<MASK><NEW_LINE>if (parse.length() == 0)<NEW_LINE>parse = "ERROR parsing: " + ParseString;<NEW_LINE>//<NEW_LINE>Window parent = Env.getParent(c);<NEW_LINE>if (parent == null)<NEW_LINE>parent = Env.getWindow(WindowNo);<NEW_LINE>//<NEW_LINE>if (showDialog && parent != null) {<NEW_LINE>if (parent instanceof JFrame)<NEW_LINE>new ADialogDialog((JFrame) parent, Env.getHeader(ctx, WindowNo), "=> " + parse, JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>else<NEW_LINE>new ADialogDialog((JDialog) parent, Env.getHeader(ctx, WindowNo), "=> " + parse, JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>} else<NEW_LINE>// message<NEW_LINE>JOptionPane.// message<NEW_LINE>showMessageDialog(// message<NEW_LINE>parent, // title<NEW_LINE>"=> " + parse + "\n", Env.getHeader(ctx, WindowNo), JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}
ctx, WindowNo, ParseString, false);
1,501,837
public void onStyleLoaded(@NonNull final Style style) {<NEW_LINE>initStyling();<NEW_LINE>// Create a new ScaleBarPlugin object<NEW_LINE>scaleBarPlugin = new ScaleBarPlugin(mapView, mapboxMap);<NEW_LINE>scaleBarPlugin.create(listOfScalebarStyleVariations[index]);<NEW_LINE>findViewById(R.id.switch_scalebar_style_fab).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>if (index == listOfScalebarStyleVariations.length - 1) {<NEW_LINE>index = 0;<NEW_LINE>}<NEW_LINE>mapboxMap.setStyle(listOfStyles[index], new Style.OnStyleLoaded() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>scaleBarPlugin.create(listOfScalebarStyleVariations[index]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Toast.makeText(ScalebarPluginActivity.this, getString(R.string.zoom_map_fab_instruction), <MASK><NEW_LINE>}
Toast.LENGTH_LONG).show();
939,095
public Block readBlock(SliceInput sliceInput) {<NEW_LINE>// read data type<NEW_LINE>int scale = sliceInput.readInt();<NEW_LINE>DataType dataType = new TimeType(scale);<NEW_LINE>// read zone id<NEW_LINE>int length = sliceInput.readInt();<NEW_LINE>byte[] zoneIdName = new byte[length];<NEW_LINE>sliceInput.read(zoneIdName);<NEW_LINE>TimeZone zone = TimeZone.getTimeZone(new String(zoneIdName));<NEW_LINE>// read position count & null value<NEW_LINE>int positionCount = sliceInput.readInt();<NEW_LINE>boolean[] valueIsNull = decodeNullBits(sliceInput, positionCount);<NEW_LINE>// read packed long array<NEW_LINE>int dataLength = sliceInput.readInt();<NEW_LINE>long[] packed = new long[dataLength];<NEW_LINE>for (int i = 0; i < dataLength; i++) {<NEW_LINE>packed[<MASK><NEW_LINE>}<NEW_LINE>return new TimeBlock(0, positionCount, valueIsNull, packed, dataType, zone);<NEW_LINE>}
i] = sliceInput.readLong();
1,277,446
public final TypeBoundContext typeBound() throws RecognitionException {<NEW_LINE>TypeBoundContext _localctx = new TypeBoundContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 34, RULE_typeBound);<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(454);<NEW_LINE>type();<NEW_LINE>setState(461);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 20, _ctx);<NEW_LINE>while (_alt != 2 && _alt != groovyjarjarantlr4.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(455);<NEW_LINE>match(BITAND);<NEW_LINE>setState(456);<NEW_LINE>nls();<NEW_LINE>setState(457);<NEW_LINE>type();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(463);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().<MASK><NEW_LINE>}<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>}
adaptivePredict(_input, 20, _ctx);
1,067,583
public void start() {<NEW_LINE>this.syncPoolExecutor = Executors.newSingleThreadScheduledExecutor(target -> <MASK><NEW_LINE>updateLowerUsefulDifficulty();<NEW_LINE>syncPoolExecutor.scheduleWithFixedDelay(() -> {<NEW_LINE>try {<NEW_LINE>if (config.getIsHeartBeatEnabled()) {<NEW_LINE>heartBeat();<NEW_LINE>}<NEW_LINE>processConnections();<NEW_LINE>updateLowerUsefulDifficulty();<NEW_LINE>fillUp();<NEW_LINE>prepareActive();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Unhandled exception", t);<NEW_LINE>}<NEW_LINE>}, WORKER_TIMEOUT, WORKER_TIMEOUT, TimeUnit.SECONDS);<NEW_LINE>if (config.waitForSync()) {<NEW_LINE>try {<NEW_LINE>while (nodeBlockProcessor.getBestBlockNumber() == 0 || nodeBlockProcessor.hasBetterBlockToSync()) {<NEW_LINE>Thread.sleep(10000);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("The SyncPool service couldn't be started", e);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new Thread(target, "syncPool"));
1,046,676
String computeAuthorizationHeader(ConsumerKey consumerAuth, RequestToken userAuth, String signature, long oauthTimestamp, String percentEncodedNonce) {<NEW_LINE>StringBuilder sb = StringBuilderPool.DEFAULT.stringBuilder();<NEW_LINE>sb.append("OAuth ");<NEW_LINE>sb.append(KEY_OAUTH_CONSUMER_KEY).append("=\"").append(consumerAuth.getPercentEncodedKey()).append("\", ");<NEW_LINE>if (userAuth.getKey() != null) {<NEW_LINE>sb.append(KEY_OAUTH_TOKEN).append("=\"").append(userAuth.getPercentEncodedKey<MASK><NEW_LINE>}<NEW_LINE>sb.append(KEY_OAUTH_SIGNATURE_METHOD).append("=\"").append(OAUTH_SIGNATURE_METHOD).append("\", ");<NEW_LINE>// careful: base64 has chars that need URL encoding:<NEW_LINE>sb.append(KEY_OAUTH_SIGNATURE).append("=\"");<NEW_LINE>Utf8UrlEncoder.encodeAndAppendPercentEncoded(sb, signature).append("\", ");<NEW_LINE>sb.append(KEY_OAUTH_TIMESTAMP).append("=\"").append(oauthTimestamp).append("\", ");<NEW_LINE>sb.append(KEY_OAUTH_NONCE).append("=\"").append(percentEncodedNonce).append("\", ");<NEW_LINE>sb.append(KEY_OAUTH_VERSION).append("=\"").append(OAUTH_VERSION_1_0).append("\"");<NEW_LINE>return sb.toString();<NEW_LINE>}
()).append("\", ");
1,674,662
public void update(Unit unit) {<NEW_LINE>float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));<NEW_LINE>if (Mathf.chance(Time.delta * chance * scl)) {<NEW_LINE>float x = unit.x + Angles.trnsx(unit.rotation, offset, width * side), y = unit.y + Angles.trnsy(unit.rotation, offset, width * side);<NEW_LINE>shootEffect.at(x, y, unit.rotation, color, parentizeEffects ? unit : null);<NEW_LINE><MASK><NEW_LINE>if (length > 0) {<NEW_LINE>Lightning.create(unit.team, color, damage, x + unit.vel.x, y + unit.vel.y, unit.rotation, length);<NEW_LINE>}<NEW_LINE>if (bullet != null) {<NEW_LINE>bullet.create(unit, unit.team, x, y, unit.rotation + bulletAngle + Mathf.range(bulletSpread));<NEW_LINE>}<NEW_LINE>if (alternate)<NEW_LINE>side *= -1f;<NEW_LINE>}<NEW_LINE>}
shootSound.at(x, y);
1,067,690
private void waitForLoadJobs(Map<String, ListenableFuture<?>> loadJobs) throws Exception {<NEW_LINE>final long startTime = System.currentTimeMillis();<NEW_LINE>System.err.println("Waiting for load jobs...");<NEW_LINE>// Add callbacks to each load job that print information on successful completion or failure.<NEW_LINE>for (final String jobId : loadJobs.keySet()) {<NEW_LINE>final String jobName = "load-" + jobId;<NEW_LINE>addCallback(loadJobs.get(jobId), new FutureCallback<Object>() {<NEW_LINE><NEW_LINE>private double elapsedSeconds() {<NEW_LINE>return (System.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Object unused) {<NEW_LINE>System.err.printf("Job %s succeeded (%.3fs)\n", jobName, elapsedSeconds());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable error) {<NEW_LINE>System.err.printf("Job %s failed (%.3fs): %s\n", jobName, elapsedSeconds(), error.getMessage());<NEW_LINE>}<NEW_LINE>}, directExecutor());<NEW_LINE>}<NEW_LINE>// Block on the completion of all the load jobs.<NEW_LINE>List<?> results = Futures.successfulAsList(loadJobs.values()).get();<NEW_LINE>int numSucceeded = (int) results.stream().filter(Objects::nonNull).count();<NEW_LINE>System.err.printf("All load jobs have terminated: %d/%d successful.\n", numSucceeded, loadJobs.size());<NEW_LINE>}
currentTimeMillis() - startTime) / 1000.0;
1,681,758
public void copyConditionalStylesFrom(org.freeplane.api.MindMap source, String styleName) {<NEW_LINE>IStyle style = NodeStyleProxy.styleByName(source, styleName);<NEW_LINE>if (style == null)<NEW_LINE>throw new IllegalArgumentException("Style " + styleName + " not found");<NEW_LINE>IStyle ownStyle = NodeStyleProxy.styleByName(getDelegate(), styleName);<NEW_LINE>if (ownStyle == null)<NEW_LINE>copyStyleFrom(source, styleName);<NEW_LINE>final MapStyleModel ownStyleModel = <MASK><NEW_LINE>ConditionalStyleModel ownConditionalStyleModel = ownStyleModel.getConditionalStyleModel();<NEW_LINE>MLogicalStyleController controller = (MLogicalStyleController) getModeController().getExtension(LogicalStyleController.class);<NEW_LINE>List<Item> ownConditionalStyles = ownConditionalStyleModel.getStyles();<NEW_LINE>for (int i = ownConditionalStyles.size() - 1; i >= 0; i--) {<NEW_LINE>Item item = ownConditionalStyles.get(i);<NEW_LINE>if (item.getStyle().equals(style)) {<NEW_LINE>controller.removeConditionalStyle(getDelegate(), ownConditionalStyleModel, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final MapStyleModel sourceStyleModel = MapStyleModel.getExtension(((MapProxy) source).getDelegate());<NEW_LINE>ConditionalStyleModel sourceConditionalStyleModel = sourceStyleModel.getConditionalStyleModel();<NEW_LINE>List<Item> sourceConditionalStyles = sourceConditionalStyleModel.getStyles();<NEW_LINE>for (int i = 0; i < sourceConditionalStyles.size(); i++) {<NEW_LINE>Item item = sourceConditionalStyles.get(i);<NEW_LINE>if (item.getStyle().equals(style)) {<NEW_LINE>controller.addConditionalStyle(getDelegate(), ownConditionalStyleModel, item.isActive(), item.getCondition(), style, item.isLast());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.refreshMap(getDelegate());<NEW_LINE>}
MapStyleModel.getExtension(getDelegate());
234,296
private boolean alertOutputs(String commandDisplayName) {<NEW_LINE>JButton setOutputOption = new JButton(NbBundle.getMessage(JavaActions.class, "CTL_SetOutput"));<NEW_LINE>setOutputOption.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(JavaActions.class, "AD_SetOutput"));<NEW_LINE>setOutputOption.setDefaultCapable(true);<NEW_LINE>String projectDisplayName = ProjectUtils.getInformation(project).getDisplayName();<NEW_LINE>String title = NbBundle.getMessage(JavaActions.<MASK><NEW_LINE>String body = NbBundle.getMessage(JavaActions.class, "TEXT_set_outputs_dialog");<NEW_LINE>NotifyDescriptor d = new NotifyDescriptor.Message(body, NotifyDescriptor.QUESTION_MESSAGE);<NEW_LINE>d.setTitle(title);<NEW_LINE>d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION);<NEW_LINE>d.setOptions(new Object[] { setOutputOption, NotifyDescriptor.CANCEL_OPTION });<NEW_LINE>if (DialogDisplayer.getDefault().notify(d) == setOutputOption) {<NEW_LINE>CustomizerProvider customizerProvider = project.getLookup().lookup(CustomizerProvider.class);<NEW_LINE>assert customizerProvider != null;<NEW_LINE>customizerProvider.showCustomizer();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
class, "TITLE_set_outputs_dialog", commandDisplayName, projectDisplayName);
1,443,624
public RegisterSchemaVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RegisterSchemaVersionResult registerSchemaVersionResult = new RegisterSchemaVersionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return registerSchemaVersionResult;<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("SchemaVersionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>registerSchemaVersionResult.setSchemaVersionId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VersionNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>registerSchemaVersionResult.setVersionNumber(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>registerSchemaVersionResult.setStatus(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 registerSchemaVersionResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
892,874
public static <T> ExprVectorProcessor<T> makeComparisonProcessor(Expr.VectorInputBindingInspector inspector, Expr left, Expr right, Supplier<LongOutStringsInFunctionVectorProcessor> longOutStringsInFunctionVectorProcessor, Supplier<LongOutLongsInFunctionVectorValueProcessor> longOutLongsInProcessor, Supplier<DoubleOutLongDoubleInFunctionVectorValueProcessor> doubleOutLongDoubleInProcessor, Supplier<DoubleOutDoubleLongInFunctionVectorValueProcessor> doubleOutDoubleLongInProcessor, Supplier<DoubleOutDoublesInFunctionVectorValueProcessor> doubleOutDoublesInProcessor) {<NEW_LINE>assert !ExpressionProcessing.useStrictBooleans();<NEW_LINE>final ExpressionType leftType = left.getOutputType(inspector);<NEW_LINE>final ExpressionType rightType = right.getOutputType(inspector);<NEW_LINE>ExprVectorProcessor<?> processor = null;<NEW_LINE>if (Types.is(leftType, ExprType.STRING)) {<NEW_LINE>if (Types.isNullOr(rightType, ExprType.STRING)) {<NEW_LINE>processor = longOutStringsInFunctionVectorProcessor.get();<NEW_LINE>} else {<NEW_LINE>processor = doubleOutDoublesInProcessor.get();<NEW_LINE>}<NEW_LINE>} else if (leftType == null) {<NEW_LINE>if (Types.isNullOr(rightType, ExprType.STRING)) {<NEW_LINE>processor = longOutStringsInFunctionVectorProcessor.get();<NEW_LINE>}<NEW_LINE>} else if (leftType.is(ExprType.DOUBLE) || Types.is(rightType, ExprType.DOUBLE)) {<NEW_LINE>processor = doubleOutDoublesInProcessor.get();<NEW_LINE>}<NEW_LINE>if (processor != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// fall through to normal math processor logic<NEW_LINE>return VectorMathProcessors.makeMathProcessor(inspector, left, right, longOutLongsInProcessor, doubleOutLongDoubleInProcessor, doubleOutDoubleLongInProcessor, doubleOutDoublesInProcessor);<NEW_LINE>}
return (ExprVectorProcessor<T>) processor;
911,155
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String gatewayName, String connectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (gatewayName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (connectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
869,644
void circuitBreakerOpenAndThenClose() {<NEW_LINE>CircuitBreakerConfig config = CircuitBreakerConfig.custom().slidingWindowType(SlidingWindowType.COUNT_BASED).slidingWindowSize(10).failureRateThreshold(25.0f).waitDurationInOpenState(Duration.ofSeconds(10)).permittedNumberOfCallsInHalfOpenState(4).build();<NEW_LINE>CircuitBreakerRegistry registry = CircuitBreakerRegistry.of(config);<NEW_LINE>CircuitBreaker circuitBreaker = registry.circuitBreaker("flightSearchService");<NEW_LINE>circuitBreaker.getEventPublisher().onCallNotPermitted(e -> {<NEW_LINE>System.out.println(e.toString());<NEW_LINE>// just to simulate lag so the circuitbreaker can change state<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException interruptedException) {<NEW_LINE>interruptedException.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>circuitBreaker.getEventPublisher().onError(e -> System.out.println(e.toString()));<NEW_LINE>circuitBreaker.getEventPublisher().onStateTransition(e -> System.out.println<MASK><NEW_LINE>FlightSearchService service = new FlightSearchService();<NEW_LINE>SearchRequest request = new SearchRequest("NYC", "LAX", "12/31/2020");<NEW_LINE>service.setPotentialFailure(new SucceedXTimesFailYTimesAndThenSucceed(4, 4));<NEW_LINE>Supplier<List<Flight>> flightsSupplier = circuitBreaker.decorateSupplier(() -> service.searchFlights(request));<NEW_LINE>for (int i = 0; i < 50; i++) {<NEW_LINE>try {<NEW_LINE>System.out.println(flightsSupplier.get());<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(e.toString()));
1,683,718
public void updateGlobalAdditionalProps() {<NEW_LINE>additionalProperties.put(X_HAS_UNKNOWN_MIME_TYPES, !unknownMimeTypes.isEmpty());<NEW_LINE>Collections.sort(unknownMimeTypes, new Comparator<Map<String, String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Map<String, String> o1, Map<String, String> o2) {<NEW_LINE>return o1.get(MEDIA_TYPE).compareTo(o2.get(MEDIA_TYPE));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>additionalProperties.put(VENDOR_EXTENSION_X_UNKNOWN_MIME_TYPES, unknownMimeTypes);<NEW_LINE>ArrayList<Map<String, Object>> params = new ArrayList<>(uniqueParamNameTypes.values());<NEW_LINE>Collections.sort(params, new Comparator<Map<String, Object>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Map<String, Object> o1, Map<String, Object> o2) {<NEW_LINE>return ((String) o1.get(VENDOR_EXTENSION_X_PARAM_NAME_TYPE)).compareTo((String<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>additionalProperties.put(X_ALL_UNIQUE_PARAMS, params);<NEW_LINE>}
) o2.get(VENDOR_EXTENSION_X_PARAM_NAME_TYPE));
845,602
protected TensorFunction<Reference> lazyGetFunction() {<NEW_LINE>if (!allInputFunctionsPresent(1))<NEW_LINE>return null;<NEW_LINE>IntermediateOperation input = inputs.get(0);<NEW_LINE>OrderedTensorType inputType = input.type().get();<NEW_LINE>String inputFunctionName = input.rankingExpressionFunctionName();<NEW_LINE>List<com.yahoo.tensor.functions.Slice.DimensionValue<Reference>> dimensionValues = new ArrayList<>();<NEW_LINE>for (int i = 0; i < inputType.rank(); ++i) {<NEW_LINE>String inputDimensionName = inputType.dimensions().<MASK><NEW_LINE>ExpressionNode reference = new ReferenceNode(inputDimensionName);<NEW_LINE>ExpressionNode offset = new ArithmeticNode(reference, ArithmeticOperator.PLUS, new ConstantNode(new DoubleValue(i == axis ? start : 0)));<NEW_LINE>dimensionValues.add(new com.yahoo.tensor.functions.Slice.DimensionValue<>(Optional.of(inputDimensionName), wrapScalar(new EmbracedNode(offset))));<NEW_LINE>}<NEW_LINE>TensorFunction<Reference> inputIndices = new TensorFunctionNode.ExpressionTensorFunction(new ReferenceNode(inputFunctionName));<NEW_LINE>com.yahoo.tensor.functions.Slice<Reference> sliceIndices = new com.yahoo.tensor.functions.Slice<>(inputIndices, dimensionValues);<NEW_LINE>ExpressionNode sliceExpression = new TensorFunctionNode(sliceIndices);<NEW_LINE>TensorFunction<Reference> generate = Generate.bound(type.type(), wrapScalar(sliceExpression));<NEW_LINE>return generate;<NEW_LINE>}
get(i).name();
163,310
private MHRMovement createMovementForCostCollector(int partnerId, MPPCostCollector costCollector) {<NEW_LINE>// get the concept that should store the labor<NEW_LINE>MHRConcept concept = MHRConcept.getByValue(getCtx(), CONCEPT_PP_COST_COLLECTOR_LABOR, costCollector.get_TrxName());<NEW_LINE>// get the attribute for specific concept<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>StringBuffer whereClause = new StringBuffer();<NEW_LINE>whereClause.append("? >= ValidFrom AND ( ? <= ValidTo OR ValidTo IS NULL)");<NEW_LINE>params.add(dateFrom);<NEW_LINE>params.add(dateTo);<NEW_LINE>if (payrollId > 0) {<NEW_LINE>whereClause.append(" AND (HR_Payroll_ID=? OR HR_Payroll_ID IS NULL)");<NEW_LINE>params.add(payrollId);<NEW_LINE>}<NEW_LINE>if (departmentId > 0) {<NEW_LINE>whereClause.append(" AND (HR_Department_ID=? OR HR_Payroll_ID IS NULL)");<NEW_LINE>params.add(departmentId);<NEW_LINE>}<NEW_LINE>if (jobId > 0) {<NEW_LINE>whereClause.append(" AND (HR_Job_ID=? OR HR_Job_ID IS NULL)");<NEW_LINE>params.add(jobId);<NEW_LINE>}<NEW_LINE>whereClause.append(" AND HR_Concept_ID = ? ");<NEW_LINE>params.add(concept.get_ID());<NEW_LINE>whereClause.append(" AND EXISTS (SELECT 1 FROM HR_Concept conc WHERE conc.HR_Concept_ID = HR_Attribute.HR_Concept_ID )");<NEW_LINE>MHRAttribute attribute = new Query(getCtx(), MHRAttribute.Table_Name, whereClause.toString(), get_TrxName()).setParameters(params).setOnlyActiveRecords(true).setOrderBy(MHRAttribute.COLUMNNAME_ValidFrom + " DESC").first();<NEW_LINE>if (attribute == null) {<NEW_LINE>// TODO ?? is necessary<NEW_LINE>throw new AdempiereException();<NEW_LINE>}<NEW_LINE>if (MHRConcept.TYPE_RuleEngine.equals(concept.getType())) {<NEW_LINE>Object result;<NEW_LINE>scriptCtx.put("_CostCollector", costCollector);<NEW_LINE>try {<NEW_LINE>result = executeScript(concept, attribute.getAD_Rule_ID(), attribute.getColumnType());<NEW_LINE>} finally {<NEW_LINE>scriptCtx.remove("_CostCollector");<NEW_LINE>}<NEW_LINE>// get employee<NEW_LINE>MHREmployee employee = MHREmployee.getActiveEmployee(getCtx(), partnerId, get_TrxName());<NEW_LINE>// create movement<NEW_LINE>MHRMovement movement = new MHRMovement(this, concept);<NEW_LINE>movement.<MASK><NEW_LINE>movement.setC_BPartner_ID(partnerId);<NEW_LINE>movement.setDescription(attribute.getDescription());<NEW_LINE>movement.setReferenceNo(attribute.getReferenceNo());<NEW_LINE>movement.setC_BP_Relation_ID(attribute.getC_BP_Relation_ID());<NEW_LINE>movement.setAD_Rule_ID(attribute.getAD_Rule_ID());<NEW_LINE>movement.setValidFrom(dateFrom);<NEW_LINE>movement.setValidTo(dateTo);<NEW_LINE>movement.setPP_Cost_Collector_ID(costCollector.getPP_Cost_Collector_ID());<NEW_LINE>movement.setIsManual(true);<NEW_LINE>movement.setColumnValue(result);<NEW_LINE>movement.setProcessed(true);<NEW_LINE>int bpGroupId = DB.getSQLValue(get_TrxName(), "SELECT C_BP_Group_ID FROM C_BPartner WHERE C_BPartner_ID=?", this.partnerId);<NEW_LINE>movement.setC_BP_Group_ID(bpGroupId);<NEW_LINE>movement.setEmployee(employee);<NEW_LINE>movement.saveEx();<NEW_LINE>return movement;<NEW_LINE>} else {<NEW_LINE>// TODO ?? is necessary<NEW_LINE>throw new AdempiereException();<NEW_LINE>}<NEW_LINE>}
setHR_Attribute_ID(attribute.getHR_Attribute_ID());
1,164,983
public Mono<? extends Connection> acquire(TransportConfig config, ConnectionObserver observer, @Nullable Supplier<? extends SocketAddress> remoteAddress, @Nullable AddressResolverGroup<?> resolverGroup) {<NEW_LINE>return Mono.create(sink -> {<NEW_LINE>SocketAddress remote = null;<NEW_LINE>if (remoteAddress != null) {<NEW_LINE>remote = Objects.requireNonNull(remoteAddress.get(), "Remote Address supplier returned null");<NEW_LINE>}<NEW_LINE>ConnectionObserver connectionObserver = new NewConnectionObserver(sink, observer);<NEW_LINE>DisposableConnect disposableConnect = new DisposableConnect(sink, config.bindAddress());<NEW_LINE>if (remote != null && resolverGroup != null) {<NEW_LINE>ChannelInitializer<Channel> channelInitializer = config.channelInitializer(connectionObserver, remote, false);<NEW_LINE>ContextContainer container = ContextContainer<MASK><NEW_LINE>container.captureContext(Context.of(sink.contextView()));<NEW_LINE>TransportConnector.connect(config, remote, resolverGroup, channelInitializer, container).subscribe(disposableConnect);<NEW_LINE>} else {<NEW_LINE>Objects.requireNonNull(config.bindAddress(), "bindAddress");<NEW_LINE>SocketAddress local = Objects.requireNonNull(config.bindAddress().get(), "Bind Address supplier returned null");<NEW_LINE>if (local instanceof InetSocketAddress) {<NEW_LINE>InetSocketAddress localInet = (InetSocketAddress) local;<NEW_LINE>if (localInet.isUnresolved()) {<NEW_LINE>local = AddressUtils.createResolved(localInet.getHostName(), localInet.getPort());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ChannelInitializer<Channel> channelInitializer = config.channelInitializer(connectionObserver, null, true);<NEW_LINE>TransportConnector.bind(config, channelInitializer, local, local instanceof DomainSocketAddress).subscribe(disposableConnect);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.create().captureThreadLocalValues();
1,283,231
final TestMetricFilterResult executeTestMetricFilter(TestMetricFilterRequest testMetricFilterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testMetricFilterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestMetricFilterRequest> request = null;<NEW_LINE>Response<TestMetricFilterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TestMetricFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(testMetricFilterRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestMetricFilter");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TestMetricFilterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TestMetricFilterResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudWatch Logs");
662,325
public void execute(JobExecutionContext context) throws JobExecutionException {<NEW_LINE>logger.debug("Starting job to publish a scheduled event");<NEW_LINE>JobDetail jobDetail = context.getJobDetail();<NEW_LINE>JobDataMap jobData = jobDetail.getJobDataMap();<NEW_LINE>try {<NEW_LINE>SchedulerContext schedulerContext = context<MASK><NEW_LINE>EventJobDataBinder jobDataBinder = (EventJobDataBinder) schedulerContext.get(EVENT_JOB_DATA_BINDER_KEY);<NEW_LINE>Object event = jobDataBinder.fromJobData(jobData);<NEW_LINE>EventMessage<?> eventMessage = createMessage(event);<NEW_LINE>EventBus eventBus = (EventBus) context.getScheduler().getContext().get(EVENT_BUS_KEY);<NEW_LINE>TransactionManager txManager = (TransactionManager) context.getScheduler().getContext().get(TRANSACTION_MANAGER_KEY);<NEW_LINE>UnitOfWork<EventMessage<?>> unitOfWork = DefaultUnitOfWork.startAndGet(null);<NEW_LINE>if (txManager != null) {<NEW_LINE>unitOfWork.attachTransaction(txManager);<NEW_LINE>}<NEW_LINE>unitOfWork.execute(() -> eventBus.publish(eventMessage));<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Job successfully executed. Scheduled Event [{}] has been published.", eventMessage.getPayloadType().getSimpleName());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Exception occurred while publishing scheduled event [{}]", jobDetail.getDescription(), e);<NEW_LINE>throw new JobExecutionException(e);<NEW_LINE>}<NEW_LINE>}
.getScheduler().getContext();
1,308,409
public void marshall(Service service, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (service == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(service.getReferenceId(), REFERENCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getNames(), NAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getRoot(), ROOT_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(service.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getEdges(), EDGES_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getSummaryStatistics(), SUMMARYSTATISTICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getDurationHistogram(), DURATIONHISTOGRAM_BINDING);<NEW_LINE>protocolMarshaller.marshall(service.getResponseTimeHistogram(), RESPONSETIMEHISTOGRAM_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
service.getStartTime(), STARTTIME_BINDING);
86,819
public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new InfraSelectIndexChoiceJoin(true));<NEW_LINE>execs.add(new InfraSelectIndexChoiceJoin(false));<NEW_LINE>execs.add(new InfraSelectIndexChoice(true));<NEW_LINE>execs.<MASK><NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArray(true));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArray(false));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArrayTwoField(true));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArrayTwoField(false));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArrayCompositeArray(true));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArrayCompositeArray(false));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArrayCompositeTwoArray(true));<NEW_LINE>execs.add(new InfraSelectIndexMultikeyWArrayCompositeTwoArray(false));<NEW_LINE>return execs;<NEW_LINE>}
add(new InfraSelectIndexChoice(false));
897,419
final ListCollectorsResult executeListCollectors(ListCollectorsRequest listCollectorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listCollectorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListCollectorsRequest> request = null;<NEW_LINE>Response<ListCollectorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListCollectorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCollectorsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MigrationHubStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListCollectors");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListCollectorsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCollectorsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
571,931
private ProcessBuilder createServerCommand() {<NEW_LINE>final List<String> command = new ArrayList<>();<NEW_LINE>command.add(Platform.getJavaPath());<NEW_LINE>if (Preferences.getBoolean("run.options.memory")) {<NEW_LINE>command.add("-Xms" + Preferences.get("run.options.memory.initial") + "m");<NEW_LINE>command.add("-Xmx" + Preferences.get("run.options.memory.maximum") + "m");<NEW_LINE>}<NEW_LINE>if (Platform.isMacOS()) {<NEW_LINE>// Suppress dock icon.<NEW_LINE>command.add("-Dapple.awt.UIElement=true");<NEW_LINE>command.add("-Xdock:name=Processing");<NEW_LINE>}<NEW_LINE>// Attempt to address https://github.com/jdf/Processing.py-Bugs/issues/158<NEW_LINE>command.add("-Dpython.console.encoding=UTF-8");<NEW_LINE>if (PythonMode.VERBOSE) {<NEW_LINE>command.add("-Dverbose=true");<NEW_LINE>}<NEW_LINE>command.add("-Djava.library.path=" + System.getProperty("java.library.path") + File.pathSeparator + mode.getContentFile<MASK><NEW_LINE>final List<String> cp = new ArrayList<>();<NEW_LINE>cp.addAll(filter(Arrays.asList(System.getProperty("java.class.path").split(Pattern.quote(File.pathSeparator))), not(or(containsPattern("(ant|ant-launcher|antlr|netbeans.*|osgi.*|jdi.*|ibm\\.icu.*|jna)\\.jar$"), containsPattern("/processing/app/(test|lib)/")))));<NEW_LINE>for (final File jar : new File(Platform.getContentFile("core"), "library").listFiles(JARS)) {<NEW_LINE>cp.add(jar.getAbsolutePath());<NEW_LINE>}<NEW_LINE>final File[] libJars = mode.getContentFile("mode").getAbsoluteFile().listFiles(JARS);<NEW_LINE>if (libJars != null) {<NEW_LINE>for (final File jar : libJars) {<NEW_LINE>cp.add(jar.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log("No library jars found; I assume we're running in Eclipse.");<NEW_LINE>}<NEW_LINE>command.add("-cp");<NEW_LINE>command.add(Joiner.on(File.pathSeparator).join(cp));<NEW_LINE>// enable assertions<NEW_LINE>command.add("-ea");<NEW_LINE>// Run the SketchRunner main.<NEW_LINE>command.add(SketchRunner.class.getName());<NEW_LINE>// Give the runner its ID as an argument.<NEW_LINE>command.add(editor.getId());<NEW_LINE>return new ProcessBuilder(command);<NEW_LINE>}
("mode").getAbsolutePath());
997,098
private void migrateSettingsDialogSize(Element element) {<NEW_LINE>int width = 0, height = 0, x = 0, y = 0;<NEW_LINE>var node = element.getFirstChild();<NEW_LINE>if (node != null) {<NEW_LINE>config.lock(LockMode.WRITE);<NEW_LINE>try {<NEW_LINE>var result = node.getNodeValue().split(":");<NEW_LINE>if (result.length == 4) {<NEW_LINE>width = Integer<MASK><NEW_LINE>height = Integer.parseInt(result[1]);<NEW_LINE>x = Integer.parseInt(result[2]);<NEW_LINE>y = Integer.parseInt(result[3]);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>width = 0;<NEW_LINE>height = 0;<NEW_LINE>x = 0;<NEW_LINE>y = 0;<NEW_LINE>}<NEW_LINE>config.setProperty(ApplicationConfiguration.SettingsDialog.WIDTH, width);<NEW_LINE>config.setProperty(ApplicationConfiguration.SettingsDialog.HEIGHT, height);<NEW_LINE>config.setProperty(ApplicationConfiguration.SettingsDialog.X, x);<NEW_LINE>config.setProperty(ApplicationConfiguration.SettingsDialog.Y, y);<NEW_LINE>config.unlock(LockMode.WRITE);<NEW_LINE>logger.debug("migrateSettingsDialogSize");<NEW_LINE>}<NEW_LINE>}
.parseInt(result[0]);
1,110,698
public DetectedObjects processOutput(TranslatorContext ctx, NDList list) {<NEW_LINE>float[] classIds = list.get(0).toFloatArray();<NEW_LINE>float[] probabilities = list.get(1).toFloatArray();<NEW_LINE>NDArray boundingBoxes = list.get(2);<NEW_LINE>List<String> retNames = new ArrayList<>();<NEW_LINE>List<Double> retProbs = new ArrayList<>();<NEW_LINE>List<BoundingBox> retBB = new ArrayList<>();<NEW_LINE>for (int i = 0; i < classIds.length; ++i) {<NEW_LINE>int classId = (int) classIds[i];<NEW_LINE>double probability = probabilities[i];<NEW_LINE>// classId starts from 0, -1 means background<NEW_LINE>if (classId >= 0 && probability > threshold) {<NEW_LINE>if (classId >= classes.size()) {<NEW_LINE>throw new AssertionError("Unexpected index: " + classId);<NEW_LINE>}<NEW_LINE>String className = classes.get(classId);<NEW_LINE>float[] box = boundingBoxes.get(i).toFloatArray();<NEW_LINE>// rescale box coordinates by imageWidth and imageHeight<NEW_LINE>double x = imageWidth > 0 ? box[0] / imageWidth : box[0];<NEW_LINE>double y = imageHeight > 0 ? box[1] / imageHeight : box[1];<NEW_LINE>double w = imageWidth > 0 ? box[2] / imageWidth - x : box[2] - x;<NEW_LINE>double h = imageHeight > 0 ? box[3] / imageHeight - y : box[3] - y;<NEW_LINE>Rectangle rect = new Rectangle(<MASK><NEW_LINE>retNames.add(className);<NEW_LINE>retProbs.add(probability);<NEW_LINE>retBB.add(rect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DetectedObjects(retNames, retProbs, retBB);<NEW_LINE>}
x, y, w, h);
1,142,103
private void findNextUserEntry(Slice deletedKey) {<NEW_LINE>// if there are no more entries, we are done<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>do {<NEW_LINE>// Peek the next entry and parse the key<NEW_LINE>InternalKey internalKey = iterator.peek().getKey();<NEW_LINE>// skip entries created after our snapshot<NEW_LINE>if (internalKey.getSequenceNumber() > snapshot.getLastSequence()) {<NEW_LINE>iterator.next();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// if the next entry is a deletion, skip all subsequent entries for that key<NEW_LINE>if (internalKey.getValueType() == ValueType.DELETION) {<NEW_LINE>deletedKey = internalKey.getUserKey();<NEW_LINE>} else if (internalKey.getValueType() == ValueType.VALUE) {<NEW_LINE>// is this value masked by a prior deletion record?<NEW_LINE>if (deletedKey == null || userComparator.compare(internalKey.getUserKey(), deletedKey) > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iterator.next();<NEW_LINE>} <MASK><NEW_LINE>}
while (iterator.hasNext());
244,411
private void searchRepository() {<NEW_LINE>SVNRevision revision = getRevision();<NEW_LINE>final SvnSearch svnSearch;<NEW_LINE>try {<NEW_LINE>RepositoryFile[] repositoryFiles = getRepositoryFiles();<NEW_LINE>if (repositoryFiles.length > 0) {<NEW_LINE>svnSearch = new SvnSearch(repositoryFiles);<NEW_LINE>} else {<NEW_LINE>svnSearch = new SvnSearch(<MASK><NEW_LINE>}<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>Subversion.LOG.log(Level.SEVERE, null, ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final DialogDescriptor dialogDescriptor = new DialogDescriptor(svnSearch.getSearchPanel(), java.util.ResourceBundle.getBundle("org/netbeans/modules/subversion/ui/browser/Bundle").getString("CTL_RepositoryPath_SearchRevisions"));<NEW_LINE>dialogDescriptor.setModal(true);<NEW_LINE>dialogDescriptor.setHelpCtx(new HelpCtx(searchHelpID));<NEW_LINE>dialogDescriptor.setValid(false);<NEW_LINE>svnSearch.addListSelectionListener(new ListSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(ListSelectionEvent e) {<NEW_LINE>// if( ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName()) ) {<NEW_LINE>dialogDescriptor.setValid(svnSearch.getSelectedRevision() != null);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>// handle results<NEW_LINE>if (DialogDescriptor.OK_OPTION.equals(dialogDescriptor.getValue())) {<NEW_LINE>revision = svnSearch.getSelectedRevision();<NEW_LINE>if (revision != null) {<NEW_LINE>if (revision.equals(SVNRevision.HEAD)) {<NEW_LINE>// NOI18N<NEW_LINE>setRevisionTextField("");<NEW_LINE>} else {<NEW_LINE>setRevisionTextField(revision.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>svnSearch.cancel();<NEW_LINE>}<NEW_LINE>}
new RepositoryFile[] { repositoryFile });
872,761
private static void deleteOrphanedRecords() {<NEW_LINE>Log.d("Database clean: removing non-existing lists");<NEW_LINE>database.delete(dbTableCachesLists, "list_id <> " + StoredList.STANDARD_LIST_ID + " AND list_id NOT IN (SELECT _id + " + customListIdOffset + " FROM " + dbTableLists + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing caches from attributes");<NEW_LINE>database.delete(dbTableAttributes, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing caches from spoilers");<NEW_LINE>database.delete(dbTableSpoilers, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing caches from lists");<NEW_LINE>database.delete(dbTableCachesLists, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing caches from waypoints");<NEW_LINE>database.delete(dbTableWaypoints, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing caches from variables");<NEW_LINE>database.delete(dbTableVariables, <MASK><NEW_LINE>Log.d("Database clean: removing non-existing caches from trackables");<NEW_LINE>database.delete(dbTableTrackables, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing caches from logcount");<NEW_LINE>database.delete(dbTableLogCount, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>DBLogOfflineUtils.cleanOrphanedRecords(database);<NEW_LINE>Log.d("Database clean: removing non-existing caches from logs");<NEW_LINE>database.delete(dbTableLogs, "geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);<NEW_LINE>Log.d("Database clean: removing non-existing logs from logimages");<NEW_LINE>database.delete(dbTableLogImages, "log_id NOT IN (SELECT _id FROM " + dbTableLogs + ")", null);<NEW_LINE>Log.d("Database clean: remove non-existing extension values");<NEW_LINE>final DBExtensionType[] extensionValues = DBExtensionType.values();<NEW_LINE>if (extensionValues.length > 0) {<NEW_LINE>String type = "";<NEW_LINE>for (DBExtensionType id : extensionValues) {<NEW_LINE>type += (StringUtils.isNotBlank(type) ? "," : "") + id.id;<NEW_LINE>}<NEW_LINE>database.delete(dbTableExtension, "_type NOT IN (" + type + ")", null);<NEW_LINE>}<NEW_LINE>database.delete(dbTableExtension, "_type=" + DBEXTENSION_INVALID.id, null);<NEW_LINE>}
"geocode NOT IN (SELECT geocode FROM " + dbTableCaches + ")", null);
77,439
public static void stopSpan(@Advice.Argument(0) ServletRequest request, @Advice.Argument(1) ServletResponse response, @Advice.Thrown Throwable throwable, @Advice.Local("otelCallDepth") CallDepth callDepth, @Advice.Local("otelRequest") ServletRequestContext<HttpServletRequest> requestContext, @Advice.Local("otelContext") Context context, @Advice.Local("otelScope") Scope scope) {<NEW_LINE>if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (scope != null) {<NEW_LINE>scope.close();<NEW_LINE>}<NEW_LINE>boolean topLevel = callDepth.decrementAndGet() == 0;<NEW_LINE>if (context == null && topLevel) {<NEW_LINE>Context currentContext = Java8BytecodeBridge.currentContext();<NEW_LINE>// Something else is managing the context, we're in the outermost level of Servlet<NEW_LINE>// instrumentation and we have an uncaught throwable. Let's add it to the current span.<NEW_LINE>if (throwable != null) {<NEW_LINE>helper().recordException(currentContext, throwable);<NEW_LINE>}<NEW_LINE>// also capture request parameters as servlet attributes<NEW_LINE>helper().captureServletAttributes(currentContext, (HttpServletRequest) request);<NEW_LINE>}<NEW_LINE>if (scope == null || context == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int responseStatusCode = HttpServletResponse.SC_OK;<NEW_LINE>Integer responseStatus = VirtualField.find(ServletResponse.class, Integer<MASK><NEW_LINE>if (responseStatus != null) {<NEW_LINE>responseStatusCode = responseStatus;<NEW_LINE>}<NEW_LINE>helper().end(context, requestContext, (HttpServletResponse) response, responseStatusCode, throwable);<NEW_LINE>}
.class).get(response);
1,353,792
final UploadDocumentsResult executeUploadDocuments(UploadDocumentsRequest uploadDocumentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(uploadDocumentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UploadDocumentsRequest> request = null;<NEW_LINE>Response<UploadDocumentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UploadDocumentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(uploadDocumentsRequest));<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, "CloudSearch Domain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UploadDocuments");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>request.addHandlerContext(HandlerContextKey.HAS_STREAMING_INPUT, Boolean.TRUE);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UploadDocumentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UploadDocumentsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,809,111
final DBClusterSnapshotAttributesResult executeModifyDBClusterSnapshotAttribute(ModifyDBClusterSnapshotAttributeRequest modifyDBClusterSnapshotAttributeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBClusterSnapshotAttributeRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBClusterSnapshotAttributeRequest> request = null;<NEW_LINE>Response<DBClusterSnapshotAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyDBClusterSnapshotAttributeRequestMarshaller().marshall(super.beforeMarshalling(modifyDBClusterSnapshotAttributeRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBClusterSnapshotAttribute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBClusterSnapshotAttributesResult> responseHandler = new StaxResponseHandler<DBClusterSnapshotAttributesResult>(new DBClusterSnapshotAttributesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
719,846
public Object run() {<NEW_LINE>FontManagerNativeLibrary.load();<NEW_LINE>// JNI throws an exception if a class/method/field is not found,<NEW_LINE>// so there's no need to do anything explicit here.<NEW_LINE>initIDs();<NEW_LINE>switch(StrikeCache.nativeAddressSize) {<NEW_LINE>case 8:<NEW_LINE>longAddresses = true;<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>longAddresses = false;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unexpected address size");<NEW_LINE>}<NEW_LINE>noType1Font = "true".equals(System.getProperty("sun.java2d.noType1Font"));<NEW_LINE>jreLibDirName = System.getProperty("java.home", <MASK><NEW_LINE>jreFontDirName = jreLibDirName + File.separator + "fonts";<NEW_LINE>File lucidaFile = new File(jreFontDirName + File.separator + FontUtilities.LUCIDA_FILE_NAME);<NEW_LINE>maxSoftRefCnt = Integer.getInteger("sun.java2d.font.maxSoftRefs", 10);<NEW_LINE>return null;<NEW_LINE>}
"") + File.separator + "lib";
1,658,323
public void testEnvObjFldAnnInjection() throws Exception {<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifString", E_STRING, ifString);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifCharacter", E_CHAR, ifCharacter);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifByte", E_BYTE, ifByte);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifShort", E_SHORT, ifShort);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifInteger", E_INTEGER, ifInteger);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifLong", E_LONG, ifLong);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifBoolean", E_BOOL, ifBoolean);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(CLASS_NAME, "ifDouble", E_DOUBLE, ifDouble);<NEW_LINE>EnvAnnObjTestHelper.testEnvAnnObjInjection(<MASK><NEW_LINE>}
CLASS_NAME, "ifFloat", E_FLOAT, ifFloat);
1,569,124
public void mouseMoved(MouseEvent m) {<NEW_LINE>lastPos = toRelativePoint(m);<NEW_LINE>boolean shiftPressed = (m.getModifiersEx(<MASK><NEW_LINE>boolean ctrlPressed = (m.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0;<NEW_LINE>boolean altPressed = (m.getModifiersEx() & InputEvent.ALT_DOWN_MASK) != 0;<NEW_LINE>List<Control> allControls = controller.getDrawing().getControls();<NEW_LINE>allControls.forEach(control -> {<NEW_LINE>boolean within = control.isWithin(lastPos);<NEW_LINE>boolean alreadyHovered = hoveredControls.contains(control);<NEW_LINE>if (!within && alreadyHovered) {<NEW_LINE>hoveredControls.remove(control);<NEW_LINE>control.onEvent(new MouseEntityEvent(control, EventType.MOUSE_OUT, lastPos, lastPos, shiftPressed, ctrlPressed, altPressed));<NEW_LINE>} else if (within && !alreadyHovered) {<NEW_LINE>hoveredControls.add(control);<NEW_LINE>control.onEvent(new MouseEntityEvent(control, EventType.MOUSE_IN, lastPos, lastPos, shiftPressed, ctrlPressed, altPressed));<NEW_LINE>control.getHoverCursor().ifPresent(controller::setCursor);<NEW_LINE>} else {<NEW_LINE>control.onEvent(new MouseEntityEvent(control, EventType.MOUSE_MOVED, lastPos, lastPos, shiftPressed, ctrlPressed, altPressed));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateCursor();<NEW_LINE>}
) & InputEvent.SHIFT_DOWN_MASK) != 0;
22,599
protected Map<String, Object> create() throws TOTorrentException {<NEW_LINE>Map<String, Map> file_tree = new TreeMap<>();<NEW_LINE>if (root.isFile()) {<NEW_LINE>processFile(root, file_tree, "");<NEW_LINE>} else {<NEW_LINE>processDirectory(root, file_tree, "");<NEW_LINE>}<NEW_LINE>if (total_file_size == 0) {<NEW_LINE>throw (new TOTorrentException("V2: No files processed", TOTorrentException.RT_ZERO_LENGTH));<NEW_LINE>}<NEW_LINE>// System.out.println( file_tree );<NEW_LINE>Map<String, Object> info = new HashMap<>();<NEW_LINE>info.put(TOTorrentImpl.TK_NAME, root.getName());<NEW_LINE>info.put(TOTorrentImpl.TK_NAME_UTF8, root.getName());<NEW_LINE>info.put(TOTorrentImpl.TK_V2_META_VERSION, 2);<NEW_LINE>info.put(TOTorrentImpl.TK_PIECE_LENGTH, piece_size);<NEW_LINE>info.put(TOTorrentImpl.TK_V2_FILE_TREE, file_tree);<NEW_LINE>Map<String, Object> torrent = new HashMap<>();<NEW_LINE>torrent.put(TOTorrentImpl.TK_INFO, info);<NEW_LINE>ByteEncodedKeyHashMap<String, byte[]> pl_map = new ByteEncodedKeyHashMap<>();<NEW_LINE>for (byte[] key : piece_layers.keys()) {<NEW_LINE>pl_map.put(new String(key, Constants.BYTE_ENCODING_CHARSET)<MASK><NEW_LINE>}<NEW_LINE>torrent.put(TOTorrentImpl.TK_V2_PIECE_LAYERS, pl_map);<NEW_LINE>return (torrent);<NEW_LINE>}
, piece_layers.get(key));
883,084
private Mono<PagedResponse<ContainerServiceInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-07-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)).<PagedResponse<ContainerServiceInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
531,451
public void onClick(View v) {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>OsmandApplication app = (OsmandApplication) activity.getApplication();<NEW_LINE>RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>final String trackName = new SimpleDateFormat("yyyy-MM-dd_HH-mm_EEE", Locale.US).format(new Date());<NEW_LINE>final GPXUtilities.GPXFile gpx = routingHelper.generateGPXFileWithRoute(trackName);<NEW_LINE>final Uri fileUri = AndroidUtils.getUriForFile(app, <MASK><NEW_LINE>File dir = new File(app.getCacheDir(), "share");<NEW_LINE>if (!dir.exists()) {<NEW_LINE>dir.mkdir();<NEW_LINE>}<NEW_LINE>File dst = new File(dir, "route.gpx");<NEW_LINE>try {<NEW_LINE>FileWriter fw = new FileWriter(dst);<NEW_LINE>GPXUtilities.writeGpx(fw, gpx, null);<NEW_LINE>fw.close();<NEW_LINE>final Intent sendIntent = new Intent();<NEW_LINE>sendIntent.setAction(Intent.ACTION_SEND);<NEW_LINE>sendIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(generateHtml(routingHelper.getRouteDirections(), routingHelper.getGeneralRouteInformation()).toString()));<NEW_LINE>sendIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_route_subject));<NEW_LINE>sendIntent.putExtra(Intent.EXTRA_STREAM, fileUri);<NEW_LINE>sendIntent.putExtra(Intent.EXTRA_STREAM, AndroidUtils.getUriForFile(app, dst));<NEW_LINE>sendIntent.setType("text/plain");<NEW_LINE>sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>AndroidUtils.startActivityIfSafe(activity, sendIntent);<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new File(gpx.path));
763,712
boolean checkIndex(final long index, final long position) {<NEW_LINE>try {<NEW_LINE>final long seq1 = queue.rollCycle().toSequenceNumber(index + 1) - 1;<NEW_LINE>final long seq2 = store.sequenceForPosition(this, position, true);<NEW_LINE>if (seq1 != seq2) {<NEW_LINE>final long seq3 = store.indexing.linearScanByPosition(wireForIndex(), position, 0, 0, true);<NEW_LINE>Jvm.error().on(getClass(), "Thread=" + Thread.currentThread().getName() + " pos: " + position + " seq1: " + Long.toHexString(seq1) + " seq2: " + Long.toHexString(seq2) + " seq3: " + Long.toHexString(seq3));<NEW_LINE>// System.out.println(store.dump());<NEW_LINE>assert seq1 == seq3 <MASK><NEW_LINE>assert seq1 == seq2 : "seq1=" + seq1 + ", seq2=" + seq2;<NEW_LINE>}<NEW_LINE>} catch (@NotNull EOFException | UnrecoverableTimeoutException | StreamCorruptedException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
: "seq1=" + seq1 + ", seq3=" + seq3;
725,609
private static void addClickFunctions(final View base, final SlidingUpPanelLayout slidingPanel, final View clickingArea, final ContentType.Type type, final Activity contextActivity, final CommentUrlObject submission) {<NEW_LINE>base.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>if (slidingPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {<NEW_LINE>slidingPanel.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);<NEW_LINE>} else {<NEW_LINE>if (type == ContentType.Type.IMAGE) {<NEW_LINE>if (SettingValues.image) {<NEW_LINE>Intent myIntent = new Intent(contextActivity, MediaView.class);<NEW_LINE>String url = submission.getUrl();<NEW_LINE>myIntent.putExtra(MediaView.<MASK><NEW_LINE>myIntent.putExtra(MediaView.EXTRA_URL, url);<NEW_LINE>myIntent.putExtra(MediaView.SUBREDDIT, submission.getSubredditName());<NEW_LINE>// May be a bug with downloading multiple comment albums off the same submission<NEW_LINE>myIntent.putExtra(EXTRA_SUBMISSION_TITLE, submission.comment.getComment().getSubmissionTitle());<NEW_LINE>myIntent.putExtra(MediaView.EXTRA_SHARE_URL, submission.getUrl());<NEW_LINE>contextActivity.startActivity(myIntent);<NEW_LINE>} else {<NEW_LINE>LinkUtil.openExternally(submission.getUrl());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
EXTRA_DISPLAY_URL, submission.getUrl());
1,085,098
public static HashStreamRanges createActiveRanges(GetActiveRangesResponse response) {<NEW_LINE>TreeMap<Long, RangeProperties> ranges = Maps.newTreeMap();<NEW_LINE>long lastEndKey = Long.MIN_VALUE;<NEW_LINE>for (RelatedRanges rr : response.getRangesList()) {<NEW_LINE>RangeProperties range = rr.getProps();<NEW_LINE>long startKey = range.getStartHashKey();<NEW_LINE>long endKey = range.getEndHashKey();<NEW_LINE>checkState(lastEndKey == startKey, "Invalid range key found : expected = %s, actual = %s", lastEndKey, startKey);<NEW_LINE>ranges.put(startKey, range);<NEW_LINE>lastEndKey = endKey;<NEW_LINE>}<NEW_LINE>checkState(Long.MAX_VALUE == lastEndKey, "Missing key range [%s - %s)", lastEndKey, Long.MAX_VALUE);<NEW_LINE>checkState(ranges.<MASK><NEW_LINE>return HashStreamRanges.ofHash(RangeKeyType.HASH, ranges);<NEW_LINE>}
size() > 0, "No active range found");
320,832
public static FetchSourceContext parseFromRestRequest(RestRequest request) {<NEW_LINE>Boolean fetchSource = null;<NEW_LINE>String[] sourceExcludes = null;<NEW_LINE>String[] sourceIncludes = null;<NEW_LINE>String <MASK><NEW_LINE>if (source != null) {<NEW_LINE>if (Booleans.isTrue(source)) {<NEW_LINE>fetchSource = true;<NEW_LINE>} else if (Booleans.isFalse(source)) {<NEW_LINE>fetchSource = false;<NEW_LINE>} else {<NEW_LINE>sourceIncludes = Strings.splitStringByCommaToArray(source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String sIncludes = request.param("_source_includes");<NEW_LINE>String sInclude = request.param("_source_include");<NEW_LINE>if (sInclude != null) {<NEW_LINE>DEPRECATION_LOGGER.deprecated("Deprecated parameter [_source_include] used, expected [_source_includes] instead");<NEW_LINE>sIncludes = sInclude;<NEW_LINE>}<NEW_LINE>if (sIncludes != null) {<NEW_LINE>sourceIncludes = Strings.splitStringByCommaToArray(sIncludes);<NEW_LINE>}<NEW_LINE>String sExcludes = request.param("_source_excludes");<NEW_LINE>String sExclude = request.param("_source_exclude");<NEW_LINE>if (sExclude != null) {<NEW_LINE>DEPRECATION_LOGGER.deprecated("Deprecated parameter [_source_exclude] used, expected [_source_excludes] instead");<NEW_LINE>sExcludes = sExclude;<NEW_LINE>}<NEW_LINE>if (sExcludes != null) {<NEW_LINE>sourceExcludes = Strings.splitStringByCommaToArray(sExcludes);<NEW_LINE>}<NEW_LINE>if (fetchSource != null || sourceIncludes != null || sourceExcludes != null) {<NEW_LINE>return new FetchSourceContext(fetchSource == null ? true : fetchSource, sourceIncludes, sourceExcludes);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
source = request.param("_source");
778,002
public Pack downloadHeapDump(Pack param, DataInputX in, DataOutputX out) {<NEW_LINE>int buff = 2 * 1024 * 1024;<NEW_LINE>File downloadFile = new File(folderName + "/" + ((MapPack) param).getText("fileName"));<NEW_LINE>try {<NEW_LINE>RandomAccessFile raf = new RandomAccessFile(downloadFile, "r");<NEW_LINE>byte[] buffer = new byte[buff];<NEW_LINE>int read = 0;<NEW_LINE>long offset = downloadFile.length();<NEW_LINE>int unitsize;<NEW_LINE>while (read < offset) {<NEW_LINE>unitsize = (int) (((offset - read) >= buff) ? buff : (offset - read));<NEW_LINE>raf.<MASK><NEW_LINE>out.writeByte(TcpFlag.HasNEXT);<NEW_LINE>out.writeBlob(buffer, 0, unitsize);<NEW_LINE>read += unitsize;<NEW_LINE>}<NEW_LINE>raf.close();<NEW_LINE>return null;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
read(buffer, 0, unitsize);
37,272
protected KeycloakUriBuilder parseHierarchicalUri(String uriTemplate, Matcher match) {<NEW_LINE>boolean scheme = match.group(2) != null;<NEW_LINE>if (scheme)<NEW_LINE>this.scheme = match.group(2);<NEW_LINE>String authority = match.group(4);<NEW_LINE>if (authority != null) {<NEW_LINE>this.authority = null;<NEW_LINE>String host = match.group(4);<NEW_LINE>int at = host.indexOf('@');<NEW_LINE>if (at > -1) {<NEW_LINE>String user = host.substring(0, at);<NEW_LINE>host = host.substring(at + 1);<NEW_LINE>this.userInfo = user;<NEW_LINE>}<NEW_LINE>Matcher hostPortMatch = hostPortPattern.matcher(host);<NEW_LINE>if (hostPortMatch.matches()) {<NEW_LINE>this.<MASK><NEW_LINE>try {<NEW_LINE>this.port = Integer.parseInt(hostPortMatch.group(2));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgumentException("Illegal uri template: " + uriTemplate, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.host = host;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match.group(5) != null) {<NEW_LINE>String group = match.group(5);<NEW_LINE>if (!scheme && !"".equals(group) && !group.startsWith("/") && group.indexOf(':') > -1)<NEW_LINE>throw new IllegalArgumentException("Illegal uri template: " + uriTemplate);<NEW_LINE>if (!"".equals(group))<NEW_LINE>replacePath(group);<NEW_LINE>}<NEW_LINE>if (match.group(7) != null)<NEW_LINE>replaceQuery(match.group(7));<NEW_LINE>if (match.group(9) != null)<NEW_LINE>fragment(match.group(9));<NEW_LINE>return this;<NEW_LINE>}
host = hostPortMatch.group(1);
596,364
public void write(org.apache.thrift.protocol.TProtocol prot, chop_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = <MASK><NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetLock()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetExtent()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 4);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetLock()) {<NEW_LINE>oprot.writeString(struct.lock);<NEW_LINE>}<NEW_LINE>if (struct.isSetExtent()) {<NEW_LINE>struct.extent.write(oprot);<NEW_LINE>}<NEW_LINE>}
new java.util.BitSet();
197,561
private void loadNode1150() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.OpenFileMode_EnumValues, new QualifiedName(0, "EnumValues"), new LocalizedText("en", "EnumValues"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.EnumValueType, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.OpenFileMode_EnumValues, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpenFileMode_EnumValues, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpenFileMode_EnumValues, Identifiers.HasProperty, Identifiers.OpenFileMode<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=7616</Identifier> </TypeId><Body><EnumValueType><Value>1</Value><DisplayName><Locale> </Locale><Text>Read</Text> </DisplayName> </EnumValueType> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=7616</Identifier> </TypeId><Body><EnumValueType><Value>2</Value><DisplayName><Locale> </Locale><Text>Write</Text> </DisplayName> </EnumValueType> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=7616</Identifier> </TypeId><Body><EnumValueType><Value>4</Value><DisplayName><Locale> </Locale><Text>EraseExisting</Text> </DisplayName> </EnumValueType> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=7616</Identifier> </TypeId><Body><EnumValueType><Value>8</Value><DisplayName><Locale> </Locale><Text>Append</Text> </DisplayName> </EnumValueType> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), false));
45,125
final PutMetricStreamResult executePutMetricStream(PutMetricStreamRequest putMetricStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putMetricStreamRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutMetricStreamRequest> request = null;<NEW_LINE>Response<PutMetricStreamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutMetricStreamRequestMarshaller().marshall(super.beforeMarshalling(putMetricStreamRequest));<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, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutMetricStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<PutMetricStreamResult> responseHandler = new StaxResponseHandler<PutMetricStreamResult>(new PutMetricStreamResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,150,398
private <T> void validateClass(Class<T> entityClass) {<NEW_LINE>if (entityClass.isAnonymousClass() || entityClass.isLocalClass()) {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>if (!ClassUtils.isAnnotationPresent(entityClass, REntity.class)) {<NEW_LINE>throw new IllegalArgumentException("REntity annotation is missing from class type declaration.");<NEW_LINE>}<NEW_LINE>FieldList<FieldDescription.InDefinedShape> fields = Introspectior.getFieldsWithAnnotation(entityClass, RIndex.class);<NEW_LINE>fields = fields.filter(ElementMatchers.fieldType(ElementMatchers.hasSuperType(ElementMatchers.anyOf(Map.class, Collection.class, RObject.class))));<NEW_LINE>for (InDefinedShape field : fields) {<NEW_LINE>throw new IllegalArgumentException("RIndex annotation couldn't be defined for field '" + field.getName() + "' with type '" + field.getType() + "'");<NEW_LINE>}<NEW_LINE>FieldList<FieldDescription.InDefinedShape> fieldsWithRIdAnnotation = Introspectior.getFieldsWithAnnotation(entityClass, RId.class);<NEW_LINE>if (fieldsWithRIdAnnotation.size() == 0) {<NEW_LINE>throw new IllegalArgumentException("RId annotation is missing from class field declaration.");<NEW_LINE>}<NEW_LINE>if (fieldsWithRIdAnnotation.size() > 1) {<NEW_LINE>throw new IllegalArgumentException("Only one field with RId annotation is allowed in class field declaration.");<NEW_LINE>}<NEW_LINE>FieldDescription.InDefinedShape idFieldDescription = fieldsWithRIdAnnotation.getOnly();<NEW_LINE>String idFieldName = idFieldDescription.getName();<NEW_LINE>Field idField = null;<NEW_LINE>try {<NEW_LINE>idField = ClassUtils.getDeclaredField(entityClass, idFieldName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>if (ClassUtils.isAnnotationPresent(idField.getType(), REntity.class)) {<NEW_LINE>throw new IllegalArgumentException("Field with RId annotation cannot be a type of which class is annotated with REntity.");<NEW_LINE>}<NEW_LINE>if (idField.getType().isAssignableFrom(RObject.class)) {<NEW_LINE>throw new IllegalArgumentException("Field with RId annotation cannot be a type of RObject");<NEW_LINE>}<NEW_LINE>}
entityClass.getName() + " is not publically accessable.");
779,010
public static void renderOnTileEntity(SmartTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) {<NEW_LINE>if (te == null || te.isRemoved())<NEW_LINE>return;<NEW_LINE>Entity cameraEntity = Minecraft.getInstance().cameraEntity;<NEW_LINE>float max = AllConfigs.CLIENT.filterItemRenderDistance.getF();<NEW_LINE>if (!te.isVirtual() && cameraEntity != null && cameraEntity.position().distanceToSqr(VecHelper.getCenterOf(te.getBlockPos())) > (max * max))<NEW_LINE>return;<NEW_LINE>LinkBehaviour behaviour = <MASK><NEW_LINE>if (behaviour == null)<NEW_LINE>return;<NEW_LINE>for (boolean first : Iterate.trueAndFalse) {<NEW_LINE>ValueBoxTransform transform = first ? behaviour.firstSlot : behaviour.secondSlot;<NEW_LINE>ItemStack stack = first ? behaviour.frequencyFirst.getStack() : behaviour.frequencyLast.getStack();<NEW_LINE>ms.pushPose();<NEW_LINE>transform.transform(te.getBlockState(), ms);<NEW_LINE>ValueBoxRenderer.renderItemIntoValueBox(stack, ms, buffer, light, overlay);<NEW_LINE>ms.popPose();<NEW_LINE>}<NEW_LINE>}
te.getBehaviour(LinkBehaviour.TYPE);
777,680
protected void paint(@Nonnull Graphics2D g2, int x, int y, int shift) {<NEW_LINE>g2.setColor(BG_COLOR);<NEW_LINE>Path2D.Double path = new Path2D.Double();<NEW_LINE>int height = JBUI.scale(HEIGHT);<NEW_LINE>float incline = height / 2.0f;<NEW_LINE>float length = JBUI.scale(WIDTH) / 2.0f;<NEW_LINE>float start = length / 2.0f;<NEW_LINE>path.moveTo(x + shift + start, y + height);<NEW_LINE>path.lineTo(x + shift + start + incline, y);<NEW_LINE>path.lineTo(x + shift + <MASK><NEW_LINE>path.lineTo(x + shift + start + length, y + height);<NEW_LINE>path.lineTo(x + shift + start, y + height);<NEW_LINE>path.closePath();<NEW_LINE>g2.fill(new Area(path));<NEW_LINE>}
start + incline + length, y);
1,516,234
private PriorityProperty<?> createPriorityProperty(Field field, String prefix, Map<String, Object> parameters) {<NEW_LINE>String[] keys = collectPropertyKeys(field, prefix, parameters);<NEW_LINE>Class<?> fieldCls = field.getType();<NEW_LINE>switch(fieldCls.getName()) {<NEW_LINE>case "int":<NEW_LINE>return createIntProperty(field, keys, 0);<NEW_LINE>case "java.lang.Integer":<NEW_LINE>return createIntProperty(field, keys, null);<NEW_LINE>case "long":<NEW_LINE>return createLongProperty(field, keys, 0L);<NEW_LINE>case "java.lang.Long":<NEW_LINE>return <MASK><NEW_LINE>case "java.lang.String":<NEW_LINE>return createStringProperty(field, keys);<NEW_LINE>case "float":<NEW_LINE>return createFloatProperty(field, keys, 0f);<NEW_LINE>case "java.lang.Float":<NEW_LINE>return createFloatProperty(field, keys, null);<NEW_LINE>case "double":<NEW_LINE>return createDoubleProperty(field, keys, 0.0);<NEW_LINE>case "java.lang.Double":<NEW_LINE>return createDoubleProperty(field, keys, null);<NEW_LINE>case "boolean":<NEW_LINE>return createBooleanProperty(field, keys, false);<NEW_LINE>case "java.lang.Boolean":<NEW_LINE>return createBooleanProperty(field, keys, null);<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("not support, field=" + field);<NEW_LINE>}
createLongProperty(field, keys, null);
634,954
public Pair<List<? extends Pod>, Integer> searchForPods(final ListPodsByCmd cmd) {<NEW_LINE>final String podName = cmd.getPodName();<NEW_LINE>final Long id = cmd.getId();<NEW_LINE>Long zoneId = cmd.getZoneId();<NEW_LINE>final Object keyword = cmd.getKeyword();<NEW_LINE>final Object allocationState = cmd.getAllocationState();<NEW_LINE>zoneId = _accountMgr.checkAccessAndSpecifyAuthority(CallContext.current().getCallingAccount(), zoneId);<NEW_LINE>final Filter searchFilter = new Filter(HostPodVO.class, "dataCenterId", true, cmd.getStartIndex(), cmd.getPageSizeVal());<NEW_LINE>final SearchBuilder<HostPodVO> sb = _hostPodDao.createSearchBuilder();<NEW_LINE>sb.and("id", sb.entity().getId(<MASK><NEW_LINE>sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ);<NEW_LINE>sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ);<NEW_LINE>sb.and("allocationState", sb.entity().getAllocationState(), SearchCriteria.Op.EQ);<NEW_LINE>final SearchCriteria<HostPodVO> sc = sb.create();<NEW_LINE>if (keyword != null) {<NEW_LINE>final SearchCriteria<HostPodVO> ssc = _hostPodDao.createSearchCriteria();<NEW_LINE>ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");<NEW_LINE>ssc.addOr("description", SearchCriteria.Op.LIKE, "%" + keyword + "%");<NEW_LINE>sc.addAnd("name", SearchCriteria.Op.SC, ssc);<NEW_LINE>}<NEW_LINE>if (id != null) {<NEW_LINE>sc.setParameters("id", id);<NEW_LINE>}<NEW_LINE>if (podName != null) {<NEW_LINE>sc.setParameters("name", podName);<NEW_LINE>}<NEW_LINE>if (zoneId != null) {<NEW_LINE>sc.setParameters("dataCenterId", zoneId);<NEW_LINE>}<NEW_LINE>if (allocationState != null) {<NEW_LINE>sc.setParameters("allocationState", allocationState);<NEW_LINE>}<NEW_LINE>final Pair<List<HostPodVO>, Integer> result = _hostPodDao.searchAndCount(sc, searchFilter);<NEW_LINE>return new Pair<List<? extends Pod>, Integer>(result.first(), result.second());<NEW_LINE>}
), SearchCriteria.Op.EQ);
1,411,453
final GetClusterCredentialsResult executeGetClusterCredentials(GetClusterCredentialsRequest getClusterCredentialsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getClusterCredentialsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetClusterCredentialsRequest> request = null;<NEW_LINE>Response<GetClusterCredentialsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetClusterCredentialsRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetClusterCredentials");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetClusterCredentialsResult> responseHandler = new StaxResponseHandler<GetClusterCredentialsResult>(new GetClusterCredentialsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getClusterCredentialsRequest));