auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onMediaListFetched(OnMediaListFetched event) { }

Target:
public void onMediaListFetched(OnMediaListFetched event) { if (event != null) { mNetworkErrorOnLastMediaFetchAttempt = event.isError(); } }
Source:
public void testInvokeMapReduceOnAllKeys() throws Exception { MapReduceTask<String, String, String, Integer> task = invokeMapReduce(null); task.setIntermediateCacheTransferSize(1024); System.out.println("Read macbeth.txt and inserted keys into cache. Executing M/R task..."); long start = System.currentTimeMillis(); Map<String, Integer> mapReduce = task.execute(); System.out.println("Task completed in " + (System.currentTimeMillis() - start) + " ms"); verifyResults(mapReduce); }

Target:
public void testInvokeMapReduceOnAllKeys() throws Exception { MapReduceTask<String, String, String, Integer> task = invokeMapReduce(null); task.setMaxCollectorSize(256); System.out.println("Read macbeth.txt and inserted keys into cache. Executing M/R task..."); long start = System.currentTimeMillis(); Map<String, Integer> mapReduce = task.execute(); System.out.println("Task completed in " + (System.currentTimeMillis() - start) + " ms"); verifyResults(mapReduce); }
Source:
public void insert(final List<AclSnapshot> batch) { template.batchUpdate(INSERT_IGNORE, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return batch.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { AclSnapshot snapshot = batch.get(i); ps.setLong(1, snapshot.getTimestamp()); String id = snapshot.getId().toLowerCase(); if (id.startsWith("syn")) { id = id.substring(3); } ps.setLong(2, Long.parseLong(id)); ps.setString(3, snapshot.getOwnerType().name()); if (snapshot.getCreationDate() != null) { ps.setLong(4, snapshot.getCreationDate().getTime()); } else { ps.setNull(4, Types.BIGINT); } if (snapshot.getResourceAccess() != null) { String xml = XMLUtils.toXML(snapshot.getResourceAccess(), AclSnapshot.RESOURCE_ACCESS_ALIAS); Blob blob = template.getDataSource().getConnection().createBlob(); blob.setBytes(1, CompressionUtils.compressStringUTF8(xml)); ps.setBlob(5, blob); } else { ps.setNull(5, Types.BLOB); } } }); }

Target:
public void insert(final List<AclSnapshot> batch) { template.batchUpdate(INSERT_IGNORE, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return batch.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { AclSnapshot snapshot = batch.get(i); ps.setLong(1, snapshot.getTimestamp()); ps.setLong(2, ObjectSnapshotUtils.convertSynapseIdToLong(snapshot.getId())); ps.setString(3, snapshot.getOwnerType().name()); if (snapshot.getCreationDate() != null) { ps.setLong(4, snapshot.getCreationDate().getTime()); } else { ps.setNull(4, Types.BIGINT); } if (snapshot.getResourceAccess() != null) { String xml = XMLUtils.toXML(snapshot.getResourceAccess(), AclSnapshot.RESOURCE_ACCESS_ALIAS); Blob blob = template.getDataSource().getConnection().createBlob(); blob.setBytes(1, CompressionUtils.compressStringUTF8(xml)); ps.setBlob(5, blob); } else { ps.setNull(5, Types.BLOB); } } }); }
Source:
public DLNAThumbnailInputStream getThumbnailInputStream() throws IOException { File cachedThumbnail = null; File thumbFolder = null; boolean alternativeCheck = false; while (cachedThumbnail == null) { if (thumbFolder == null) { thumbFolder = file.getParentFile(); } cachedThumbnail = FileUtil.replaceExtension(thumbFolder, file, "jpg", true, true); if (cachedThumbnail == null) { cachedThumbnail = FileUtil.replaceExtension(thumbFolder, file, "png", true, true); } if (cachedThumbnail == null) { cachedThumbnail = FileUtil.getFileNameWithAddedExtension(thumbFolder, file, ".cover.jpg"); } if (cachedThumbnail == null) { cachedThumbnail = FileUtil.getFileNameWithAddedExtension(thumbFolder, file, ".cover.png"); } if (alternativeCheck) { break; } if (StringUtils.isNotBlank(configuration.getAlternateThumbFolder())) { thumbFolder = new File(configuration.getAlternateThumbFolder()); if (!thumbFolder.isDirectory()) { thumbFolder = null; break; } } alternativeCheck = true; } if (cachedThumbnail != null) { return DLNAThumbnailInputStream.toThumbnailInputStream(new FileInputStream(cachedThumbnail)); } else if (getMedia() != null && getMedia().getThumb() != null) { try (DLNAThumbnailInputStream dtis = getMedia().getThumbnailInputStream()) { return dtis; } } else { try (DLNAThumbnailInputStream dtis = getGenericThumbnailInputStream(null)) { return dtis; } } }

Target:
public DLNAThumbnailInputStream getThumbnailInputStream() throws IOException { File cachedThumbnail = null; File thumbFolder = null; boolean alternativeCheck = false; while (cachedThumbnail == null) { if (thumbFolder == null) { thumbFolder = file.getParentFile(); } cachedThumbnail = FileUtil.replaceExtension(thumbFolder, file, "jpg", true, true); if (cachedThumbnail == null) { cachedThumbnail = FileUtil.replaceExtension(thumbFolder, file, "png", true, true); } if (cachedThumbnail == null) { cachedThumbnail = FileUtil.getFileNameWithAddedExtension(thumbFolder, file, ".cover.jpg"); } if (cachedThumbnail == null) { cachedThumbnail = FileUtil.getFileNameWithAddedExtension(thumbFolder, file, ".cover.png"); } if (alternativeCheck) { break; } if (StringUtils.isNotBlank(configuration.getAlternateThumbFolder())) { thumbFolder = new File(configuration.getAlternateThumbFolder()); if (!thumbFolder.isDirectory()) { thumbFolder = null; break; } } alternativeCheck = true; } if (cachedThumbnail != null) { return DLNAThumbnailInputStream.toThumbnailInputStream(new FileInputStream(cachedThumbnail)); } else if (getMedia() != null && getMedia().getThumb() != null) { DLNAThumbnailInputStream dtis = getMedia().getThumbnailInputStream(); return dtis; } else { DLNAThumbnailInputStream dtis = getGenericThumbnailInputStream(null); return dtis; } }
Source:
private void setBodyText(View view, final String email) { TextView body = view.findViewById(R.id.sign_in_email_sent_text); String bodyText = getString(R.string.fui_email_link_email_sent, email); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText); int emailStart = bodyText.indexOf(email); spannableStringBuilder.setSpan(new StyleSpan(Typeface.BOLD), emailStart, emailStart + email.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); body.setText(spannableStringBuilder); }

