auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isNormalEdgeMapping(Object obj) { return ((EObject) obj).eContainer().eClass().equals(DescriptionPackage.eINSTANCE.getEdgeMapping()); }

Target:
private boolean isNormalEdgeMapping(Object obj) { return ((EObject) obj).eContainer().eClass() == DescriptionPackage.Literals.EDGE_MAPPING; }
Source:
private static JoinNode.EquiJoinClause toEquiJoinClause(ComparisonExpression equality, Set<Symbol> leftSymbols) { Symbol leftSymbol = Symbol.from(equality.getLeft()); Symbol rightSymbol = Symbol.from(equality.getRight()); JoinNode.EquiJoinClause equiJoinClause = new JoinNode.EquiJoinClause(leftSymbol, rightSymbol); return leftSymbols.contains(leftSymbol) ? equiJoinClause : equiJoinClause.flip(); }

Target:
private static EquiJoinClause toEquiJoinClause(ComparisonExpression equality, Set<Symbol> leftSymbols) { Symbol leftSymbol = Symbol.from(equality.getLeft()); Symbol rightSymbol = Symbol.from(equality.getRight()); EquiJoinClause equiJoinClause = new EquiJoinClause(leftSymbol, rightSymbol); return leftSymbols.contains(leftSymbol) ? equiJoinClause : equiJoinClause.flip(); }
Source:
protected abstract Collection<ThirdPartyDetails> createThirdPartyDetails() throws IOException, ThirdPartyToolException, ProjectBuildingException, MojoFailureException, InvalidDependencyVersionException, ArtifactNotFoundException, ArtifactResolutionException, DependenciesToolException, MojoExecutionException; protected void init() throws IOException { if ( licenseMergesUrl != null ) { getLog().warn( "" ); getLog().warn( "licenseMerges will be overridden by licenseMergesUrl." ); getLog().warn( "" ); if ( UrlRequester.isStringUrl( licenseMergesUrl ) ) { licenseMerges = Arrays.asList( UrlRequester.getFromUrl( licenseMergesUrl ).split( "\n" ) ); } } }

Target:
protected abstract Collection<ThirdPartyDetails> createThirdPartyDetails() throws IOException, ThirdPartyToolException, ProjectBuildingException, MojoFailureException, InvalidDependencyVersionException, ArtifactNotFoundException, ArtifactResolutionException, DependenciesToolException, MojoExecutionException; protected void init() throws IOException { if ( licenseMergesUrl != null ) { getLog().warn( "" ); getLog().warn( "licenseMerges will be overridden by licenseMergesUrl." ); getLog().warn( "" ); if ( UrlRequester.isStringUrl( licenseMergesUrl ) ) { licenseMerges = Arrays.asList( UrlRequester.getFromUrl( licenseMergesUrl ).split( "[\n\r]+" ) ); } } }
Source:
protected void executeCommand() { setVdsStatus(VDSStatus.Installing); try (final VdsDeploy vdsDeploy = new VdsDeploy("ovirt-host-mgmt", getVds(), false)) { vdsDeploy.addUnit( new VdsDeployPKIUnit(), new VdsDeployVmconsoleUnit(true) ); vdsDeploy.setCorrelationId(getCorrelationId()); vdsDeploy.useDefaultKeyPair(); vdsDeploy.execute(); initializeVds(); setVdsStatus(VDSStatus.Maintenance); setSucceeded(true); } catch (final Exception e) { log.error("Failed to enroll certificate for host '{}': {}", getVds().getName(), e.getMessage()); log.error("Exception", e); setVdsStatus(VDSStatus.InstallFailed); } }

Target:
protected void executeCommand() { setVdsStatus(VDSStatus.Installing); try (final VdsDeploy vdsDeploy = new VdsDeploy("ovirt-host-mgmt", getVds(), false)) { vdsDeploy.addUnit( new VdsDeployPKIUnit(), new VdsDeployVmconsoleUnit(true) ); vdsDeploy.setCorrelationId(getCorrelationId()); vdsDeploy.useDefaultKeyPair(); vdsDeploy.execute(); resourceManager.reestablishConnection(getVdsId()); setVdsStatus(VDSStatus.Maintenance); setSucceeded(true); } catch (final Exception e) { log.error("Failed to enroll certificate for host '{}': {}", getVds().getName(), e.getMessage()); log.error("Exception", e); setVdsStatus(VDSStatus.InstallFailed); } }
Source:
static boolean isClassDirectoryURL(@Nonnull URL url) { final File file = urlToFile(url); if (file != null && file.isDirectory()) { return true; } return url.toExternalForm().endsWith("/"); }

Target:
static boolean isClassDirectoryURL(@Nonnull URL url) { final File file = urlToFile(url); if (file != null && file.isDirectory()) { return true; } String u = url.toExternalForm(); return u.endsWith("/") && !u.startsWith("jar:"); }
Source:
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { if (v instanceof WebView) { WebView.HitTestResult result = ((WebView) v).getHitTestResult(); if (result != null) { int type = result.getType(); if (type == WebView.HitTestResult.IMAGE_TYPE || type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) { String imageUrl = result.getExtra(); if (imageUrl.startsWith("http")) { try { downloadUrl = new URL(imageUrl); } catch (MalformedURLException e) { return; } super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.news_detail_context_img, menu); } } } } }

