auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onRewardedVideoAdClicked(String instanceId, Placement placement) { onLog("onRewardedVideoAdClicked, placement: " + placement.getPlacementName() + " for instance: " + instanceId); if (mMediationRewardedVideoAdListener != null) { sendEventOnUIThread(new Runnable() { public void run() { <START> mMediationRewardedVideoAdListener.onAdClicked(IronSourceRewardedAdapter.this); <END> } }); } }</code><technical_language>Please call [onAdLeftApplication()](<LINK_0> similar interstitial adapter</technical_language>

Target:
public void onRewardedVideoAdClicked(String instanceId, Placement placement) { onLog("onRewardedVideoAdClicked, placement: " + placement.getPlacementName() + " for instance: " + instanceId); if (mMediationRewardedVideoAdListener != null) { sendEventOnUIThread(new Runnable() { public void run() { mMediationRewardedVideoAdListener.onAdClicked(IronSourceRewardedAdapter.this); mMediationRewardedVideoAdListener.onAdLeftApplication(IronSourceRewardedAdapter.this); } }); } }
Source:
<code>public void cannotInsertSameEntityTwice() throws Exception { getTransactionManager().begin(); EntityManager em = getFactory().createEntityManager(); MakeupArtist wibke = new MakeupArtist( "wibke", "halloween" ); em.persist( wibke ); getTransactionManager().commit(); em.clear(); getTransactionManager().begin(); em.joinTransaction(); MakeupArtist notWibke = new MakeupArtist( "wibke", "glamorous" ); em.persist( notWibke ); try { getTransactionManager().commit(); fail( "Expected exception wasn't raised" ); } catch (Exception e) { <START> assertThat( e.getCause().getMessage() ).matches( ".*OGM000067.*" ); <END> } em.clear(); getTransactionManager().begin(); em.joinTransaction(); MakeupArtist loadedMakeupArtist = em.find( MakeupArtist.class, "wibke" ); assertThat( loadedMakeupArtist ).isNotNull(); assertThat( loadedMakeupArtist.getFavoriteStyle() ).describedAs( "Second insert should not be applied" ).isEqualTo( "halloween" ); em.remove( loadedMakeupArtist ); getTransactionManager().commit(); em.close(); }</code><technical_language>this a new form of exception? a defined exception type in JPA (i.e. created existing JPA code)</technical_language>

Target:
public void cannotInsertSameEntityTwice() throws Exception { getTransactionManager().begin(); EntityManager em = getFactory().createEntityManager(); MakeupArtist wibke = new MakeupArtist( "wibke", "halloween" ); em.persist( wibke ); getTransactionManager().commit(); em.clear(); getTransactionManager().begin(); em.joinTransaction(); MakeupArtist notWibke = new MakeupArtist( "wibke", "glamorous" ); em.persist( notWibke ); try { getTransactionManager().commit(); fail( "Expected exception wasn't raised" ); } catch (Exception e) { assertThat( e.getCause() ).isExactlyInstanceOf( EntityExistsException.class ); assertThat( e.getCause().getMessage() ).matches( ".*OGM000067.*" ); } em.clear(); getTransactionManager().begin(); em.joinTransaction(); MakeupArtist loadedMakeupArtist = em.find( MakeupArtist.class, "wibke" ); assertThat( loadedMakeupArtist ).isNotNull(); assertThat( loadedMakeupArtist.getFavoriteStyle() ).describedAs( "Second insert should not be applied" ).isEqualTo( "halloween" ); em.remove( loadedMakeupArtist ); getTransactionManager().commit(); em.close(); }
Source:
<code>private Map<String, LoadBalancerStrategyFactory<?>> createDefaultLoadBalancerStrategyFactories() { final Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories = new HashMap<>(_config.loadBalancerStrategyFactories); final RandomLoadBalancerStrategyFactory randomStrategyFactory = new RandomLoadBalancerStrategyFactory(); loadBalancerStrategyFactories.putIfAbsent("random", randomStrategyFactory); final DegraderLoadBalancerStrategyFactoryV3 degraderStrategyFactoryV3 = new DegraderLoadBalancerStrategyFactoryV3( _config.healthCheckOperations, _config._executorService, _config.eventEmitter, Collections.emptyList()); loadBalancerStrategyFactories.putIfAbsent("degrader", degraderStrategyFactoryV3); loadBalancerStrategyFactories.putIfAbsent("degraderV2", degraderStrategyFactoryV3); loadBalancerStrategyFactories.putIfAbsent("degraderV3", degraderStrategyFactoryV3); loadBalancerStrategyFactories.putIfAbsent("degraderV2_1", degraderStrategyFactoryV3); final RelativeLoadBalancerStrategyFactory relativeLoadBalancerStrategyFactory = new RelativeLoadBalancerStrategyFactory( _config._executorService, _config.healthCheckOperations, Collections.emptyList(), _config.eventEmitter); <START> loadBalancerStrategyFactories.putIfAbsent("relative", relativeLoadBalancerStrategyFactory); <END> return loadBalancerStrategyFactories; }</code><technical_language>public static string defined in RelativeLoadBalancerStrategy</technical_language>

Target:
private Map<String, LoadBalancerStrategyFactory<?>> createDefaultLoadBalancerStrategyFactories() { final Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories = new HashMap<>(_config.loadBalancerStrategyFactories); final RandomLoadBalancerStrategyFactory randomStrategyFactory = new RandomLoadBalancerStrategyFactory(); loadBalancerStrategyFactories.putIfAbsent("random", randomStrategyFactory); final DegraderLoadBalancerStrategyFactoryV3 degraderStrategyFactoryV3 = new DegraderLoadBalancerStrategyFactoryV3( _config.healthCheckOperations, _config._executorService, _config.eventEmitter, Collections.emptyList()); loadBalancerStrategyFactories.putIfAbsent("degrader", degraderStrategyFactoryV3); loadBalancerStrategyFactories.putIfAbsent("degraderV2", degraderStrategyFactoryV3); loadBalancerStrategyFactories.putIfAbsent("degraderV3", degraderStrategyFactoryV3); loadBalancerStrategyFactories.putIfAbsent("degraderV2_1", degraderStrategyFactoryV3); final RelativeLoadBalancerStrategyFactory relativeLoadBalancerStrategyFactory = new RelativeLoadBalancerStrategyFactory( _config._executorService, _config.healthCheckOperations, Collections.emptyList(), _config.eventEmitter); loadBalancerStrategyFactories.putIfAbsent(RelativeLoadBalancerStrategy.RELATIVE_LOAD_BALANCER_STRATEGY_NAME, relativeLoadBalancerStrategyFactory); return loadBalancerStrategyFactories; }
Source:
<code>public static void cleanupTestBucketOrDirectory(final MantaClient client, final String testPath) throws IOException { if (testPath.contains(bucketObjectsSubstring)) { final String bucketPath = parseBucketPath(testPath); try { client.deleteBucket(bucketPath); } catch (MantaClientHttpResponseException e) { if (e.getServerCode().equals(MantaErrorCode.BUCKET_NOT_EMPTY_ERROR)) { <START> e.setContextValue("Cleanup of non-empty test bucket attempted at:", testPath); <END> throw e; } } } else { IntegrationTestConfigContext.cleanupTestDirectory(client, testPath); } }</code><technical_language>Context keys generally in format of a case string underscores instead of spaces. Perhaps, key bucket_path</technical_language>

Target:
public static void cleanupTestBucketOrDirectory(final MantaClient client, final String testPath) throws IOException { if (testPath.contains(bucketObjectsSubstring)) { final String bucket_path = parseBucketPath(testPath); try { client.deleteBucket(bucket_path); } catch (MantaClientHttpResponseException e) { if (e.getServerCode().equals(MantaErrorCode.BUCKET_NOT_EMPTY_ERROR)) { MantaIOException mioe = new MantaIOException("Cannot delete bucket containing objects", e); mioe.setContextValue("bucket_path", testPath); throw mioe; } } } else { IntegrationTestConfigContext.cleanupTestDirectory(client, testPath); } }
Source:
<code>public synchronized Identity createEndpoint(ServerInfo serverInfo) { if (currentEndpoint != null) { coapServer.getEndpoints().remove(currentEndpoint); currentEndpoint.destroy(); } Identity server; if (serverInfo.isSecure()) { Builder newBuilder = cloneDtlsConfigBuilder(dtlsConfigbuilder); if (serverInfo.secureMode == SecurityMode.PSK) { StaticPskStore staticPskStore = new StaticPskStore(serverInfo.pskId, serverInfo.pskKey); newBuilder.setPskStore(staticPskStore); } if (endpointFactory != null) { currentEndpoint = endpointFactory.createSecuredEndpoint(newBuilder.build(), coapConfig, null); } else { currentEndpoint = new CoapEndpoint(new DTLSConnector(newBuilder.build()), coapConfig, null, null); } server = Identity.psk(serverInfo.getAddress(), serverInfo.pskId); } else { if (endpointFactory != null) { currentEndpoint = endpointFactory.createUnsecuredEndpoint(localAddress, coapConfig, null); } else { currentEndpoint = new CoapEndpoint(localAddress, coapConfig); <START> } <END> server = Identity.unsecure(serverInfo.getAddress()); } coapServer.addEndpoint(currentEndpoint); if (started) { coapServer.start(); try { currentEndpoint.start(); LOG.info("New endpoint created for server at {}", serverInfo.serverUri, currentEndpoint.getUri()); } catch (IOException e) { throw new RuntimeException("Unable to start endpoint", e); } } return server; }</code><technical_language>passing ObservationStore endpoints</technical_language>

Target:
public synchronized Identity createEndpoint(ServerInfo serverInfo) { if (currentEndpoint != null) { coapServer.getEndpoints().remove(currentEndpoint); currentEndpoint.destroy(); } Identity server; if (serverInfo.isSecure()) { Builder newBuilder = cloneDtlsConfigBuilder(dtlsConfigbuilder); if (serverInfo.secureMode == SecurityMode.PSK) { StaticPskStore staticPskStore = new StaticPskStore(serverInfo.pskId, serverInfo.pskKey); newBuilder.setPskStore(staticPskStore); } if (endpointFactory != null) { currentEndpoint = endpointFactory.createSecuredEndpoint(newBuilder.build(), coapConfig, null); } else { CoapEndpoint.CoapEndpointBuilder builder = new CoapEndpoint.CoapEndpointBuilder(); builder.setConnector(new DTLSConnector(newBuilder.build())); builder.setNetworkConfig(coapConfig); currentEndpoint = builder.build(); } server = Identity.psk(serverInfo.getAddress(), serverInfo.pskId); } else { if (endpointFactory != null) { currentEndpoint = endpointFactory.createUnsecuredEndpoint(localAddress, coapConfig, null); } else { CoapEndpoint.CoapEndpointBuilder builder = new CoapEndpoint.CoapEndpointBuilder(); builder.setInetSocketAddress(localAddress); builder.setNetworkConfig(coapConfig); currentEndpoint = builder.build(); } server = Identity.unsecure(serverInfo.getAddress()); } coapServer.addEndpoint(currentEndpoint); if (started) { coapServer.start(); try { currentEndpoint.start(); LOG.info("New endpoint created for server at {}", serverInfo.serverUri, currentEndpoint.getUri()); } catch (IOException e) { throw new RuntimeException("Unable to start endpoint", e); } } return server; }
Source:
<code>public static String offerIDListToString(List<OfferID> offerIDList) { List<String> offerIDsAsStrings = Lists.transform(offerIDList, offerIDToStringTransform); <START> return "[" + StringUtils.join(offerIDsAsStrings, ", ") + "]"; <END> }</code><technical_language>Please try follow this new non-+ strategy, above: String.format("[%s]", StringUtils.join(rangesAsStrings, ","));</technical_language>

Target:
public static String offerIDListToString(List<OfferID> offerIDList) { List<String> offerIDsAsStrings = Lists.transform(offerIDList, offerIDToStringTransform); return String.format("[ %s ]", StringUtils.join(offerIDsAsStrings, ", ")); }
Source:
<code>public static RuntimeException rethrow(Throwable pThrowable) { if (pThrowable == null) { throw new NullPointerException("The Throwable must not be null."); } <START> if (pThrowable instanceof RuntimeException) { <END> throw (RuntimeException) pThrowable; } else if (pThrowable instanceof Error) { throw (Error) pThrowable; } else if (pThrowable instanceof IOException) { throw new UncheckedIOException((IOException) pThrowable); } else { throw new UndeclaredThrowableException(pThrowable); } }</code><technical_language>This is a completely change; please mix changes in a pull request</technical_language>

Target:
public static RuntimeException rethrow(Throwable pThrowable) { if (pThrowable == null) { throw new NullPointerException("The Throwable must not be null."); } else { if (pThrowable instanceof RuntimeException) { throw (RuntimeException) pThrowable; } else if (pThrowable instanceof Error) { throw (Error) pThrowable; } else if (pThrowable instanceof IOException) { throw new UncheckedIOException((IOException) pThrowable); } else { throw new UndeclaredThrowableException(pThrowable); } } }
Source:
<code>public void run(IAction action) { final IResource[] resources = getSelectedResources(); if (resources.length == 0) return; WorkspaceJob job = new WorkspaceJob("Ignore Git resources") { public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { monitor.beginTask("Ignoring Git resources", resources.length); try { for (IResource resource : resources) { if (!Team.isIgnoredHint(resource)) { IContainer container = resource.getParent(); IFile gitignore = container.getFile(new Path( Constants.GITIGNORE_FILENAME)); String entry = "/" + resource.getName() + "\n"; if (gitignore.exists()) { gitignore.appendContents( <START> new ByteArrayInputStream(entry <END> .getBytes(Constants.CHARACTER_ENCODING)), true, true, monitor); } else { ByteArrayInputStream bais = new ByteArrayInputStream( entry .getBytes(Constants.CHARACTER_ENCODING)); gitignore.create(bais, true, monitor); } } monitor.worked(1); } monitor.done(); } catch (CoreException e) { throw e; } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, "org.eclipse.egit.ui", "Unable to ignore resources", e)); } return Status.OK_STATUS; } }; job.schedule(); }</code><technical_language>This is completely common blocks, allocate duplicate code</technical_language>