Target:
private void setBodyText(View view, final String email) { TextView body = view.findViewById(R.id.sign_in_email_sent_text); String bodyText = getString(R.string.fui_email_link_email_sent, email); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText); TextHelper.boldAllOccurencesOfText(spannableStringBuilder, bodyText, email); body.setText(spannableStringBuilder); }
Source:
@Override protected void beforeTestsStarted() throws Exception { Assume.assumeFalse("<LINK_0>", MvccFeatureChecker.forcedMvcc()); System.setProperty(IGNITE_BASELINE_AUTO_ADJUST_ENABLED, "false"); super.beforeTestsStarted(); }

Target:
@Override protected void beforeTestsStarted() throws Exception { System.setProperty(IGNITE_BASELINE_AUTO_ADJUST_ENABLED, "false"); super.beforeTestsStarted(); }
Source:
private String getWhereClause() { return getClause(whereConstraints, "WHERE ", " AND "); }

Target:
private String getWhereClause() { return getClauseFromQueryConditions(whereConstraints, "WHERE ", " AND "); }
Source:
public static String getShareTypeFromComponentName(@NonNull ComponentName componentName) { if (componentName.getPackageName().contains("facebook")) { return "facebook"; } else if (componentName.getPackageName().contains("twitter")) { return "twitter"; } else { return "other"; } }

Target:
public static String getShareTypeFromComponentName(@NonNull ComponentName componentName) { switch (componentName.getPackageName()) { case "com.facebook.katana": return "facebook"; case "com.twitter.android": return "twitter"; default: return "other"; } }
Source:
public RabbitMQInjectHandler(String injectingSeq, String onErrorSeq, boolean sequential, SynapseEnvironment synapseEnvironment) throws SynapseException { this.injectingSeq = injectingSeq; if (injectingSeq == null || injectingSeq.equals("")) { String msg = "Injecting Sequence name is not specified."; log.error(msg); throw new SynapseException(msg); } seq = (SequenceMediator) synapseEnvironment.getSynapseConfiguration().getSequence(injectingSeq); if (seq != null && !seq.isInitialized()) { seq.init(synapseEnvironment); } this.onErrorSeq = onErrorSeq; this.sequential = sequential; this.synapseEnvironment = synapseEnvironment; }

Target:
public RabbitMQInjectHandler(String injectingSeq, String onErrorSeq, boolean sequential, SynapseEnvironment synapseEnvironment) throws SynapseException { this.injectingSeq = injectingSeq; if (injectingSeq == null || injectingSeq.equals("")) { String msg = "Injecting Sequence name is not specified."; log.error(msg); throw new SynapseException(msg); } seq = (SequenceMediator) synapseEnvironment.getSynapseConfiguration().getSequence(injectingSeq); if (seq == null) { throw new SynapseException("Specified injecting sequence: " + injectingSeq + "is invalid."); } if (!seq.isInitialized()) { seq.init(synapseEnvironment); } this.onErrorSeq = onErrorSeq; this.sequential = sequential; this.synapseEnvironment = synapseEnvironment; }
Source:
public Map<Double, Long> getCounts() { double scale = TimeUnit.MILLISECONDS.toNanos(1); Map<Double, Long> result = new TreeMap<>(); for (HistogramIterationValue entry : snapshot.get().logarithmicBucketValues(TimeUnit.MILLISECONDS.toNanos(1), 2)) { double median = entry.getValueIteratedTo() + entry.getValueIteratedFrom() / 2.0; result.put(round(median / scale, 2), entry.getCountAddedInThisIterationStep()); } return result; }

Target:
public Map<Double, Long> getCounts() { Map<Double, Long> result = new TreeMap<>(); for (HistogramIterationValue entry : snapshot.get().logarithmicBucketValues(TimeUnit.MILLISECONDS.toNanos(1), 2)) { double median = entry.getValueIteratedTo() + entry.getValueIteratedFrom() / 2.0; result.put(round(median / (double) TimeUnit.MILLISECONDS.toNanos(1), 2), entry.getCountAddedInThisIterationStep()); } return result; }
Source:
public void test() { connect(); getActions().click(driver.findElement(By.className("z-textbox"))).perform(); selectAll(); copy(); JQuery db = jq("@decimalbox"); click(db); waitResponse(); paste(); blur(db); waitResponse(); Assert.assertEquals("12.3", db.val()); }

