auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } GlusterVolumeEntity volume = getGlusterVolumeDao().getById(getGlusterVolumeId()); if (volume != null && volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!GlusterUtil.getInstance().isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume != null && volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!GlusterUtil.getInstance().isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } return true; }
Source:
public static QuotaDAO getQuotaDAO() { return DbFacade.getInstance() .getQuotaDao(); }

Target:
public QuotaDAO getQuotaDAO() { return DbFacade.getInstance() .getQuotaDao(); }
Source:
public void onChildOpened( @NonNull Network network, @NonNull ChildSessionConfiguration childConfig) { if (!isActiveNetwork(network)) { Log.d(TAG, "onOpened called for obsolete network " + network); return; } try { final String interfaceName = mTunnelIface.getInterfaceName(); final int maxMtu = mProfile.getMaxMtu(); final List<LinkAddress> internalAddresses = childConfig.getInternalAddresses(); final List<String> dnsAddrStrings = new ArrayList<>(); final Collection<RouteInfo> newRoutes = VpnIkev2Utils.getRoutesFromTrafficSelectors( childConfig.getOutboundTrafficSelectors()); for (final LinkAddress address : internalAddresses) { mTunnelIface.addAddress(address.getAddress(), address.getPrefixLength()); } for (InetAddress addr : childConfig.getInternalDnsServers()) { dnsAddrStrings.add(addr.getHostAddress()); } final NetworkAgent networkAgent; final LinkProperties lp; synchronized (Vpn.this) { mInterface = interfaceName; mConfig.mtu = maxMtu; mConfig.interfaze = mInterface; mConfig.addresses.clear(); mConfig.addresses.addAll(internalAddresses); mConfig.routes.clear(); mConfig.routes.addAll(newRoutes); mConfig.dnsServers.clear(); mConfig.dnsServers.addAll(dnsAddrStrings); networkAgent = mNetworkAgent; if (networkAgent == null) { if (isSettingsVpnLocked()) { prepareStatusIntent(); } agentConnect(); return; } lp = makeLinkProperties(); } networkAgent.sendLinkProperties(lp); } catch (Exception e) { Log.d(TAG, "Error in ChildOpened for network " + network, e); onSessionLost(network); } }

Target:
public void onChildOpened( @NonNull Network network, @NonNull ChildSessionConfiguration childConfig) { if (!isActiveNetwork(network)) { Log.d(TAG, "onOpened called for obsolete network " + network); return; } try { final String interfaceName = mTunnelIface.getInterfaceName(); final int maxMtu = mProfile.getMaxMtu(); final List<LinkAddress> internalAddresses = childConfig.getInternalAddresses(); final List<String> dnsAddrStrings = new ArrayList<>(); final Collection<RouteInfo> newRoutes = VpnIkev2Utils.getRoutesFromTrafficSelectors( childConfig.getOutboundTrafficSelectors()); for (final LinkAddress address : internalAddresses) { mTunnelIface.addAddress(address.getAddress(), address.getPrefixLength()); } for (InetAddress addr : childConfig.getInternalDnsServers()) { dnsAddrStrings.add(addr.getHostAddress()); } final NetworkAgent networkAgent; final LinkProperties lp; synchronized (Vpn.this) { mInterface = interfaceName; mConfig.mtu = maxMtu; mConfig.interfaze = mInterface; mConfig.addresses.clear(); mConfig.addresses.addAll(internalAddresses); mConfig.routes.clear(); mConfig.routes.addAll(newRoutes); if (mConfig.dnsServers == null) mConfig.dnsServers = new ArrayList<>(); mConfig.dnsServers.clear(); mConfig.dnsServers.addAll(dnsAddrStrings); networkAgent = mNetworkAgent; if (networkAgent == null) { if (isSettingsVpnLocked()) { prepareStatusIntent(); } agentConnect(); return; } lp = makeLinkProperties(); } networkAgent.sendLinkProperties(lp); } catch (Exception e) { Log.d(TAG, "Error in ChildOpened for network " + network, e); onSessionLost(network); } }
Source:
public void compactAll(long compactionId, UserCompactionConfig compactionConfig) { boolean updateMetadata = false; synchronized (this) { if (lastCompactID >= compactionId) return; if (isMinorCompactionRunning()) { if (compactionWaitInfo.compactionID == compactionId) { if (lastFlushID == compactionWaitInfo.flushID) return; } else { compactionWaitInfo.compactionID = compactionId; compactionWaitInfo.flushID = lastFlushID; return; } } if (isClosing() || isClosed() || majorCompactionQueued.contains(MajorCompactionReason.USER) || isMajorCompactionRunning()) return; CompactionStrategyConfig strategyConfig = compactionConfig.getCompactionStrategy(); CompactionStrategy strategy = createCompactionStrategy(strategyConfig); MajorCompactionRequest request = new MajorCompactionRequest(extent, MajorCompactionReason.USER, tableConfiguration, context); request.setFiles(getDatafileManager().getDatafileSizes()); try { if (strategy.shouldCompact(request)) { initiateMajorCompaction(MajorCompactionReason.USER); } else { majorCompactionState = CompactionState.IN_PROGRESS; updateMetadata = true; lastCompactID = compactionId; } } catch (IOException e) { throw new RuntimeException("IOException on " + extent + " during compact all", e); } } if (updateMetadata) { try { MetadataTableUtil.updateTabletCompactID(extent, compactionId, getTabletServer().getContext(), getTabletServer().getLock()); } finally { synchronized (this) { majorCompactionState = null; this.notifyAll(); } } } }