Target:
public void run(IAction action) { final IResource[] resources = getSelectedResources(); if (resources.length == 0) return; WorkspaceJob job = new WorkspaceJob(UIText.IgnoreAction_jobName) { public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { monitor.beginTask(UIText.IgnoreAction_taskName, resources.length); try { for (IResource resource : resources) { if (!Team.isIgnoredHint(resource)) { addIgnore(monitor, resource); } monitor.worked(1); } monitor.done(); } catch (CoreException e) { throw e; } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, "org.eclipse.egit.ui", UIText.IgnoreAction_error, e)); } return Status.OK_STATUS; } private void addIgnore(IProgressMonitor monitor, IResource resource) throws UnsupportedEncodingException, CoreException { IContainer container = resource.getParent(); IFile gitignore = container.getFile(new Path( Constants.GITIGNORE_FILENAME)); String entry = "/" + resource.getName() + "\n"; ByteArrayInputStream entryBytes = asStream(entry); if (gitignore.exists()) gitignore.appendContents(entryBytes, true, true, monitor); else gitignore.create(entryBytes, true, monitor); } private ByteArrayInputStream asStream(String entry) throws UnsupportedEncodingException { return new ByteArrayInputStream(entry .getBytes(Constants.CHARACTER_ENCODING)); } }; job.schedule(); }
Source:
<code>public boolean equals(Object o) { if (o instanceof MultipleInstanceCollectionInput) { MultipleInstanceCollectionInput other = (MultipleInstanceCollectionInput) o; <START> return (null != value) ? value.equals(other.value) : null == other.value; <END> } return false; }</code><technical_language>Objects.equals</technical_language>