Target:
public void test() { connect(); click(jq("@textbox")); waitResponse(); selectAll(); waitResponse(); copy(); waitResponse(); JQuery db = jq("@decimalbox"); click(db); waitResponse(); paste(); blur(db); waitResponse(); Assert.assertEquals("12.3", db.val()); }
Source:
private void subscribe(final Subscriber<? super Account> subscriber) { final Context appContext = activity.getApplication(); final AccountManager am = AccountManager.get(appContext); final AccountManagerCallback<Bundle> callback = new AccountManagerCallback<Bundle>() { @Override public void run(AccountManagerFuture<Bundle> future) { try { final Bundle results = future.getResult(); Account[] accs = am.getAccountsByType(accountType); if (accs.length == 0) { if (results != null) { final String accountName = results.getString(AccountManager.KEY_ACCOUNT_NAME); final String accountType = results.getString(AccountManager.KEY_ACCOUNT_TYPE); if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) { accs = new Account[1]; accs[0] = new Account(accountName, accountType == null ? OnSubscribeAddAccount.this.accountType : accountType); } else if (results.containsKey(AccountManager.KEY_INTENT)) subscriber.onError(new IllegalStateException("AccountManager " + "returned a key Intent: " + results.get(AccountManager.KEY_INTENT))); } } if (accs.length == 0) subscriber.onError(new IllegalStateException("Returned from AccountManager " + "without Account creation; results: " + results)); else { for (Account acc:accs) subscriber.onNext(acc); subscriber.onCompleted(); } } catch (Exception e) { subscriber.onError(e); } } }; final AccountManagerFuture<Bundle> f = am.addAccount(accountType, authTokenType, requiredFeatures, addAccountOptions, activity, callback, handler); subscriber.add(BooleanSubscription.create(new Action0() { @Override public void call() { f.cancel(true); } })); }

Target:
private void subscribe(final Subscriber<? super Account> subscriber) { final Context appContext = activity.getApplication(); final AccountManager am = AccountManager.get(appContext); final AccountManagerCallback<Bundle> callback = new AccountManagerCallback<Bundle>() { @Override public void run(AccountManagerFuture<Bundle> future) { if (subscriber.isUnsubscribed()) return; Exception errorDescription = null; try { final Bundle results = future.getResult(); Account[] accs = am.getAccountsByType(accountType); if (accs.length == 0) { errorDescription = new IllegalStateException("No Account created; results: " + results); } else { for (Account acc:accs) { subscriber.onNext(acc); } subscriber.onCompleted(); } } catch (Exception e) { errorDescription = e; } finally { if (errorDescription != null) { subscriber.onError(errorDescription); } } } }; final AccountManagerFuture<Bundle> f = am.addAccount(accountType, authTokenType, requiredFeatures, addAccountOptions, activity, callback, handler); activity = null; subscriber.add(AndroidSubscriptions.unsubscribeInHandlerThread(new Action0() { @Override public void call() { f.cancel(true); } }, handler)); }
Source:
public List<DiffEntry> scan(AbstractTreeIterator a, AbstractTreeIterator b) throws IOException { assertHaveRepository(); TreeWalk walk = new TreeWalk(reader); walk.addTree(a); walk.addTree(b); walk.setRecursive(true); TreeFilter filter = getDiffTreeFilterFor(a, b); if (pathFilter instanceof FollowFilter) { walk.setFilter(AndTreeFilter.create( PathFilter.create(((FollowFilter) pathFilter).getPath()), filter)); } else if (pathFilter != null) { walk.setFilter(AndTreeFilter.create(pathFilter, filter)); } else { walk.setFilter(filter); } source = new ContentSource.Pair(source(a), source(b)); List<DiffEntry> files = DiffEntry.scan(walk); if (pathFilter instanceof FollowFilter && isAdd(files)) { a.reset(); b.reset(); walk.reset(); walk.addTree(a); walk.addTree(b); walk.setFilter(filter); if (renameDetector == null) setDetectRenames(true); files = updateFollowFilter(detectRenames(DiffEntry.scan(walk))); } else if (renameDetector != null) files = detectRenames(files); return files; }

Target:
public List<DiffEntry> scan(AbstractTreeIterator a, AbstractTreeIterator b) throws IOException { assertHaveRepository(); TreeWalk walk = new TreeWalk(reader); walk.addTree(a); walk.addTree(b); walk.setRecursive(true); TreeFilter filter = getDiffTreeFilterFor(a, b); if (pathFilter instanceof FollowFilter) { walk.setFilter(AndTreeFilter.create( PathFilter.create(((FollowFilter) pathFilter).getPath()), filter)); } else { walk.setFilter(AndTreeFilter.create(pathFilter, filter)); } source = new ContentSource.Pair(source(a), source(b)); List<DiffEntry> files = DiffEntry.scan(walk); if (pathFilter instanceof FollowFilter && isAdd(files)) { a.reset(); b.reset(); walk.reset(); walk.addTree(a); walk.addTree(b); walk.setFilter(filter); if (renameDetector == null) setDetectRenames(true); files = updateFollowFilter(detectRenames(DiffEntry.scan(walk))); } else if (renameDetector != null) files = detectRenames(files); return files; }
Source:
private static Set<String> getListById(Node subSection, String id) { final Node node = XmlUtil.findChildElementById(subSection, id); assertNotNull(node, "Expected list element with id " + id); return XmlUtil.getChildrenElements(node) .stream() .map(Node::getTextContent) .collect(Collectors.toSet()); }

Target:
private static Set<String> getListById(Node subSection, String id) { Set<String> result = null; final Node node = XmlUtil.findChildElementById(subSection, id); if (node != null) { result = XmlUtil.getChildrenElements(node) .stream() .map(Node::getTextContent) .collect(Collectors.toSet()); } return result; }
Source:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; if (Config.isDevServer()) { response.setHeader("Access-Control-Allow-Origin", DEV_FRONTEND_URL); response.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); response.setHeader("Access-Control-Allow-Credentials", "true"); } if (Config.XSRF_KEY.equals(request.getParameter("xsrfkey"))) { chain.doFilter(req, res); return; } String referrer = request.getHeader("referer"); if (referrer == null) { } else if (!isHttpReferrerValid(referrer, request.getRequestURL().toString())) { response.setStatus(403); denyAccess("Invalid HTTP referrer.", response); return; } switch (request.getMethod()) { case "POST": case "PUT": case "DELETE": String message = getXsrfTokenErrorIfAny(request); if (message != null) { response.setStatus(403); denyAccess(message, response); return; } break; default: break; } chain.doFilter(req, res); }