Target:
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { if (v instanceof WebView) { WebView.HitTestResult result = ((WebView) v).getHitTestResult(); if (result != null) { int type = result.getType(); Document htmldoc = Jsoup.parse(html); if (type == WebView.HitTestResult.IMAGE_TYPE || type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) { String imageUrl = result.getExtra(); if (imageUrl.startsWith("http")) { String imgaltval = ""; String imgsrcval = ""; try { Elements imgtag = htmldoc.getElementsByAttributeValueContaining("src", imageUrl); imgaltval = imgtag.first().attr("alt"); imgsrcval = imageUrl.substring(imageUrl.lastIndexOf('/') + 1, imageUrl.length()); this.imageUrl = new URL(imageUrl); } catch (MalformedURLException e) { return; } super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle(imgsrcval); menu.setHeaderIcon(android.R.drawable.ic_menu_gallery); if( !imgsrcval.equals(imgaltval) && imgaltval.length() > 0 ) { menu.add(imgaltval).setEnabled(false).setIcon(android.R.drawable.ic_menu_info_details); } MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.news_detail_context_img, menu); } } } } }
Source:
public void run() { if (!isAlive.compareAndSet(false, true)) { inQueue.set(false); return; } inQueue.set(false); try { while (!referenceLists.isEmpty()) { try { Reference<?> ref = queue.remove(100); if (ref instanceof PhantomReferenceImpl) { PhantomReferenceImpl r = (PhantomReferenceImpl) ref; final Channel.Ref channelRef = r.channel; try { r.cleanup(); } catch (IOException e) { logger.log(Level.WARNING, String.format("Couldn't clean up oid=%d from %s", r.oid, r.origin), e); } catch (Error e) { logger.log(Level.SEVERE, String.format("Couldn't clean up oid=%d from %s", r.oid, r.origin), e); throw e; } catch (Throwable e) { logger.log(Level.WARNING, String.format("Couldn't clean up oid=%d from %s", r.oid, r.origin), e); } finally { if (channelRef != null) { final List<PhantomReferenceImpl> referenceList = referenceLists.get(channelRef); if (referenceList != null) { referenceList.remove(r); if (channelRef.channel() == null) { cleanList(referenceList); } } } } } } catch (InterruptedException e) { logger.log(Level.FINE, "Interrupted", e); } for (Iterator<Map.Entry<Channel.Ref, List<PhantomReferenceImpl>>> iterator = referenceLists.entrySet().iterator(); iterator.hasNext(); ) { final Map.Entry<Channel.Ref, List<PhantomReferenceImpl>> entry = iterator.next(); final Channel.Ref r = entry.getKey(); if (r == null || r.channel() == null) { iterator.remove(); cleanList(entry.getValue()); } } } } finally { isAlive.set(false); } }

Target:
public void run() { if (!isAlive.compareAndSet(false, true)) { inQueue.set(false); return; } inQueue.set(false); try { long nextSweep = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(200); while (!referenceLists.isEmpty()) { try { Reference<?> ref = queue.remove(100); if (ref instanceof PhantomReferenceImpl) { PhantomReferenceImpl r = (PhantomReferenceImpl) ref; final Channel.Ref channelRef = r.channel; try { r.cleanup(); } catch (IOException e) { logger.log(Level.WARNING, String.format("Couldn't clean up oid=%d from %s", r.oid, r.origin), e); } catch (Error e) { logger.log(Level.SEVERE, String.format("Couldn't clean up oid=%d from %s", r.oid, r.origin), e); throw e; } catch (Throwable e) { logger.log(Level.WARNING, String.format("Couldn't clean up oid=%d from %s", r.oid, r.origin), e); } finally { if (channelRef != null) { final List<PhantomReferenceImpl> referenceList = referenceLists.get(channelRef); if (referenceList != null) { referenceList.remove(r); if (channelRef.channel() == null) { cleanList(referenceList); } } } } } } catch (InterruptedException e) { logger.log(Level.FINE, "Interrupted", e); } if (System.nanoTime() > nextSweep) { nextSweep = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(200); for (Iterator<Map.Entry<Channel.Ref, List<PhantomReferenceImpl>>> iterator = referenceLists.entrySet().iterator(); iterator.hasNext(); ) { final Map.Entry<Channel.Ref, List<PhantomReferenceImpl>> entry = iterator.next(); final Channel.Ref r = entry.getKey(); if (r == null || r.channel() == null) { iterator.remove(); cleanList(entry.getValue()); } } } } } finally { isAlive.set(false); } }
Source:
public void testWithArithmeticOperator() throws IOException { Filter arthimeticMultiplyFilter = ff.equals( ff.multiply( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(2)), ff.literal(400)); Filter arthimeticDivideFilter = ff.equals( ff.divide( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(2)), ff.literal(100)); Filter arthimeticAdditionFilter = ff.equals( ff.add( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(100)), ff.literal(300)); Filter arthimeticSubtractionFilter = ff.equals( ff.subtract( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(100)), ff.literal(100)); FeatureCollection<FeatureType, Feature> features = fSource.getFeatures(); PropertyName positionalAccuracy = ff.property("gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"); FeatureIterator<Feature> iterator = features.features(); try { Feature f = iterator.next(); Property val = (Property) positionalAccuracy.evaluate(f); System.out.println(val.getValue()); assertTrue(arthimeticMultiplyFilter.evaluate(f)); assertTrue(arthimeticDivideFilter.evaluate(f)); assertTrue(arthimeticAdditionFilter.evaluate(f)); assertTrue(arthimeticSubtractionFilter.evaluate(f)); } finally { iterator.close(); } }

Target:
public void testWithArithmeticOperator() throws IOException { Filter arithmeticMultiplyFilter = ff.equals( ff.multiply( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(2)), ff.literal(400)); Filter arithmeticDivideFilter = ff.equals( ff.divide( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(2)), ff.literal(100)); Filter arithmeticAdditionFilter = ff.equals( ff.add( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(100)), ff.literal(300)); Filter arithmeticSubtractionFilter = ff.equals( ff.subtract( ff.property( "gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"), ff.literal(100)), ff.literal(100)); FeatureCollection<FeatureType, Feature> features = fSource.getFeatures(); PropertyName positionalAccuracy = ff.property("gsml:positionalAccuracy/gsml:CGI_NumericValue/gsml:principalValue"); FeatureIterator<Feature> iterator = features.features(); try { Feature f = iterator.next(); Property val = (Property) positionalAccuracy.evaluate(f); System.out.println(val.getValue()); assertTrue(arithmeticMultiplyFilter.evaluate(f)); assertTrue(arithmeticDivideFilter.evaluate(f)); assertTrue(arithmeticAdditionFilter.evaluate(f)); assertTrue(arithmeticSubtractionFilter.evaluate(f)); } finally { iterator.close(); } }
Source:
private String extractAuthorizationProvider(ProfileEntry profileEntry) { return profileEntry == null ? "" : profileEntry.getAuthz(); }