Target:
public boolean equals(Object o) { if (o instanceof MultipleInstanceCollectionInput) { MultipleInstanceCollectionInput other = (MultipleInstanceCollectionInput) o; return Objects.equals(value, other.value); } return false; }
Source:
<code><START> private void createWorkers(final GameData data) { <END> workers.clear(); if (data != null && cancelCurrentOperation.get() >= 0) { final long startTime = System.currentTimeMillis(); final long startMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); final GameData newData; try { data.acquireWriteLock(); newData = GameDataUtils.cloneGameDataWithoutHistory(data, false); } finally { data.releaseWriteLock(); } currentThreads = getThreadsToUse((System.currentTimeMillis() - startTime), startMemory); try { newData.acquireReadLock(); int i = 0; if (currentThreads <= 2 || MAX_THREADS <= 2) { while (cancelCurrentOperation.get() >= 0 && i < currentThreads) { workers.add(new BattleCalculator(newData, (currentThreads == ++i))); } } else { final CountDownLatch workerLatch = new CountDownLatch(currentThreads - 1); while (i < (currentThreads - 1)) { ++i; executor.execute( () -> { if (cancelCurrentOperation.get() >= 0) { workers.add(new BattleCalculator(newData, false)); } workerLatch.countDown(); }); } workers.add(new BattleCalculator(newData, true)); Interruptibles.await(workerLatch); } } finally { newData.releaseReadLock(); } } if (cancelCurrentOperation.get() < 0 || data == null) { workers.clear(); isDataSet = false; } else { isDataSet = true; dataLoadedAction.run(); } latchWorkerThreadsCreation.countDown(); latchSetData.countDown(); }</code><technical_language>Method createWorkers a Cognitive Complexity of 16 (exceeds 7 allowed). Consider refactoring</technical_language>

Target:
private void createWorkers(final GameData data) { workers.clear(); if (data != null && cancelCurrentOperation.get() >= 0) { final long startTime = System.currentTimeMillis(); final long startMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); final GameData newData; try { data.acquireWriteLock(); newData = GameDataUtils.cloneGameDataWithoutHistory(data, false); } finally { data.releaseWriteLock(); } final int currentThreads = getThreadsToUse((System.currentTimeMillis() - startTime), startMemory); try { newData.acquireReadLock(); int i = 0; if (currentThreads <= 2 || MAX_THREADS <= 2) { while (cancelCurrentOperation.get() >= 0 && i < currentThreads) { workers.add(new BattleCalculator(newData, (currentThreads == ++i))); } } else { final CountDownLatch workerLatch = new CountDownLatch(currentThreads - 1); while (i < (currentThreads - 1)) { ++i; executor.execute( () -> { if (cancelCurrentOperation.get() >= 0) { workers.add(new BattleCalculator(newData, false)); } workerLatch.countDown(); }); } workers.add(new BattleCalculator(newData, true)); Interruptibles.await(workerLatch); } } finally { newData.releaseReadLock(); } } if (cancelCurrentOperation.get() < 0 || data == null) { workers.clear(); isDataSet = false; } else { isDataSet = true; dataLoadedAction.run(); } latchWorkerThreadsCreation.countDown(); latchSetData.countDown(); }
Source:
<code>private static PlanNode addPartitioningNodes(Context context, PlanNode node, Symbol partitionSymbol, KdbTree kdbTree, Expression geometry, Optional<Expression> radius) { Assignments.Builder projections = Assignments.builder(); for (Symbol outputSymbol : node.getOutputSymbols()) { projections.putIdentity(outputSymbol); } ImmutableList.Builder<Expression> partitioningArguments = ImmutableList.<Expression>builder() .add(new Cast(new StringLiteral(KDB_TREE_CODEC.toJson(kdbTree)), KDB_TREE_TYPENAME)) .add(geometry); radius.map(partitioningArguments::add); FunctionCall partitioningFunction = new FunctionCall(QualifiedName.of("spatial_partitions"), partitioningArguments.build()); Symbol partitionsSymbol = context.getSymbolAllocator().newSymbol(partitioningFunction, new ArrayType(INTEGER)); projections.put(partitionsSymbol, partitioningFunction); <START> return new UnnestNode(context.getIdAllocator().getNextId(), <END> new ProjectNode(context.getIdAllocator().getNextId(), node, projections.build()), node.getOutputSymbols(), ImmutableMap.of(partitionsSymbol, ImmutableList.of(partitionSymbol)), Optional.empty()); }</code><technical_language>argument next line</technical_language>