Target:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; if (Config.isDevServer()) { response.setHeader("Access-Control-Allow-Origin", Config.APP_FRONTENDDEV_URL); response.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); response.setHeader("Access-Control-Allow-Credentials", "true"); } if (Config.XSRF_KEY.equals(request.getParameter("xsrfkey"))) { chain.doFilter(req, res); return; } String referrer = request.getHeader("referer"); if (referrer == null) { } else if (!isHttpReferrerValid(referrer, request.getRequestURL().toString())) { response.setStatus(403); denyAccess("Invalid HTTP referrer.", response); return; } switch (request.getMethod()) { case "POST": case "PUT": case "DELETE": String message = getXsrfTokenErrorIfAny(request); if (message != null) { response.setStatus(403); denyAccess(message, response); return; } break; default: break; } chain.doFilter(req, res); }
Source:
public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) { TreeSet<HtmlParameter> urlParams = msg.getUrlParams(); String uri = msg.getRequestHeader().getURI().toString(); boolean found = false; OptionsParam options = Model.getSingleton().getOptionsParam(); HttpSessionsParam sessionOptions = options.getParamSet(HttpSessionsParam.class); if(!urlParams.isEmpty() && sessionOptions != null) { List<String> sessionIds = sessionOptions.getDefaultTokensEnabled(); for (HtmlParameter param: urlParams) { if (sessionIds.contains(param.getName().toLowerCase(Locale.ROOT))) { if (param.getValue().length() > SESSION_TOKEN_MIN_LENGTH) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, param.getName(), "", "", getSolution(), getReference(), param.getValue(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } } } if (!found) { Matcher jsessMatcher = Pattern.compile(";jsessionid\\=[\\dA-Z]*", Pattern.CASE_INSENSITIVE).matcher(uri); if (jsessMatcher.find()) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, "", "", "", getSolution(), getReference(), jsessMatcher.group(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } try { checkSessionIDExposure(msg, id); } catch (URIException e) { } }

Target:
public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) { TreeSet<HtmlParameter> urlParams = msg.getUrlParams(); String uri = msg.getRequestHeader().getURI().toString(); boolean found = false; OptionsParam options = Model.getSingleton().getOptionsParam(); HttpSessionsParam sessionOptions = options.getParamSet(HttpSessionsParam.class); List<String> sessionIds = Collections.emptyList(); if (sessionOptions != null) { sessionIds = sessionOptions.getDefaultTokensEnabled(); } if(!urlParams.isEmpty()) { for (HtmlParameter param: urlParams) { if (sessionIds.contains(param.getName().toLowerCase(Locale.ROOT))) { if (param.getValue().length() > SESSION_TOKEN_MIN_LENGTH) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, param.getName(), "", "", getSolution(), getReference(), param.getValue(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } } } if (!found && msg.getRequestHeader().getURI().getEscapedPath() != null) { Matcher jsessMatcher = null; try { jsessMatcher = Pattern.compile("jsessionid=[\\dA-Z]*", Pattern.CASE_INSENSITIVE).matcher(msg.getRequestHeader().getURI().getPath()); } catch (URIException e) { } if (jsessMatcher != null && jsessMatcher.find() && sessionIds.contains(jsessMatcher.group().split("=")[0].trim())) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, "", "", "", getSolution(), getReference(), jsessMatcher.group(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } if (found) { try { checkSessionIDExposure(msg, id); } catch (URIException e) { } } }
Source:
public static <T> Comparator<IForgeRegistryEntry<T>> registryNameComparator() { return Comparator.comparing(IForgeRegistryEntry::getRegistryName, Comparator.naturalOrder()); }

Target:
public static <T> Comparator<IForgeRegistryEntry<T>> registryNameComparator() { return Comparator.comparing(IForgeRegistryEntry::getRegistryName); }
Source:
@Override public void init() { final ISPObservation obs = getContextObservation(); if (obs != null) { obs.addCompositeChangeListener(obslogUpdater); } final ISPObsComponent instrument = getContextInstrument(); if (instrument != null) { final SPComponentType type = instrument.getType(); _w.tabbedPane.remove(itcImagingPanel.peer()); _w.tabbedPane.remove(itcSpectroscopyPanel.peer()); if (itcImagingPanel.visibleFor(type)) _w.tabbedPane.add("ITC Imaging", itcImagingPanel.peer()); if (itcSpectroscopyPanel.visibleFor(type)) _w.tabbedPane.add("ITC Spectroscopy", itcSpectroscopyPanel.peer()); } _origSequenceTab.init(this); final String title = getDataObject().getTitle(); if (title != null) { _w.title.setText(title); } else { _w.title.setText("Sequence"); } stateChanged(null); }

Target:
@Override public void init() { final ISPObservation obs = getContextObservation(); if (obs != null) { obs.addCompositeChangeListener(obslogUpdater); } final ISPObsComponent instrument = getContextInstrument(); _w.tabbedPane.remove(itcImagingPanel.peer()); _w.tabbedPane.remove(itcSpectroscopyPanel.peer()); if (instrument != null) { final SPComponentType type = instrument.getType(); if (itcImagingPanel.visibleFor(type)) _w.tabbedPane.add("ITC Imaging", itcImagingPanel.peer()); if (itcSpectroscopyPanel.visibleFor(type)) _w.tabbedPane.add("ITC Spectroscopy", itcSpectroscopyPanel.peer()); } _origSequenceTab.init(this); final String title = getDataObject().getTitle(); if (title != null) { _w.title.setText(title); } else { _w.title.setText("Sequence"); } stateChanged(null); }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { BigDecimal result = null; for (int i=0; i<children.size(); i++) { Expression childExpr = children.get(i); if (!childExpr.evaluate(tuple, ptr)) { return false; } if (ptr.getLength() == 0) { return true; } PDataType childType = childExpr.getDataType(); SortOrder childSortOrder = childExpr.getSortOrder(); BigDecimal bd = (BigDecimal) PDecimal.INSTANCE.toObject(ptr, childType, childSortOrder); if (result == null) { result = bd; } else { result = result.add(bd); } } if (maxLength != null || scale != null) { result = NumberUtil.setDecimalWidthAndScale(result, maxLength, scale); } if (result == null) { throw new DataExceedsCapacityException("", maxLength); } ptr.set(PDecimal.INSTANCE.toBytes(result)); return true; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { BigDecimal result = null; for (int i=0; i<children.size(); i++) { Expression childExpr = children.get(i); if (!childExpr.evaluate(tuple, ptr)) { return false; } if (ptr.getLength() == 0) { return true; } PDataType childType = childExpr.getDataType(); SortOrder childSortOrder = childExpr.getSortOrder(); BigDecimal bd = (BigDecimal) PDecimal.INSTANCE.toObject(ptr, childType, childSortOrder); if (result == null) { result = bd; } else { result = result.add(bd); } } if (maxLength != null || scale != null) { result = NumberUtil.setDecimalWidthAndScale(result, maxLength, scale); } if (result == null) { throw new DataExceedsCapacityException(PDecimal.INSTANCE, maxLength, scale, null); } ptr.set(PDecimal.INSTANCE.toBytes(result)); return true; }
Source:
public void testMemory() throws InternalTranslationException, InterpreterException { interpreter.setMemory(0, 1, 4); final MockOperandTree operandTree1 = new MockOperandTree(); operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "dword"); operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.MEMDEREF, "[")); operandTree1.root.m_children.get(0).getChildren() .add(new MockOperandTreeNode(ExpressionType.IMMEDIATE_INTEGER, "0")); final MockOperandTree operandTree2 = new MockOperandTree(); operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "dword"); operandTree2.root.m_children .add(new MockOperandTreeNode(ExpressionType.IMMEDIATE_INTEGER, "0")); final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2); final IInstruction instruction = new MockInstruction("btr", operands); translator.translate(environment, instruction, instructions); interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100)); assertEquals(2, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size()); assertEquals(BigInteger.valueOf(1), interpreter.getVariableValue("CF")); assertEquals(BigInteger.valueOf(0), interpreter.getMemory().load(0, 4)); assertEquals(BigInteger.valueOf(4L), BigInteger.valueOf(interpreter.getMemorySize())); }

