auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testRangesTransaction() { Transaction t = startTransaction(); put(t, "row1", "col1", "v1"); t.commit(); RangeRequest allRange = RangeRequest.builder().batchHint(3).build(); t = startTransaction(); <START> verifyAllGetRangesImplsRangeSizes(t, Iterables.limit(Iterables.cycle(allRange), 1000), 1); <END> }</code><technical_language>do Iterables.limit(Iterables.cycle(foo)) time. sense push helper method</technical_language>

Target:
public void testRangesTransaction() { Transaction t = startTransaction(); put(t, "row1", "col1", "v1"); t.commit(); RangeRequest allRange = RangeRequest.builder().batchHint(3).build(); t = startTransaction(); verifyAllGetRangesImplsRangeSizes(t, allRange, 1); }
Source:
<code>public boolean performFinish() { <START> if (selectedDataObservable.getValue() instanceof BusinessObjectData) { <END> return perFormFinishForBusinessObjectData(); } if (selectedDataObservable.getValue() instanceof Document) { return performFinishForDocument(); } return true; }</code><technical_language>extract selectedDataObservable.getValue()</technical_language>

Target:
public boolean performFinish() { final Object selectedData = selectedDataObservable.getValue(); if (selectedData instanceof BusinessObjectData) { return perFormFinishForBusinessObjectData(); } if (selectedData instanceof Document) { return performFinishForDocument(); } return true; }
Source:
<code>public View getView(int position, View convertView, ViewGroup parent) { View view; if(!isInitialized){ visibleButtons = new LinkedList<SquareButtonWithNotification>(); Log.i("HomeScrnAdpt","Creating all buttons because got a null in position " + position); for (int i = 0; i < buttons.length; i++) { if (buttons[i] != null) continue; SquareButtonWithNotification button = (SquareButtonWithNotification) LayoutInflater.from(context) .inflate(buttonsResources[i], parent, false); buttons[i] = button; Log.i("HomeScrnAdpt","Added button " + button + "to position " + i); View.OnClickListener listener = buttonListeners[i]; if(listener != null) { button.setOnClickListener(listener); Log.i("HomeScrnAdpt","Added onClickListener " + listener + " to button in position " + i); } <START> if( i == position ) view = button; <END> if(!hiddenButtons[i]) visibleButtons.add(button); } isInitialized = true; } if(position < 0 || position >= getCount()) return null; if(convertView != null) { return convertView; } else { SquareButtonWithNotification btn = visibleButtons.get(position); if(btn == null) { Log.i("HomeScrnAdpt","Unexpected null button"); } return btn; } }</code><technical_language>'view' is variable. (Please run linter code pre-PR posting)</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { if (position < 0 || position >= getCount()) { return null; } if (convertView != null) { return convertView; } else { SquareButtonWithNotification btn = visibleButtons.get(position); if (btn == null) { Log.i(TAG, "Unexpected null button"); } return btn; } }
Source:
<code>String getDependentName(RuntimeCapability cap, OperationContext context) { if (cap.isDynamicallyNamed()) { return cap.fromBaseCapability(context.getCurrentAddress()).getName(); } else { return cap.getName(); <START> } <END> }</code><technical_language>This whitespace change incorrect</technical_language>

Target:
String getDependentName(RuntimeCapability cap, OperationContext context) { if (cap.isDynamicallyNamed()) { return cap.fromBaseCapability(context.getCurrentAddress()).getName(); } return cap.getName(); }
Source:
<code>public Builder executor(@NonNull ExecutorService executorService) { checkNotNull(executorService, "executorService == null"); if (!isChild && this.service != null) { <START> throw new IllegalStateException("Executor service already set."); <END> } this.service = executorService; return this; }</code><technical_language>remove checks isChild flag. checks add value</technical_language>

Target:
public Builder executor(@NonNull ExecutorService executorService) { checkNotNull(executorService, "executorService == null"); this.service = executorService; return this; }
Source:
<code>public void parseButtonClicked() { List<Path> fileList = checkedFileList.stream() .map(item -> item.getValue().getPath()) .filter(path -> path.toFile().isFile()) .collect(Collectors.toList()); if (fileList.isEmpty()) { LOGGER.warn("There are no valid files checked"); return; } <START> BackgroundTask.wrap(() -> new TexBibEntriesResolver(databaseContext.getDatabase(), preferencesService.getImportFormatPreferences(), fileMonitor).resolve(new DefaultTexParser().parse(fileList))) <END> .onRunning(() -> searchInProgress.set(true)) .onFinished(() -> searchInProgress.set(false)) .onSuccess(result -> new ParseTexResultView(result, databaseContext, Paths.get(texDirectory.get())).showAndWait()) .onFailure(dialogService::showErrorDialogAndWait) .executeWith(taskExecutor); }</code><technical_language>this is a bit hard understand, I introduce a variable isntea of resolve</technical_language>

Target:
public void parseButtonClicked() { List<Path> fileList = checkedFileList.stream() .map(item -> item.getValue().getPath()) .filter(path -> path.toFile().isFile()) .collect(Collectors.toList()); if (fileList.isEmpty()) { LOGGER.warn("There are no valid files checked"); return; } TexBibEntriesResolver entriesResolver = new TexBibEntriesResolver(databaseContext.getDatabase(), preferencesService.getImportFormatPreferences(), fileMonitor); BackgroundTask.wrap(() -> entriesResolver.resolve(new DefaultTexParser().parse(fileList))) .onRunning(() -> searchInProgress.set(true)) .onFinished(() -> searchInProgress.set(false)) .onSuccess(result -> new ParseTexResultView(result, databaseContext, Paths.get(texDirectory.get())).showAndWait()) .onFailure(dialogService::showErrorDialogAndWait) .executeWith(taskExecutor); }
Source:
<code>public void reportIssue(Tree tree, String message, Set<List<JavaFileScannerContext.Location>> flows) { <START> Preconditions.checkNotNull(tree); <END> Optional<SEIssue> sameTreeIssue = issueWithTree(tree); sameTreeIssue.ifPresent(issue -> issue.flows.addAll(flows)); if (!sameTreeIssue.isPresent()) { issues.add(new SEIssue(tree, message, flows)); } }</code><technical_language>need for checking this ? is implied package annotation fail a NPE lines further</technical_language>