Target:
private String extractAuthorizationProvider(ProfileEntry profileEntry) { return profileEntry.getAuthz(); }
Source:
protected Object encodeCommand(Command command) { ChannelBuffer commandString; switch (command.getType()) { case Command.TYPE_IDENTIFICATION: commandString = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 12); commandString.writeBytes("BB+IDNT".getBytes(StandardCharsets.US_ASCII)); GranitProtocolDecoder.appendChecksum(commandString, 7); return commandString; case Command.TYPE_REBOOT_DEVICE: commandString = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 13); commandString.writeBytes("BB+RESET".getBytes(StandardCharsets.US_ASCII)); GranitProtocolDecoder.appendChecksum(commandString, 8); return commandString; case Command.TYPE_POSITION_SINGLE: commandString = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 12); commandString.writeBytes("BB+RRCD".getBytes(StandardCharsets.US_ASCII)); GranitProtocolDecoder.appendChecksum(commandString, 7); return commandString; default: Log.warning(new UnsupportedOperationException(command.getType())); break; } return null; }

Target:
protected Object encodeCommand(Command command) { String commandString = ""; switch (command.getType()) { case Command.TYPE_IDENTIFICATION: commandString = "BB+IDNT"; break; case Command.TYPE_REBOOT_DEVICE: commandString = "BB+RESET"; break; case Command.TYPE_POSITION_SINGLE: commandString = "BB+RRCD"; break; default: Log.warning(new UnsupportedOperationException(command.getType())); return null; } if (!commandString.isEmpty()) { ChannelBuffer commandBuf = ChannelBuffers.dynamicBuffer(); commandBuf.writeBytes(commandString.getBytes(StandardCharsets.US_ASCII)); GranitProtocolDecoder.appendChecksum(commandBuf, commandString.length()); return commandBuf; } return null; }
Source:
private void handleChange(Change change) throws RetryableException, ContainedException { log.debug("Received revision information {}", change); if (change.revision() >= 0 && rdfRepository.hasRevision(change.entityId(), change.revision())) { log.debug("RDF repository already has this revision, skipping."); return; } String entityId = change.entityId(); Collection<Statement> statements = wikibase.fetchRdfForEntity(entityId); Collection<String> values = rdfRepository.getValues(entityId); Collection<String> refs = rdfRepository.getRefs(entityId); munger.munge(entityId, statements, values, refs); rdfRepository.sync(entityId, statements); List<String> cleanupList = new ArrayList<String>(values); cleanupList.addAll(refs); rdfRepository.cleanUnused(cleanupList); updateMeter.mark(); }

Target:
private void handleChange(Change change) throws RetryableException, ContainedException { log.debug("Received revision information {}", change); if (change.revision() >= 0 && rdfRepository.hasRevision(change.entityId(), change.revision())) { log.debug("RDF repository already has this revision, skipping."); return; } Collection<Statement> statements = wikibase.fetchRdfForEntity(change.entityId()); Set<String> values = rdfRepository.getValues(change.entityId()); Set<String> refs = rdfRepository.getRefs(change.entityId()); munger.munge(change.entityId(), statements, values, refs); rdfRepository.sync(change.entityId(), statements); List<String> cleanupList = new ArrayList<>(); cleanupList.addAll(values); cleanupList.addAll(refs); rdfRepository.cleanUnused(cleanupList); updateMeter.mark(); }
Source:
public void configure(Map<String, ?> configs) throws KafkaException { if (sslEngineBuilder != null) { throw new IllegalStateException("SslFactory was already configured."); } this.endpointIdentification = (String) configs.get(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG); Map<String, Object> nextConfigs = new HashMap<>(); copyMapEntries(nextConfigs, configs, SslConfigs.NON_RECONFIGURABLE_CONFIGS); copyMapEntries(nextConfigs, configs, SslConfigs.RECONFIGURABLE_CONFIGS); if (clientAuthConfigOverride != null) { nextConfigs.put(BrokerSecurityConfigs.SSL_CLIENT_AUTH_CONFIG, clientAuthConfigOverride); } nextConfigs.put(SecurityConfig.SECURITY_PROVIDERS_CONFIG, configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG)); SslEngineBuilder builder = new SslEngineBuilder(nextConfigs); if (keystoreVerifiableUsingTruststore) { try { SslEngineValidator.validate(builder, builder); } catch (Exception e) { throw new ConfigException("A client SSLEngine created with the provided settings " + "can't connect to a server SSLEngine created with those settings.", e); } } this.sslEngineBuilder = builder; }

Target:
public void configure(Map<String, ?> configs) throws KafkaException { if (sslEngineBuilder != null) { throw new IllegalStateException("SslFactory was already configured."); } this.endpointIdentification = (String) configs.get(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG); Map<String, Object> nextConfigs = new HashMap<>(); copyMapEntries(nextConfigs, configs, SslConfigs.NON_RECONFIGURABLE_CONFIGS); copyMapEntries(nextConfigs, configs, SslConfigs.RECONFIGURABLE_CONFIGS); copyMapEntry(nextConfigs, configs, SecurityConfig.SECURITY_PROVIDERS_CONFIG); if (clientAuthConfigOverride != null) { nextConfigs.put(BrokerSecurityConfigs.SSL_CLIENT_AUTH_CONFIG, clientAuthConfigOverride); } SslEngineBuilder builder = new SslEngineBuilder(nextConfigs); if (keystoreVerifiableUsingTruststore) { try { SslEngineValidator.validate(builder, builder); } catch (Exception e) { throw new ConfigException("A client SSLEngine created with the provided settings " + "can't connect to a server SSLEngine created with those settings.", e); } } this.sslEngineBuilder = builder; }
Source:
public void rawStreamConsumerRestart() { final int BATCH_SIZE = 10; final int CHECKPOINT_SIZE = 3; final String CHECKPOINT_AUTHOR = "Author"; final String tableName = "test"; final CorfuTable<Integer, Integer> map = getDefaultRuntime().getObjectsView().build() .setTypeToken(new TypeToken<CorfuTable<Integer, Integer>>() {}) .setStreamName(tableName) .open(); final MultiCheckpointWriter<CorfuTable> mcw = new MultiCheckpointWriter(); mcw.addMap(map); IntStream.range(0, BATCH_SIZE).forEach(idx -> map.put(idx, idx)); Token checkpointAddress = mcw.appendCheckpoints(getRuntime(), CHECKPOINT_AUTHOR); IntStream.range(0, BATCH_SIZE).forEach(idx -> map.put(idx, idx)); trim(checkpointAddress); CorfuRuntime newRuntime = getNewRuntime(getDefaultNode()).connect(); Map<Integer, Integer> newMap = newRuntime.getObjectsView().build() .setTypeToken(new TypeToken<CorfuTable<Integer, Integer>>() { }) .setStreamName(tableName) .open(); IStreamView stream = newRuntime.getStreamsView().get(CorfuRuntime.getStreamID(tableName)); stream.seek(BATCH_SIZE + CHECKPOINT_SIZE); Assertions.assertThat(Stream.of( stream.remainingUpTo(Long.MAX_VALUE), stream.remainingUpTo(Long.MAX_VALUE)) .map(List::size).mapToInt(Integer::intValue).sum()) .isEqualTo(BATCH_SIZE); trim(mcw.appendCheckpoints(getRuntime(), CHECKPOINT_AUTHOR)); IntStream.range(0, BATCH_SIZE).forEach(idx -> newMap.put(idx, idx)); Assertions.assertThatThrownBy(() -> stream.remainingUpTo(Long.MAX_VALUE)) .isInstanceOf(TrimmedException.class); }