Target:
private static PlanNode addPartitioningNodes(Context context, PlanNode node, Symbol partitionSymbol, KdbTree kdbTree, Expression geometry, Optional<Expression> radius) { Assignments.Builder projections = Assignments.builder(); for (Symbol outputSymbol : node.getOutputSymbols()) { projections.putIdentity(outputSymbol); } ImmutableList.Builder<Expression> partitioningArguments = ImmutableList.<Expression>builder() .add(new Cast(new StringLiteral(KdbTreeUtils.toJson(kdbTree)), KDB_TREE_TYPENAME)) .add(geometry); radius.map(partitioningArguments::add); FunctionCall partitioningFunction = new FunctionCall(QualifiedName.of("spatial_partitions"), partitioningArguments.build()); Symbol partitionsSymbol = context.getSymbolAllocator().newSymbol(partitioningFunction, new ArrayType(INTEGER)); projections.put(partitionsSymbol, partitioningFunction); return new UnnestNode( context.getIdAllocator().getNextId(), new ProjectNode(context.getIdAllocator().getNextId(), node, projections.build()), node.getOutputSymbols(), ImmutableMap.of(partitionsSymbol, ImmutableList.of(partitionSymbol)), Optional.empty()); }
Source:
<code>protected void crawlXmlFolders() throws Exception { for ( SourceCrawlerXMLFolder xmlFolder : xmlFolders ) { String[] xmlDirs = { xmlFolder.getFolder() }; String[] xmlMasks = { xmlFolder.getWildcard() }; <START> String[] xmlReq = { N_STRING }; <END> boolean[] xmlSubdirs = { true }; FileInputList xulFileInputList = FileInputList.createFileList( new Variables(), xmlDirs, xmlMasks, xmlReq, xmlSubdirs ); for ( FileObject fileObject : xulFileInputList.getFiles() ) { try { Document doc = XMLHandler.loadXMLFile( fileObject ); for ( SourceCrawlerXMLElement xmlElement : xmlFolder.getElements() ) { addLabelOccurrences( xmlFolder.getDefaultSourceFolder(), fileObject, doc .getElementsByTagName( xmlElement.getSearchElement() ), xmlFolder.getKeyPrefix(), xmlElement .getKeyTag(), xmlElement.getKeyAttribute(), xmlFolder.getDefaultPackage(), xmlFolder .getPackageExceptions() ); } } catch ( KettleXMLException e ) { log.logError( "Unable to open XUL / XML document: " + fileObject ); } } } }</code><technical_language>declaring a constant for is once</technical_language>

Target:
protected void crawlXmlFolders() throws Exception { for ( SourceCrawlerXMLFolder xmlFolder : xmlFolders ) { String[] xmlDirs = { xmlFolder.getFolder() }; String[] xmlMasks = { xmlFolder.getWildcard() }; String[] xmlReq = { N }; boolean[] xmlSubdirs = { true }; FileInputList xulFileInputList = FileInputList.createFileList( new Variables(), xmlDirs, xmlMasks, xmlReq, xmlSubdirs ); for ( FileObject fileObject : xulFileInputList.getFiles() ) { try { Document doc = XMLHandler.loadXMLFile( fileObject ); for ( SourceCrawlerXMLElement xmlElement : xmlFolder.getElements() ) { addLabelOccurrences( xmlFolder.getDefaultSourceFolder(), fileObject, doc .getElementsByTagName( xmlElement.getSearchElement() ), xmlFolder.getKeyPrefix(), xmlElement .getKeyTag(), xmlElement.getKeyAttribute(), xmlFolder.getDefaultPackage(), xmlFolder .getPackageExceptions() ); } } catch ( KettleXMLException e ) { log.logError( "Unable to open XUL / XML document: " + fileObject ); } } } }
Source:
<code>protected void onResume() { super.onResume(); if (getIntent() != null && getIntent().getAction().equals(Intent.ACTION_VIEW)) { Uri uri = getIntent().getData(); if (uri.getQueryParameter("error") != null) { <START> String error = uri.getQueryParameter("error"); <END> } else { String authCode = uri.getQueryParameter("code"); Intent intent = new Intent(this, AccountRetrievalService.class); intent.putExtra("AUTHCODE", authCode); intent.putExtra("REDIRECT_URI", REDIRECT_URI); intent.putExtra("CLIENT_ID", CLIENT_ID); startService(intent); Intent loadingActivityIntent = new Intent(this, LoadingActivity.class); startActivity(loadingActivityIntent); } } }</code><technical_language>Variable error is used</technical_language>

Target:
protected void onResume() { super.onResume(); if (getIntent() != null && getIntent().getAction().equals(Intent.ACTION_VIEW)) { Uri uri = getIntent().getData(); Log.d("LandingActivity", "onResume: uri = " + uri); String error = uri.getQueryParameter("error"); if (error != null) { Toast.makeText(this, R.string.whoops_error_message_on_app_return, Toast.LENGTH_SHORT).show(); Log.d("LandingActivity", "onResume: error = " + error); } else { String authCode = uri.getQueryParameter("code"); Intent intent = new Intent(this, AccountRetrievalService.class); intent.putExtra("AUTHCODE", authCode); intent.putExtra("REDIRECT_URI", REDIRECT_URI); intent.putExtra("CLIENT_ID", CLIENT_ID); startService(intent); Intent loadingActivityIntent = new Intent(this, LoadingActivity.class); startActivity(loadingActivityIntent); } } }
Source:
<code>public FlowIdentifier backupClusterDatabase(@NotNull NameOrCrn nameOrCrn, Long workspaceId, String location, String backupId) { LOGGER.debug("Starting cluster database backup: " + nameOrCrn); <START> if (nameOrCrn.hasName()) { <END> return databaseBackupRestoreService.backupDatabase(workspaceId, nameOrCrn.getName(), location, backupId); } else { LOGGER.debug("No stack name provided for backup, found: " + nameOrCrn); throw new BadRequestException("Please provide a stack name for backup"); } }</code><technical_language>this work crn</technical_language>