Target:
public void reportIssue(Tree tree, String message, Set<List<JavaFileScannerContext.Location>> flows) { issues.add(issues.stream() .filter(seIssue -> seIssue.tree.equals(tree)) .findFirst() .map(seIssue -> { seIssue.flows.addAll(flows); return seIssue; }) .orElse(new SEIssue(tree, message, flows))); }
Source:
<code>public void testReadBooleans() { V4Vm object = objectFromJson("{'properties': [false, true]}"); List<Boolean> expected = Arrays.asList(false, true); <START> assertEquals(expected, object.properties()); <END> }</code><technical_language>this fail, input a list of strings, type of "properties" is "String[]"</technical_language>

Target:
public void testReadBooleans() { objectFromJson("{'properties': [false, true]}"); }
Source:
<code>private void generateKey() { try { keyStore = KeyStore.getInstance("AndroidKeyStore"); } catch (Exception e) { <START> e.printStackTrace(); <END> } KeyGenerator keyGenerator; try { keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore"); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new RuntimeException("Failed to get KeyGenerator instance", e); } try { keyStore.load(null); keyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setUserAuthenticationRequired(true) .setEncryptionPaddings( KeyProperties.ENCRYPTION_PADDING_PKCS7) .build()); keyGenerator.generateKey(); } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | CertificateException | IOException e) { } }</code><technical_language>@vzool , more printStackTrace</technical_language>

Target:
private void generateKey() { try { keyStore = KeyStore.getInstance("AndroidKeyStore"); } catch (Exception e) { Log.e(TAG, "Error(0): " + e.getMessage()); } KeyGenerator keyGenerator; try { keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore"); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new RuntimeException("Failed to get KeyGenerator instance", e); } try { keyStore.load(null); keyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setUserAuthenticationRequired(true) .setEncryptionPaddings( KeyProperties.ENCRYPTION_PADDING_PKCS7) .build()); keyGenerator.generateKey(); } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | CertificateException | IOException e) { Log.e(TAG, "Error(1): " + e.getMessage()); } }
Source:
<code>public static String parseMessage(final String i18nMessage, Object... args) { final String pattern = getPattern(i18nMessage); try { return parseFormat(pattern, args); } catch (IllegalArgumentException e) { <START> LOGGER.warn(CORE, "Invalid translation pattern for key {}!", i18nMessage); <END> return i18nMessage+" - invalid pattern"; } }</code><technical_language>consider logging key exception's message least</technical_language>

Target:
public static String parseMessage(final String i18nMessage, Object... args) { final String pattern = getPattern(i18nMessage); try { return parseFormat(pattern, args); } catch (IllegalArgumentException e) { LOGGER.warn(CORE, "Invalid translation pattern for key {}: {}!", i18nMessage, e.getLocalizedMessage()); return i18nMessage; } }
Source:
<code>public Response updateSenseBlackList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @Valid final Set<String> updatedSenseBlackList) { Jedis jedis = null; try { jedis = jedisPool.getResource(); final Pipeline pipe = jedis.pipelined(); pipe.multi(); pipe.del(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY); for (final String senseId : updatedSenseBlackList){ pipe.sadd(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY, senseId); } pipe.exec(); } catch (JedisDataException e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to get data from redis - %s", e.getMessage()))).build()); } catch (Exception e) { <START> if (jedis != null) { <END> jedisPool.returnBrokenResource(jedis); } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to update sense black list because %s", e.getMessage()))).build()); } finally { if (jedis != null) { jedisPool.returnResource(jedis); } } return Response.noContent().build(); }</code><technical_language>need in Exception a finally clause get executed end</technical_language>

Target:
public Response updateSenseBlackList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @Valid final Set<String> updatedSenseBlackList) { Jedis jedis = null; try { jedis = jedisPool.getResource(); final Pipeline pipe = jedis.pipelined(); pipe.multi(); pipe.del(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY); for (final String senseId : updatedSenseBlackList){ pipe.sadd(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY, senseId); } pipe.exec(); } catch (JedisDataException e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); jedis = null; } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to get data from redis - %s", e.getMessage()))).build()); } catch (Exception e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); jedis = null; } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to update sense black list because %s", e.getMessage()))).build()); } finally { if (jedis != null) { jedisPool.returnResource(jedis); } } return Response.noContent().build(); }
Source:
<code>public ArrayList<EnrolledCoursesResponse> getDownloadedCoursesWithVideoCountAndSize() { ArrayList<EnrolledCoursesResponse> downloadedCourseList = new ArrayList<>(); List<EnrolledCoursesResponse> enrolledCourses = null; String username = getUsername(); if (username != null) { enrolledCourses = api.getUserEnrolledCourses(username, true); } <START> if(enrolledCourses!=null && enrolledCourses.size()>0){ <END> for(EnrolledCoursesResponse enrolledCoursesResponse : enrolledCourses){ int videoCount = db.getDownloadedVideoCountByCourse( enrolledCoursesResponse.getCourse().getId(),null); if(videoCount>0){ enrolledCoursesResponse.videoCount = videoCount; enrolledCoursesResponse.size = db.getDownloadedVideosSizeByCourse( enrolledCoursesResponse.getCourse().getId(),null); downloadedCourseList.add(enrolledCoursesResponse); } } } return downloadedCourseList; }</code><technical_language>un-necessary null check</technical_language>

