auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void pushdown(TopNKeyOperator topNKey) throws SemanticException { final Operator<? extends OperatorDesc> parent = topNKey.getParentOperators().get(0); switch (parent.getType()) { case SELECT: pushdownThroughSelect(topNKey); break; case FORWARD: moveDown(topNKey); pushdown(topNKey); break; case GROUPBY: pushdownThroughGroupBy(topNKey); break; case REDUCESINK: pushdownThroughReduceSink(topNKey); break; case MERGEJOIN: case JOIN: { final CommonJoinOperator<? extends JoinDesc> join = (CommonJoinOperator<? extends JoinDesc>) parent; final JoinCondDesc[] joinConds = join.getConf().getConds(); final JoinCondDesc firstJoinCond = joinConds[0]; for (JoinCondDesc joinCond : joinConds) { if (!firstJoinCond.equals(joinCond)) { return; } } switch (firstJoinCond.getType()) { case JoinDesc.FULL_OUTER_JOIN: pushdownThroughFullOuterJoin(topNKey); break; case JoinDesc.LEFT_OUTER_JOIN: pushdownThroughLeftOuterJoin(topNKey); break; case JoinDesc.RIGHT_OUTER_JOIN: pushdownThroughRightOuterJoin(topNKey); break; case JoinDesc.INNER_JOIN: pushdownThroughInnerJoin(topNKey); break; } } break; case TOPNKEY: if (hasSameTopNKeyDesc(parent, topNKey.getConf())) { parent.removeChildAndAdoptItsChildren(topNKey); } break; } }

Target:
private void pushdown(TopNKeyOperator topNKey) throws SemanticException { final Operator<? extends OperatorDesc> parent = topNKey.getParentOperators().get(0); switch (parent.getType()) { case SELECT: pushdownThroughSelect(topNKey); break; case FORWARD: moveDown(topNKey); pushdown(topNKey); break; case GROUPBY: pushdownThroughGroupBy(topNKey); break; case REDUCESINK: pushdownThroughReduceSink(topNKey); break; case MERGEJOIN: case JOIN: { final CommonJoinOperator<? extends JoinDesc> join = (CommonJoinOperator<? extends JoinDesc>) parent; final JoinCondDesc[] joinConds = join.getConf().getConds(); final JoinCondDesc firstJoinCond = joinConds[0]; for (JoinCondDesc joinCond : joinConds) { if (!firstJoinCond.equals(joinCond)) { return; } } switch (firstJoinCond.getType()) { case JoinDesc.FULL_OUTER_JOIN: pushdownThroughFullOuterJoin(topNKey); break; case JoinDesc.LEFT_OUTER_JOIN: pushdownThroughLeftOuterJoin(topNKey); break; case JoinDesc.RIGHT_OUTER_JOIN: pushdownThroughRightOuterJoin(topNKey); break; default: break; } } break; case TOPNKEY: if (hasSameTopNKeyDesc(parent, topNKey.getConf())) { parent.removeChildAndAdoptItsChildren(topNKey); } break; default: break; } }
Source:
public void changeElementOpacity(String selector, int value) { driver.findElement(By.cssSelector(selector)); js.executeScript( "document.querySelector(arguments[0]).style.opacity = arguments[1];", selector, value); }

Target:
public void changeElementOpacity(String selector, int value) { js.executeScript( "document.querySelector(arguments[0]).style.opacity = arguments[1];", selector, value); }
Source:
public void reset(LogPartition partition) { ChronicleLogTailer<M> tailer = tailers.stream().filter(t -> t.assignments().contains(partition)).findFirst().orElse(null); if (tailer == null) { throw new IllegalArgumentException(String.format("Cannot reset, partition: %s not found on tailer assignments: %s", partition, logPartitions)); } }

Target:
public void reset(LogPartition partition) { ChronicleLogTailer<M> tailer = tailers.stream() .filter(t -> t.assignments().contains(partition)) .findFirst() .orElseThrow(() -> new IllegalArgumentException(String.format( "Cannot reset, partition: %s not found on tailer assignments: %s", partition, logPartitions))); tailer.reset(); }
Source:
private void monitorAndForwardSplits( SourceContext<TimestampedHiveInputSplit> context) throws IOException, TException { assert (Thread.holdsLock(checkpointLock)); List<Partition> partitions = client.listPartitionsByFilter( tablePath.getDatabaseName(), tablePath.getObjectName(), strategy.generateFetchFilter(partitionKeys, currentReadTime), (short) -1); if (partitions.isEmpty()) { return; } long maxTime = Long.MIN_VALUE; for (Partition partition : partitions) { List<String> partSpec = partition.getValues(); if (!this.distinctPartitions.contains(partSpec)) { this.distinctPartitions.add(partition.getValues()); long time = this.strategy.extractPartTime(partitionKeys, partition.getValues()); if (time > maxTime) { maxTime = time; } HiveTableInputSplit[] splits = HiveTableInputFormat.createInputSplits( this.readerParallelism, Collections.singletonList(toHiveTablePartition(partition)), this.conf.conf()); for (HiveTableInputSplit split : splits) { context.collect(new TimestampedHiveInputSplit(time, split)); } } } this.currentReadTime = maxTime; this.distinctPartitions.removeIf(partSpec -> this.strategy.canExpireForDistinct( this.strategy.extractPartTime(partitionKeys, partSpec), this.currentReadTime)); }