Target:
public FlowIdentifier backupClusterDatabase(@NotNull NameOrCrn nameOrCrn, Long workspaceId, String location, String backupId) { databaseBackupRestoreService.validate(workspaceId, nameOrCrn, location, backupId); LOGGER.debug("Starting cluster database backup: " + nameOrCrn); return databaseBackupRestoreService.backupDatabase(workspaceId, nameOrCrn, location, backupId); }
Source:
<code>public void restRequest(RestRequest request, RequestContext requestContext, Map<String, String> wireAttrs, TransportCallback<RestResponse> callback) { int currentIntervalIndex = (int) (_clockedExecutor.currentTimeMillis() / _intervalMillis); int requestCount = _lastRequestCountMap.getOrDefault(_uri, 0); long latency = _latencyManager.getLatency(_uri, requestCount, currentIntervalIndex); boolean hasError = _errorCountManager.getErrorCount(_uri, requestCount, currentIntervalIndex) - _currentErrorCountMap.getOrDefault(_uri, 0) > 0; _clockedExecutor.schedule(new Runnable() { @Override public void run() { RestResponseBuilder restResponseBuilder = new RestResponseBuilder().setEntity(request.getURI().getRawPath().getBytes()); if (hasError) { restResponseBuilder.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); RestException restException = new RestException(restResponseBuilder.build(), new Throwable("internal error")); callback.onResponse(TransportResponseImpl.error(restException)); return; } callback.onResponse(TransportResponseImpl.success(restResponseBuilder.build())); } }, latency, TimeUnit.MILLISECONDS); <START> synchronized (_lock) <END> { if (hasError) { _currentErrorCountMap.putIfAbsent(_uri, 0); _currentErrorCountMap.put(_uri, _currentErrorCountMap.get(_uri) + 1); } _callCountMap.putIfAbsent(_uri, 0); _callCountMap.put(_uri, _callCountMap.get(_uri) + 1); _latencySumMap.putIfAbsent(_uri, 0L); _latencySumMap.put(_uri, _latencySumMap.get(_uri) + latency); } }</code><technical_language>mockTransportClient handle concurrent requests? understand need a lock</technical_language>

Target:
public void restRequest(RestRequest request, RequestContext requestContext, Map<String, String> wireAttrs, TransportCallback<RestResponse> callback) { int currentIntervalIndex = (int) (_clockedExecutor.currentTimeMillis() / _intervalMillis); int requestCount = _lastRequestCountMap.getOrDefault(_uri, 0); long latency = _latencyManager.getLatency(_uri, requestCount, currentIntervalIndex); boolean hasError = _errorCountManager.getErrorCount(_uri, requestCount, currentIntervalIndex) - _currentErrorCountMap.getOrDefault(_uri, 0) > 0; _clockedExecutor.schedule(new Runnable() { @Override public void run() { RestResponseBuilder restResponseBuilder = new RestResponseBuilder().setEntity(request.getURI().getRawPath().getBytes()); if (hasError) { restResponseBuilder.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); RestException restException = new RestException(restResponseBuilder.build(), new Throwable("internal error")); callback.onResponse(TransportResponseImpl.error(restException)); return; } callback.onResponse(TransportResponseImpl.success(restResponseBuilder.build())); } }, latency, TimeUnit.MILLISECONDS); if (hasError) { _currentErrorCountMap.putIfAbsent(_uri, 0); _currentErrorCountMap.put(_uri, _currentErrorCountMap.get(_uri) + 1); } _callCountMap.putIfAbsent(_uri, 0); _callCountMap.put(_uri, _callCountMap.get(_uri) + 1); _latencySumMap.putIfAbsent(_uri, 0L); _latencySumMap.put(_uri, _latencySumMap.get(_uri) + latency); }
Source:
<code>protected Response performRemove(String id) { QuotaCRUDParameters prms = new QuotaCRUDParameters(); <START> prms.setQuotaId(GuidUtils.asGuid(id)); <END> return performAction(VdcActionType.RemoveQuota, prms); }</code><technical_language>need for GuidUtils, a asGuid(String guid) method in ancestor class</technical_language>

Target:
protected Response performRemove(String id) { QuotaCRUDParameters prms = new QuotaCRUDParameters(); prms.setQuotaId(asGuid(id)); return performAction(VdcActionType.RemoveQuota, prms); }
Source:
<code>private static void drawMarkerLabels(List<IMarkerEvent> markerEvents, Rectangle rect, GC gc, long time0, int leftSpace, double pixelsPerNanoSec) { if (markerEvents == null) { return; } for (IMarkerEvent markerEvent : markerEvents) { String label = markerEvent.getLabel(); if (label != null && markerEvent.getEntry() == null) { <START> label = label.substring(0, Math.min(256, label.length())); <END> int x = rect.x + leftSpace + (int) (Math.floor((markerEvent.getTime() - time0) * pixelsPerNanoSec)); int y = rect.y + rect.height - gc.stringExtent(" ").y + 2; gc.setForeground(markerEvent.getColor()); Utils.drawText(gc, label, x, y, true); } } }</code><technical_language>extract constant</technical_language>

Target:
private static void drawMarkerLabels(List<IMarkerEvent> markerEvents, Rectangle rect, GC gc, long time0, int leftSpace, double pixelsPerNanoSec) { if (markerEvents == null) { return; } for (IMarkerEvent markerEvent : markerEvents) { String label = markerEvent.getLabel(); if (label != null && markerEvent.getEntry() == null) { label = label.substring(0, Math.min(label.indexOf('\n') != -1 ? label.indexOf('\n') : label.length(), MAX_LABEL_LENGTH)); int x = rect.x + leftSpace + (int) (Math.floor((markerEvent.getTime() - time0) * pixelsPerNanoSec)); int y = rect.y + rect.height - gc.stringExtent(" ").y + 2; gc.setForeground(markerEvent.getColor()); Utils.drawText(gc, label, x, y, true); } } }
Source:
<code>public String getUniverseInfo() { int worldCount = entityManager.getWorldPools().size(); StringBuilder message = new StringBuilder(100); <START> message.append("Number of world is " + worldCount + "\n"); <END> Map<Long, EngineEntityPool> worldPoolMap = entityManager.getPoolMap(); Map<EngineEntityPool, Long> poolCounts = new HashMap<EngineEntityPool, Long>(); for (EngineEntityPool engineEntityPools : entityManager.getWorldPools()) { poolCounts.put(engineEntityPools, 0L); } for (Map.Entry<Long, EngineEntityPool> entry : worldPoolMap.entrySet()) { if (poolCounts.containsKey(entry.getValue())) { poolCounts.put(entry.getValue(), poolCounts.get(entry.getValue()) + 1); } else { poolCounts.put(entry.getValue(), 1L); } } for (Map.Entry<WorldInfo, EngineEntityPool> entry : entityManager.getWorldPoolsMap().entrySet()) { message.append("Pool for " + entry.getKey().getTitle() + " has " + poolCounts.get(entry.getValue()) + " entities \n"); } return message.toString(); }</code><technical_language>Number of worlds*</technical_language>