Target:
public void compactAll(long compactionId, UserCompactionConfig compactionConfig) { boolean updateMetadata = false; synchronized (this) { if (lastCompactID >= compactionId) return; if (isMinorCompactionRunning()) { if (compactionWaitInfo.compactionID == compactionId) { if (lastFlushID == compactionWaitInfo.flushID) return; } else { compactionWaitInfo.compactionID = compactionId; compactionWaitInfo.flushID = lastFlushID; return; } } if (isClosing() || isClosed() || majorCompactionQueued.contains(MajorCompactionReason.USER) || isMajorCompactionRunning()) return; CompactionStrategyConfig strategyConfig = compactionConfig.getCompactionStrategy(); CompactionStrategy strategy = createCompactionStrategy(strategyConfig); MajorCompactionRequest request = new MajorCompactionRequest(extent, MajorCompactionReason.USER, tableConfiguration, context); request.setFiles(getDatafileManager().getDatafileSizes()); try { if (strategy.shouldCompact(request)) { initiateMajorCompaction(MajorCompactionReason.USER); } else { majorCompactionState = CompactionState.IN_PROGRESS; updateMetadata = true; lastCompactID = compactionId; } } catch (IOException e) { throw new UncheckedIOException("IOException on " + extent + " during compact all", e); } } if (updateMetadata) { try { MetadataTableUtil.updateTabletCompactID(extent, compactionId, getTabletServer().getContext(), getTabletServer().getLock()); } finally { synchronized (this) { majorCompactionState = null; this.notifyAll(); } } } }
Source:
protected Hardware resolveHardware(Set<? extends Hardware> hardwarel, final Iterable<? extends Image> images) { try { return super.resolveHardware(hardwarel, images); } catch (NoSuchElementException ex) { if (minCores <= 0 || minRam == 0 || minDisk < 0) { throw new IllegalArgumentException("Please, set minCores, minRam and minDisk to positive values."); } return automaticHardware(minCores, minRam, minDisk == 0 ? Optional.<Float>absent() : Optional.of((float)minDisk)); } }

Target:
protected Hardware resolveHardware(Set<? extends Hardware> hardwarel, final Iterable<? extends Image> images) { try { return super.resolveHardware(hardwarel, images); } catch (NoSuchElementException ex) { if (minCores <= 0 || minRam == 0 || minDisk < 0) { throw new IllegalArgumentException("No hardware profile matching the given criteria was found. If you" + " want to use exact values, please set the minCores, minRam and minDisk to positive values."); } return automaticHardware(minCores, minRam, minDisk == 0 ? Optional.<Float>absent() : Optional.of((float)minDisk)); } }
Source:
public void setUp() throws Exception { setFixture(ModelelementsFactory.eINSTANCE.createElementGroup()); model = SysMLTestResources.createSysMLModel(houseKeeper.createResourceSet()); if(model == null) { fail(); } if(model.getAppliedProfiles().isEmpty()) { fail(); } defaultComment= model.createOwnedComment(); default_elementgroup = (ElementGroup)StereotypeApplicationHelper.getInstance(null).applyStereotype(defaultComment, ModelelementsPackage.eINSTANCE.getElementGroup()); defaultComment.setBody(criterion); class1 = model.createOwnedClass("Class1", false); class2 = model.createOwnedClass("Class2", false); defaultComment.getAnnotatedElements().add(class1); defaultComment.getAnnotatedElements().add(class2); }

Target:
public void setUp() throws Exception { setFixture(ModelelementsFactory.eINSTANCE.createElementGroup()); model = SysMLTestResources.createSysMLModel(houseKeeper.createResourceSet()); if(model == null) { fail("The model is not created."); } if(model.getAppliedProfiles().isEmpty()) { fail(" the Sysml profil has not be applied."); } defaultComment= model.createOwnedComment(); default_elementgroup = (ElementGroup)StereotypeApplicationHelper.getInstance(null).applyStereotype(defaultComment, ModelelementsPackage.eINSTANCE.getElementGroup()); defaultComment.setBody(criterion); class1 = model.createOwnedClass("Class1", false); class2 = model.createOwnedClass("Class2", false); defaultComment.getAnnotatedElements().add(class1); defaultComment.getAnnotatedElements().add(class2); }
Source:
public Set<K> keySet(Predicate predicate) { checkNotNull(predicate, "Predicate cannot be null!"); Set<K> resultingSet = new HashSet<K>(); Set<QueryableEntry> query = indexes.query(predicate); if (query != null) { for (QueryableEntry entry : query) { K key = (K) serializationService.toObject(entry.getKeyData()); resultingSet.add(key); } } else { doFullKeyScan(predicate, resultingSet); } return resultingSet; }

Target:
public Set<K> keySet(Predicate predicate) { checkNotNull(predicate, "Predicate cannot be null!"); Set<K> resultingSet = new HashSet<K>(); Set<QueryableEntry> query = indexes.query(predicate); if (query != null) { for (QueryableEntry entry : query) { K key = toObject(entry.getKeyData()); resultingSet.add(key); } } else { doFullKeyScan(predicate, resultingSet); } return resultingSet; }
Source:
private synchronized void display() { try { token.acquire(); if ((searchFilteredList.size() > 0) && (pageIndex <= searchFilteredList.size())) { builder.append("<html><body><table cellpadding=0 cellspacing=0>"); builder.append(buildString(searchFilteredList.get(pageIndex-1).getMessages())); } else { builder.replace(0, builder.length(), ""); builder.append("<b>") .append(Res.getString("message.no.history.found")) .append("</b>"); } window.setText(builder.toString()); try { String text = searchQuery; Document doc = window.getDocument(); String line; if (text.length() > 0 && focusFlag) { String str = doc.getText(1, doc.getLength()); BufferedReader buf = new BufferedReader(new StringReader(str)); int globalPos = 1; while ((line = buf.readLine()) != null){ Matcher matcherTime = Pattern .compile("\\(\\d\\d:\\d\\d:\\d\\d\\)\\s[a-zA-Z0-9]+:\\s") .matcher(line); if (matcherTime.find()) { for (int i = matcherTime.end(); i + text.length() < line.length() + 1; i++) { String match = line.substring(i, i + text.length()); if (text.toLowerCase().equals(match.toLowerCase())) { window.getHighlighter().addHighlight(globalPos + i, globalPos + i + text.length(), highlighter); } } } globalPos = globalPos + line.length() + 1; } } } catch (BadLocationException | IOException ex) { ex.printStackTrace(); } builder.replace(0, builder.length(), ""); if (window.getText().length() > 0) window.setCaretPosition(0); pageCounter.setText(pageIndex + " / " + maxPages); token.release(); } catch (InterruptedException e) { Log.error(e); e.printStackTrace(); } }