Target:
public ArrayList<EnrolledCoursesResponse> getDownloadedCoursesWithVideoCountAndSize() { ArrayList<EnrolledCoursesResponse> downloadedCourseList = new ArrayList<>(); List<EnrolledCoursesResponse> enrolledCourses = null; String username = getUsername(); if (username != null) { enrolledCourses = api.getUserEnrolledCourses(username, true); } if(enrolledCourses.size()>0){ for(EnrolledCoursesResponse enrolledCoursesResponse : enrolledCourses){ int videoCount = db.getDownloadedVideoCountByCourse( enrolledCoursesResponse.getCourse().getId(),null); if(videoCount>0){ enrolledCoursesResponse.videoCount = videoCount; enrolledCoursesResponse.size = db.getDownloadedVideosSizeByCourse( enrolledCoursesResponse.getCourse().getId(),null); downloadedCourseList.add(enrolledCoursesResponse); } } } return downloadedCourseList; }
Source:
<code>public static void fhirResourceSearchPost(String fhirStoreName, String resourceType) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( <START> "%sv1beta1/%s/fhir/%s/_search", client.getRootUrl(), fhirStoreName, resourceType); <END> URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); StringEntity requestEntity = new StringEntity(""); HttpUriRequest request = RequestBuilder .post() .setUri(uriBuilder.build()) .setEntity(requestEntity) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception searching FHIR resources: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource search results: "); responseEntity.writeTo(System.out); }</code><technical_language>v1</technical_language>

Target:
public static void fhirResourceSearchPost(String fhirStoreName, String resourceType) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1/%s/fhir/%s/_search", client.getRootUrl(), fhirStoreName, resourceType); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); StringEntity requestEntity = new StringEntity(""); HttpUriRequest request = RequestBuilder .post() .setUri(uriBuilder.build()) .setEntity(requestEntity) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception searching FHIR resources: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource search results: "); responseEntity.writeTo(System.out); }
Source:
<code>protected void moveCursor(final int keyCode) { int index; switch (keyCode) { case SWT.HOME: index = 0; while (index < fScaledData.fLastBucket && fScaledData.fData[index].isEmpty()) { index++; } if (index < fScaledData.fLastBucket) { fScaledData.fSelectionBeginBucket = index; } break; <START> case SWT.ARROW_RIGHT: { <END> long prevTime = getTimestamp(fScaledData.fSelectionBeginBucket); index = Math.max(0, fScaledData.fSelectionBeginBucket + 1); while (index < fScaledData.fWidth && (fScaledData.fData[index].isEmpty() || prevTime == getTimestamp(index))) { index++; } if (index >= fScaledData.fLastBucket) { index = fScaledData.fLastBucket; } fScaledData.fSelectionBeginBucket = index; break; } case SWT.END: index = fScaledData.fLastBucket; while (index >= 0 && fScaledData.fData[index].isEmpty()) { index--; } if (index >= 0) { fScaledData.fSelectionBeginBucket = index; } break; case SWT.ARROW_LEFT: { long prevTime = getTimestamp(fScaledData.fSelectionBeginBucket); index = Math.min(fScaledData.fLastBucket - 1, fScaledData.fSelectionBeginBucket - 1); while (index >= 0 && (fScaledData.fData[index].isEmpty() || prevTime == getTimestamp(index))) { index--; } if (index <= 0) { index = 0; } fScaledData.fSelectionBeginBucket = index; break; } default: return; } fScaledData.fSelectionEndBucket = fScaledData.fSelectionBeginBucket; fSelectionBegin = getTimestamp(fScaledData.fSelectionBeginBucket); fSelectionEnd = fSelectionBegin; updateSelectionTime(); }</code><technical_language>zoomed in nanoseconds, non-empty scaled bucket a start timestamp match events populated model. update previous time iteration selected bucket corresponds a timestamp immediately preceding bucket</technical_language>

Target:
protected void moveCursor(final int keyCode) { int index; switch (keyCode) { case SWT.HOME: fScaledData.fSelectionBeginBucket = 0; break; case SWT.END: fScaledData.fSelectionBeginBucket = fScaledData.fWidth - 1; break; case SWT.ARROW_RIGHT: { long prevStartTime = getTimestamp(fScaledData.fSelectionBeginBucket); index = Math.max(0, Math.min(fScaledData.fLastBucket - 1, fScaledData.fSelectionBeginBucket + 1)); while (index < fScaledData.fWidth && (fScaledData.fData[index].isEmpty() || prevStartTime == getTimestamp(index))) { prevStartTime = getTimestamp(index); index++; } if (index >= fScaledData.fWidth) { index = fScaledData.fWidth - 1; } fScaledData.fSelectionBeginBucket = index; break; } case SWT.ARROW_LEFT: { long prevEndTime = getTimestamp(fScaledData.fSelectionBeginBucket + 1); index = Math.max(0, Math.min(fScaledData.fLastBucket - 1, fScaledData.fSelectionBeginBucket - 1)); while (index >= 0 && (fScaledData.fData[index].isEmpty() || prevEndTime == getTimestamp(index + 1))) { prevEndTime = getTimestamp(index + 1); index--; } if (index <= 0) { index = 0; } fScaledData.fSelectionBeginBucket = index; break; } default: return; } fScaledData.fSelectionEndBucket = fScaledData.fSelectionBeginBucket; fSelectionBegin = getTimestamp(fScaledData.fSelectionBeginBucket); fSelectionEnd = fSelectionBegin; updateSelectionTime(); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); <START> RefreshRepositoryTasksAction na = new RefreshRepositoryTasksAction(); <END> na.selectionChanged((IStructuredSelection) selection); na.run(); return null; }</code><technical_language>na called action</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); RefreshRepositoryTasksAction action = new RefreshRepositoryTasksAction(); action.selectionChanged((IStructuredSelection) selection); action.run(); return null; }
Source:
<code>public String getName(IterationInfo iteration) { if (delegate == null) return fallback.getName(iteration); <START> try { <END> String name = delegate.getName(iteration); if (name != null) return name; return fallback.getName(iteration); } catch (Exception e) { return fallback.getName(iteration); } }</code><technical_language>previous implementation here, is a safe variant if is exception other name provider. set DataVariablesIterationNameProvider alternative UnrollNameProvider</technical_language>