Target:
public String getUniverseInfo() { int worldCount = entityManager.getWorldPools().size(); StringBuilder message = new StringBuilder(); message.append("Number of worlds is " + worldCount + "\n"); Map<EngineEntityPool, Long> poolCounts = entityManager.getPoolCounts(); for (Map.Entry<WorldInfo, EngineEntityPool> entry : entityManager.getWorldPoolsMap().entrySet()) { message.append("Pool for " + entry.getKey().getTitle() + " has " + entry.getValue().getActiveEntityCount() + " entities \n"); } return message.toString(); }
Source:
<code>public void addError(AuditEvent event) { final int line = event.getLine(); final String message = event.getMessage(); if (position >= comments.length) { fail("found a warning when none was expected for #" + position + " at line " + line + " with message " + message); } final IndentComment comment = comments[position]; position++; final String possibleExceptedMessages = Arrays.stream(comment.getExpectedMessages()) .reduce("", (cur, next) -> cur + "\"" + next + "\", "); final boolean hasExpectedMessagePostfix = Arrays.stream(comment.getExpectedMessages()).anyMatch(message::endsWith); assertTrue( "input expected warning #" + position + " at line " + comment.getLineNumber() + " to report one of the following: " + possibleExceptedMessages <START> + "but got instead: " + line + ": " + message, <END> hasExpectedMessagePostfix && line == comment.getLineNumber()); }</code><technical_language>missing space but</technical_language>

Target:
public void addError(AuditEvent event) { final int line = event.getLine(); final String message = event.getMessage(); if (position >= comments.length) { fail("found a warning when none was expected for #" + position + " at line " + line + " with message " + message); } final IndentComment comment = comments[position]; position++; final String possibleExceptedMessages = Arrays.stream(comment.getExpectedMessages()) .reduce("", (cur, next) -> cur + "\"" + next + "\", "); final String assertMessage = String.format( Locale.ROOT, "input expected warning #%d at line %d to report one of the following: %s" + "but got instead: %d: %s", position, comment.getLineNumber(), possibleExceptedMessages, line, message); assertTrue(assertMessage, line == comment.getLineNumber() && Arrays.stream(comment.getExpectedMessages()).anyMatch(message::endsWith)); }
Source:
<code>public void clear() { notifyInactive(); <START> setPreviewSurfaceCallback(null); <END> super.clear(); }</code><technical_language>Do a test check onSafeToRelease() is called clear()</technical_language>

Target:
public void clear() { notifyInactive(); if (mSurfaceHolder != null) { mSurfaceHolder.release(); } super.clear(); }
Source:
<code>public void testExecuteAndPostProcess() { InstructorAttributes instructor = typicalBundle.instructors.get("instructor1OfCourse1"); String instructorId = instructor.googleId; gaeSimulation.loginAsInstructor(instructorId); ______TS("Unsuccessful case: not enough parameters"); verifyAssumptionFailure(); String[] submissionParams = new String[] {}; verifyAssumptionFailure(submissionParams); ______TS("typical successful case"); submissionParams = new String[] { Const.ParamsNames.COURSE_ID, instructor.courseId, Const.ParamsNames.COURSE_INDEX, "1", Const.ParamsNames.USER_ID, instructor.googleId }; InstructorCourseEnrollAjaxPageAction action = getAction(submissionParams); AjaxResult ar = getAjaxResult(action); InstructorCourseEnrollAjaxPageData pageData = (InstructorCourseEnrollAjaxPageData) ar.data; String expectedString = "Section 1|Team 1.1</td></div>'\"|student1 In Course1</td></div>'\"" + "|student1InCourse1@gmail.tmt|comment for student1InCourse1</td></div>'\"" + "Section 1|Team 1.1</td></div>'\"|student2 In Course1|student2InCourse1@gmail.tmt|" + "Section 1|Team 1.1</td></div>'\"|student3 In Course1|student3InCourse1@gmail.tmt|" + "Section 1|Team 1.1</td></div>'\"|student4 In Course1|student4InCourse1@gmail.tmt|" + "Section 2|Team 1.2|student5 In Course1|student5InCourse1@gmail.tmt|"; StringBuilder resultString = new StringBuilder(); for (StudentAttributes student : pageData.students) { resultString.append(student.toEnrollmentString()); } assertEquals(expectedString, resultString.toString()); <START> } <END></code><technical_language>need test accessing this page a student instructor of a well</technical_language>

Target:
public void testExecuteAndPostProcess() { InstructorAttributes instructor = typicalBundle.instructors.get("instructor1OfCourse1"); String instructorId = instructor.googleId; gaeSimulation.loginAsInstructor(instructorId); ______TS("Unsuccessful case: not enough parameters"); verifyAssumptionFailure(); String[] submissionParams = new String[] {}; verifyAssumptionFailure(submissionParams); ______TS("typical successful case"); submissionParams = new String[] { Const.ParamsNames.COURSE_ID, instructor.courseId, }; InstructorCourseEnrollAjaxPageAction action = getAction(submissionParams); AjaxResult ajaxResult = getAjaxResult(action); assertNotNull(ajaxResult); InstructorCourseEnrollAjaxPageData pageData = (InstructorCourseEnrollAjaxPageData) ajaxResult.data; String expectedString = "Section 1|Team 1.1</td></div>'\"|student1 In Course1</td></div>'\"" + "|student1InCourse1@gmail.tmt|comment for student1InCourse1</td></div>'\"" + "Section 1|Team 1.1</td></div>'\"|student2 In Course1|student2InCourse1@gmail.tmt|" + "Section 1|Team 1.1</td></div>'\"|student3 In Course1|student3InCourse1@gmail.tmt|" + "Section 1|Team 1.1</td></div>'\"|student4 In Course1|student4InCourse1@gmail.tmt|" + "Section 2|Team 1.2|student5 In Course1|student5InCourse1@gmail.tmt|"; StringBuilder resultString = new StringBuilder(); for (StudentAttributes student : pageData.students) { resultString.append(student.toEnrollmentString()); } assertEquals(expectedString, resultString.toString()); }
Source:
<code>public void routeError(Exception error, Consumer<CoreEvent> continueCallback, Consumer<Throwable> propagateCallback) { <START> MessagingException messagingError = (MessagingException) error; <END> CoreEvent failureEvent = messagingError.getEvent(); routingSink.get().next(quickCopy(failureEvent, of(getParameterId(ERROR_EXCEPTION, failureEvent), error, getParameterId(ERROR_SUCCESS_CALLBACK, failureEvent), continueCallback, getParameterId(ERROR_RETHROWN_CALLBACK, failureEvent), propagateCallback, getParameterId(ERROR_EVENT, failureEvent), failureEvent))); }</code><technical_language>put this in</technical_language>