Target:
private synchronized void display() { try { token.acquire(); if ((searchFilteredList.size() > 0) && (pageIndex <= searchFilteredList.size())) { builder.append("<html><body><table cellpadding=0 cellspacing=0>"); builder.append(buildString(searchFilteredList.get(pageIndex-1).getMessages())); } else { builder.replace(0, builder.length(), ""); builder.append("<b>") .append(Res.getString("message.no.history.found")) .append("</b>"); } window.setText(builder.toString()); try { String text = searchQuery; Document doc = window.getDocument(); String line; if (text.length() > 0 && focusFlag) { String str = doc.getText(1, doc.getLength()); BufferedReader buf = new BufferedReader(new StringReader(str)); int globalPos = 1; while ((line = buf.readLine()) != null){ Matcher matcherTime = Pattern .compile("\\(\\d\\d:\\d\\d:\\d\\d\\)\\s[a-zA-Z0-9]+:\\s") .matcher(line); if (matcherTime.find()) { for (int i = matcherTime.end(); i + text.length() < line.length() + 1; i++) { String match = line.substring(i, i + text.length()); if (text.equalsIgnoreCase(match)) { window.getHighlighter().addHighlight(globalPos + i, globalPos + i + text.length(), highlighter); } } } globalPos = globalPos + line.length() + 1; } } } catch (BadLocationException | IOException ex) { Log.error(ex); ex.printStackTrace(); } builder.replace(0, builder.length(), ""); if (window.getText().length() > 0) window.setCaretPosition(0); pageCounter.setText(pageIndex + " / " + maxPages); token.release(); } catch (InterruptedException e) { Log.error(e); e.printStackTrace(); } }
Source:
public void unselect() { fieldElement.removeClassName(ConstantHolder.SELECTED); checkElement.getStyle().setDisplay(Style.Display.NONE); }

Target:
public void unselect() { fieldElement.removeClassName(ConstantHolder.SELECTED); showCheck(false); }
Source:
public void invalidateVisualState() { if (this.value.getText().startsWith("?")) { this.getNextValue(5); } super.invalidateVisualState(); }

Target:
public void invalidateVisualState() { if (this.hasValue != this.output.hasConnection()) { this.getNextValue(5); } super.invalidateVisualState(); }
Source:
synchronized void setForumSelection(final String forumSelection) { this.forumSelection = Optional.ofNullable(forumSelection) .filter(Predicates.not(String::isBlank)) .orElse(getForumSelectionOptions().iterator().next()); Postconditions.assertState( this.forumSelection != null && !this.forumSelection.isBlank(), "Forum selection is driven by a drop-down to ensure user can never set it to null, " + "if setting to null from a game properties, we default to the first available " + "selection entry, forum selection should never be null or empty."); forumUsername = this.forumSelection.equals(NodeBbForumPoster.TRIPLEA_FORUM_DISPLAY_NAME) ? ClientSetting.tripleaForumUsername.getValue().map(String::valueOf).orElse("") : ClientSetting.aaForumUsername.getValue().map(String::valueOf).orElse(""); forumPassword = this.forumSelection.equals(NodeBbForumPoster.TRIPLEA_FORUM_DISPLAY_NAME) ? ClientSetting.tripleaForumPassword.getValue().orElse(new char[] {}) : ClientSetting.aaForumPassword.getValue().orElse(new char[] {}); readyCallback.run(); }

Target:
synchronized void setForumSelection(final String forumSelection) { this.forumSelection = Optional.ofNullable(forumSelection) .filter(Predicate.not(String::isBlank)) .orElse(getForumSelectionOptions().iterator().next()); Postconditions.assertState( this.forumSelection != null && !this.forumSelection.isBlank(), "Forum selection is driven by a drop-down to ensure user can never set it to null, " + "if setting to null from a game properties, we default to the first available " + "selection entry, forum selection should never be null or empty."); forumUsername = this.forumSelection.equals(NodeBbForumPoster.TRIPLEA_FORUM_DISPLAY_NAME) ? ClientSetting.tripleaForumUsername.getValue().map(String::valueOf).orElse("") : ClientSetting.aaForumUsername.getValue().map(String::valueOf).orElse(""); forumPassword = this.forumSelection.equals(NodeBbForumPoster.TRIPLEA_FORUM_DISPLAY_NAME) ? ClientSetting.tripleaForumPassword.getValue().orElse(new char[0]) : ClientSetting.aaForumPassword.getValue().orElse(new char[0]); readyCallback.run(); }
Source:
public void testVmOvfCreation() throws Exception{ VM vm = createVM(); String xml = manager.ExportVm(vm, new ArrayList<DiskImage>()); assertNotNull(xml); final VM newVm = new VM(); manager.ImportVm(xml, newVm, new ArrayList<DiskImage>(), new ArrayList<VmNetworkInterface>()); assertEquals(vm, newVm); assertEquals(newVm.getDbGeneration(), vm.getDbGeneration()); }

Target:
public void testVmOvfCreation() throws Exception { VM vm = createVM(); String xml = manager.ExportVm(vm, new ArrayList<DiskImage>()); assertNotNull(xml); final VM newVm = new VM(); manager.ImportVm(xml, newVm, new ArrayList<DiskImage>(), new ArrayList<VmNetworkInterface>()); assertEquals("imported vm is different than expected", vm, newVm); assertEquals("imported db generation is different than expected",newVm.getDbGeneration(), vm.getDbGeneration()); }
Source:
public Object evaluate(DeferredObject[] arguments) throws HiveException{ String uriHost = PrimitiveObjectInspectorUtils.getString( arguments[0].get(), (PrimitiveObjectInspector) argumentsOI[0]); String uriPath = PrimitiveObjectInspectorUtils.getString( arguments[1].get(), (PrimitiveObjectInspector) argumentsOI[1]); String uriQuery = PrimitiveObjectInspectorUtils.getString( arguments[2].get(), (PrimitiveObjectInspector) argumentsOI[2]); ; String httpStatus = PrimitiveObjectInspectorUtils.getString( arguments[3].get(), (PrimitiveObjectInspector) argumentsOI[3]); String contentType = PrimitiveObjectInspectorUtils.getString( arguments[4].get(), (PrimitiveObjectInspector) argumentsOI[4]); String userAgent = PrimitiveObjectInspectorUtils.getString( arguments[5].get(), (PrimitiveObjectInspector) argumentsOI[5]); String rawXAnalyticsHeader = ""; if (checkForXAnalytics) { rawXAnalyticsHeader = PrimitiveObjectInspectorUtils.getString( arguments[6].get(), (PrimitiveObjectInspector) argumentsOI[6]); } if (Constants.REDIRECT_HTTP_CODES.contains(httpStatus) && (Constants.PAGEVIEW_WORTHY_CONTENT_TYPES.contains(contentType) || contentType.trim().equals("-")) ){ WebrequestData webrequestData = new WebrequestData(uriHost, uriPath, uriQuery, "200", "text/html", userAgent, rawXAnalyticsHeader); return PageviewDefinition.getInstance().isPageview(webrequestData); } else { return false; } }