Target:
public String getName(IterationInfo iteration) { if (delegate == null) return getFallbackName(iteration); try { String name = delegate.getName(iteration); if (name != null) return name; return getFallbackName(iteration); } catch (Exception e) { return getFallbackName(iteration); } }
Source:
<code>public JSchProcess(IRemoteProcess process) { fProcess = process; fChannel = ((JSchProcessBuilder) process.getProcessBuilder()).getChannel(); try { if (process.getProcessBuilder().redirectErrorStream()) { PipedOutputStream pipedOutput = new PipedOutputStream(); fProcStdout = new PipedInputStream(pipedOutput); fProcStderr = new NullInputStream(); if (fChannel instanceof ChannelExec) { fStderrReader = new Thread(new ProcReader(((ChannelExec) fChannel).getErrStream(), pipedOutput)); <START> } <END> fStdoutReader = new Thread(new ProcReader(fChannel.getInputStream(), pipedOutput)); fStderrReader.start(); fStdoutReader.start(); } else { fProcStdout = fChannel.getInputStream(); if (fChannel instanceof ChannelExec) { fProcStderr = ((ChannelExec) fChannel).getErrStream(); } } } catch (IOException e) { Activator.log(e); destroy(); } }</code><technical_language>fChannel.getExtInputStream() for ChannelExec ChannelShell instead of getErrStream()</technical_language>

Target:
public JSchProcess(IRemoteProcess process) { fProcess = process; fChannel = ((JSchProcessBuilder) process.getProcessBuilder()).getChannel(); try { if (process.getProcessBuilder().redirectErrorStream()) { PipedOutputStream pipedOutput = new PipedOutputStream(); fProcStdout = new PipedInputStream(pipedOutput); fProcStderr = new NullInputStream(); fStderrReader = new Thread(new ProcReader(fChannel.getExtInputStream(), pipedOutput)); fStdoutReader = new Thread(new ProcReader(fChannel.getInputStream(), pipedOutput)); fStderrReader.start(); fStdoutReader.start(); } else { fProcStdout = fChannel.getInputStream(); fProcStderr = fChannel.getExtInputStream(); } } catch (IOException e) { Activator.log(e); destroy(); } }
Source:
<code>public void createClassContext(@Observes(precedence=100) EventContext<ClassEvent> context) { ClassContext classContext = this.classContextInstance.get(); try { classContext.activate(context.getEvent().getTestClass().getJavaClass()); testClassProducer.set(context.getEvent().getTestClass()); context.proceed(); } finally { if (AfterClass.class.isAssignableFrom(context.getEvent().getClass())) { classContext.deactivate(); <START> classContext.clearAll(); <END> classContext.destroy(context.getEvent().getTestClass().getJavaClass()); } } }</code><technical_language>clearAll here, destroy other Class contexts well</technical_language>

Target:
public void createClassContext(@Observes(precedence = 100) EventContext<ClassEvent> context) { ClassContext classContext = this.classContextInstance.get(); try { classContext.activate(context.getEvent().getTestClass().getJavaClass()); testClassProducer.set(context.getEvent().getTestClass()); context.proceed(); } finally { classContext.deactivate(); if (AfterClass.class.isAssignableFrom(context.getEvent().getClass())) { classContext.destroy(context.getEvent().getTestClass().getJavaClass()); } } }
Source:
<code>public void testCustomCallbackIsWrappedByDefaultCallbackBehavior() { MockProducer<String, String> producer = new MockProducer<>(Cluster.empty(), false, null, null, null); KafkaBolt<String, String> bolt = makeBolt(producer); PreparableCallback customCallback = mock(PreparableCallback.class); bolt.withProducerCallback(customCallback); OutputCollector collector = mock(OutputCollector.class); bolt.prepare(new HashMap<>(), mock(TopologyContext.class), collector); String key = "KEY"; String value = "VALUE"; Tuple testTuple = createTestTuple(key, value); bolt.execute(testTuple); assertThat(producer.history().size(), is(1)); ProducerRecord<String, String> arg = producer.history().get(0); LOG.info("GOT ->", arg); LOG.info("{}, {}, {}", arg.topic(), arg.key(), arg.value()); assertThat(arg.topic(), is("MY_TOPIC")); assertThat(arg.key(), is(key)); assertThat(arg.value(), is(value)); producer.completeNext(); verify(collector).ack(testTuple); <START> verify(customCallback).onCompletion(any(), any()); <END> }</code><technical_language>Nit: more specific parameters here, hard do</technical_language>

Target:
public void testCustomCallbackIsWrappedByDefaultCallbackBehavior() { MockProducer<String, String> producer = new MockProducer<>(Cluster.empty(), false, null, null, null); KafkaBolt<String, String> bolt = makeBolt(producer); PreparableCallback customCallback = mock(PreparableCallback.class); bolt.withProducerCallback(customCallback); OutputCollector collector = mock(OutputCollector.class); TopologyContext context = mock(TopologyContext.class); Map<String, Object> topoConfig = new HashMap<>(); bolt.prepare(topoConfig, context, collector); verify(customCallback).prepare(topoConfig, context); String key = "KEY"; String value = "VALUE"; Tuple testTuple = createTestTuple(key, value); bolt.execute(testTuple); assertThat(producer.history().size(), is(1)); ProducerRecord<String, String> arg = producer.history().get(0); LOG.info("GOT ->", arg); LOG.info("{}, {}, {}", arg.topic(), arg.key(), arg.value()); assertThat(arg.topic(), is("MY_TOPIC")); assertThat(arg.key(), is(key)); assertThat(arg.value(), is(value)); KafkaException ex = new KafkaException(); producer.errorNext(ex); verify(customCallback).onCompletion(any(), eq(ex)); verify(collector).reportError(ex); verify(collector).fail(testTuple); }
Source:
<code>public <F> SerializableConsumer<F> setDataProvider( DataProvider<T, F> dataProvider, F initialFilter) { Objects.requireNonNull(dataProvider, "data provider cannot be null"); filter = initialFilter; doSetDefinedSize(null, null, -1, true); <START> skipSizeCheckUntilReset = false; <END> sizeReset = false; handleDetach(); reset(); getKeyMapper().removeAll(); this.dataProvider = dataProvider; getKeyMapper().setIdentifierGetter(dataProvider::getId); handleAttach(); return filter -> { if (this.dataProvider != dataProvider) { throw new IllegalStateException( "Filter slot is no longer valid after data provider has been changed"); } if (!Objects.equals(this.filter, filter)) { this.filter = filter; reset(); } }; }</code><technical_language>Do need skipSizeCheckUntilReset = false; set here? is set reset method, a couple lines of code</technical_language>