Target:
private void monitorAndForwardSplits( SourceContext<TimestampedHiveInputSplit> context) throws Exception { assert (Thread.holdsLock(checkpointLock)); List<Tuple2<Partition, Long>> partitions = fetcher.fetchPartitions(this.context, currentReadTime); if (partitions.isEmpty()) { return; } partitions.sort((o1, o2) -> (int) (o1.f1 - o2.f1)); long maxTimestamp = Long.MIN_VALUE; Set<List<String>> nextDistinctParts = new HashSet<>(); for (Tuple2<Partition, Long> tuple2 : partitions) { Partition partition = tuple2.f0; List<String> partSpec = partition.getValues(); if (!this.distinctPartitions.contains(partSpec)) { this.distinctPartitions.add(partSpec); long timestamp = tuple2.f1; if (timestamp > currentReadTime) { nextDistinctParts.add(partSpec); } if (timestamp > maxTimestamp) { maxTimestamp = timestamp; } HiveTableInputSplit[] splits = HiveTableInputFormat.createInputSplits( this.readerParallelism, Collections.singletonList(toHiveTablePartition(partition)), this.conf.conf()); for (HiveTableInputSplit split : splits) { context.collect(new TimestampedHiveInputSplit(timestamp, split)); } } } if (maxTimestamp > currentReadTime) { currentReadTime = maxTimestamp; distinctPartitions.clear(); distinctPartitions.addAll(nextDistinctParts); } }
Source:
public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { nextStatement.evaluate(); } catch (Throwable e) { errors.add(e); } IAfterTest after = null; log.debug("Run after test extensions for test class " + testClass.getJavaClass().getName()); for (IAfterTest each : afters) { try { after = each; if (after.hasToRun()){ log.debug("Run method runAfterTest() of class " + after.getClass().getCanonicalName()); after.runAfterTest(config, target, frameworkMethod); } } catch (Throwable e) { log.error("Run method runAfterTest() of class " + after.getClass().getCanonicalName() + " failed", e); if (isScreenshotRequired(e)) { createScreenshot("AfterTestExt", after.getClass()); } errors.add(e); } } MultipleFailureException.assertEmpty(errors); }

Target:
public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { nextStatement.evaluate(); } catch (Throwable e) { errors.add(e); } IAfterTest after = null; log.debug("Run after test extensions for test class " + testClass.getJavaClass().getName()); for (IAfterTest each : afters) { try { after = each; if (after.hasToRun()){ log.debug("Run method runAfterTest() of class " + after.getClass().getCanonicalName()); after.runAfterTest(config, target, frameworkMethod); } } catch (Throwable e) { if(ScreenshotCapturer.shouldCaptureScreenshotOnException(e)){ log.error("Run method runAfterTest() of class " + after.getClass().getCanonicalName() + " failed", e); createScreenshot("AfterTestExt", after.getClass()); } errors.add(e); } } MultipleFailureException.assertEmpty(errors); }
Source:
public void testImportDump() throws OWLOntologyCreationException, IOException { String journalPath = "/tmp/journal.jrnl"; String sourceModelPath = "src/test/resources/dummy-noctua-model.ttl"; String targetModelPath = "/tmp/http:/model.geneontology.org/0000000300000001.ttl"; File journalFile = new File(journalPath); File targetModelFile = new File(journalPath); FileUtils.deleteQuietly(journalFile); FileUtils.deleteQuietly(targetModelFile); final ParserWrapper pw1 = new ParserWrapper(); pw1.addIRIMapper(new CatalogXmlIRIMapper(new File("src/test/resources/mmg/catalog-v001.xml"))); OWLGraphWrapper g = pw1.parseToOWLGraph(getResourceIRIString("mmg/basic-tbox-importer.omn")); BlazegraphMolecularModelManager m3 = new BlazegraphMolecularModelManager<>(g, "go", journalPath, "/tmp"); try { m3.importModelToDatabase(new File(sourceModelPath)); m3.dumpAllStoredModels(); Model sourceModel = ModelFactory.createDefaultModel() ; Model targetModel = ModelFactory.createDefaultModel() ; sourceModel.read(sourceModelPath); targetModel.read(targetModelPath); if (compareModels(sourceModel, targetModel) != true) fail("Missing statements in target model."); if (compareModels(targetModel, sourceModel) != true) fail("Sprious statements in target model."); } catch (Exception e) { e.printStackTrace(); fail(); } }

Target:
public void testImportDump() throws OWLOntologyCreationException, IOException, RepositoryException, RDFParseException, RDFHandlerException, OWLOntologyStorageException { String journalPath = folder.newFile().getAbsolutePath(); String tempRootPath = folder.getRoot().getAbsolutePath(); String sourceModelPath = "src/test/resources/dummy-noctua-model.ttl"; final ParserWrapper pw1 = new ParserWrapper(); pw1.addIRIMapper(new CatalogXmlIRIMapper(new File("src/test/resources/mmg/catalog-v001.xml"))); OWLGraphWrapper g = pw1.parseToOWLGraph(getResourceIRIString("mmg/basic-tbox-importer.omn")); BlazegraphMolecularModelManager<Void> m3 = new BlazegraphMolecularModelManager<>(g, "http:/model.geneontology.org/", journalPath, tempRootPath); m3.importModelToDatabase(new File(sourceModelPath)); for (IRI modelId : m3.getStoredModelIds()) m3.dumpStoredModel(modelId, folder.getRoot()); Model sourceModel = ModelFactory.createDefaultModel(); sourceModel.read(sourceModelPath); Model targetModel = ModelFactory.createDefaultModel(); for (IRI modelId : m3.getStoredModelIds()) targetModel.read(tempRootPath + File.separator + modelId + ".ttl"); if (sourceModel.isIsomorphicWith(targetModel) != true) fail("Source graphs and target graphs are not isomorphic."); }
Source:
private String[] getSparkHomeConf() { String sparkHome = null; String sparkConf = null; String jobSparkVer = getJobProps().get(SparkJobArg.SPARK_VERSION.azPropName); if (jobSparkVer != null) { sparkHome = getSysProps().get("spark." + jobSparkVer + ".home"); if (sparkHome != null) { sparkConf = getSysProps().get("spark." + jobSparkVer + ".conf"); if (sparkConf == null) { sparkConf = sparkHome + "/conf"; } info("Using job specific spark: " + sparkHome + " and conf: " + sparkConf); getJobProps().put("env." + SPARK_HOME_ENV_VAR, sparkHome); getJobProps().put("env." + SPARK_CONF_DIR_ENV_VAR, sparkConf); } } if (sparkHome == null) { sparkHome = getSysProps().get("spark.home"); if (sparkHome == null) { sparkHome = System.getenv(SPARK_HOME_ENV_VAR); } sparkConf = (System.getenv(SPARK_CONF_DIR_ENV_VAR) != null) ? System.getenv(SPARK_CONF_DIR_ENV_VAR) : (sparkHome + "/conf"); info("Using system default spark: " + sparkHome + " and conf: " + sparkConf); } if (sparkHome == null) { throw new RuntimeException("SPARK is not available on the azkaban machine."); } return new String[]{sparkHome, sparkConf}; }