Target:
public Object evaluate(DeferredObject[] arguments) throws HiveException{ String uriHost = PrimitiveObjectInspectorUtils.getString( arguments[0].get(), (PrimitiveObjectInspector) argumentsOI[0]); String uriPath = PrimitiveObjectInspectorUtils.getString( arguments[1].get(), (PrimitiveObjectInspector) argumentsOI[1]); String uriQuery = PrimitiveObjectInspectorUtils.getString( arguments[2].get(), (PrimitiveObjectInspector) argumentsOI[2]); ; String httpStatus = PrimitiveObjectInspectorUtils.getString( arguments[3].get(), (PrimitiveObjectInspector) argumentsOI[3]); String contentType = PrimitiveObjectInspectorUtils.getString( arguments[4].get(), (PrimitiveObjectInspector) argumentsOI[4]); String userAgent = PrimitiveObjectInspectorUtils.getString( arguments[5].get(), (PrimitiveObjectInspector) argumentsOI[5]); String rawXAnalyticsHeader = ""; if (checkForXAnalytics) { rawXAnalyticsHeader = PrimitiveObjectInspectorUtils.getString( arguments[6].get(), (PrimitiveObjectInspector) argumentsOI[6]); } WebrequestData webrequestData = new WebrequestData(uriHost, uriPath, uriQuery, httpStatus, contentType, userAgent, rawXAnalyticsHeader); return RedirectToPageview.getInstance().isRedirectToPageview(webrequestData); }
Source:
public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history input stream should not be null"); } int version = getVersion(historyFileContents); switch (version) { case 1: return new JobHistoryFileParserHadoop1(); case 2: return new JobHistoryFileParserHadoop2(); default: throw new IllegalArgumentException( " Unknown format of job history file "); } }

Target:
public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } int version = getVersion(historyFileContents); switch (version) { case 1: return new JobHistoryFileParserHadoop1(); case 2: return new JobHistoryFileParserHadoop2(); default: throw new IllegalArgumentException( " Unknown format of job history file "); } }
Source:
Map<String, Long> getExternalResources(Resource resource) throws Exception { if (!isYarnResourceTypesAvailable) { throw new UnsupportedOperationException("Should not try to get ResourceInformation because the underlying Yarn does not support it."); } final Map<String, Long> externalResources = new HashMap<>(); final Object[] externalResourcesInfo = (Object[]) getResourceValueMethod.invoke(resource); for (int i = 2; i < externalResourcesInfo.length; i++) { final String name = (String) getInfoNameMethod.invoke(externalResourcesInfo[i]); final long value = (long) getInfoValueMethod.invoke(externalResourcesInfo[i]); externalResources.put(name, value); } return externalResources; }

Target:
Map<String, Long> getExternalResources(Resource resource) { return getExternalResourcesUnSafe(resource); }
Source:
public Integer add(Stream<E> entities) { return delegate().add(entities.filter(entity -> { boolean permitted = isOperationPermitted(entity, Action.CREATE); if (permitted) { createAcl(entity); } return permitted; })); }

Target:
public Integer add(Stream<E> entities) { return delegate().add(entities.filter(entity -> { isOperationPermitted(entity, Action.CREATE); createAcl(entity); return true; })); }
Source:
@Test public void testPushAggregateThroughtOuterJoin9() { final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(AggregateProjectMergeRule.INSTANCE) .build(); final HepProgram program = new HepProgramBuilder() .addRuleInstance(AggregateJoinTransposeRule.EXTENDED) .build(); final String sql = "select e.job, d.name\n" + "from (select * from sales.emp where empno = 10) as e\n" + "join sales.dept as d on e.job = d.name\n" + "and e.deptno + e.empno = d.deptno + 5\n" + "group by e.job, d.name"; checkPlanning(tester, preProgram, new HepPlanner(program), sql); }

Target:
@Test public void testPushAggregateThroughtOuterJoin9() { final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(AggregateProjectMergeRule.INSTANCE) .build(); final HepProgram program = new HepProgramBuilder() .addRuleInstance(AggregateJoinTransposeRule.EXTENDED) .build(); final String sql = "select e.job, d.name\n" + "from (select * from sales.emp where empno = 10) as e\n" + "left outer join sales.dept as d on e.job = d.name\n" + "and e.deptno + e.empno = d.deptno + 5\n" + "group by e.job, d.name"; checkPlanning(tester, preProgram, new HepPlanner(program), sql); }
Source:
public static String digest(String script) { try { return new String(MessageDigest.getInstance("MD5").digest(script.getBytes())); } catch (NoSuchAlgorithmException e) { return script; } }

Target:
public static String digest(String script) { try { return new String(MessageDigest.getInstance(MD5).digest(script.getBytes())); } catch (NoSuchAlgorithmException e) { logger.error("No algorithm found, digest will use the script content", e); return script; } }
Source:
public void loadConfiguredFileSystem() throws Exception { abfsConfig.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, false); String[] authorityParts = (new java.net.URI(rawConfig.get(FS_AZURE_CONTRACT_TEST_URI))).getRawAuthority().split( AbfsHttpConstants.AZURE_DISTRIBUTED_FILE_SYSTEM_AUTHORITY_DELIMITER, 2);; this.fileSystemName = authorityParts[0]; final String abfsUrl = this.getFileSystemName() + "@" + this.getAccountName(); URI defaultUri = null; defaultUri = new URI(abfsScheme, abfsUrl, null, null, null); this.testUrl = defaultUri.toString(); abfsConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, defaultUri.toString()); useConfiguredFileSystem = true; }