Target:
public <F> SerializableConsumer<F> setDataProvider( DataProvider<T, F> dataProvider, F initialFilter) { Objects.requireNonNull(dataProvider, "data provider cannot be null"); filter = initialFilter; clearSizeCallbacksAndState(); definedSize = true; sizeReset = false; handleDetach(); reset(); getKeyMapper().removeAll(); this.dataProvider = dataProvider; getKeyMapper().setIdentifierGetter(dataProvider::getId); handleAttach(); return filter -> { if (this.dataProvider != dataProvider) { throw new IllegalStateException( "Filter slot is no longer valid after data provider has been changed"); } if (!Objects.equals(this.filter, filter)) { this.filter = filter; reset(); } }; }
Source:
<code>public void addTargetGroup(TargetGroup targetGroup) { <START> if (targetGroups == null) { <END> targetGroups = new HashSet<>(); } targetGroups.add(targetGroup); }</code><technical_language>initialize targetgroups = new HashSet<>() top of file</technical_language>

Target:
public void addTargetGroup(TargetGroup targetGroup) { targetGroups.add(targetGroup); }
Source:
<code>public <A extends Annotation> A getAnnotation(Class<A> annotationType) { <START> return wrapped.getAnnotation(annotationType); <END> }</code><technical_language>annotations field too, wrapped reference</technical_language>

Target:
public <A extends Annotation> A getAnnotation(Class<A> annotationType) { for (Annotation annotation : annotations) { if (annotationType.isInstance(annotation)) { return (A) annotation; } } return null; }
Source:
<code>protected void channelRead0(ChannelHandlerContext ctx, Message msg) throws Exception { seenMessages.incrementAndGet(); byte[] payload = msg.asBytes(); if (encryptionConfig != null) { try { payload = encrypt(payload); } catch (Exception e) { log.error("Fail to encrypt message: ", e.getMessage()); } } String kafkaTopic = defaultTopic; byte[] partitionKey = null; for (String tag : msg.getTags()) { if (tag.startsWith("kt:")) { kafkaTopic = tag.substring(3); } else if (tag.startsWith("pk:")) { <START> partitionKey = Base64.getUrlDecoder().decode( tag.substring(3)); <END> } } sendOrReportFailure(kafkaTopic, partitionKey, payload); if (propagate) { msg.retain(); ctx.fireChannelRead(msg); } }</code><technical_language>do need Base64 decode partition key? apache KafkaProducer examples a String key. guessing if a String call hashcode() it</technical_language>

Target:
protected void channelRead0(ChannelHandlerContext ctx, Message msg) throws Exception { seenMessages.incrementAndGet(); byte[] payload = msg.asBytes(); if (encryptionConfig != null) { try { payload = encrypt(payload); } catch (Exception e) { log.error("Fail to encrypt message: ", e.getMessage()); } } String kafkaTopic = defaultTopic; String partitionKey = null; for (String tag : msg.getTags()) { if (tag.startsWith("kt:")) { kafkaTopic = tag.substring(3); } else if (tag.startsWith("pk:")) { partitionKey = tag.substring(3); } } sendOrReportFailure(kafkaTopic, partitionKey, payload); if (propagate) { msg.retain(); ctx.fireChannelRead(msg); } }
Source:
<code>public void a_pancake_can_be_fried_out_of_an_egg_milk_and_flour() { given() .ingredients().comma() .consisting_of() <START> .asterisk() .an() .egg() <END> .asterisk() .some() .milk() .asterisk() .the() .ingredient( "flour" ); when() .the_cook_mangles_everthing_to_a_dough(). and() .the_cook_fries_the_dough_in_a_pan(); then() .the_resulting_meal_is_a_pan_cake(); }</code><technical_language>in this case, argue asterisk is functionally closer a word punctuation. I get now, implemented did. completely satisfied..</technical_language>

Target:
public void a_pancake_can_be_fried_out_of_an_egg_milk_and_flour() { given() .some() .open_bracket().fresh().close_bracket() .ingredients().comma() .consisting_of().colon() .an() .egg() .some() .milk() .the() .ingredient( "flour" ); when() .the_cook_mangles_everthing_to_a_dough(). and() .the_cook_fries_the_dough_in_a_pan(); then() .the_resulting_meal_is_a_pan_cake(); }
Source:
<code><START> public Condition unvoidCondition(Condition condition) throws APIException { <END> condition.setVoided(false); condition.setVoidedBy(null); condition.setDateVoided(null); condition.setVoidReason(null); Context.getConditionService().saveCondition(condition); return condition; }</code><technical_language>ObsServiceImpl's unvoidObs()</technical_language>