Target:
private String[] getSparkHomeConf() { String sparkHome = null; String sparkConf = null; String jobSparkVer = getJobProps().get(SparkJobArg.SPARK_VERSION.azPropName); if (jobSparkVer != null) { info("This job set spark version: " + jobSparkVer); sparkHome = getSysProps().get("spark." + jobSparkVer + ".home"); if (sparkHome != null) { sparkConf = getSysProps().get("spark." + jobSparkVer + ".conf"); if (sparkConf == null) { sparkConf = sparkHome + "/conf"; } info("Using job specific spark: " + sparkHome + " and conf: " + sparkConf); getJobProps().put("env." + SPARK_HOME_ENV_VAR, sparkHome); getJobProps().put("env." + SPARK_CONF_DIR_ENV_VAR, sparkConf); } else { info("The spark version " + jobSparkVer +" is not supported. Using system default."); } } if (sparkHome == null) { sparkHome = getSysProps().get("spark.home"); if (sparkHome == null) { sparkHome = System.getenv(SPARK_HOME_ENV_VAR); } sparkConf = (System.getenv(SPARK_CONF_DIR_ENV_VAR) != null) ? System.getenv(SPARK_CONF_DIR_ENV_VAR) : (sparkHome + "/conf"); info("Using system default spark: " + sparkHome + " and conf: " + sparkConf); } if (sparkHome == null) { throw new RuntimeException("SPARK is not available on the azkaban machine."); } else { File homeDir = new File(sparkHome); if (!homeDir.exists()) { throw new RuntimeException("SPARK home dir does not exist."); } File confDir = new File(sparkConf); if (!confDir.exists()) { error("SPARK conf dir does not exist. Will use SPARK_HOME/conf as default."); } } return new String[]{sparkHome, sparkConf}; }
Source:
private boolean isObjectInInnerClass(VariableTree variableTree) { if (nestedClassesLevel > 1) { if (variableTree.type().is(Tree.Kind.IDENTIFIER)) { return !"String".equals(((IdentifierTree) variableTree.type()).name()); } else { ExpressionTree initializer = variableTree.initializer(); return !(variableTree.type().is(Tree.Kind.PRIMITIVE_TYPE) && initializer != null && ConstantUtils.resolveAsConstant(initializer) != null); } } return false; }

Target:
private boolean isObjectInInnerClass(VariableTree variableTree) { if (nestedClassesLevel > 1) { ExpressionTree initializer = variableTree.initializer(); return !((variableTree.type().is(Tree.Kind.PRIMITIVE_TYPE) || variableTree.symbol().type().is("java.lang.String")) && initializer != null && ConstantUtils.resolveAsConstant(initializer) != null); } return false; }
Source:
public MessageFormatSend(MessageReadSet readSet, MessageFormatFlags flag, MessageFormatMetrics metrics) throws IOException, MessageFormatException { this.readSet = readSet; this.flag = flag; totalSizeToWrite = 0; this.metrics = metrics; calculateOffsets(); sizeWritten = 0; currentWriteIndex = 0; sizeWrittenFromCurrentIndex = 0; }

Target:
public MessageFormatSend(MessageReadSet readSet, MessageFormatFlags flag, MessageFormatMetrics metrics) throws IOException, MessageFormatException { this.readSet = readSet; this.flag = flag; totalSizeToWrite = 0; long startTime = SystemTime.getInstance().milliseconds(); calculateOffsets(); metrics.calculateOffsetMessageFormatSendTime.update(SystemTime.getInstance().milliseconds() - startTime); sizeWritten = 0; currentWriteIndex = 0; sizeWrittenFromCurrentIndex = 0; }
Source:
public Set<Message> getAllMessages() { List<Message> allMessages = null; LinkedHashSet<Message> allOrderedMessages = null; if (useCache) { if (allMessagesCache != null) { allMessages = Lists.newArrayList(allMessagesCache); } allOrderedMessages = allOrderedMessagesCache; } if (allOrderedMessages == null) { if (allMessages == null) { allMessages = Lists.newArrayList(); for (Edge edge : Iterables.filter(Iterables.filter(getNotationDiagram().getEdges(), Edge.class), Message.notationPredicate())) { Option<Message> message = ISequenceElementAccessor.getMessage(edge); assert message.some() : INTERNAL_ERROR; allMessages.add(message.get()); } if (useCache) { allMessagesCache = Lists.newArrayList(allMessages); } } Collections.sort(allMessages, RangeHelper.lowerBoundOrdering().onResultOf(ISequenceEvent.VERTICAL_RANGE)); allOrderedMessages = Sets.newLinkedHashSet(allMessages); if (useCache) { allOrderedMessagesCache = allOrderedMessages; } } return allOrderedMessages; }

Target:
public Set<Message> getAllMessages() { List<Message> allMessages = null; LinkedHashSet<Message> allOrderedMessages = null; if (useCache) { if (allMessagesCache != null) { allMessages = Lists.newArrayList(allMessagesCache); } allOrderedMessages = allOrderedMessagesCache; } if (allOrderedMessages == null) { if (allMessages == null) { allMessages = Lists.newArrayList(); for (Edge edge : Iterables.filter(Iterables.filter(getNotationDiagram().getEdges(), Edge.class), Message.notationPredicate())) { Option<Message> message = ISequenceElementAccessor.getMessage(edge); assert message.some() : INTERNAL_ERROR; allMessages.add(message.get()); } if (useCache) { allMessagesCache = allMessages; } } Collections.sort(allMessages, RangeHelper.lowerBoundOrdering().onResultOf(ISequenceEvent.VERTICAL_RANGE)); allOrderedMessages = Sets.newLinkedHashSet(allMessages); if (useCache) { allOrderedMessagesCache = allOrderedMessages; } } return allOrderedMessages; }
Source:
public void remove(KeyCacheObject key, @Nullable CacheDataRow prevRow) throws IgniteCheckedException { if (!qryProcEnabled && !QueryUtils.isEnabled(cctx.config())) return; if (!enterBusy()) return; try { if (isIndexingSpiEnabled()) { Object key0 = unwrapIfNeeded(key, cctx.cacheObjectContext()); cctx.kernalContext().indexing().remove(cacheName, key0); } if (qryProcEnabled && prevRow != null) qryProc.remove(cctx, prevRow); } finally { invalidateResultCache(); leaveBusy(); } }