Target:
public void loadConfiguredFileSystem() throws Exception { abfsConfig.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, false); String[] authorityParts = (new URI(rawConfig.get(FS_AZURE_CONTRACT_TEST_URI))).getRawAuthority().split( AbfsHttpConstants.AZURE_DISTRIBUTED_FILE_SYSTEM_AUTHORITY_DELIMITER, 2); this.fileSystemName = authorityParts[0]; final String abfsUrl = this.getFileSystemName() + "@" + this.getAccountName(); URI defaultUri = null; defaultUri = new URI(abfsScheme, abfsUrl, null, null, null); this.testUrl = defaultUri.toString(); abfsConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, defaultUri.toString()); useConfiguredFileSystem = true; }
Source:
private int zigzagDecode(int input) { return (input >> 1) ^ (-(input & 1)); }

Target:
private int zigzagDecode(int input) { return (input >>> 1) ^ (-(input & 1)); }
Source:
public void deleteUpdateCacheStorageTest() { CacheStorageImpl cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1= new HashMap<>(); queryState1.put(oid1, value1); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertEquals(true, cache.delete(qid1)); Assert.assertEquals(false, cache.update(qid1, oid1, value2)); }

Target:
public void deleteUpdateCacheStorageTest() { final CacheStorage cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1 = new HashMap<>(); queryState1.put(oid1, value1); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertTrue(cache.delete(qid1)); Assert.assertFalse(cache.update(qid1, oid1, value2)); }
Source:
protected String doInBackground(String... url) { url[0] = url[0].replaceAll("https://", "").replaceAll("http://", ""); try { if (isHttpsWebsite(url[0])) return ("https://" + url[0]); else if (isHttpWebsite(url[0])) return ("http://" + url[0]); else return (null); } catch (IOException e) { e.printStackTrace(); return (null); } }

Target:
protected String doInBackground(String... url) { String newUrl = url[0].replaceAll("https://", "").replaceAll("http://", ""); try { if (isHttpsWebsite(newUrl)) return ("https://" + newUrl); else if (isHttpWebsite(newUrl)) return ("http://" + newUrl); else return ("https://" + newUrl); } catch (IOException e) { e.printStackTrace(); return ("https://" + newUrl); } }
Source:
public void filteredMessage(HttpMessage msg, String reason) { try { filterMessageTableModel.addScanResult(SessionStructure.getNodeName(msg), reason); } catch (URIException e) { log.error( "Error while adding message information to filter message table model: " + e.getMessage(), e); } }

Target:
public void filteredMessage(HttpMessage msg, String reason) { filterMessageTableModel.addResult(msg.getRequestHeader().getURI().toString(), reason); }
Source:
public static boolean isSlightTurn(int type) { return !isLeftTurn(type) && !isRightTurn(type) && type != TU && type != TRU && type != OFFR; }

Target:
public static boolean isSlightTurn(int type) { return type == TSLL || type == TSLR || type == C || type == KL || type == KR; }
Source:
public void validate() { Matcher matcher = pattern.matcher(name); if (!matcher.find()) { throw new MalformedPluginConfigurationException( String.format("Invalid plugin name: %s", name)); } }

Target:
public void validate() { if (!PLUGIN_NAME_PATTERN.matcher(name).matches()) { throw new MalformedPluginConfigurationException( String.format("Invalid plugin name: %s", name)); } }
Source:
public QueryMemoryInfo(QueryId queryId, MemoryPoolId memoryPoolId, long memoryReservation) { this.queryId = queryId; this.memoryPoolId = memoryPoolId; this.memoryReservation = memoryReservation; }

Target:
public QueryMemoryInfo(QueryId queryId, MemoryPoolId memoryPoolId, long memoryReservation) { this.queryId = requireNonNull(queryId, "queryId is null"); this.memoryPoolId = requireNonNull(memoryPoolId, "memoryPoolId is null"); this.memoryReservation = memoryReservation; }
Source:
protected void onInit() throws ServletException { SubdomainResolver subdomainResolver = new SubdomainResolver(); subdomainResolver.setBaseDomainName(getConfig().get("stormpath.web.application.domain")); DefaultOrganizationNameKeyResolver organizationNameKeyResolver = new DefaultOrganizationNameKeyResolver(); organizationNameKeyResolver.setSubdomainResolver(subdomainResolver); DefaultSamlOrganizationResolver samlOrganizationResolver = new DefaultSamlOrganizationResolver(); samlOrganizationResolver.setOrganizationNameKeyResolver(organizationNameKeyResolver); SamlController controller = new SamlController(); controller.setServerUriResolver(new DefaultServerUriResolver()); controller.setSamlUri("/"); controller.setCallbackUri(getConfig().get("stormpath.web.saml.result.uri")); controller.setAlreadyLoggedInUri(getConfig().getLoginControllerConfig().getNextUri()); controller.setSamlOrganizationResolver(samlOrganizationResolver); controller.init(); setController(controller); super.onInit(); }

Target:
protected void onInit() throws ServletException { super.onInit(); }
Source:
public void createAnonAccessDeniedTest() throws Exception { context.turnOffAuthorisationSystem(); ObjectMapper mapper = new ObjectMapper(); EPersonRest data = new EPersonRest(); EPersonRest dataFull = new EPersonRest(); MetadataRest metadataRest = new MetadataRest(); data.setEmail("createtest@fake-email.com"); data.setCanLogIn(true); MetadataValueRest surname = new MetadataValueRest(); surname.setValue("Doe"); metadataRest.put("eperson.lastname", surname); MetadataValueRest firstname = new MetadataValueRest(); firstname.setValue("John"); metadataRest.put("eperson.firstname", firstname); data.setMetadata(metadataRest); dataFull.setEmail("createtestFull@fake-email.com"); dataFull.setCanLogIn(true); dataFull.setMetadata(metadataRest); getClient().perform(post("/api/eperson/epersons") .content(mapper.writeValueAsBytes(data)) .contentType(contentType) .param("projection", "full")) .andExpect(status().isUnauthorized()); }