Target:
public Condition unvoidCondition(Condition condition) { return Context.getConditionService().saveCondition(condition); }
Source:
<code>public static boolean isSessionValid(HttpServletRequest req) throws NamingException { String sessionId = (String) req.getSession(true).getAttribute(SessionConstants.SSO_TOKEN_KEY); boolean isValid = false; if (StringUtils.isNotEmpty(sessionId)) { try { SSOQueryServiceUtils.getFromSsoQueryService(req, String.format("command=sso-token-validate&sso_token=%s", sessionId)); <START> isValid = true; <END> } catch (Exception e) { log.error("Session not valid session id = " + sessionId, e.getMessage()); } } return isValid; }</code><technical_language>args... ? SSOQueryServiceUtils.getFromSsoQueryService("command=sso-token-validate", String.format("sso_token=%s", sessionId); as: SSOQueryServiceUtils.getFromSsoQueryService(req, "command=sso-token-validate&sso_token=%s", sessionId);</technical_language>

Target:
public static boolean isSessionValid(HttpServletRequest req) throws NamingException { String sessionId = (String) req.getSession(true).getAttribute(SessionConstants.SSO_TOKEN_KEY); boolean isValid = false; if (StringUtils.isNotEmpty(sessionId)) { try { SSOQueryServiceUtils.getFromSsoQueryService("command=sso-token-validate&sso_token=%s", sessionId); isValid = true; } catch (Exception e) { log.error("Session not valid session id = " + sessionId, e.getMessage()); } } return isValid; }
Source:
<code>public EObject getEObject(String uriFragment) { Option<String> optionalRewrittenFragment = VSMMigrationService.getInstance().getNewFragment(uriFragment); if (optionalRewrittenFragment.some()) { return getEObject(optionalRewrittenFragment.get()); } else { <START> if (useURIFragmentAsId) { <END> return getEObjectUsingURIFragmentAsId(uriFragment); } else { return super.getEObject(uriFragment); } } }</code><technical_language>this introduces a nesting level of if/else blocks is needed. be: if (...) { } else if (...) { } else { } instead of if (...) { } else { if (...) { } else { } }</technical_language>

Target:
public EObject getEObject(String uriFragment) { Option<String> optionalRewrittenFragment = VSMMigrationService.getInstance().getNewFragment(uriFragment); if (optionalRewrittenFragment.some()) { return getEObject(optionalRewrittenFragment.get()); } else if (useURIFragmentAsId) { return getEObjectUsingURIFragmentAsId(uriFragment); } else { return super.getEObject(uriFragment); } }
Source:
<code>public SimpleSearcher(String indexDir) throws IOException { Path indexPath = Paths.get(indexDir); if (!Files.exists(indexPath) || !Files.isDirectory(indexPath) || !Files.isReadable(indexPath)) { throw new IllegalArgumentException(indexDir + " does not exist or is not a directory."); } this.reader = DirectoryReader.open(FSDirectory.open(indexPath)); this.similarity = new LMDirichletSimilarity(1000.0f); this.analyzer = new EnglishAnalyzer(); <START> setNormalReranker(); <END> }</code><technical_language>this code, rename "Default" opposed "Normal"</technical_language>

Target:
public SimpleSearcher(String indexDir) throws IOException { Path indexPath = Paths.get(indexDir); if (!Files.exists(indexPath) || !Files.isDirectory(indexPath) || !Files.isReadable(indexPath)) { throw new IllegalArgumentException(indexDir + " does not exist or is not a directory."); } this.reader = DirectoryReader.open(FSDirectory.open(indexPath)); this.similarity = new LMDirichletSimilarity(1000.0f); this.analyzer = new EnglishAnalyzer(); this.searchtweets = false; this.isRerank = false; setDefaultReranker(); }
Source:
<code>public void requestBannerAd(Context context, MediationBannerListener listener, Bundle serverParameters, AdSize adSize, MediationAdRequest adRequest, Bundle mediationExtras) { mBannerListener = listener; String gameId = serverParameters.getString(KEY_GAME_ID); mBannerPlacementId = serverParameters.getString(KEY_PLACEMENT_ID); <START> if (!isValidIds(gameId, mPlacementId)) { <END> if (mBannerListener != null) { mBannerListener.onAdFailedToLoad(UnityAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; } if (!isValidContext(context)) { return; } if (!UnitySingleton.initializeUnityAds(mUnityAdapterDelegate, (Activity) context, gameId)) { if (mBannerListener != null) { mBannerListener.onAdFailedToLoad(UnityAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; } mActivityWeakReference = new WeakReference<>((Activity) context); UnitySingleton.loadBannerAd(mBannerDelegate); }</code><technical_language>This mBannerPlacementId</technical_language>

Target:
public void requestBannerAd(Context context, MediationBannerListener listener, Bundle serverParameters, AdSize adSize, MediationAdRequest adRequest, Bundle mediationExtras) { mBannerListener = listener; String gameId = serverParameters.getString(KEY_GAME_ID); mBannerPlacementId = serverParameters.getString(KEY_PLACEMENT_ID); if (!isValidIds(gameId, mBannerPlacementId)) { if (mBannerListener != null) { mBannerListener.onAdFailedToLoad(UnityAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; } if (!isValidContext(context)) { return; } if (!UnitySingleton.initializeUnityAds(mUnityAdapterDelegate, (Activity) context, gameId)) { if (mBannerListener != null) { mBannerListener.onAdFailedToLoad(UnityAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; } mActivityWeakReference = new WeakReference<>((Activity) context); UnitySingleton.loadBannerAd(mBannerDelegate); }
Source:
<code>public Stream<? extends DomainEventData<?>> findSnapshots(MongoCollection<Document> snapshotCollection, String aggregateIdentifier) { FindIterable<Document> cursor = snapshotCollection.find(eq(eventConfiguration.aggregateIdentifierProperty(), aggregateIdentifier)) <START> .sort(new BasicDBObject(eventConfiguration.sequenceNumberProperty(), ORDER_ASC)).limit(1); <END> return stream(cursor.spliterator(), false).map(this::extractSnapshot); }</code><technical_language>I means a Mongo expert, wont limit(1) call ensure get snapshot</technical_language>

Target:
public Stream<? extends DomainEventData<?>> findSnapshots(MongoCollection<Document> snapshotCollection, String aggregateIdentifier) { FindIterable<Document> cursor = snapshotCollection.find(eq(eventConfiguration.aggregateIdentifierProperty(), aggregateIdentifier)) .sort(orderBy(descending(eventConfiguration.sequenceNumberProperty()))); return stream(cursor.spliterator(), false).map(this::extractSnapshot); }
Source:
<code>public Address[] getRecipients(RecipientType type) { switch (type) { case TO: { if (mTo == null) { mTo = Address.parse(MimeUtility.unfold(getFirstHeader("To"))); } return mTo; } case CC: { if (mCc == null) { mCc = Address.parse(MimeUtility.unfold(getFirstHeader("CC"))); } return mCc; } case BCC: { if (mBcc == null) { mBcc = Address.parse(MimeUtility.unfold(getFirstHeader("BCC"))); } return mBcc; } case RESENT_TO: { if (mResentTo == null) { mResentTo = Address.parse(MimeUtility.unfold(getFirstHeader("Resent-To"))); } <START> return mTo; <END> } case RESENT_CC: { if (mResentCc == null) { mResentCc = Address.parse(MimeUtility.unfold(getFirstHeader("Resent-CC"))); } return mCc; } case RESENT_BCC: { if (mResentBcc == null) { mResentBcc = Address.parse(MimeUtility.unfold(getFirstHeader("Resent-BCC"))); } return mBcc; } } throw new IllegalArgumentException("Unrecognized recipient type."); }</code><technical_language>I this is error</technical_language>

Target:
public Address[] getRecipients(RecipientType type) { switch (type) { case TO: { if (mTo == null) { mTo = Address.parse(MimeUtility.unfold(getFirstHeader("To"))); } return mTo; } case CC: { if (mCc == null) { mCc = Address.parse(MimeUtility.unfold(getFirstHeader("CC"))); } return mCc; } case BCC: { if (mBcc == null) { mBcc = Address.parse(MimeUtility.unfold(getFirstHeader("BCC"))); } return mBcc; } case RESENT_TO: { if (mResentTo == null) { mResentTo = Address.parse(MimeUtility.unfold(getFirstHeader("Resent-To"))); } return mResentTo; } case RESENT_CC: { if (mResentCc == null) { mResentCc = Address.parse(MimeUtility.unfold(getFirstHeader("Resent-CC"))); } return mResentCc; } case RESENT_BCC: { if (mResentBcc == null) { mResentBcc = Address.parse(MimeUtility.unfold(getFirstHeader("Resent-BCC"))); } return mResentBcc; } } throw new IllegalArgumentException("Unrecognized recipient type."); }
Source:
<code>public static int hash( short[] values ) { <START> final int max = values.length; <END> int result = COEFFICIENTS[max]; for ( int i = 0; i < values.length && i < COEFFICIENTS.length - 1; ++i ) { result += COEFFICIENTS[max - i - 1] * values[i]; } return result; }</code><technical_language>if values.length is longer COEFFICIENTS.length</technical_language>

Target:
public static int hash( short[] values ) { final int max = Math.min( values.length, MAX_LENGTH ); int result = COEFFICIENTS[max]; for ( int i = 0; i < values.length && i < COEFFICIENTS.length - 1; ++i ) { result += COEFFICIENTS[max - i - 1] * values[i]; } return result; }
Source:
<code>private static BulkObject getBlobFromPosition(final ImmutableMultimap<BulkObject, Range> blobs, final long position) { if (Guard.isMultiMapNullOrEmpty(blobs)) { return null; } for (final BulkObject bulkObject : blobs.keySet()) { <START> if (bulkObject.getOffset() <= position && position <= (bulkObject.getOffset() + bulkObject.getLength() - 1)) { <END> return bulkObject; } } return null; }</code><technical_language>is comparison encased in parentheses? Also, simplification here</technical_language>

Target:
private static BulkObject getBlobFromPosition(final ImmutableMultimap<BulkObject, Range> blobs, final long position) { if (Guard.isMultiMapNullOrEmpty(blobs)) { return null; } for (final BulkObject bulkObject : blobs.keySet()) { if (bulkObject.getOffset() <= position && position < bulkObject.getOffset() + bulkObject.getLength()) { return bulkObject; } } return null; }
Source:
<code>private void createPointCloudLayer() { PointCloudLayer pointCloudLayer = new PointCloudLayer( Environment.getExternalStorageDirectory() + getString(R.string.scene_layer_package_location)); pointCloudLayer.addLoadStatusChangedListener(loadStatusChangedEvent -> { if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.LOADED) { mScene.getOperationalLayers().add(pointCloudLayer); } else if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.FAILED_TO_LOAD) { <START> Toast.makeText(this, R.string.point_cloud_layer_load_failure_message, Toast.LENGTH_LONG).show(); <END> } }); pointCloudLayer.loadAsync(); }</code><technical_language>write log <LINK_0></technical_language>

Target:
private void createPointCloudLayer() { PointCloudLayer pointCloudLayer = new PointCloudLayer( Environment.getExternalStorageDirectory() + getString(R.string.scene_layer_package_location)); pointCloudLayer.addLoadStatusChangedListener(loadStatusChangedEvent -> { if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.LOADED) { mSceneView.getScene().getOperationalLayers().add(pointCloudLayer); } else if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.FAILED_TO_LOAD) { String error = getString(R.string.point_cloud_layer_load_failure_message); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); pointCloudLayer.loadAsync(); }
Source:
<code>public void testTransformWhenFileIsNew() { final String fileName = "file.dmn"; final String xml = ""; final ServiceCallback<Diagram> callback = mock(ServiceCallback.class); final String title = "title"; <START> doReturn(title).when(service).getDiagramTitle(fileName); <END> doNothing().when(service).doNewDiagram(title, callback); service.transform(fileName, xml, callback); verify(service).doNewDiagram(title, callback); }</code><technical_language>Do mock behaviour of this method!?</technical_language>

Target:
public void testTransformWhenFileIsNew() { final String fileName = "file.dmn"; final String xml = ""; final ServiceCallback<Diagram> callback = mock(ServiceCallback.class); final String title = "file"; doNothing().when(service).doNewDiagram(title, callback); service.transform(fileName, xml, callback); verify(service).doNewDiagram(title, callback); }
Source:
<code>public void testValues() { int i; long[] values = { 0, 100, 1000, 1500, 64000, 124531, 3651782, 86400000, 86434349, 1075634299, 86480001 }; String[] expected = { "0 ms", "100 ms", "1.0 seconds", "1.500 seconds", "0:01:04", "0:02:04", "1:00:51", "1 day", "1 day", <START> "12 days 10:47:14", "1 day 00:01:20" <END> }; for (i = 0; i < values.length; i++) { assertEquals(expected[i], StringUtils.getReadableTime(values[i])); } }</code><technical_language>add a 86400001 (one day + ms) too</technical_language>

Target:
public void testValues() { int i; long[] values = { 0, 100, 1000, 1500, 64000, 124531, 3651782, 86400000, 86434349, 1075634299, 86480001, 86400001 }; String[] expected = { "0 ms", "100 ms", "1.0 seconds", "1.500 seconds", "0:01:04", "0:02:04", "1:00:51", "1 day", "1 day", "12 days 10:47:14", "1 day 00:01:20", "1 day" }; for (i = 0; i < values.length; i++) { assertEquals(expected[i], StringUtils.getReadableTime(values[i])); } }
Source:
<code>void killTopologyHandler(String topologyName) throws TopologyRuntimeManagementException { Scheduler.KillTopologyRequest killTopologyRequest = Scheduler.KillTopologyRequest.newBuilder() .setTopologyName(topologyName).build(); if (!schedulerClient.killTopology(killTopologyRequest)) { throw new TopologyRuntimeManagementException( String.format("Failed to kill topology '%s' with scheduler, " + "please re-try the kill command later", topologyName)); } cleanState(topologyName, Runtime.schedulerStateManagerAdaptor(runtime)); if (foundData) { LOG.fine(String.format("Scheduler killed topology %s successfully.", topologyName)); } else { <START> LOG.warning(String.format("Topology %s data is not found, but scheduler has tried to" <END> + " clean up data for it anyway.", topologyName)); } }</code><technical_language>is this message for</technical_language>

Target:
void killTopologyHandler(String topologyName) throws TopologyRuntimeManagementException { Scheduler.KillTopologyRequest killTopologyRequest = Scheduler.KillTopologyRequest.newBuilder() .setTopologyName(topologyName).build(); if (!schedulerClient.killTopology(killTopologyRequest)) { throw new TopologyRuntimeManagementException( String.format("Failed to kill topology '%s' with scheduler, " + "please re-try the kill command later", topologyName)); } cleanState(topologyName, Runtime.schedulerStateManagerAdaptor(runtime)); if (potentialStaleExecutionData) { LOG.warning(String.format("Topology %s does not exist. Cleaned up potential stale state.", topologyName)); } else { LOG.fine(String.format("Scheduler killed topology %s successfully.", topologyName)); } }
Source:
<code>public void updateAllRevisionDatasetsEntries(String globalId, String schema, String version, Revision revision) throws RepresentationNotExistsException { Representation rep = recordDAO.getRepresentation(globalId, schema, version); if (rep == null) throw new RepresentationNotExistsException(schema); Collection<CompoundDataSetId> dataSets = dataSetDAO.getDataSetAssignments(globalId, schema, version); for (CompoundDataSetId dsID : dataSets) { String datasetName = dsID.getDataSetId(); String datasetProvider = dsID.getDataSetProviderId(); String revisionId = RevisionUtils.getRevisionKey(revision); dataSetDAO.insertProviderDatasetRepresentationInfo(datasetName, datasetProvider, globalId, version, schema, revisionId, revision.getUpdateTimeStamp(), revision.isAcceptance(), revision.isPublished(), revision.isDeleted()); <START> dataSetDAO.insertLatestProviderDatasetRepresentationInfo(datasetName, datasetProvider, <END> globalId, schema, revision.getRevisionName(), revision.getRevisionProviderId(), revision.getUpdateTimeStamp(), version, revision.isAcceptance(), revision.isPublished(), revision.isDeleted()); dataSetDAO.addDataSetsRevision(datasetProvider, datasetName, revisionId, schema, globalId); } }</code><technical_language>Again...I revision creation timestamp, update</technical_language>

Target:
public void updateAllRevisionDatasetsEntries(String globalId, String schema, String version, Revision revision) throws RepresentationNotExistsException { Representation rep = recordDAO.getRepresentation(globalId, schema, version); if (rep == null) throw new RepresentationNotExistsException(schema); Collection<CompoundDataSetId> dataSets = dataSetDAO.getDataSetAssignments(globalId, schema, version); for (CompoundDataSetId dsID : dataSets) { String datasetName = dsID.getDataSetId(); String datasetProvider = dsID.getDataSetProviderId(); String revisionId = RevisionUtils.getRevisionKey(revision); dataSetDAO.insertProviderDatasetRepresentationInfo(datasetName, datasetProvider, globalId, version, schema, revisionId, revision.getUpdateTimeStamp(), revision.isAcceptance(), revision.isPublished(), revision.isDeleted()); dataSetDAO.insertLatestProviderDatasetRepresentationInfo(datasetName, datasetProvider, globalId, schema, revision.getRevisionName(), revision.getRevisionProviderId(), revision.getUpdateTimeStamp(), version, revision.isAcceptance(), revision.isPublished(), revision.isDeleted()); dataSetDAO.addDataSetsRevision(datasetProvider, datasetName, revisionId, schema, globalId); dataSetDAO.addLatestRevisionForDatasetAssignment(dataSetDAO.getDataSet(datasetProvider, datasetName), rep, revision); } }