Target:
public void rawStreamConsumerRestart() { final int BATCH_SIZE = 10; final int CHECKPOINT_SIZE = 3; final String CHECKPOINT_AUTHOR = "Author"; final String tableName = "test"; final CorfuTable<Integer, Integer> map = getDefaultRuntime().getObjectsView().build() .setTypeToken(new TypeToken<CorfuTable<Integer, Integer>>() {}) .setStreamName(tableName) .open(); final MultiCheckpointWriter<CorfuTable> mcw = new MultiCheckpointWriter(); mcw.addMap(map); IntStream.range(0, BATCH_SIZE).forEach(idx -> map.put(idx, idx)); Token checkpointAddress = mcw.appendCheckpoints(getRuntime(), CHECKPOINT_AUTHOR); IntStream.range(0, BATCH_SIZE * 2).forEach(idx -> map.put(idx, idx)); trim(checkpointAddress); CorfuRuntime newRuntime = getNewRuntime(getDefaultNode()).connect(); Map<Integer, Integer> newMap = newRuntime.getObjectsView().build() .setTypeToken(new TypeToken<CorfuTable<Integer, Integer>>() { }) .setStreamName(tableName) .open(); IStreamView stream = newRuntime.getStreamsView().get(CorfuRuntime.getStreamID(tableName)); stream.seek(BATCH_SIZE + CHECKPOINT_SIZE); Assertions.assertThat(Stream.of( stream.remainingUpTo(Long.MAX_VALUE), stream.remainingUpTo(Long.MAX_VALUE)) .map(List::size).mapToInt(Integer::intValue).sum()) .isEqualTo(BATCH_SIZE * 2); trim(mcw.appendCheckpoints(getRuntime(), CHECKPOINT_AUTHOR)); IntStream.range(0, BATCH_SIZE).forEach(idx -> newMap.put(idx, idx)); Assertions.assertThatThrownBy(() -> stream.remainingUpTo(Long.MAX_VALUE)) .isInstanceOf(TrimmedException.class); }
Source:
private void updateLookFromFormula() { int lookPosition = -1; String parsedLookName = ""; try { lookPosition = formula.interpretInteger(sprite); } catch (InterpretationException e) { try { parsedLookName = formula.interpretString(sprite); } catch (InterpretationException ex) { Log.d(getClass().getSimpleName(), "Formula interpretation for look failed.", e); return; } } if (lookPosition <= sprite.getLookDataList().size() && lookPosition > 0) { look = sprite.getLookDataList().get(lookPosition - 1); } else { for (LookData lookData : sprite.getLookDataList()) { if (lookData.getLookName().equals(parsedLookName)) { look = lookData; } } } }

Target:
private void updateLookFromFormula() { int lookPosition = -1; String parsedLookName = ""; try { lookPosition = formula.interpretInteger(sprite); } catch (InterpretationException e) { try { parsedLookName = formula.interpretString(sprite); } catch (InterpretationException ex) { Log.d(getClass().getSimpleName(), "Formula interpretation for look failed.", e); return; } } if (lookPosition > 0 && lookPosition <= sprite.getLookDataList().size()) { look = sprite.getLookDataList().get(lookPosition - 1); } else { for (LookData lookData : sprite.getLookDataList()) { if (lookData.getLookName().equals(parsedLookName)) { look = lookData; } } } }
Source:
public AppiumServerStatus getStatus() { Map<String, Object> statusMap = (Map<String, Object>) execute(DriverCommand.STATUS).getValue(); Map<String, String> versionMap = (Map<String, String>) statusMap.get("build"); AppiumServerStatus status = new AppiumServerStatus(versionMap.get("version")); return status; }

Target:
public Map<String, Object> getStatus() { return (Map<String, Object>) execute(DriverCommand.STATUS).getValue(); }
Source:
public void equal_shouldReturnTrueWhenBothPatientIdsAreNullAndEndDateAndStartDateAreEqual() { CohortMembership cohortMembershipOne = new CohortMembership(); CohortMembership cohortMembershipTwo = new CohortMembership(); Date startDate1 = new Date(1545140935); Date endDate1 = new Date(1577836801); Date startDate2 = new Date(1545140935); Date endDate2 = new Date(1577836800); cohortMembershipOne.setEndDate(endDate1); cohortMembershipOne.setStartDate(startDate1); cohortMembershipTwo.setStartDate(startDate2); cohortMembershipTwo.setEndDate(endDate2); assertFalse(cohortMembershipOne.equals(cohortMembershipTwo)); }