Target:
public void createAnonAccessDeniedTest() throws Exception { context.turnOffAuthorisationSystem(); ObjectMapper mapper = new ObjectMapper(); EPersonRest data = new EPersonRest(); EPersonRest dataFull = new EPersonRest(); MetadataRest metadataRest = new MetadataRest(); data.setEmail("createtest@fake-email.com"); data.setCanLogIn(true); MetadataValueRest surname = new MetadataValueRest(); surname.setValue("Doe"); metadataRest.put("eperson.lastname", surname); MetadataValueRest firstname = new MetadataValueRest(); firstname.setValue("John"); metadataRest.put("eperson.firstname", firstname); data.setMetadata(metadataRest); dataFull.setEmail("createtestFull@fake-email.com"); dataFull.setCanLogIn(true); dataFull.setMetadata(metadataRest); context.restoreAuthSystemState(); getClient().perform(post("/api/eperson/epersons") .content(mapper.writeValueAsBytes(data)) .contentType(contentType) .param("projection", "full")) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/eperson/epersons/search/byEmail") .param("email", data.getEmail())) .andExpect(status().isNoContent()); }
Source:
private void validateDistanceSortField(ExtendedSearchIntegrator extendedIntegrator, SortField sortField) { String field = sortField.getField(); boolean indexedField = false; for ( Class<?> clazz : classesAndSubclasses ) { IndexedTypeDescriptor indexedTypeDescriptor = extendedIntegrator.getIndexedTypeDescriptor( clazz ); FieldDescriptor fieldDescriptor = indexedTypeDescriptor.getIndexedField( field ); if ( fieldDescriptor != null ) { indexedField = true; if ( fieldDescriptor.getType() != Type.SPATIAL ) { throw log.distanceSortRequiresSpatialField( field ); } } } if ( !indexedField ) { throw log.sortRequiresIndexedField( field ); } }

Target:
private void validateDistanceSortField(ExtendedSearchIntegrator extendedIntegrator, SortField sortField) { boolean indexedField = false; String field = sortField.getField(); if ( field != null ) { for ( Class<?> clazz : classesAndSubclasses ) { IndexedTypeDescriptor indexedTypeDescriptor = extendedIntegrator.getIndexedTypeDescriptor( clazz ); FieldDescriptor fieldDescriptor = indexedTypeDescriptor.getIndexedField( field ); if ( fieldDescriptor != null ) { indexedField = true; if ( fieldDescriptor.getType() != Type.SPATIAL ) { throw log.distanceSortRequiresSpatialField( field ); } break; } } } if ( !indexedField ) { throw log.sortRequiresIndexedField( sortField.getClass(), field ); } }
Source:
private void subscribeToAlternate() { ssub.set(alternate.unsafeSubscribe(new AlternateSubscriber<T>(child, arbiter))); }

Target:
private void subscribeToAlternate() { AlternateSubscriber<T> as = new AlternateSubscriber<T>(child, arbiter); ssub.set(as); alternate.unsafeSubscribe(as); }
Source:
public void onMessage(final ByteBuffer buffer) { final Request request = AbstractServerWebSocketHandler.Decoder.parseRequest(buffer); if (request.getRequestType() == Request.MessageType.TIME) { final Request rsp = TimeManager.decodeRequest(request); if (rsp != null) { try { this.getParentManager().send(rsp, request.getSessionInfo(), LoginClientWebSocket.class); } catch (ConnectionException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } } return; } if (request.getRequestType() == Request.MessageType.LOGIN) { LoginInformation login = null; try { login = LoginInformation.parseFrom(request.getOtherData()); } catch (InvalidProtocolBufferException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } final LoginConnectionState state = (LoginConnectionState) getStateFromId(request.getSessionInfo()); state.addTry(); if (login == null) { LOG.info("Login failed to get to the client"); final Request result = ProxyConnectionManager.createClientRequest(request); final Request.Builder errorMessage = Request.newBuilder(result); errorMessage.setResponseText(errorMessage.getResponseText() + " : The data sent back from the login server was not the correct format"); this.getParentServer().send(getConnectionFromState(state), result); return; } loginUser(login, request, state); createUser(login, request); } }

Target:
public void onMessage(final ByteBuffer buffer) { final Request request = AbstractServerWebSocketHandler.Decoder.parseRequest(buffer); if (request.getRequestType() == Request.MessageType.TIME) { final Request rsp = TimeManager.decodeRequest(request); if (rsp != null) { try { this.getParentManager().send(rsp, request.getSessionInfo(), LoginClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } } return; } if (request.getRequestType() == Request.MessageType.LOGIN) { LoginInformation login = null; try { login = LoginInformation.parseFrom(request.getOtherData()); } catch (InvalidProtocolBufferException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } final LoginConnectionState state = (LoginConnectionState) getStateFromId(request.getSessionInfo()); state.addTry(); if (login == null) { LOG.error("Login failed to get to the client"); final Request result = ProxyConnectionManager.createClientRequest(request); final Request.Builder errorMessage = Request.newBuilder(result); errorMessage.setResponseText(errorMessage.getResponseText() + " : The data sent back from the login server was not the correct format"); this.getParentServer().send(getConnectionFromState(state), result); return; } loginUser(login, request, state); createUser(login, request); } }
Source:
public double joinSelectivity(Optimizable optTable, ConglomerateDescriptor currentCd, long innerRowCount, long outerRowCount, SelectivityUtil.SelectivityJoinType selectivityJoinType) throws StandardException { double selectivity = 0.0d; switch(selectivityJoinType) { case LEFTOUTER: case FULLOUTER: selectivity = 1.0d/innerRowCount; break; case INNER: case ANTIJOIN: selectivity = (1.0d-.1d)*(1.0d-.1d)/Math.max(innerRowCount,outerRowCount); if ((optTable instanceof FromTable && ((FromTable) optTable).getExistsTable())) { if (outerRowCount >= innerRowCount) { selectivity = (1 - .1d) / outerRowCount; if (selectivityJoinType == SelectivityUtil.SelectivityJoinType.ANTIJOIN) { selectivity = (1 - .1d) / outerRowCount * (outerRowCount - innerRowCount) / innerRowCount; } } else { selectivity = (1 - .1d)/innerRowCount; if (selectivityJoinType == SelectivityUtil.SelectivityJoinType.ANTIJOIN) { selectivity = 0.1 * selectivity; } } } break; } return selectivity; }

Target:
public double joinSelectivity(Optimizable optTable, ConglomerateDescriptor currentCd, long innerRowCount, long outerRowCount, SelectivityUtil.SelectivityJoinType selectivityJoinType) throws StandardException { double selectivity = 0.0d; switch(selectivityJoinType) { case LEFTOUTER: case FULLOUTER: selectivity = 1.0d/innerRowCount; break; case ANTIJOIN: if (outerRowCount >= innerRowCount) { selectivity = (1 - .1d) / outerRowCount * (outerRowCount - innerRowCount) / innerRowCount; } else { selectivity = (1 - .1d)/innerRowCount; selectivity = 0.1 * selectivity; } break; case INNER: selectivity = (1.0d-.1d)*(1.0d-.1d)/Math.max(innerRowCount,outerRowCount); if ((optTable instanceof FromTable && ((FromTable) optTable).getExistsTable())) { if (outerRowCount >= innerRowCount) { selectivity = (1 - .1d) / outerRowCount; } else { selectivity = (1 - .1d)/innerRowCount; } } break; } return selectivity; }
Source:
CompactionDetails getCompactionDetails(BlobStore blobStore) throws StoreException { CompactionPolicyFactory compactionPolicyFactory; try { compactionPolicyFactory = Utils.getObj(storeConfig.storeCompactionPolicyFactory, storeConfig, time); } catch (Exception e) { throw new IllegalStateException("Error creating compaction policy for store " + blobStore.toString()); } return blobStore.getCompactionDetails(compactionPolicyFactory.getCompactionPolicy()); }

Target:
private CompactionDetails getCompactionDetails(BlobStore blobStore) throws StoreException { return blobStore.getCompactionDetails(compactionPolicy); }
Source:
protected List<MergedAnomalyResultDTO> retrieveAnomaliesFromDatabase(List<MergedAnomalyResultDTO> generated) { AnomalySlice effectiveSlice = this.slice.withDetectionId(this.config.getId()) .withStart(this.getStartTime(generated) - this.maxGap - 1) .withEnd(this.getEndTime(generated) + this.maxGap + 1); Collection<MergedAnomalyResultDTO> anomalies = this.provider.fetchAnomalies(Collections.singleton(effectiveSlice)).get(effectiveSlice); return anomalies.stream().filter(anomaly -> !anomaly.isChild()).collect(Collectors.toList()); }

Target:
protected List<MergedAnomalyResultDTO> retrieveAnomaliesFromDatabase(List<MergedAnomalyResultDTO> generated) { List<MergedAnomalyResultDTO> retrieved = super.retrieveAnomaliesFromDatabase(generated); return new ArrayList<>(Collections2.filter(retrieved, anomaly -> !anomaly.isChild() && anomaly.getAnomalyResultSource().equals(AnomalyResultSource.DATA_QUALITY_DETECTION) )); }
Source:
public void unacknowledgeAlarm(OnmsAlarm alarm, Date now) { LOG.info("Un-Acknowledging alarm with id: @ {}", alarm.getId(), now); final OnmsAlarm alarmInTrans = alarmDao.get(alarm.getId()); if (alarmInTrans == null) { LOG.warn("Alarm disappeared: {}. Skipping un-ack.", alarm); return; } OnmsAcknowledgment ack = new OnmsAcknowledgment(alarm, DEFAULT_USER, now); ack.setAckAction(AckAction.UNACKNOWLEDGE); acknowledgmentDao.processAck(ack); }

Target:
public void unacknowledgeAlarm(OnmsAlarm alarm, Date now) { LOG.info("Un-Acknowledging alarm with id: @ {}", alarm.getId(), now); final OnmsAlarm alarmInTrans = alarmDao.get(alarm.getId()); if (alarmInTrans == null) { LOG.warn("Alarm disappeared: {}. Skipping un-ack.", alarm); return; } OnmsAcknowledgment ack = new OnmsAcknowledgment(alarmInTrans, DEFAULT_USER, now); ack.setAckAction(AckAction.UNACKNOWLEDGE); acknowledgmentDao.processAck(ack); }
Source:
@Override public void handle(IgniteBiTuple<WALPointer, WALRecord> record) { initIfRequired(); byte[] writes = (DEFAULT_WAL_RECORD_PREFIX + record.get2() + "\n").getBytes(Charset.forName("utf-8")); int written = 0; try { while ((written += fileToWrite.writeFully(writes, written, writes.length - written)) < writes.length); } catch (IOException ex) { throw new IgniteException(ex); } }

Target:
@Override public void handle(IgniteBiTuple<WALPointer, WALRecord> record) { initIfRequired(); byte[] writes = (DEFAULT_WAL_RECORD_PREFIX + record.get2() + "\n").getBytes(StandardCharsets.UTF_8); int written = 0; try { while ((written += fileToWrite.writeFully(writes, written, writes.length - written)) < writes.length); } catch (IOException ex) { throw new IgniteException(ex); } }
Source:
public void testCaseSensitiveIndexNamesInGridCacheQueryManager() throws Exception { inlineSize = 1; String idxName1 = "test_v1_IDX"; String idxName2 = "test_v1_idx"; Ignite ignite = startGrids(1); ignite.cluster().active(true); class TestValue implements Serializable { private TestValue(int v1) { this.v1 = v1; } @QuerySqlField private final int v1; } CacheConfiguration ccfg = new CacheConfiguration() .setName("testIndexesCache") .setSqlSchema("PUBLIC") .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setIndexedTypes(Integer.class, TestValue.class); IgniteCache cache = ignite.createCache(ccfg); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName1+"\" on \"1TESTVALUE\" (v1)")).getAll(); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName2+"\" on \"1TESTVALUE\" (v1)")).getAll(); GridCacheQueryManager cmgr = ((IgniteCacheProxy)cache).context().queries(); assertTrue("Index " + idxName1 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName1)); assertTrue("Index " + idxName2 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName2)); assertTrue("Index " + idxName1 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName1)); assertTrue("Index " + idxName1 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName2)); }