Target:
public void testMemory() throws InternalTranslationException, InterpreterException { interpreter.setMemory(0, 1, 4); final MockOperandTree operandTree1 = new MockOperandTree(); operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "dword"); operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.MEMDEREF, "[")); operandTree1.root.m_children.get(0).getChildren() .add(new MockOperandTreeNode(ExpressionType.IMMEDIATE_INTEGER, "0")); final MockOperandTree operandTree2 = new MockOperandTree(); operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "dword"); operandTree2.root.m_children .add(new MockOperandTreeNode(ExpressionType.IMMEDIATE_INTEGER, "0")); final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2); final IInstruction instruction = new MockInstruction("btr", operands); translator.translate(environment, instruction, instructions); interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100)); assertEquals(2, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size()); assertEquals(BigInteger.ONE, interpreter.getVariableValue("CF")); assertEquals(BigInteger.ZERO, interpreter.getMemory().load(0, 4)); assertEquals(BigInteger.valueOf(4L), BigInteger.valueOf(interpreter.getMemorySize())); }
Source:
public void testFindTablesByPost() { long waiterId = 2L; TableEto table = new TableEtoBuilder().number(NUMBER_TABLE_NEW).waiterId(waiterId).state(TableState.RESERVED).createNew(); assertThat(table).isNotNull(); TableEto savedTable = this.service.saveTable(table); assertThat(savedTable).isNotNull(); TableSearchCriteriaTo criteria = new TableSearchCriteriaTo(); assertThat(criteria).isNotNull(); criteria.setState(TableState.RESERVED); PaginatedListTo<TableEto> tables = this.service.findTablesByPost(criteria); List<TableEto> result = tables.getResult(); assertThat(result).isNotEmpty(); assertThat(result).hasAtLeastOneElementOfType(TableEto.class).extracting("state").contains(TableState.RESERVED); assertThat(result).extracting("state").doesNotContain(TableState.FREE); assertThat(result).extracting("state").doesNotContain(TableState.OCCUPIED); assertThat(result).extracting("waiterId").contains(waiterId); assertThat(result).extracting("number").contains(NUMBER_TABLE_NEW); }

Target:
public void testFindTablesByPost() { TableEto table = new TableEtoBuilder().state(TableState.RESERVED).createNew(); TableEto savedTable = this.service.saveTable(table); assertThat(savedTable).isNotNull(); TableSearchCriteriaTo criteria = new TableSearchCriteriaTo(); assertThat(criteria).isNotNull(); criteria.setState(TableState.RESERVED); PaginatedListTo<TableEto> tables = this.service.findTablesByPost(criteria); List<TableEto> result = tables.getResult(); assertThat(result).isNotEmpty(); assertThat(result).hasAtLeastOneElementOfType(TableEto.class).extracting("state").contains(TableState.RESERVED); assertThat(result).extracting("state").doesNotContain(TableState.FREE); assertThat(result).extracting("state").doesNotContain(TableState.OCCUPIED); assertThat(result).extracting("waiterId").contains(ID_WAITER); assertThat(result).extracting("number").contains(NUMBER_TABLE_NEW); }
Source:
protected boolean canDoAction() { Map<Guid, StorageDomain> domainsMap = new HashMap<Guid, StorageDomain>(); if (getVdsGroup() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY); return false; } if (!canDoActionBeforeCloneVm(domainsMap)) { return false; } if (getParameters().isImportAsNewEntity()) { initImportClonedVm(); if (getVm().getInterfaces().size() > getMacPool().getAvailableMacsCount()) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); return false; } } OsRepository osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class); if (getVdsGroup() != null && getVm().isBalloonEnabled() && !osRepository.isBalloonEnabled(getVm().getStaticData().getOsId(), getVdsGroup().getcompatibility_version())) { addCanDoActionMessageVariable("clusterArch", getVdsGroup().getArchitecture()); return failCanDoAction(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH); } return canDoActionAfterCloneVm(domainsMap); }