Target:
public void equal_shouldReturnTrueWhenBothPatientIdsAreNullAndEndDateAndStartDateAreEqual() { CohortMembership cohortMembershipOne = new CohortMembership(); CohortMembership cohortMembershipTwo = new CohortMembership(); final int TIMESTAMP_START_DATE = 1545140935; Date startDate1 = new Date(TIMESTAMP_START_DATE); Date endDate1 = new Date(1577836801); Date startDate2 = new Date(TIMESTAMP_START_DATE); Date endDate2 = new Date(1577836800); cohortMembershipOne.setEndDate(endDate1); cohortMembershipOne.setStartDate(startDate1); cohortMembershipTwo.setStartDate(startDate2); cohortMembershipTwo.setEndDate(endDate2); assertFalse(cohortMembershipOne.equals(cohortMembershipTwo)); }
Source:
public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasRestored) { final int orientation = getResources().getConfiguration().orientation; int currentPos = 0; if (videoModel != null) { currentPos = (int) videoModel.getLastPlayedOffset(); } if (!wasRestored) { Uri uri = Uri.parse(unit.getData().encodedVideos.getYoutubeVideoInfo().url); final String videoId = uri.getQueryParameter("v"); player.loadVideo(videoId, currentPos); youTubePlayer = player; youTubePlayer.setPlayerStateChangeListener(new StateChangeListener()); youTubePlayer.setPlaybackEventListener(new PlaybackListener()); youTubePlayer.setOnFullscreenListener(new FullscreenListener()); if (orientation == Configuration.ORIENTATION_LANDSCAPE) { youTubePlayer.setFullscreen(true); } } subtitleDisplayHandler = new Handler(); subtitleDisplayHandler.postDelayed(subtitlesProcessorRunnable, SUBTITLES_DISPLAY_DELAY_MS); }

Target:
public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasRestored) { if (getActivity() == null) { return; } final int orientation = getActivity().getResources().getConfiguration().orientation; int currentPos = 0; if (videoModel != null) { currentPos = (int) videoModel.getLastPlayedOffset(); } if (!wasRestored) { Uri uri = Uri.parse(unit.getData().encodedVideos.getYoutubeVideoInfo().url); final String videoId = uri.getQueryParameter("v"); player.loadVideo(videoId, currentPos); youTubePlayer = player; youTubePlayer.setPlayerStateChangeListener(new StateChangeListener()); youTubePlayer.setPlaybackEventListener(new PlaybackListener()); youTubePlayer.setOnFullscreenListener(new FullscreenListener()); if (orientation == Configuration.ORIENTATION_LANDSCAPE) { youTubePlayer.setFullscreen(true); } } subtitleDisplayHandler = new Handler(); subtitleDisplayHandler.postDelayed(subtitlesProcessorRunnable, SUBTITLES_DISPLAY_DELAY_MS); }
Source:
public int compareTo(@NotNull KotlinFunctionInfo f) { return this.toString().hashCode() - f.toString().hashCode(); }