Target:
public void testCaseSensitiveIndexNamesInGridCacheQueryManager() throws Exception { inlineSize = 1; String idxName1 = "test_v1_IDX"; String idxName2 = idxName1.toLowerCase(); Ignite ignite = startGrids(1); ignite.cluster().active(true); CacheConfiguration ccfg = new CacheConfiguration("testIndexesCache"); ccfg.setIndexedTypes(Integer.class, Person.class); IgniteCache cache = ignite.createCache(ccfg); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName1+"\" on \"PERSON\" (name)")).getAll(); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName2+"\" on \"PERSON\" (name)")).getAll(); GridCacheQueryManager cmgr = ((IgniteCacheProxy)cache).context().queries(); assertTrue("Index " + idxName1 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName1)); assertTrue("Index " + idxName2 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName2)); assertTrue("Index " + idxName1 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName1)); assertTrue("Index " + idxName2 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName2)); }
Source:
private void expandInRemoteSystemView( IViewPart remoteSystemView, IFileStore fileStore) { Viewer viewer = getViewer(remoteSystemView); Object input = viewer.getInput(); ArrayList<String> names = createSegmentNames(fileStore); ArrayList<Object> treeSegments = new ArrayList<Object>(); for (String name : names) { if (input != null && input instanceof IAdaptable) { ISystemViewElementAdapter adapter = SystemAdapterHelpers.getViewAdapter(input); if (adapter != null) { for (Object object : adapter.getChildren((IAdaptable)input, null)) { if (object instanceof IAdaptable) { adapter = SystemAdapterHelpers.getViewAdapter(object); if (adapter != null && name.equals(adapter.getText(object))) { input = object; treeSegments.add(input); break; } } } } } else { treeSegments.clear(); break; } } TreePath treePath = new TreePath(treeSegments.toArray()); viewer.setSelection(new StructuredSelection(treePath)); if (viewer instanceof TreeViewer) { ((TreeViewer)viewer).expandToLevel(treePath, 1); } }