Target:
public void routeError(Exception error, Consumer<CoreEvent> continueCallback, Consumer<Throwable> propagateCallback) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Routing error in '" + this.toString() + "'..."); } MessagingException messagingError = (MessagingException) error; CoreEvent failureEvent = messagingError.getEvent(); routingSink.get().next(quickCopy(failureEvent, of(getParameterId(ERROR_EXCEPTION, failureEvent), error, getParameterId(ERROR_SUCCESS_CALLBACK, failureEvent), continueCallback, getParameterId(ERROR_RETHROWN_CALLBACK, failureEvent), propagateCallback, getParameterId(ERROR_EVENT, failureEvent), failureEvent))); }
Source:
<code><START> public void onPreReceive(ReceivePack rp, Collection<ReceiveCommand> commands) { <END> for (PreReceiveHook hook : hooks) { hook.onPreReceive(rp, commands); } }</code><technical_language>line wrap</technical_language>

Target:
public void onPreReceive(ReceivePack rp, Collection<ReceiveCommand> commands) { for (int i = 0; i < count; i++) hooks[i].onPreReceive(rp, commands); }
Source:
<code>private static org.ehcache.xml.model.ResourceUnit unparseUnit(ResourceUnit resourceUnit) { if (resourceUnit instanceof EntryUnit) { return org.ehcache.xml.model.ResourceUnit.ENTRIES; } else { <START> return org.ehcache.xml.model.ResourceUnit.valueOf(((MemoryUnit) resourceUnit).name()); <END> } }</code><technical_language>issues KB K_B</technical_language>

Target:
private static org.ehcache.xml.model.ResourceUnit unparseUnit(ResourceUnit resourceUnit) { if (resourceUnit instanceof EntryUnit) { return org.ehcache.xml.model.ResourceUnit.ENTRIES; } else { return org.ehcache.xml.model.ResourceUnit.fromValue(resourceUnit.toString()); } }
Source:
<code>public void dropIndex(String databaseName, final String indexName) throws UndefinedDatabaseException, UndefinedIndexException { PreparedStatement pstmt = null; <START> try (Connection conn = getConnection()) { <END> int databaseId = getDatabaseId(databaseName); String sql = String.format("SELECT INDEX_NAME FROM %s WHERE %s=? AND INDEX_NAME=?", TB_INDEXES, COL_DATABASES_PK); pstmt = conn.prepareStatement(sql); pstmt.setInt(1, databaseId); pstmt.setString(2, indexName); ResultSet res = pstmt.executeQuery(); if (!res.next()) { throw new UndefinedIndexException(CatalogUtil.buildFQName(databaseName, indexName)); } pstmt.close(); res.close(); sql = "DELETE FROM " + TB_INDEXES + " WHERE " + COL_DATABASES_PK + "=? AND INDEX_NAME=?"; if (LOG.isDebugEnabled()) { LOG.debug(sql); } pstmt = conn.prepareStatement(sql); pstmt.setInt(1, databaseId); pstmt.setString(2, indexName); pstmt.executeUpdate(); } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(pstmt); } }</code><technical_language>do close connection here</technical_language>

Target:
public void dropIndex(String databaseName, final String indexName) throws UndefinedDatabaseException, UndefinedIndexException { Connection conn; PreparedStatement pstmt = null; try { int databaseId = getDatabaseId(databaseName); String sql = String.format("SELECT INDEX_NAME FROM %s WHERE %s=? AND INDEX_NAME=?", TB_INDEXES, COL_DATABASES_PK); conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setInt(1, databaseId); pstmt.setString(2, indexName); ResultSet res = pstmt.executeQuery(); if (!res.next()) { throw new UndefinedIndexException(CatalogUtil.buildFQName(databaseName, indexName)); } pstmt.close(); res.close(); sql = "DELETE FROM " + TB_INDEXES + " WHERE " + COL_DATABASES_PK + "=? AND INDEX_NAME=?"; if (LOG.isDebugEnabled()) { LOG.debug(sql); } pstmt = conn.prepareStatement(sql); pstmt.setInt(1, databaseId); pstmt.setString(2, indexName); pstmt.executeUpdate(); } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(pstmt); } }
Source:
<code>public void testInnerInequalityJoinWithEquiJoinConjuncts() throws Exception { assertPlan("SELECT 1 FROM orders o JOIN lineitem l ON o.shippriority = l.linenumber AND o.orderkey < l.orderkey", anyTree( join(INNER, <START> ImmutableList.of(equiJoinClause("O_SHIPPRIORITY", "L_LINENUMBER")), <END> Optional.of("O_ORDERKEY < L_ORDERKEY"), any(tableScan("orders", ImmutableMap.of( "O_SHIPPRIORITY", "shippriority", "O_ORDERKEY", "orderkey"))), anyTree(tableScan("lineitem", ImmutableMap.of( "L_LINENUMBER", "linenumber", "L_ORDERKEY", "orderkey")))))); }</code><technical_language>Any, filter</technical_language>