Target:
protected boolean canDoAction() { Map<Guid, StorageDomain> domainsMap = new HashMap<Guid, StorageDomain>(); if (getVdsGroup() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY); return false; } if (!canDoActionBeforeCloneVm(domainsMap)) { return false; } if (getParameters().isImportAsNewEntity()) { initImportClonedVm(); if (getVm().getInterfaces().size() > getMacPool().getAvailableMacsCount()) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); return false; } } OsRepository osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class); if (getVm().isBalloonEnabled() && !osRepository.isBalloonEnabled(getVm().getStaticData().getOsId(), getVdsGroup().getcompatibility_version())) { addCanDoActionMessageVariable("clusterArch", getVdsGroup().getArchitecture()); return failCanDoAction(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH); } return canDoActionAfterCloneVm(domainsMap); }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } IscsiBondValidator validator = new IscsiBondValidator(); if (!validate(validator.isIscsiBondExist(getExistingIscsiBond()))) { return false; } if (isNameChanged() && !validate(validator.iscsiBondWithTheSameNameExistInDataCenter(getIscsiBond()))) { return false; } return true; }

Target:
protected boolean canDoAction() { IscsiBondValidator validator = new IscsiBondValidator(); if (!validate(validator.isIscsiBondExist(getExistingIscsiBond()))) { return false; } if (isNameChanged() && !validate(validator.iscsiBondWithTheSameNameExistInDataCenter(getIscsiBond()))) { return false; } return true; }
Source:
public void testEncodeYes() { AffineCipher affineCipher = new AffineCipher(); assertEquals("xbt", affineCipher.encode("yes", 5, 7) ); }

Target:
public void testEncodeYes() { assertEquals("xbt", affineCipher.encode("yes", 5, 7)); }
Source:
public void init() { internalInit(); final String url = GWT.getHostPageBaseURL() + "plugin/data-access/api/permissions/hasDataAccess"; RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); builder.setHeader("accept", "application/json"); try { builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { showMessagebox("Error", exception.getLocalizedMessage()); } public void onResponseReceived(Request request, Response response) { showMessagebox("Log", response.getText()); boolean hasDataAccess = new Boolean(response.getText()); DatasourceSelectionDialogController.this.administrator = hasDataAccess; showMessagebox("test", new Boolean(DatasourceSelectionDialogController.this.administrator).toString()); addDatasourceButton.setVisible(hasDataAccess); editDatasourceButton.setVisible(hasDataAccess); removeDatasourceButton.setVisible(hasDataAccess); try { removeDatasourceButtonBinding.fireSourceChanged(); editDatasourceButtonBinding.fireSourceChanged(); } catch (Exception e) { showMessagebox("Error", e.getLocalizedMessage()); } } }); } catch (RequestException e) { } }

Target:
public void init() { internalInit(); final String url = GWT.getHostPageBaseURL() + "plugin/data-access/api/permissions/hasDataAccess"; RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); builder.setHeader("accept", "application/json"); try { builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { showMessagebox("Error", exception.getLocalizedMessage()); } public void onResponseReceived(Request request, Response response) { boolean hasDataAccess = new Boolean(response.getText()); DatasourceSelectionDialogController.this.administrator = hasDataAccess; addDatasourceButton.setVisible(hasDataAccess); editDatasourceButton.setVisible(hasDataAccess); removeDatasourceButton.setVisible(hasDataAccess); try { removeDatasourceButtonBinding.fireSourceChanged(); editDatasourceButtonBinding.fireSourceChanged(); } catch (Exception e) { showMessagebox("Error", e.getLocalizedMessage()); } } }); } catch (RequestException e) { } }
Source:
protected void startBrooklynNode() { final String classpath = System.getenv("INITIAL_CLASSPATH"); if (classpath == null || Strings.isBlank(classpath)) { LOG.warn("Cannot find INITIAL_CLASSPATH environment variable, skipping BrooklynNode entity creation"); return; } ApplicationBuilder brooklyn = new ApplicationBuilder() { @Override protected void doBuild() { addChild(EntitySpec.create(BrooklynNode.class) .configure(SoftwareProcess.ENTITY_STARTED, true) .configure(SoftwareProcess.RUN_DIR, System.getenv("ROOT")) .configure(SoftwareProcess.INSTALL_DIR, System.getenv("BROOKLYN_HOME")) .configure(BrooklynNode.ENABLED_HTTP_PROTOCOLS, ImmutableList.of(webServer.getHttpsEnabled() ? "https" : "http")) .configure(webServer.getHttpsEnabled() ? BrooklynNode.HTTPS_PORT : BrooklynNode.HTTP_PORT, PortRanges.fromInteger(webServer.getActualPort())) .configure(BrooklynNode.WEB_CONSOLE_BIND_ADDRESS, bindAddress) .configure(BrooklynNode.WEB_CONSOLE_PUBLIC_ADDRESS, publicAddress) .configure(BrooklynNode.CLASSPATH, Splitter.on(":").splitToList(classpath)) .displayName("Brooklyn Console")); } }; brooklyn.appDisplayName("Brooklyn") .manage(managementContext) .start(ImmutableList.of(new LocalhostMachine())); }