Target:
private void expandInRemoteSystemView( IViewPart remoteSystemView, IFileStore fileStore) { Viewer viewer = getViewer(remoteSystemView); if (viewer == null) return; Object input = viewer.getInput(); ArrayList<String> names = createSegmentNames(fileStore); ArrayList<Object> treeSegments = new ArrayList<Object>(); for (String name : names) { if (input instanceof IAdaptable) { ISystemViewElementAdapter adapter = SystemAdapterHelpers.getViewAdapter(input); if (adapter != null) { for (Object object : adapter.getChildren((IAdaptable)input, null)) { if (object instanceof IAdaptable) { adapter = SystemAdapterHelpers.getViewAdapter(object); if (adapter != null && name.equals(adapter.getText(object))) { input = object; treeSegments.add(input); break; } } } } } else { treeSegments.clear(); break; } } TreePath treePath = new TreePath(treeSegments.toArray()); viewer.setSelection(new StructuredSelection(treePath)); if (viewer instanceof TreeViewer) { ((TreeViewer)viewer).expandToLevel(treePath, 1); } }
Source:
protected boolean isTimeoutException(final Exception exception) { return false; }

Target:
protected boolean isTimeoutException(final Exception exception) { return (exception instanceof SQLTimeoutException); }
Source:
public List<MediaUnit> getChildren() { return subordinateUnits; }

Target:
public List<MediaUnit> getChildren() { return children; }
Source:
public void getObjectCustomParserNoObject_Test() throws IOException{ final String objectName = "doesNotExistObject"; final ByteArrayOutputStream stream = new ByteArrayOutputStream(); final ObjectOutputStreamBuilder builder = new ObjectOutputStreamBuilder() { @Override public OutputStream buildOutputStream(String key) throws IOException { return stream; } }; final GetObjectRequest request = new GetObjectRequest( BUCKET_NAME, objectName, builder.buildChannel(objectName)); try { client.getObject(request, new Function<GetObjectCustomParserParameters, GetObjectResponse>() { @Override public GetObjectResponse apply(GetObjectCustomParserParameters getObjectParserParams) { final WebResponse webResponse = getObjectParserParams.getWebResponse(); if (ResponseParserUtils.validateStatusCode(webResponse.getStatusCode(), 200, 206)) { fail(); } throw new RuntimeException("Could not download object " + getObjectParserParams.getObjectName()); } }); fail(); } catch (final RuntimeException e) { assertThat(e.getMessage(), is("Could not download object " + objectName)); } }

Target:
public void getObjectCustomParserNoObject_Test() throws IOException{ final String objectName = "doesNotExistObject"; final GetObjectRequest request = new GetObjectRequest( BUCKET_NAME, objectName, new NullChannel()); client.getObject(request, new Function<GetObjectCustomParserParameters, GetObjectResponse>() { @Override public GetObjectResponse apply(final GetObjectCustomParserParameters getObjectParserParams) { return null; } }); }
Source:
public BufferView next() { if (buffer == null) { return null; } BufferView currentView = bufferView; currentView.buffer = buffer; currentView.position = position; currentView.length = length; try { advance(); } catch (IOException e) { throw new RuntimeException(e); } return currentView; }

Target:
public Buffer next() { if (buffer == null) { throw new NoSuchElementException(); } Buffer currentContainer = bufferContainer; currentContainer.setBuffer(isUncompressed ? uncompressedBuffer : buffer); currentContainer.setPosition(isUncompressed ? getOffsetInBuffer() : toIntExact(current.position())); currentContainer.setLength(isUncompressed ? toIntExact(uncompressedBufferOffset + current.length()) : toIntExact(current.length())); try { if (decompressor.isPresent()) { advance(); if (current == null) { currentCompressedBlockOffset = toIntExact(compressedSliceInput.position()); current = EMPTY_SLICE.getInput(); } } } catch (IOException e) { throw new UncheckedIOException(e); } return currentContainer; }
Source:
RetryPolicyFactory createRetryPolicyFactory() { return new RetryPolicyFactory(new RetryPolicyConfig() .setMinWait(Period.seconds(2)) .setMaxWait(Period.seconds(8)) .setMaxRetryCount(5) ); }

Target:
RetryPolicyFactory createRetryPolicyFactory() { return new RetryPolicyFactory( new RetryPolicyConfig() .setMinWait(Period.seconds(2)) .setMaxWait(Period.seconds(8)) .setMaxRetryCount(8) ); }