Target:
public void testInnerInequalityJoinWithEquiJoinConjuncts() throws Exception { assertPlan("SELECT 1 FROM orders o JOIN lineitem l ON o.shippriority = l.linenumber AND o.orderkey < l.orderkey", anyTree( anyNot(FilterNode.class, join(INNER, ImmutableList.of(equiJoinClause("O_SHIPPRIORITY", "L_LINENUMBER")), Optional.of("O_ORDERKEY < L_ORDERKEY"), any(tableScan("orders", ImmutableMap.of( "O_SHIPPRIORITY", "shippriority", "O_ORDERKEY", "orderkey"))), anyTree(tableScan("lineitem", ImmutableMap.of( "L_LINENUMBER", "linenumber", "L_ORDERKEY", "orderkey"))))))); }
Source:
<code>public void testSimpleGetAll() throws Exception { Cache<Number, CharSequence> testCache = cacheManager.createCache("testCache", CacheConfigurationBuilder.newCacheConfigurationBuilder().buildConfig(Number.class, CharSequence.class)); testCache.put(1, "one"); testCache.put(2, "two"); Map<Number, CharSequence> all = testCache.getAll(Arrays.asList(1, 2, 3)); assertThat(all.size(), is(2)); assertThat(all.get(1), Matchers.<CharSequence>equalTo("one")); assertThat(all.get(2), Matchers.<CharSequence>equalTo("two")); <START> assertThat(all.get(3), is(nullValue())); <END> }</code><technical_language>above: this assertion is useless returned map a size of keys 1 & 2 asserted</technical_language>

Target:
public void testSimpleGetAll() throws Exception { Cache<Number, CharSequence> testCache = cacheManager.createCache("testCache", CacheConfigurationBuilder.newCacheConfigurationBuilder().buildConfig(Number.class, CharSequence.class)); testCache.put(1, "one"); testCache.put(2, "two"); Map<Number, CharSequence> all = testCache.getAll(Arrays.asList(1, 2, 3)); assertThat(all.keySet(), containsInAnyOrder((Number)1, 2)); assertThat(all.get(1), Matchers.<CharSequence>equalTo("one")); assertThat(all.get(2), Matchers.<CharSequence>equalTo("two")); }
Source:
<code>public void removeAllPlayers() { <START> removePlayers( players ); <END> players.clear(); }</code><technical_language>clone list avoid CME, line redundant. I suggest renaming clearPlayers</technical_language>

Target:
public void removeAllPlayers() { sendToAffected( removePacket ); players.clear(); }
Source:
<code>protected void doStop() { <START> autoEncryptionSupport.close(); <END> super.doStop(); LDAPCache.clear(); }</code><technical_language>Check for null missing</technical_language>

Target:
protected void doStop() { if (autoEncryptionSupport != null) { autoEncryptionSupport.close(); } super.doStop(); LDAPCache.clear(); }
Source:
<code><START> public boolean isResponseTypeAllowed(ResponseType responseType) { <END> return isResponseTypeAllowed(responseType); }</code><technical_language>testing code this pull request in attempt get Restlet OAuth 2.0 working in OSGi environment. MemoryClient#isResponseTypeAllowed endless recursion resulted in StackOverflowException. I temporarily fixed this in environment exclusively returning true. noticing method MemoryClient#isFlowSupported takes Object parameter instead of GrantType, isFlowSupported(responseType) used</technical_language>

Target:
public boolean isResponseTypeAllowed(ResponseType responseType) { return isFlowSupported(responseType); }
Source:
<code>public void testEnforceValidityWarningsOnly() throws Exception { Dictionary<String, Object> markerPluginProps = configureValidationMarkerPlugin( Collections.singletonList(SAMPLE_VALIDATOR), false, true, getAdminConfig()); ingestXmlFromResourceWaitForFailure(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); String errorId = ingestXmlFromResourceAndWait(ERROR_METACARD); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); query(errorId, TRANSFORMER_XML, HttpStatus.SC_OK); String warningData = getFileContent(WARNING_METACARD); String errorData = getFileContent(ERROR_METACARD); update(cleanId, warningData, MediaType.APPLICATION_XML, HttpStatus.SC_BAD_REQUEST); update(cleanId, errorData, MediaType.APPLICATION_XML, HttpStatus.SC_OK); <START> configureValidationMarkerPlugin(markerPluginProps, getAdminConfig()); <END> }</code><technical_language>is reset if test failed before</technical_language>

Target:
public void testEnforceValidityWarningsOnly() throws Exception { Dictionary<String, Object> markerPluginProps = configureValidationMarkerPlugin( Collections.singletonList(SAMPLE_VALIDATOR), false, true, getAdminConfig()); try { ingestXmlFromResourceWaitForFailure(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); String errorId = ingestXmlFromResourceAndWait(ERROR_METACARD); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); query(errorId, TRANSFORMER_XML, HttpStatus.SC_OK); String warningData = getFileContent(WARNING_METACARD); String errorData = getFileContent(ERROR_METACARD); update(cleanId, warningData, MediaType.APPLICATION_XML, HttpStatus.SC_BAD_REQUEST); update(cleanId, errorData, MediaType.APPLICATION_XML, HttpStatus.SC_OK); } finally { configureValidationMarkerPlugin(markerPluginProps, getAdminConfig()); } }
Source:
<code>public int hashCode() { int result = defaultField != null ? defaultField.hashCode() : 0; result = 31 * result + (getAuthors() != null ? getAuthors().hashCode() : 0); result = 31 * result + (getTitlePhrases() != null ? getTitlePhrases().hashCode() : 0); <START> result = 31 * result + (getAbstractPhrases() != null ? getTitlePhrases().hashCode() : 0); <END> result = 31 * result + (getFromYear().isPresent() ? getFromYear().hashCode() : 0); result = 31 * result + (getToYear().isPresent() ? getToYear().hashCode() : 0); result = 31 * result + (getSingleYear().isPresent() ? getSingleYear().hashCode() : 0); result = 31 * result + (getJournal().isPresent() ? getJournal().hashCode() : 0); return result; }</code><technical_language>return Objects.hash(defaultField, getAuthors(), ...)</technical_language>

Target:
public int hashCode() { return Objects.hash(defaultField, getAuthors(), getSingleYear(), getAbstractPhrases(), getFromYear(), getToYear(), getTitlePhrases(), getJournal()); }
Source:
<code>public void testGetterValidationOccursBecauseItIsEnabledInXml() throws Exception { assertNotNull( repeater ); try { repeater.getHelloWorld(); <START> fail( "method validation should be disabled via validation.xml" ); <END> } catch ( ConstraintViolationException e ) { } }</code><technical_language>"disabled"="enabled"</technical_language>

Target:
public void testGetterValidationOccursBecauseItIsEnabledInXml() throws Exception { assertNotNull( repeater ); try { repeater.getHelloWorld(); fail( "method validation should be enabled via validation.xml" ); } catch ( ConstraintViolationException e ) { } }