Target:
protected void startBrooklynNode() { final String classpath = System.getenv("INITIAL_CLASSPATH"); if (Strings.isBlank(classpath)) { LOG.warn("Cannot find INITIAL_CLASSPATH environment variable, skipping BrooklynNode entity creation"); return; } if (webServer == null || !startWebApps) { LOG.info("Skipping BrooklynNode entity creation, BrooklynWebServer not running"); return; } ApplicationBuilder brooklyn = new ApplicationBuilder() { @Override protected void doBuild() { addChild(EntitySpec.create(LocalBrooklynNode.class) .configure(SoftwareProcess.ENTITY_STARTED, true) .configure(SoftwareProcess.RUN_DIR, System.getenv("ROOT")) .configure(SoftwareProcess.INSTALL_DIR, System.getenv("BROOKLYN_HOME")) .configure(BrooklynNode.ENABLED_HTTP_PROTOCOLS, ImmutableList.of(webServer.getHttpsEnabled() ? "https" : "http")) .configure(webServer.getHttpsEnabled() ? BrooklynNode.HTTPS_PORT : BrooklynNode.HTTP_PORT, PortRanges.fromInteger(webServer.getActualPort())) .configure(BrooklynNode.WEB_CONSOLE_BIND_ADDRESS, bindAddress) .configure(BrooklynNode.WEB_CONSOLE_PUBLIC_ADDRESS, publicAddress) .configure(BrooklynNode.CLASSPATH, Splitter.on(":").splitToList(classpath)) .configure(BrooklynNode.NO_WEB_CONSOLE_AUTHENTICATION, Boolean.TRUE.equals(skipSecurityFilter)) .configure(BrooklynNode.NO_SHUTDOWN_ON_EXIT, stopWhichAppsOnShutdown == StopWhichAppsOnShutdown.NONE) .displayName("Brooklyn Console")); } }; LocationSpec<?> spec = LocationSpec.create(LocalhostMachine.class).displayName("Local Brooklyn"); Location localhost = managementContext.getLocationManager().createLocation(spec); brooklyn.appDisplayName("Brooklyn") .manage(managementContext) .start(ImmutableList.of(localhost)); }
Source:
protected void testExecute_instructorAsStudentWithCourseId_shouldReturnAllSessionsForCourseOfStudent() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); StudentAttributes student2InCourse2 = typicalBundle.students.get("student2InCourse2"); loginAsStudentInstructor(instructor1OfCourse1.googleId); String[] submissionParam = { Const.ParamsNames.COURSE_ID, student2InCourse2.getCourse(), Const.ParamsNames.ENTITY_TYPE, Const.EntityType.STUDENT, }; GetFeedbackSessionsAction action = getAction(submissionParam); FeedbackSessionsData fsData = (FeedbackSessionsData) getJsonResult(action).getOutput(); assertEquals(2, fsData.getFeedbackSessions().size()); for (FeedbackSessionData sessionData : fsData.getFeedbackSessions()) { assertEquals(student2InCourse2.getCourse(), sessionData.getCourseId()); assertNull(sessionData.getDeletedAtTimestamp()); assertTrue(sessionsInCourse2.stream().anyMatch(session -> session.getFeedbackSessionName().equals(sessionData.getFeedbackSessionName()))); } }

Target:
protected void testExecute_instructorAsStudentWithCourseId_shouldReturnAllSessionsForCourseOfStudent() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); StudentAttributes student2InCourse2 = typicalBundle.students.get("student2InCourse2"); loginAsStudentInstructor(instructor1OfCourse1.googleId); String[] submissionParam = { Const.ParamsNames.COURSE_ID, student2InCourse2.getCourse(), Const.ParamsNames.ENTITY_TYPE, Const.EntityType.STUDENT, }; GetFeedbackSessionsAction action = getAction(submissionParam); FeedbackSessionsData fsData = (FeedbackSessionsData) getJsonResult(action).getOutput(); assertAllStudentSessionsMatch(fsData, sessionsInCourse2); }
Source:
private void interpretCommandStatus(String status, ResultHandler handler) { long oid = 0; long count = 0; Matcher matcher = COMMAND_COMPLETE_MATCHER.reset(status); if (matcher.matches()) { String group2 = matcher.group(2); String group3 = matcher.group(3); try { if (group3 != null) { oid = Long.parseLong(group2); count = Long.parseLong(group3); } else if (group2 != null) { count = Long.parseLong(group2); } } catch (NumberFormatException e) { handler.handleError(new PSQLException( GT.tr("Unable to parse the count in command completion tag: {0}.", status), PSQLState.CONNECTION_FAILURE)); return; } } int countAsInt = 0; if (count > Integer.MAX_VALUE) { countAsInt = Statement.SUCCESS_NO_INFO; } else if (count > 0) { countAsInt = (int) count; } handler.handleCommandStatus(status, countAsInt, oid); }

Target:
private void interpretCommandStatus(String status, ResultHandler handler) { long oid = 0; long count = 0; Matcher matcher = commandCompleteMatcher.reset(status); if (matcher.matches()) { String group2 = matcher.group(2); String group3 = matcher.group(3); try { if (group3 != null) { oid = Long.parseLong(group2); count = Long.parseLong(group3); } else if (group2 != null) { count = Long.parseLong(group2); } } catch (NumberFormatException e) { handler.handleError(new PSQLException( GT.tr("Unable to parse the count in command completion tag: {0}.", status), PSQLState.CONNECTION_FAILURE)); return; } } int countAsInt = 0; if (count > Integer.MAX_VALUE) { countAsInt = Statement.SUCCESS_NO_INFO; } else if (count > 0) { countAsInt = (int) count; } handler.handleCommandStatus(status, countAsInt, oid); }
Source:
public static void createProjects(final Repository repository, final IProgressMonitor monitor) throws CoreException { List<File> projects = new ArrayList<File>(); if (ProjectUtil.findProjectFiles(projects, repository.getWorkTree() .getParentFile(), null, monitor)) for (File file : projects) ProjectUtil.createProject(repository, file, monitor); }