Target:
public void remove(KeyCacheObject key, @Nullable CacheDataRow prevRow) throws IgniteCheckedException { if (!qryProcEnabled) return; if (!enterBusy()) return; try { if (isIndexingSpiEnabled()) { Object key0 = unwrapIfNeeded(key, cctx.cacheObjectContext()); cctx.kernalContext().indexing().remove(cacheName, key0); } if (qryProcEnabled && prevRow != null) qryProc.remove(cctx, prevRow); } finally { invalidateResultCache(); leaveBusy(); } }
Source:
static String handleId(String id) { if (id == null) return null; boolean isAlphanumericLowCase = true; boolean isAlphanumeric = true; for (int i = 0; i < id.length(); i++) { char c = id.charAt(i); if (c >= 65 && c <= 90) { isAlphanumericLowCase = false; } else { if (!( (c >= 48 && c <= 57) || (c == 95) || (c >= 97 && c <= 122) )) { isAlphanumeric = false; isAlphanumericLowCase = false; break; } } } if (isAlphanumericLowCase) { return id; } if (isAlphanumeric) { return id.toLowerCase(); } return ParseUtils.unDoubleQuote(id); }

Target:
static String handleId(String id) { if (id == null) return null; boolean isAlphanumericLowCase = true; boolean isAlphanumeric = true; for (int i = 0; i < id.length(); i++) { char c = id.charAt(i); if (c >= 65 && c <= 90) { isAlphanumericLowCase = false; } else if (!( (c >= 48 && c <= 57) || (c == 95) || (c >= 97 && c <= 122) )) { isAlphanumeric = false; isAlphanumericLowCase = false; break; } } if (isAlphanumericLowCase) { return id; } if (isAlphanumeric) { return id.toLowerCase(); } return ParseUtils.unDoubleQuote(id); }
Source:
public String toString() { StringBuilder result = new StringBuilder(); result.append('[').append(currentPage).append(',').append(totalPages) .append(',').append(totalItems).append(',').append(firstIndex) .append(',').append(lastIndex).append(',').append(pageSize) .append(']'); return result.toString(); }

Target:
public String toString() { return new StringBuilder().append('[').append(currentPage).append(',') .append(totalPages).append(',').append(totalItems).append(',') .append(firstIndex).append(',').append(lastIndex).append(',') .append(pageSize).append(']').toString(); }
Source:
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Project context) { List<StandardUsernamePasswordCredentials> creds = lookupCredentials(StandardUsernamePasswordCredentials.class, context, ACL.SYSTEM, HTTP_SCHEME, HTTPS_SCHEME); return new StandardUsernameListBoxModel().withAll(creds); }

Target:
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Project context) { if (context == null && !Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER) || context != null && !context.hasPermission(context.EXTENDED_READ) && !context.hasPermission(CredentialsProvider.USE_ITEM)) { return new StandardUsernameListBoxModel(); } List<StandardUsernamePasswordCredentials> creds = lookupCredentials(StandardUsernamePasswordCredentials.class, context, ACL.SYSTEM, HTTP_SCHEME, HTTPS_SCHEME); return new StandardUsernameListBoxModel().withAll(creds); }
Source:
private Response specSuspendOrResume(final String id, boolean suspend) { return asLeaderWithSupervisorManager( manager -> { if (manager.suspendOrResumeSupervisor(id, suspend)) { Optional<SupervisorSpec> spec = manager.getSupervisorSpec(id); return Response.ok(spec.get()).build(); } else { Optional<SupervisorSpec> spec = manager.getSupervisorSpec(id); final Response.Status status = spec.isPresent() ? Response.Status.BAD_REQUEST : Response.Status.NOT_FOUND; final String errMsg = spec.isPresent() ? StringUtils.format( "[%s] is already %s", id, suspend ? "suspended" : "running" ) : StringUtils.format("[%s] does not exist", id); return Response.status(status) .entity(ImmutableMap.of("error", errMsg)) .build(); } } ); }

Target:
private Response specSuspendOrResume(final String id, boolean suspend) { return asLeaderWithSupervisorManager( manager -> { if (manager.suspendOrResumeSupervisor(id, suspend)) { Optional<SupervisorSpec> spec = manager.getSupervisorSpec(id); return Response.ok(spec.get()).build(); } else { Optional<SupervisorSpec> spec = manager.getSupervisorSpec(id); Response.Status status; String errMsg; if (spec.isPresent()) { status = Response.Status.BAD_REQUEST; errMsg = StringUtils.format("[%s] is already %s", id, suspend ? "suspended" : "running"); } else { status = Response.Status.NOT_FOUND; errMsg = StringUtils.format("[%s] does not exist", id); } return Response.status(status) .entity(ImmutableMap.of("error", errMsg)) .build(); } } ); }
Source:
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(CONFIGURE); String proposedName = Util.fixEmptyAndTrim(req.getSubmittedForm().getString("name")); Jenkins.checkGoodName(proposedName); Node node = getNode(); if (node == null) { throw new ServletException("No such node " + nodeName); } if ((!proposedName.equals(nodeName)) && Jenkins.getInstance().getNode(proposedName) != null) { throw new Failure(Messages.ComputerSet_SlaveAlreadyExists(proposedName)); } Node result = node.reconfigure(req, req.getSubmittedForm()); replaceBy(result); rsp.sendRedirect2("../" + result.getNodeName() + '/'); }

