auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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 ) ) { <START> licenseMerges = Arrays.asList( UrlRequester.getFromUrl( licenseMergesUrl ).split( "\n" ) ); <END> } } }</code><technical_language>[\n\r]+ safer</technical_language>

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:
<code>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(); <START> initializeVds(); <END> 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); } }</code><technical_language>changing behavior here? motivation it</technical_language>

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:
<code>static boolean isClassDirectoryURL(@Nonnull URL url) { final File file = urlToFile(url); if (file != null && file.isDirectory()) { return true; } <START> return url.toExternalForm().endsWith("/"); <END> }</code><technical_language>ant: Careful. While this correctly allow file:/tmp/mylibs.jar, incorrectly forbid jar:file:/tmp/mylibs.jar!/, is preferred form (IMO). for jar:http://server/mylibs.jar!/. I suggest java String u = url.toExternalForm(); return u.endsWith("/") && !u.startsWith("jar:");</technical_language>

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:
<code>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(); <START> if (imageUrl.startsWith("http")) { <END> 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); } } } } }</code><technical_language>allow https images</technical_language>

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:
<code>public void run() { if (!isAlive.compareAndSet(false, true)) { inQueue.set(false); return; } inQueue.set(false); try { <START> while (!referenceLists.isEmpty()) { <END> 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); } }</code><technical_language>tricky follow easily, trusting this is correct</technical_language>

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:
<code>public void testWithArithmeticOperator() throws IOException { <START> Filter arthimeticMultiplyFilter = <END> 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(); } }</code><technical_language>arthimetic ;-) (see other variables too)</technical_language>

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:
<code>private String extractAuthorizationProvider(ProfileEntry profileEntry) { <START> return profileEntry == null ? "" : profileEntry.getAuthz(); <END> }</code><technical_language>if is null search return ""</technical_language>

Target:
private String extractAuthorizationProvider(ProfileEntry profileEntry) { return profileEntry.getAuthz(); }
Source:
<code>protected Object encodeCommand(Command command) { ChannelBuffer commandString; switch (command.getType()) { case Command.TYPE_IDENTIFICATION: <START> commandString = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 12); <END> 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; }</code><technical_language>I dynamicBuffer other hardcoding length</technical_language>

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:
<code>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; } <START> String entityId = change.entityId(); <END> 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(); }</code><technical_language>need do this I - save typing execution time</technical_language>

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:
<code>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, <START> configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG)); <END> 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; }</code><technical_language>Remove lines code below? copyMapEntries(nextConfigs, configs, SslConfigs.NON_RECONFIGURABLE_CONFIGS); copyMapEntries(nextConfigs, configs, SslConfigs.RECONFIGURABLE_CONFIGS); copyMapEntries(nextConfigs, configs, SecurityConfig. SECURITY_PROVIDERS_CONFIG)</technical_language>

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:
<code>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); <START> IntStream.range(0, BATCH_SIZE).forEach(idx -> map.put(idx, idx)); <END> 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); }</code><technical_language>change this (BATCH_SIZE, BATCH_SIZE*2)? indexes, easily verify if checkpoint loaded</technical_language>

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:
<code>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; } } <START> if (lookPosition <= sprite.getLookDataList().size() && lookPosition > 0) { <END> look = sprite.getLookDataList().get(lookPosition - 1); } else { for (LookData lookData : sprite.getLookDataList()) { if (lookData.getLookName().equals(parsedLookName)) { look = lookData; } } } }</code><technical_language>I set lookPosition > 0 condition here, is more fail results in evaluations runtime. a lot of difference in other situations</technical_language>

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:
<code><START> public AppiumServerStatus getStatus() { <END> 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; }</code><technical_language>simply return a map out of it. status output is constant differs for drivers</technical_language>

Target:
public Map<String, Object> getStatus() { return (Map<String, Object>) execute(DriverCommand.STATUS).getValue(); }
Source:
<code>public void equal_shouldReturnTrueWhenBothPatientIdsAreNullAndEndDateAndStartDateAreEqual() { CohortMembership cohortMembershipOne = new CohortMembership(); CohortMembership cohortMembershipTwo = new CohortMembership(); <START> Date startDate1 = new Date(1545140935); <END> 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)); }</code><technical_language>Do wee need duplicate 1545140935</technical_language>

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:
<code>public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasRestored) { final int orientation = getResources().getConfiguration().orientation; int currentPos = 0; <START> if (videoModel != null) { <END> 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); }</code><technical_language>Extra line needs removed</technical_language>

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:
<code>public int compareTo(@NotNull KotlinFunctionInfo f) { <START> return this.toString().hashCode() - f.toString().hashCode(); <END> }</code><technical_language>return this.toString().compareTo(f.toString()); more correct. Equality of hash codes guarantee objects equal (though is true)</technical_language>