Target:
public int compareTo(@NotNull KotlinFunctionInfo f) { return this.toString().compareTo(f.toString()); }
Source:
protected CommunityRest createAndReturn(Context context, UUID id) throws AuthorizeException { if (id == null) { throw new DSpaceBadRequestException("The given parent parameter was invalid: " + id); } HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); CommunityRest communityRest; try { ServletInputStream input = req.getInputStream(); communityRest = mapper.readValue(input, CommunityRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body: " + e1.toString()); } Community community; try { Community parent = cs.find(context, id); if (parent == null) { throw new UnprocessableEntityException("Parent community for id: " + id + " not found"); } community = cs.create(parent, context); cs.update(context, community); metadataConverter.setMetadata(context, community, communityRest.getMetadata()); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return dsoConverter.convert(community); }

Target:
protected CommunityRest createAndReturn(Context context, UUID id) throws AuthorizeException { if (id == null) { throw new DSpaceBadRequestException("Parent Community UUID is null. " + "Cannot create a SubCommunity without providing a parent Community."); } HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); CommunityRest communityRest; try { ServletInputStream input = req.getInputStream(); communityRest = mapper.readValue(input, CommunityRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body.", e1); } Community community; try { Community parent = cs.find(context, id); if (parent == null) { throw new UnprocessableEntityException("Parent community for id: " + id + " not found"); } community = cs.create(parent, context); cs.update(context, community); metadataConverter.setMetadata(context, community, communityRest.getMetadata()); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return dsoConverter.convert(community); }
Source:
public static StringWrapper toPassword(String encryptedStringEntryInDb) { try { return new StringWrapper( CryptUtil.decryptPassword(AppConfig.getInstance(), encryptedStringEntryInDb)); } catch (Exception e) { android.util.Log.e(TAG, "Error decrypting password", e); return null; } }

Target:
public static StringWrapper toPassword(String encryptedStringEntryInDb) { try { return new StringWrapper( CryptUtil.decryptPassword(AppConfig.getInstance(), encryptedStringEntryInDb)); } catch (Exception e) { android.util.Log.e(TAG, "Error decrypting password", e); return new StringWrapper(encryptedStringEntryInDb); } }
Source:
public Response act(final Request req) throws IOException { final Request file = new RqMultipart.Smart( new RqMultipart.Base(req) ).single("file"); final Matcher matcher = FILE_NAME_PATTERN.matcher( new RqHeaders.Smart( new RqHeaders.Base(file) ).single("Content-Disposition") ); if (!matcher.find()) { throw new RsFailure("Filename was not provided"); } final String name = URLDecoder.decode( matcher.group(FILE_NAME_POS), CharEncoding.UTF_8 ); final File temp = File.createTempFile("netbout", "bin"); IOUtils.copy(file.body(), new FileOutputStream(temp)); final Bout bout = new RqBout(this.base, req).bout(); final StringBuilder msg = new StringBuilder(Tv.HUNDRED); if (new Attachments.Search(bout.attachments()).exists(name)) { msg.append(String.format("attachment \"%s\" overwritten", name)); } else { try { bout.attachments().create(name); } catch (final Attachments.InvalidNameException ex) { throw new RsFailure(ex); } msg.append(String.format("attachment \"%s\" uploaded", name)); } final String ctype = TkAttach.ctype(temp); msg.append(" (").append(temp.length()) .append(" bytes, ").append(ctype).append(')'); try { bout.attachments().get(name).write( new FileInputStream(temp), ctype, Long.toString(System.currentTimeMillis()) ); } catch (final Attachment.TooBigException | Attachment.BrokenContentException ex) { throw new RsFailure(ex); } FileUtils.forceDelete(temp); throw new RsForward(new RsFlash(msg.toString())); }

Target:
public Response act(final Request req) throws IOException { final Request file = new RqMultipart.Smart( new RqMultipart.Base(req) ).single("file"); final Matcher matcher = FILE_NAME_PATTERN.matcher( new RqHeaders.Smart( new RqHeaders.Base(file) ).single("Content-Disposition") ); if (!matcher.find()) { throw new RsFailure("Filename was not provided"); } final String name = URLDecoder.decode( matcher.group(5), CharEncoding.UTF_8 ); final File temp = File.createTempFile("netbout", "bin"); IOUtils.copy(file.body(), new FileOutputStream(temp)); final Bout bout = new RqBout(this.base, req).bout(); final StringBuilder msg = new StringBuilder(Tv.HUNDRED); if (new Attachments.Search(bout.attachments()).exists(name)) { msg.append(String.format("attachment \"%s\" overwritten", name)); } else { try { bout.attachments().create(name); } catch (final Attachments.InvalidNameException ex) { throw new RsFailure(ex); } msg.append(String.format("attachment \"%s\" uploaded", name)); } final String ctype = TkAttach.ctype(temp); msg.append(" (").append(temp.length()) .append(" bytes, ").append(ctype).append(')'); try { bout.attachments().get(name).write( new FileInputStream(temp), ctype, Long.toString(System.currentTimeMillis()) ); } catch (final Attachment.TooBigException | Attachment.BrokenContentException ex) { throw new RsFailure(ex); } FileUtils.forceDelete(temp); throw new RsForward(new RsFlash(msg.toString())); }
Source:
public void updateText(@Nonnull Mapping field, String lang, String text) { if (Strings.isEmpty(text)) { deleteText(field, lang); return; } T translation = findOrCreateTranslation(field, lang, text); if (translation != null) { translation.getTranslationData().setText(text); updateTranslation(translation); if (owner instanceof Journaled) { JournalData.addJournalEntry(owner, String.format("Updated translated text for %s (%s): '%s'", field.getName(), lang, text)); } } else if (owner instanceof Journaled) { JournalData.addJournalEntry(owner, String.format( "Invalid language detected while updating translated text for %s (%s): '%s'", field.getName(), lang, text)); } }

Target:
public void updateText(@Nonnull Mapping field, String lang, String text) { if (Strings.isEmpty(text)) { deleteText(field, lang); return; } T translation = findOrCreateTranslation(field, lang, text); translation.getTranslationData().setText(text); updateTranslation(translation); if (owner instanceof Journaled) { JournalData.addJournalEntry(owner, String.format("Updated translated text for %s (%s): '%s'", field.getName(), lang, text)); } }
Source:
public Response addMapper(IdentityProviderMapperRepresentation mapper) { auth.requireManage(); IdentityProviderMapperModel model = RepresentationToModel.toModel(mapper); model = realm.addIdentityProviderMapper(model); adminEvent.realm(realm).operation(OperationType.ACTION).resourcePath(model, uriInfo.getPath()) .representation(mapper).success(); return Response.created(uriInfo.getAbsolutePathBuilder().path(model.getId()).build()).build(); }

Target:
public Response addMapper(IdentityProviderMapperRepresentation mapper) { auth.requireManage(); IdentityProviderMapperModel model = RepresentationToModel.toModel(mapper); model = realm.addIdentityProviderMapper(model); adminEvent.operation(OperationType.CREATE).resourcePath(model, uriInfo.getPath()) .representation(mapper).success(); return Response.created(uriInfo.getAbsolutePathBuilder().path(model.getId()).build()).build(); }
Source:
public double getAvgMemBytesUsed() { return memBytesTotal / (double) numTasks; }

Target:
public double getAvgMemBytesUsed() { return memBytesUsed / (double) numTasks; }
Source:
private boolean upgradeEightNine(SQLiteDatabase db) { db.beginTransaction(); android.database.Cursor cursor = null; try { upgradeXFormAndroidInstallerV1(db); TableBuilder builder = new TableBuilder(FormDefRecord.class); db.execSQL(builder.getTableCreateString()); builder = new TableBuilder(InstanceRecord.class); db.execSQL(builder.getTableCreateString()); migrateInstanceProvider(db); migrateFormProvier(db); db.setTransactionSuccessful(); return true; } finally { db.endTransaction(); } }

Target:
private boolean upgradeEightNine(SQLiteDatabase db) { boolean success; db.beginTransaction(); try { upgradeXFormAndroidInstallerV1(db); TableBuilder builder = new TableBuilder(FormDefRecord.class); db.execSQL(builder.getTableCreateString()); migrateFormProvider(db); db.setTransactionSuccessful(); success = true; } finally { db.endTransaction(); } if (success) { try { context.getContentResolver().delete(FormsProviderAPI.FormsColumns.CONTENT_URI, null, null); } catch (Exception e) { e.printStackTrace(); Logger.exception(e); } } return success; }
Source:
private List<InternalNode> convertToInternalNode(NodeMap nodeMap, List<HostAddress> preferredNodes) { List<InternalNode> internalNodes = new ArrayList<>(); preferredNodes.stream().forEach(node -> internalNodes.addAll(nodeMap.getNodesByHostAndPort().get(node))); return ImmutableList.copyOf(internalNodes); }

Target:
private static List<InternalNode> convertToInternalNode(NodeMap nodeMap, List<HostAddress> preferredNodes) { List<InternalNode> internalNodes = new ArrayList<>(); preferredNodes.forEach(node -> internalNodes.addAll(nodeMap.getNodesByHostAndPort().get(node))); return ImmutableList.copyOf(internalNodes); }
Source:
public Object visit(ASTCompilationUnit node, Object data) { int maxFields = getProperty(MAX_FIELDS_DESCRIPTOR); stats = new HashMap<>(5); nodes = new HashMap<>(5); List<ASTFieldDeclaration> l = node.findDescendantsOfType(ASTFieldDeclaration.class); for (ASTFieldDeclaration fd : l) { if (fd.isFinal() && fd.isStatic()) { continue; } ASTClassOrInterfaceDeclaration clazz = fd.getFirstParentOfType(ASTClassOrInterfaceDeclaration.class); if (clazz != null && !clazz.isInterface()) { bumpCounterFor(clazz); } } for (Map.Entry<String, Integer> entry : stats.entrySet()) { int val = stats.get(entry.getKey()); Node n = nodes.get(entry.getKey()); if (val > maxFields) { addViolation(data, n); } } return data; }

Target:
public Object visit(ASTCompilationUnit node, Object data) { int maxFields = getProperty(MAX_FIELDS_DESCRIPTOR); stats = new HashMap<>(5); nodes = new HashMap<>(5); List<ASTFieldDeclaration> l = node.findDescendantsOfType(ASTFieldDeclaration.class); for (ASTFieldDeclaration fd : l) { if (fd.isFinal() && fd.isStatic()) { continue; } ASTClassOrInterfaceDeclaration clazz = fd.getFirstParentOfType(ASTClassOrInterfaceDeclaration.class); if (clazz != null && !clazz.isInterface()) { bumpCounterFor(clazz); } } for (Map.Entry<String, Integer> entry : stats.entrySet()) { int val = entry.getValue(); Node n = nodes.get(entry.getKey()); if (val > maxFields) { addViolation(data, n); } } return data; }
Source:
private void updateSearchRecords(String query) { resetTask(); forwarderManager.updateSearchRecords(query); if (query.isEmpty()) { toggleTags.hideBar(); systemUiVisibilityHelper.resetScroll(); } else { toggleTags.showBar(prefs); runTask(new QuerySearcher(this, query)); } }

Target:
private void updateSearchRecords(String query) { resetTask(); dismissPopup(); forwarderManager.updateSearchRecords(query); if (query.isEmpty()) { toggleTags.hideBar(); systemUiVisibilityHelper.resetScroll(); } else { toggleTags.showBar(prefs); runTask(new QuerySearcher(this, query)); } }
Source:
public void bat$setAwake(boolean awake) { setIsBatHanging(awake); }

Target:
public void bat$setAwake(boolean awake) { setIsBatHanging(!awake); }
Source:
void removedBlockCommentsPrinted() { String code = "public class Foo {" + EOL + " " + EOL + "void mymethod() {" + EOL + "}" + EOL + "}"; CompilationUnit cu = JavaParser.parse(code); LexicalPreservingPrinter.setup(cu); cu.getAllContainedComments().get(0).remove(); assertEqualsNoEol("public class Foo {" + EOL + "void mymethod() {" + EOL + "}" + EOL + "}", LexicalPreservingPrinter.print(cu)); }

Target:
void removedBlockCommentsPrinted() { String code = "public class Foo {" + EOL + " " + EOL + "void mymethod() {" + EOL + "}" + EOL + "}"; CompilationUnit cu = parse(code); LexicalPreservingPrinter.setup(cu); cu.getAllContainedComments().get(0).remove(); assertEqualsNoEol("public class Foo {" + EOL + "void mymethod() {" + EOL + "}" + EOL + "}", LexicalPreservingPrinter.print(cu)); }
Source:
protected void reduce( final BytesWritable key, Iterable<BytesWritable> values, final Context context ) throws IOException, InterruptedException { Iterator<BytesWritable> iter = values.iterator(); BytesWritable first = iter.next(); if(iter.hasNext()) { SortableBytes keyBytes = SortableBytes.fromBytesWritable(key); Bucket bucket = Bucket.fromGroupKey(keyBytes.getGroupKey()).lhs; final int maxTotalBufferSize = config.getSchema().getTuningConfig().getBufferSize(); final int aggregationBufferSize = (int) ((double) maxTotalBufferSize * config.getSchema().getTuningConfig().getAggregationBufferRatio()); final StupidPool<ByteBuffer> bufferPool = new OffheapBufferPool(aggregationBufferSize); IncrementalIndex index = makeIncrementalIndex(bucket, combiningAggs, bufferPool, config); index.add(InputRowHelper.fromBytes(first.getBytes(), config.getSchema().getDataSchema().getAggregators())); while(iter.hasNext()) { context.progress(); InputRow value = InputRowHelper.fromBytes(iter.next().getBytes(), config.getSchema().getDataSchema().getAggregators()); index.add(value); } Iterator<Row> rows = index.iterator(); while(rows.hasNext()) { Row row = rows.next(); InputRow inputRow = InputRowHelper.getInputRowFromRow(row, index.getDimensions()); context.write( key, new BytesWritable(InputRowHelper.toBytes(inputRow, combiningAggs)) ); } } else { context.write(key, first); } }

Target:
protected void reduce( final BytesWritable key, Iterable<BytesWritable> values, final Context context ) throws IOException, InterruptedException { Iterator<BytesWritable> iter = values.iterator(); BytesWritable first = iter.next(); if(iter.hasNext()) { SortableBytes keyBytes = SortableBytes.fromBytesWritable(key); Bucket bucket = Bucket.fromGroupKey(keyBytes.getGroupKey()).lhs; IncrementalIndex index = makeIncrementalIndex(bucket, combiningAggs, config, false, null); index.add(InputRowSerde.fromBytes(first.getBytes(), aggregators)); while(iter.hasNext()) { context.progress(); InputRow value = InputRowSerde.fromBytes(iter.next().getBytes(), aggregators); if(!index.canAppendRow()) { log.info("current index full due to [%s]. creating new index.", index.getOutOfRowsReason()); flushIndexToContextAndClose(key, index, context); index = makeIncrementalIndex(bucket, combiningAggs, config, false, null); } index.add(value); } flushIndexToContextAndClose(key, index, context); } else { context.write(key, first); } }
Source:
public void enterAlternatingTag( @NotNull final se.tre.freki.query.SelectParser.AlternatingTagContext ctx) { super.enterAlternatingTag(ctx); if (isKey) { isKey = false; final List<ListenableFuture<LabelId>> futureIds = new ArrayList<>(); for (final TerminalNode terminalNode : ctx.LABEL_NAME()) { futureIds.add(labelClient.lookupId(terminalNode.getText(), TAGK)); } futurePredicateList.add(Futures.transform(allAsList(futureIds), new AsyncFunction<List<LabelId>, TimeSeriesIdPredicate>() { @Override public ListenableFuture<TimeSeriesIdPredicate> apply(final List<LabelId> labelIds) throws Exception { return immediateFuture(AlternationTimeSeriesIdPredicate.ids(labelIds)); } })); } else { isKey = true; final List<ListenableFuture<LabelId>> futureIds = new ArrayList<>(); for (final TerminalNode terminalNode : ctx.LABEL_NAME()) { futureIds.add(labelClient.lookupId(terminalNode.getText(), TAGV)); } futurePredicateList.add(Futures.transform(allAsList(futureIds), new AsyncFunction<List<LabelId>, TimeSeriesIdPredicate>() { @Override public ListenableFuture<TimeSeriesIdPredicate> apply(final List<LabelId> labelIds) throws Exception { return immediateFuture(AlternationTimeSeriesIdPredicate.ids(labelIds)); } })); } }

Target:
public void enterAlternatingTag( @NotNull final se.tre.freki.query.SelectParser.AlternatingTagContext ctx) { super.enterAlternatingTag(ctx); final LabelType labelType = alternate(); final List<ListenableFuture<LabelId>> futureIds = new ArrayList<>(); for (final TerminalNode terminalNode : ctx.LABEL_NAME()) { futureIds.add(labelClient.lookupId(terminalNode.getText(), labelType)); } futurePredicateList.add(Futures.transform(allAsList(futureIds), new AsyncFunction<List<LabelId>, TimeSeriesIdPredicate>() { @Override public ListenableFuture<TimeSeriesIdPredicate> apply(final List<LabelId> labelIds) throws Exception { return immediateFuture(AlternationTimeSeriesIdPredicate.ids(labelIds)); } })); }
Source:
protected KieServicesClient createDefaultClient(KieServicesConfiguration configuration, MarshallingFormat marshallingFormat) throws Exception { KieServicesClient kieServicesClient = null; configuration.setTimeout(60000); configuration.setMarshallingFormat(marshallingFormat); configuration.addJaxbClasses(new HashSet<Class<?>>(extraClasses.values())); additionalConfiguration(configuration); if (extraClasses.size() > 0) { ClassLoader classLoader = extraClasses.values().iterator().next().getClassLoader(); kieServicesClient = KieServicesFactory.newKieServicesClient(configuration, classLoader); } else { kieServicesClient = KieServicesFactory.newKieServicesClient(configuration); } setupClients(kieServicesClient); return kieServicesClient; }

Target:
protected KieServicesClient createDefaultClient(KieServicesConfiguration configuration, MarshallingFormat marshallingFormat) throws Exception { KieServicesClient kieServicesClient = null; configuration.setTimeout(DEFAULT_TIMEOUT); configuration.setMarshallingFormat(marshallingFormat); configuration.addJaxbClasses(new HashSet<Class<?>>(extraClasses.values())); additionalConfiguration(configuration); if (extraClasses.size() > 0) { ClassLoader classLoader = extraClasses.values().iterator().next().getClassLoader(); kieServicesClient = KieServicesFactory.newKieServicesClient(configuration, classLoader); } else { kieServicesClient = KieServicesFactory.newKieServicesClient(configuration); } setupClients(kieServicesClient); return kieServicesClient; }
Source:
public ICustomCollision getCustomCollision( World w, int x, int y, int z ) { if( this instanceof ICustomCollision ) { return (ICustomCollision) this; } return null; }

Target:
protected ICustomCollision getCustomCollision( World w, int x, int y, int z ) { if( this instanceof ICustomCollision ) { return (ICustomCollision) this; } return null; }
Source:
public void startup(Application application, ComponentStartupStatus ss) { FileOps.ensureDir(deltaClientZone); FileOps.clearAll(deltaClientZone); zone = Zone.connect(deltaClientZone); deltaLink = DeltaLinkHTTP.connect(deltaServerURL); deltaClient = DeltaClient.create(zone, deltaLink); jmsMessagingClient = application.getJMSMessagingClient(); log.info(String.format("DeltaClient connected to DeltaServer at %s with zone %s", deltaServerURL, deltaClientZone)); }

Target:
public void startup(Application application, ComponentStartupStatus ss) { FileOps.ensureDir(deltaClientZone); FileOps.clearAll(deltaClientZone); Zone zone = Zone.connect(deltaClientZone); deltaLink = DeltaLinkHTTP.connect(deltaServerURL); deltaClient = DeltaClient.create(zone, deltaLink); jmsMessagingClient = application.getJMSMessagingClient(); ss.info(String.format("DeltaClient connected to DeltaServer at %s with zone %s", deltaServerURL, deltaClientZone)); }
Source:
private void setRoviDescription(LocalizedDescription localizedDescription, RoviProgramDescriptionLine roviDescription) { if (roviDescription.getDescriptionType().equals("Generic Description")) { localizedDescription.setShortDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals("Plot Synopsis")) { localizedDescription.setMediumDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals("Synopsis")) { localizedDescription.setLongDescription(roviDescription.getDescription().orNull()); } Optional<String> longestDescription = getLongestDescription(localizedDescription); localizedDescription.setDescription(longestDescription.orNull()); }

Target:
private void setRoviDescription(LocalizedDescription localizedDescription, RoviProgramDescriptionLine roviDescription) { if (roviDescription.getDescriptionType().equals(GENERIC_DESCRIPTION_TYPE)) { localizedDescription.setShortDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals(PLOT_SYNOPSIS_TYPE)) { localizedDescription.setMediumDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals(SYNOPSIS_TYPE)) { localizedDescription.setLongDescription(roviDescription.getDescription().orNull()); } Optional<String> longestDescription = getLongestDescription(localizedDescription); localizedDescription.setDescription(longestDescription.orNull()); }
Source:
private void cleanUpOldUnusedTasksFromConnector(Collection<DatastreamTask> unusedTasks) { unusedTasks.forEach(t -> deleteConnectorTask(t.getConnectorType(), t.getDatastreamTaskName())); }

Target:
private void cleanUpOldUnusedTasksFromConnector(Collection<DatastreamTask> unusedTasks) { LOG.info("cleanUpOldUnusedTasksFromConnector::start total unused tasks: {}", unusedTasks.size()); unusedTasks.forEach(t -> deleteConnectorTask(t.getConnectorType(), t.getDatastreamTaskName())); LOG.info("cleanUpOldUnusedTasksFromConnector::end"); }
Source:
void testFilter() { for (String region : supportedRegions) { SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegion(region)); assertNotNull(allResults); if (allResults.size() >= 1) { PlacementGroup group = allResults.last(); SortedSet<PlacementGroup> result = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("group-name", group.getName()).build())); assertNotNull(result); PlacementGroup compare = result.last(); assertEquals(compare, group); } } }

Target:
public void testFilter() { for (String region : supportedRegions) { SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegion(region)); assertNotNull(allResults); if (allResults.size() >= 1) { PlacementGroup group = allResults.last(); SortedSet<PlacementGroup> result = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("group-name", group.getName()).build())); assertNotNull(result); PlacementGroup compare = result.last(); assertEquals(compare, group); } } }
Source:
public ParseException(String message) { super("Parse error in filter: " + message); }

Target:
public ParseException(String message) { super("Error in filter: " + message); }