Target:
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(CONFIGURE); String proposedName = Util.fixEmptyAndTrim(req.getSubmittedForm().getString("name")); Jenkins.checkGoodName(proposedName); Node node = getNode(); if (node == null) { throw new ServletException("No such node " + nodeName); } if ((!proposedName.equals(nodeName)) && Jenkins.getActiveInstance().getNode(proposedName) != null) { throw new FormException(Messages.ComputerSet_SlaveAlreadyExists(proposedName), "name"); } Node result = node.reconfigure(req, req.getSubmittedForm()); replaceBy(result); rsp.sendRedirect2("../" + result.getNodeName() + '/'); }
Source:
public void OnFinishSelected() { FragmentManager mgr = getSupportFragmentManager(); final Transaction transaction = new Transaction(); transaction.setUser((User) User.getCurrentUser()); AmountInputFragment amountFragment = (AmountInputFragment) mgr .findFragmentByTag(AmountInputFragment.class.getName()); transaction.setAmount(Double.parseDouble(amountFragment.getAmountSelected())); transaction.setName(getString(R.string.label_goal_payment)); transaction.setGoal(goal); transaction.setTransactionDate(new Date()); transaction.setType(TransactionType.CREDIT); transaction.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { if (e == null) { Toast.makeText(AddGoalPaymentActivity.this, "Done savign txn", Toast.LENGTH_LONG).show(); Intent txnData = new Intent(); txnData.putExtra(Transaction.NAME_KEY, transaction); setResult(RESULT_OK, txnData); setResult(RESULT_OK, txnData); finish(); } else { Log.e("goal", e.getLocalizedMessage(), e); Toast.makeText(AddGoalPaymentActivity.this, R.string.parse_error_saving, Toast.LENGTH_SHORT).show(); } } }); }

Target:
public void OnFinishSelected() { FragmentManager mgr = getSupportFragmentManager(); Category txnCategory = ParseObject.createWithoutData(Category.class, "93BaEoZPfo"); final Transaction transaction = new Transaction(); transaction.setUser((User) User.getCurrentUser()); AmountInputFragment amountFragment = (AmountInputFragment) mgr .findFragmentByTag(AmountInputFragment.class.getName()); transaction.setAmount(Double.parseDouble(amountFragment.getAmountSelected())); transaction.setName(getString(R.string.label_goal_payment)); transaction.setGoal(goal); transaction.setTransactionDate(new Date()); transaction.setType(TransactionType.CREDIT); transaction.setCategory(txnCategory); transaction.pinInBackground(ParseUtils.PIN_CALLBACK); Intent txnData = new Intent(); txnData.putExtra(Transaction.NAME_KEY, transaction.getObjectId()); setResult(RESULT_OK, txnData); finish(); }
Source:
void onRequest(Exchange exchange, SpanCustomizer span) { span.name(spanName); span.tag("camel.client.endpoint.url", url); span.tag("camel.client.exchange.id", exchange.getExchangeId()); span.tag("camel.client.exchange.pattern", exchange.getPattern().name()); if (eventNotifier.isIncludeMessageBody() || eventNotifier.isIncludeMessageBodyStreams()) { boolean streams = eventNotifier.isIncludeMessageBodyStreams(); StreamCache cache = prepareBodyForLogging(exchange, streams); String body = MessageHelper.extractBodyForLogging(exchange.getMessage(), "", streams, streams); span.tag("camel.client.exchange.message.request.body", body); if (cache != null) { cache.reset(); } } Object clientTagsObj = exchange.getProperty("camel.custom.tags"); if (clientTagsObj != null) { Map<String, String> clientTags = (Map)clientTagsObj; if (clientTags != null && !clientTags.isEmpty()) { for (Map.Entry<String, String> tag: clientTags.entrySet()) { span.tag("custom." + tag.getKey(), tag.getValue()); } } } }

Target:
void onRequest(Exchange exchange, SpanCustomizer span) { span.name(spanName); span.tag("camel.client.endpoint.url", url); span.tag("camel.client.exchange.id", exchange.getExchangeId()); span.tag("camel.client.exchange.pattern", exchange.getPattern().name()); if (eventNotifier.isIncludeMessageBody() || eventNotifier.isIncludeMessageBodyStreams()) { boolean streams = eventNotifier.isIncludeMessageBodyStreams(); StreamCache cache = prepareBodyForLogging(exchange, streams); String body = MessageHelper.extractBodyForLogging(exchange.getMessage(), "", streams, streams); span.tag("camel.client.exchange.message.request.body", body); if (cache != null) { cache.reset(); } } Map<String, String> customTags = exchange.getProperty("camel.client.customtags", Map.class); if (customTags != null && !customTags.isEmpty()) { for (Map.Entry<String, String> tag : customTags.entrySet()) { span.tag("custom." + tag.getKey(), tag.getValue()); } } }
Source:
public void start(Stage primaryStage) throws Exception { ready.addListener(event -> { Platform.runLater(() -> { stage = primaryStage; stage.setTitle(DNAINATOR); stage.getIcons().add(new Image(getClass().getResourceAsStream(ICON))); stage.setMinWidth(MIN_WIDTH); stage.setMinHeight(MIN_HEIGHT); stage.setMaximized(true); notifyPreloader(new Preloader.ProgressNotification(1)); try { BorderPane rootLayout = FXMLLoader.load(getClass().getResource(FXML)); stage.setScene(new Scene(rootLayout)); stage.show(); } catch (IOException e) { e.printStackTrace(); } }); }); }

Target:
public void start(Stage primaryStage) throws Exception { ready.addListener(event -> { Platform.runLater(() -> { primaryStage.setTitle(DNAINATOR); primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(ICON))); primaryStage.setMinWidth(MIN_WIDTH); primaryStage.setMinHeight(MIN_HEIGHT); notifyPreloader(new Preloader.ProgressNotification(1)); try { BorderPane rootLayout = FXMLLoader.load(getClass().getResource(FXML)); Scene scene = new Scene(rootLayout, getScreenWidth(), getScreenHeight()); primaryStage.setScene(scene); primaryStage.show(); } catch (IOException e) { e.printStackTrace(); } }); }); }
Source:
protected void configure() { install(new CacheModule() { @Override protected void configure() { cache(PROJECT_DOC_RESOURCES, ResourceKey.class, Resource.class) .maximumWeight(2 << 20) .weigher(ResourceWeigher.class); } }); }

Target:
protected void configure() { cache(PROJECT_DOC_RESOURCES, ResourceKey.class, Resource.class) .maximumWeight(2 << 20) .weigher(ResourceWeigher.class); }
Source:
public void theResponseDeviceIsInactiveShouldBeGiven(final String arg1) throws Throwable { this.notOkRequestRunner(PROPERTIES_MAP, TEST_CASE_NAME_REQUEST, TEST_CASE_XML, TEST_SUITE_XML, LOGGER); assertTrue(this.response.indexOf(arg1) > 0); }