Target:
public int compareTo(@NotNull KotlinFunctionInfo f) { return this.toString().compareTo(f.toString()); }
Source:
<code>protected CommunityRest createAndReturn(Context context, UUID id) throws AuthorizeException { if (id == null) { throw new DSpaceBadRequestException("The given parent parameter was invalid: " <START> + id); <END> } 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); }</code><technical_language>Similar above, id is null. reword this "Parent Community UUID is null. create a SubCommunity providing a parent Community"</technical_language>

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:
<code>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); <START> return null; <END> } }</code><technical_language>return raw string if decrypt fail, done in previous logic</technical_language>

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:
<code>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()) { <START> throw new RsFailure("Filename was not provided"); <END> } 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())); }</code><technical_language>@antonini if this is new code, test cover</technical_language>

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:
<code>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) { <START> JournalData.addJournalEntry(owner, <END> String.format( "Invalid language detected while updating translated text for %s (%s): '%s'", field.getName(), lang, text)); } }</code><technical_language>Humm, JournalData is place log errors</technical_language>

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:
<code>public Response addMapper(IdentityProviderMapperRepresentation mapper) { auth.requireManage(); IdentityProviderMapperModel model = RepresentationToModel.toModel(mapper); model = realm.addIdentityProviderMapper(model); <START> adminEvent.realm(realm).operation(OperationType.ACTION).resourcePath(model, uriInfo.getPath()) <END> .representation(mapper).success(); return Response.created(uriInfo.getAbsolutePathBuilder().path(model.getId()).build()).build(); }</code><technical_language>This ACTION, a CREATE</technical_language>

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:
<code><START> public double getAvgMemBytesUsed() { <END> return memBytesTotal / (double) numTasks; }</code><technical_language>getters means included json fields. easily calculated, else in code exclude these? (think extra fields x 3000+ requests in json blob)</technical_language>

Target:
public double getAvgMemBytesUsed() { return memBytesUsed / (double) numTasks; }
Source:
<code>private boolean upgradeEightNine(SQLiteDatabase db) { db.beginTransaction(); <START> android.database.Cursor cursor = null; <END> 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(); } }</code><technical_language>Strictly speaking lines of code occur db.begin try starts</technical_language>

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:
<code><START> private List<InternalNode> convertToInternalNode(NodeMap nodeMap, List<HostAddress> preferredNodes) <END> { List<InternalNode> internalNodes = new ArrayList<>(); preferredNodes.stream().forEach(node -> internalNodes.addAll(nodeMap.getNodesByHostAndPort().get(node))); return ImmutableList.copyOf(internalNodes); }</code><technical_language>static</technical_language>

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:
<code>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()) { <START> int val = stats.get(entry.getKey()); <END> Node n = nodes.get(entry.getKey()); if (val > maxFields) { addViolation(data, n); } } return data; }</code><technical_language>This is wrong, entry.getValue()</technical_language>

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:
<code>private void updateSearchRecords(String query) { resetTask(); forwarderManager.updateSearchRecords(query); if (query.isEmpty()) { <START> toggleTags.hideBar(); <END> systemUiVisibilityHelper.resetScroll(); } else { toggleTags.showBar(prefs); runTask(new QuerySearcher(this, query)); } }</code><technical_language>if this is related this line, is a bug in current tag bar, if search for empty search query, bar is displayed again</technical_language>

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:
<code>public void bat$setAwake(boolean awake) { <START> setIsBatHanging(awake); <END> }</code><technical_language>setIsBatHanging(!awake) for reason</technical_language>

Target:
public void bat$setAwake(boolean awake) { setIsBatHanging(!awake); }
Source:
<code>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)); }</code><technical_language>Huh? :-)</technical_language>

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:
<code>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()); <START> index.add(value); <END> } 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); } }</code><technical_language>do need check index size bounds</technical_language>

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:
<code>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)); } })); <START> } <END> }</code><technical_language>myBool = !myBool;</technical_language>

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:
<code>protected KieServicesClient createDefaultClient(KieServicesConfiguration configuration, MarshallingFormat marshallingFormat) throws Exception { KieServicesClient kieServicesClient = null; <START> configuration.setTimeout(60000); <END> 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; }</code><technical_language>"timeout" a Java constant</technical_language>

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:
<code><START> public ICustomCollision getCustomCollision( World w, int x, int y, int z ) <END> { if( this instanceof ICustomCollision ) { return (ICustomCollision) this; } return null; }</code><technical_language>public (protected suffice) returns null of object, dangerous (potential new NPEs)</technical_language>

Target:
protected ICustomCollision getCustomCollision( World w, int x, int y, int z ) { if( this instanceof ICustomCollision ) { return (ICustomCollision) this; } return null; }
Source:
<code>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(); <START> log.info(String.format("DeltaClient connected to DeltaServer at %s with zone %s", deltaServerURL, deltaClientZone)); <END> }</code><technical_language>log.info() ss.info()</technical_language>

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)); }