Target:
public static void createProjects(final Repository repository, final IProgressMonitor monitor) throws CoreException { List<File> projects = new ArrayList<File>(); if (ProjectUtil.findProjectFiles(projects, repository.getWorkTree(), null, monitor)) for (File file : projects) ProjectUtil.createProject(repository, file, monitor); }
Source:
private void threadSummary() { List<String> prefixes = Lists.newArrayList("HTTP", "IntraLineDiff", "ReceiveCommits", "SSH git-receive-pack", "SSH git-upload-pack", "SSH-Interactive-Worker", "SSH-Stream-Worker", "SshCommandStart"); Runtime r = Runtime.getRuntime(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); stdout.format("Threads: %d cpus available, %d threads\n", r.availableProcessors(), threadMXBean.getThreadCount()); Table<String, Thread.State, Integer> count = HashBasedTable.create(); for (long id : threadMXBean.getAllThreadIds()) { ThreadInfo info = threadMXBean.getThreadInfo(id); if (info == null) { continue; } String name = info.getThreadName(); for (String p : prefixes) { if (name.startsWith(p)) { Thread.State state = info.getThreadState(); Integer c = count.get(p, state); count.put(p, info.getThreadState(), c != null ? c++ : 1); } } } stdout.print(String.format(" %22s", "")); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14s", s.name())); } stdout.print('\n'); for (String p : prefixes) { stdout.print(String.format(" %-22s", p)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(p, s)))); } stdout.print('\n'); } stdout.print('\n'); }

Target:
private void threadSummary() { List<String> prefixes = Lists.newArrayList("HTTP", "IntraLineDiff", "ReceiveCommits", "SSH git-receive-pack", "SSH git-upload-pack", "SSH-Interactive-Worker", "SSH-Stream-Worker", "SshCommandStart"); Runtime r = Runtime.getRuntime(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); stdout.format("Threads: %d CPUs available, %d threads\n", r.availableProcessors(), threadMXBean.getThreadCount()); Table<String, Thread.State, Integer> count = HashBasedTable.create(); for (long id : threadMXBean.getAllThreadIds()) { ThreadInfo info = threadMXBean.getThreadInfo(id); if (info == null) { continue; } String name = info.getThreadName(); for (String p : prefixes) { if (name.startsWith(p)) { Thread.State state = info.getThreadState(); Integer c = count.get(p, state); count.put(p, info.getThreadState(), c != null ? c++ : 1); } } } stdout.print(String.format(" %22s", "")); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14s", s.name())); } stdout.print('\n'); for (String p : prefixes) { stdout.print(String.format(" %-22s", p)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(p, s)))); } stdout.print('\n'); } stdout.print('\n'); }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); SchemaValidator.validateFieldsArePresentInSchema(inputSchema, kvTableConfig.keyField); SchemaValidator.validateFieldsArePresentInSchema(inputSchema, kvTableConfig.valueField); validateSchemaTypeIsStringOrBytes(inputSchema, kvTableConfig.keyField); validateSchemaTypeIsStringOrBytes(inputSchema, kvTableConfig.valueField); }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { SchemaValidator.validateFieldsArePresentInSchema(inputSchema, kvTableConfig.keyField); SchemaValidator.validateFieldsArePresentInSchema(inputSchema, kvTableConfig.valueField); validateSchemaTypeIsStringOrBytes(inputSchema, kvTableConfig.keyField, false); validateSchemaTypeIsStringOrBytes(inputSchema, kvTableConfig.valueField, true); } }
Source:
@Override public boolean equals(Object obj) { if (!(obj instanceof TimeWithTimeZone)) { return false; } TimeWithTimeZone that = (TimeWithTimeZone) obj; return milliOfDay == that.milliOfDay && timeZone == that.timeZone; }

Target:
@Override public boolean equals(Object obj) { if (!(obj instanceof TimeWithTimeZone)) { return false; } TimeWithTimeZone that = (TimeWithTimeZone) obj; return milliOfDay == that.milliOfDay && timeZone.equals(that.timeZone); }
Source:
public int getMaxIntermediateSize() { return Long.BYTES + Double.BYTES + 1; }

Target:
public int getMaxIntermediateSize() { return Long.BYTES + Byte.BYTES + Double.BYTES; }
Source:
public String findPlacement(Bundle networkExtras, Bundle serverParameters) { String placement = null; if (networkExtras != null && networkExtras.containsKey(VungleExtrasBuilder.EXTRA_PLAY_PLACEMENT)) { placement = networkExtras.getString(VungleExtrasBuilder.EXTRA_PLAY_PLACEMENT); } if (serverParameters != null && serverParameters.containsKey(PLAYING_PLACEMENT)) { if (placement != null) { Log.i(TAG, "'placementID' had a value in both serverParameters and networkExtras. " + "Used one from serverParameters"); } placement = serverParameters.getString(PLAYING_PLACEMENT); } if (placement == null) { Log.e(TAG, "placementID not provided from serverParameters. Please check your AdMob dashboard settings." + "load and play functionality will not work"); } return placement; }

Target:
public String findPlacement(Bundle networkExtras, Bundle serverParameters) { String placement = null; if (networkExtras != null && networkExtras.containsKey(VungleExtrasBuilder.EXTRA_PLAY_PLACEMENT)) { placement = networkExtras.getString(VungleExtrasBuilder.EXTRA_PLAY_PLACEMENT); } if (serverParameters != null && serverParameters.containsKey(PLAYING_PLACEMENT)) { if (placement != null) { Log.i(TAG, "'placementID' had a value in both serverParameters and networkExtras. " + "Used one from serverParameters"); } placement = serverParameters.getString(PLAYING_PLACEMENT); } if (placement == null) { Log.e(TAG, "placementID not provided from serverParameters."); } return placement; }
Source:
public String getDescription() { return "This strategy is is a specialization in order to be able to drop a Parameter inside Parameter Property."; }

Target:
public String getDescription() { return "This strategy is is a specialization in order to be able to drop a Parameter."; }