Target:
public void theResponseDeviceIsInactiveShouldBeGiven(final String arg1) throws Throwable { assertTrue(this.runXpathResult.assertXpath(this.response, PATH_REQUEST_RESPONSE, arg1)); }
Source:
@VisibleForTesting String getGitDescribe(@NotNull Repository repository) throws MojoExecutionException { try { DescribeResult describeResult = DescribeCommand .on(repository) .withMojo(mojo) .apply(super.gitDescribe) .call(); return describeResult.toString(); } catch (GitAPIException ex) { ex.printStackTrace(); throw new MojoExecutionException("Unable to obtain git.commit.id.describe information", ex); } }

Target:
@VisibleForTesting String getGitDescribe(@NotNull Repository repository) throws GitCommitIdExecutionException { try { DescribeResult describeResult = DescribeCommand .on(repository, log) .apply(super.gitDescribe) .call(); return describeResult.toString(); } catch (GitAPIException ex) { ex.printStackTrace(); throw new GitCommitIdExecutionException("Unable to obtain git.commit.id.describe information", ex); } }
Source:
public void readLac(final BookieSocketAddress addr, final long ledgerId, final ReadLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.readLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, null, null, ctx); return; } client.obtain((rc, pcbc) -> { if (rc != BKException.Code.OK) { try { executor.executeOrdered(ledgerId, safeRun(() -> { cb.readLacComplete(rc, ledgerId, null, null, ctx); })); } catch (RejectedExecutionException re) { cb.readLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, null, null, ctx); } } else { pcbc.readLac(ledgerId, cb, ctx); } }, ledgerId, conf.getUseV2WireProtocol()); }

Target:
public void readLac(final BookieSocketAddress addr, final long ledgerId, final ReadLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.readLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, null, null, ctx); return; } client.obtain((rc, pcbc) -> { if (rc != BKException.Code.OK) { try { executor.executeOrdered(ledgerId, safeRun(() -> { cb.readLacComplete(rc, ledgerId, null, null, ctx); })); } catch (RejectedExecutionException re) { cb.readLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, null, null, ctx); } } else { pcbc.readLac(ledgerId, cb, ctx); } }, ledgerId, useV3Enforced); }
Source:
public void setPreferredAgencies(String s) { if (s != null && !s.equals("")) preferredAgencies = Sets.newHashSet(s.split(",")); }

Target:
public void setPreferredAgencies(String s) { if (!s.isEmpty()) { preferredAgencies = new HashSet<>(); Collections.addAll(preferredAgencies, s.split(",")); } }
Source:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
public void returnsFileContent() throws Exception { final Storage storage = new MkStorage( this.temp.getRoot().getAbsolutePath() ); final String path = "some_file.txt"; final String content = "some text content"; storage.put(path, IOUtils.toInputStream(content)); MatcherAssert.assertThat( IOUtils.toString( new TkGetFile(storage).route( new RqRegex.Fake( "/api/file/(?<path>[^/]+)", String.format( "/api/file/%s", path ) ) ).act().body() ), Matchers.containsString(content) ); }

Target:
public void returnsFileContent() throws Exception { final Storage storage = new MkStorage( this.temp.getRoot().getAbsolutePath() ); final String path = "some_file.txt"; final String content = "some text content"; storage.put(path, IOUtils.toInputStream(content)); MatcherAssert.assertThat( new RsPrint( new TkGetFile(storage).route( new RqRegex.Fake( "/api/file/(?<path>[^/]+)", String.format( "/api/file/%s", path ) ) ).act() ).printBody(), Matchers.containsString(content) ); }
Source:
public boolean isMemberOf(IEntityGroup group) throws GroupsException { final Set<IEntityGroup> parents = getParentGroups(); return parents.contains(group); }

Target:
public boolean isMemberOf(IEntityGroup group) throws GroupsException { return getParentGroups().contains(group); }
Source:
public GraphModel adapt(Map<String, Object> data) { final Set<Long> nodeIdentities = new HashSet<>(); final Set<Long> edgeIdentities = new HashSet<>(); DefaultGraphModel graphModel = new DefaultGraphModel(); for (Map.Entry<String, Object> mapEntry : data.entrySet()) { final Object value = mapEntry.getValue(); String resultKey = mapEntry.getKey(); boolean generatedNodes = AdapterUtils.matchesPatternComprehension(resultKey); adaptInternal(nodeIdentities, edgeIdentities, graphModel, value, generatedNodes); } return graphModel; }

Target:
public GraphModel adapt(Map<String, Object> data) { final Set<Long> nodeIdentities = new HashSet<>(); final Set<Long> edgeIdentities = new HashSet<>(); DefaultGraphModel graphModel = new DefaultGraphModel(); for (Map.Entry<String, Object> mapEntry : data.entrySet()) { final Object value = mapEntry.getValue(); String resultKey = mapEntry.getKey(); boolean generatedNodes = AdapterUtils.describesGeneratedNode(resultKey); adaptInternal(nodeIdentities, edgeIdentities, graphModel, value, generatedNodes); } return graphModel; }
Source:
public Datastream createBootstrapDatastream(String datastreamName) throws DatastreamException { ActionRequest<Datastream> request = _bootstrapBuilders.actionCreate().paramBaseDatastream(datastreamName).build(); ResponseFuture<Datastream> datastreamResponseFuture = _restClient.sendRequest(request); Response<Datastream> response; try { response = datastreamResponseFuture.getResponse(); return response.getEntity(); } catch (RemoteInvocationException e) { if(e instanceof RestLiResponseException && ((RestLiResponseException) e).getStatus() == HttpStatus.S_404_NOT_FOUND.getCode()) { throw new DatastreamNotFoundException(datastreamName, e); } else { throw new DatastreamException(String.format( "Create Bootstrap Datastream {%s} failed with error %s", datastreamName, e.toString()), e); } } }

Target:
public Datastream createBootstrapDatastream(String datastreamName) throws DatastreamException { ActionRequest<Datastream> request = _bootstrapBuilders.actionCreate().paramBaseDatastream(datastreamName).build(); ResponseFuture<Datastream> datastreamResponseFuture = _restClient.sendRequest(request); Response<Datastream> response; try { response = datastreamResponseFuture.getResponse(); return response.getEntity(); } catch (RemoteInvocationException e) { if(e instanceof RestLiResponseException && ((RestLiResponseException) e).getStatus() == HttpStatus.S_404_NOT_FOUND.getCode()) { throw new DatastreamNotFoundException(datastreamName, e); } else { throw new DatastreamException(String.format( "Create Bootstrap Datastream {%s} failed with error.", datastreamName), e); } } }
Source:
public void persistDeviceBusInfo(UserVmVO vm, String rootDiskController) { String existingVmRootDiskController = vm.getDetail(VmDetailConstants.ROOK_DISK_CONTROLLER); if (StringUtils.isEmpty(existingVmRootDiskController) && !StringUtils.isEmpty(rootDiskController)) { vm.setDetail(VmDetailConstants.ROOK_DISK_CONTROLLER, rootDiskController); _vmDao.saveDetails(vm); s_logger.debug("Persisted device bus information rootDiskController=" + rootDiskController + " for vm: " + vm.getDisplayName()); } }

Target:
public void persistDeviceBusInfo(UserVmVO vm, String rootDiskController) { String existingVmRootDiskController = vm.getDetail(VmDetailConstants.ROOT_DISK_CONTROLLER); if (StringUtils.isEmpty(existingVmRootDiskController) && !StringUtils.isEmpty(rootDiskController)) { vm.setDetail(VmDetailConstants.ROOT_DISK_CONTROLLER, rootDiskController); _vmDao.saveDetails(vm); if (s_logger.isDebugEnabled()) { s_logger.debug("Persisted device bus information rootDiskController=" + rootDiskController + " for vm: " + vm.getDisplayName()); } } }
Source:
ServerChecker doCreateChecker(URL url, String serverRef) { if ("terminal".equals(serverRef)) { return new TerminalHttpConnectionServerChecker( url, machineName, serverRef, 3, 180, 1, TimeUnit.SECONDS, timer); } if ("wsagent/http".equals(serverRef)) { return new HttpConnectionServerChecker( url, machineName, serverRef, 3, 180, wsagentPingSuccessThreshold, TimeUnit.SECONDS, timer); } return new HttpConnectionServerChecker( url, machineName, serverRef, 3, 180, 1, TimeUnit.SECONDS, timer); }

Target:
ServerChecker doCreateChecker(URL url, String serverRef) { if ("terminal".equals(serverRef)) { return new TerminalHttpConnectionServerChecker( url, machineName, serverRef, 3, 180, serverPingSuccessThreshold, TimeUnit.SECONDS, timer); } return new HttpConnectionServerChecker( url, machineName, serverRef, 3, 180, serverPingSuccessThreshold, TimeUnit.SECONDS, timer); }
Source:
public boolean resetModem() { boolean retVal = true; if (KuraConstants.ReliaGATE_10_05.getTargetName().equals(TARGET_NAME)) { try { if (!isSysfsGpioExported(RELIAGATE_10_05_GSM_RESET_GPIO_NUM)) { initSysfsGpio(RELIAGATE_10_05_GSM_RESET_GPIO_NUM, false); } echoSysfsResource(RELIAGATE_10_05_GSM_USB_PATH, false); Thread.sleep(1000); pulseSysfsGpio(RELIAGATE_10_05_GSM_RESET_GPIO_NUM, true, 1000); Thread.sleep(1000); echoSysfsResource(RELIAGATE_10_05_GSM_USB_PATH, true); int cnt = 10; while (!isOn() && cnt > 0) { sleep(1000); cnt--; } if (!isOn()) { retVal = false; } } catch (IOException e) { s_logger.error("Failed to write to gpio", e); retVal = false; } catch (KuraException e) { s_logger.error("Failed to detect modem", e); retVal = false; } catch (InterruptedException e) { s_logger.error("Interrupted Exception during sleep", e); retVal = false; } } else { s_logger.warn("resetModem() :: modem reset operation is not supported for the platform", TARGET_NAME); } return retVal; }

Target:
public boolean resetModem() { boolean retVal = false; if (KuraConstants.ReliaGATE_10_05.getTargetName().equals(TARGET_NAME)) { try { if (!isSysfsGpioExported(RELIAGATE_10_05_GSM_RESET_GPIO_NUM)) { initSysfsGpio(RELIAGATE_10_05_GSM_RESET_GPIO_NUM, false); } echoSysfsResource(RELIAGATE_10_05_GSM_USB_PATH, false); Thread.sleep(1000); pulseSysfsGpio(RELIAGATE_10_05_GSM_RESET_GPIO_NUM, true, 1000); Thread.sleep(1000); echoSysfsResource(RELIAGATE_10_05_GSM_USB_PATH, true); int cnt = 10; while (!isOn() && cnt > 0) { sleep(1000); cnt--; } if (isOn()) { retVal = true; } } catch (IOException e) { s_logger.error("Failed to write to gpio", e); } catch (KuraException e) { s_logger.error("Failed to detect modem", e); } catch (InterruptedException e) { s_logger.error("Interrupted Exception during sleep", e); } } else { s_logger.warn("resetModem() :: modem reset operation is not supported for the platform", TARGET_NAME); } return retVal; }
Source:
protected void loadContributions() { if (Platform.isRunning()) { delegatesParticipants.clear(); IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.sirius.migrationParticipant"); for (IConfigurationElement configurationElement : config) { try { String kind = configurationElement.getAttribute("kind"); if (kind.equals(getKind())) { Object contribution = configurationElement.createExecutableExtension("class"); if (contribution instanceof IMigrationParticipant) { delegatesParticipants.add((IMigrationParticipant) contribution); } } } catch (CoreException e) { SiriusPlugin.getDefault().getLog().log(new Status(Status.WARNING, SiriusPlugin.ID, "Cannot instanciate migration contribution", e)); } } } }

Target:
protected void loadContributions() { delegatesParticipants.clear(); IConfigurationElement[] config = EclipseUtil.getConfigurationElementsFor("org.eclipse.sirius.migrationParticipant"); for (IConfigurationElement configurationElement : config) { try { String kind = configurationElement.getAttribute("kind"); if (kind.equals(getKind())) { Object contribution = configurationElement.createExecutableExtension("class"); if (contribution instanceof IMigrationParticipant) { delegatesParticipants.add((IMigrationParticipant) contribution); } } } catch (CoreException e) { SiriusPlugin.getDefault().getLog().log(new Status(Status.WARNING, SiriusPlugin.ID, "Cannot instanciate migration contribution", e)); } } }
Source:
public void testMulticastSocket(MulticastSocket receiveSocket, InetAddress sendAddress, boolean expectSuccessfulRead) throws IOException { MulticastSocket sendSocket = new MulticastSocketFactoryImpl().createMulticastSocket(sendAddress, PORT); try { sendSocket.joinGroup(sendAddress); String data = "1234567890"; byte[] buffer = data.getBytes(); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, sendAddress, PORT); if (ADVERTISE_INTERFACE != null && !System.getProperty("os.name").startsWith("Windows")) { try { InetAddress socketInterface = InetAddress.getByName(ADVERTISE_INTERFACE); sendSocket.setInterface(socketInterface); } catch (Exception ex) { ; } } sendSocket.send(packet); try { Thread.sleep(20); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } Arrays.fill(buffer, (byte) 0); packet = new DatagramPacket(buffer, buffer.length); try { receiveSocket.receive(packet); System.out.println("MERDE: " + expectSuccessfulRead + " : " + buffer + " : " + data); System.out.println("MERDE: " + expectSuccessfulRead + " : " + buffer + " : " + data.getBytes()); Assert.assertTrue(expectSuccessfulRead); Assert.assertArrayEquals(buffer, data.getBytes()); } catch (SocketTimeoutException e) { Assert.assertFalse(expectSuccessfulRead); } try { sendSocket.leaveGroup(sendAddress); } catch (java.net.SocketException ex) { } } finally { sendSocket.close(); } }

Target:
public void testMulticastSocket(MulticastSocket receiveSocket, InetAddress sendAddress, boolean expectSuccessfulRead) throws IOException { MulticastSocket sendSocket = new MulticastSocketFactoryImpl().createMulticastSocket(sendAddress, PORT); try { sendSocket.joinGroup(sendAddress); String data = "1234567890"; byte[] buffer = data.getBytes(); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, sendAddress, PORT); if (ADVERTISE_INTERFACE != null && !System.getProperty("os.name").startsWith("Windows")) { try { InetAddress socketInterface = InetAddress.getByName(ADVERTISE_INTERFACE); sendSocket.setInterface(socketInterface); } catch (Exception ex) { ; } } sendSocket.send(packet); try { Thread.sleep(20); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } Arrays.fill(buffer, (byte) 0); packet = new DatagramPacket(buffer, buffer.length); try { receiveSocket.receive(packet); Assert.assertTrue(expectSuccessfulRead); Assert.assertArrayEquals(buffer, data.getBytes()); } catch (SocketTimeoutException e) { Assert.assertFalse(expectSuccessfulRead); } try { sendSocket.leaveGroup(sendAddress); } catch (java.net.SocketException ex) { } } finally { sendSocket.close(); } }
Source:
public abstract void killRecursively() throws InterruptedException; protected @CheckForNull VetoCause getVeto() { String causeMessage = null; try { VirtualChannel channelToMaster = SlaveComputer.getChannelToMaster(); if (channelToMaster!=null) { CheckVetoes vetoCheck = new CheckVetoes(this); causeMessage = channelToMaster.call(vetoCheck); } } catch (IOException e) { LOGGER.log(Level.WARNING, "I/O Exception while checking for vetoes", e); } catch (InterruptedException e) { LOGGER.log(Level.WARNING, "Interrupted Exception while checking for vetoes", e); } if (causeMessage != null) { return new VetoCause(causeMessage); } return null; }

Target:
public abstract void killRecursively() throws InterruptedException; protected @CheckForNull VetoCause getVeto() { String causeMessage = null; if (!skipVetoes) { try { VirtualChannel channelToMaster = SlaveComputer.getChannelToMaster(); if (channelToMaster!=null) { CheckVetoes vetoCheck = new CheckVetoes(this); causeMessage = channelToMaster.call(vetoCheck); } } catch (IOException e) { LOGGER.log(Level.WARNING, "I/O Exception while checking for vetoes", e); } catch (InterruptedException e) { LOGGER.log(Level.WARNING, "Interrupted Exception while checking for vetoes", e); } } if (causeMessage != null) { return new VetoCause(causeMessage); } return null; }
Source:
public void sign_sameAs() throws IOException { MockMetadataServerTransportFactory transportFactory = new MockMetadataServerTransportFactory(); final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; String defaultAccountEmail = "mail@mail.com"; byte[] expectedSignature = {0xD, 0xE, 0xA, 0xD}; transportFactory.transport.setAccessToken(accessToken); transportFactory.transport.setServiceAccountEmail(defaultAccountEmail); transportFactory.transport.setSignature(expectedSignature); ComputeEngineCredentials credentials = ComputeEngineCredentials.newBuilder().setHttpTransportFactory(transportFactory).build(); assertEquals(defaultAccountEmail, credentials.getAccount()); }

Target:
public void sign_sameAs() throws IOException { MockMetadataServerTransportFactory transportFactory = new MockMetadataServerTransportFactory(); final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; String defaultAccountEmail = "mail@mail.com"; byte[] expectedSignature = {0xD, 0xE, 0xA, 0xD}; transportFactory.transport.setAccessToken(accessToken); transportFactory.transport.setServiceAccountEmail(defaultAccountEmail); transportFactory.transport.setSignature(expectedSignature); ComputeEngineCredentials credentials = ComputeEngineCredentials.newBuilder().setHttpTransportFactory(transportFactory).build(); assertArrayEquals(expectedSignature, credentials.sign(expectedSignature)); }
Source:
public void setName(EntityModel<String> name) { this.name = name; }

Target:
private void setName(EntityModel<String> name) { this.name = name; }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != getClass()) { return false; } Flow other = (Flow) obj; return new EqualsBuilder() .append(elements, other.elements) .append(exceptional, other.exceptional) .isEquals(); }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != getClass()) { return false; } Flow other = (Flow) obj; return Objects.equal(elements, other.elements) && exceptional == other.exceptional; }
Source:
protected void executeCommand() { Guid secretUuid = getParameters().getLibvirtSecret().getId(); addCustomValue("LibvirtSecretUUID", secretUuid.toString()); getReturnValue().setActionReturnValue(secretUuid); }

Target:
protected void executeCommand() { getReturnValue().setActionReturnValue(getParameters().getLibvirtSecret().getId()); }