auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public JSONObject getDebugState(boolean full, String endpointId) { JSONObject debugState = new JSONObject(); debugState.put("id", id); <START> debugState.put("name", conferenceName == null ? null : conferenceName); <END> if (full) { debugState.put("gid", gid); debugState.put("expired", expired); debugState.put("creationTime", creationTime); debugState.put("lastActivity", lastActivityTime); debugState.put("speechActivity", speechActivity.getDebugState()); debugState.put("includeInStatistics", includeInStatistics); debugState.put("statistics", statistics.getJson()); ConfOctoTransport tentacle = this.tentacle; debugState.put( "tentacle", tentacle == null ? null : tentacle.getDebugState()); } JSONObject endpoints = new JSONObject(); debugState.put("endpoints", endpoints); for (Endpoint e : endpointsCache) { if (endpointId == null || endpointId.equals(e.getID())) { endpoints.put(e.getID(), full ? e.getDebugState() : e.getStatsId()); } } return debugState; }</code><technical_language>equivalent conferenceName. want string "null"</technical_language>

Target:
public JSONObject getDebugState(boolean full, String endpointId) { JSONObject debugState = new JSONObject(); debugState.put("id", id); debugState.put("name", conferenceName); if (full) { debugState.put("gid", gid); debugState.put("expired", expired); debugState.put("creationTime", creationTime); debugState.put("lastActivity", lastActivityTime); debugState.put("speechActivity", speechActivity.getDebugState()); debugState.put("includeInStatistics", includeInStatistics); debugState.put("statistics", statistics.getJson()); ConfOctoTransport tentacle = this.tentacle; debugState.put( "tentacle", tentacle == null ? null : tentacle.getDebugState()); } JSONObject endpoints = new JSONObject(); debugState.put("endpoints", endpoints); for (Endpoint e : endpointsCache) { if (endpointId == null || endpointId.equals(e.getID())) { endpoints.put(e.getID(), full ? e.getDebugState() : e.getStatsId()); } } return debugState; }
Source:
<code>public static void checkoutEntry(final Repository repo, File f, DirCacheEntry entry, ObjectReader or) throws IOException { ObjectLoader ol = or.open(entry.getObjectId()); File parentDir = f.getParentFile(); parentDir.mkdirs(); File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY); FileOutputStream rawChannel = new FileOutputStream(tmpFile); OutputStream channel; if (opt.getAutoCRLF() == AutoCRLF.TRUE) channel = new AutoCRLFOutputStream(rawChannel); else channel = rawChannel; try { ol.copyTo(channel); } finally { channel.close(); } FS fs = repo.getFS(); if (opt.isFileMode() && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { FileUtils.delete(f, FileUtils.IGNORE_ERRORS); FileUtils.delete(f, FileUtils.EMPTY_DIRECTORIES_ONLY <START> | FileUtils.RECURSIVE | FileUtils.IGNORE_ERRORS); <END> if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); if (opt.getAutoCRLF() != AutoCRLF.FALSE) entry.setLength(f.length()); else entry.setLength((int) ol.getSize()); }</code><technical_language>Delete twice, why</technical_language>

Target:
public static void checkoutEntry(final Repository repo, File f, DirCacheEntry entry, ObjectReader or) throws IOException { ObjectLoader ol = or.open(entry.getObjectId()); File parentDir = f.getParentFile(); parentDir.mkdirs(); File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY); FileOutputStream rawChannel = new FileOutputStream(tmpFile); OutputStream channel; if (opt.getAutoCRLF() == AutoCRLF.TRUE) channel = new AutoCRLFOutputStream(rawChannel); else channel = rawChannel; try { ol.copyTo(channel); } finally { channel.close(); } FS fs = repo.getFS(); if (opt.isFileMode() && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } try { FileUtils.rename(tmpFile, f); } catch (IOException e) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } entry.setLastModified(f.lastModified()); if (opt.getAutoCRLF() != AutoCRLF.FALSE) entry.setLength(f.length()); else entry.setLength((int) ol.getSize()); }
Source:
<code>public static EventNotificationMethod valueOfString(String value) { <START> return valueOf(value != null ? value.toUpperCase() : null); <END> }</code><technical_language>valueOf support nulls - this NPE, code patch. guessing meant do this: return != null ? valueOf(value.toUpperCase()) : null;</technical_language>

Target:
public static EventNotificationMethod valueOfString(String value) { return value != null ? valueOf(value.toUpperCase()) : null; }
Source:
<code>private void processFlow(ExecutionReference reference, ExecutableFlow exflow, Set<Executor> availableExecutors) throws ExecutorManagerException { synchronized (exflow) { Executor selectedExecutor = selectExecutor(exflow, availableExecutors); if (selectedExecutor != null) { try { dispatch(reference, exflow, selectedExecutor); } catch (ExecutorManagerException e) { <START> logger.debug(String.format( <END> "Executor %s responded with exception for exec: %d", selectedExecutor, exflow.getExecutionId()), e); handleDispatchExceptionCase(reference, exflow, selectedExecutor, availableExecutors); } } else { handleNoExecutorSelectedCase(reference, exflow); } } }</code><technical_language>I if this logger.warn() instead of logger.debug(), in normal running mode</technical_language>

Target:
private void processFlow(ExecutionReference reference, ExecutableFlow exflow, Set<Executor> availableExecutors) throws ExecutorManagerException { synchronized (exflow) { Executor selectedExecutor = selectExecutor(exflow, availableExecutors); if (selectedExecutor != null) { try { dispatch(reference, exflow, selectedExecutor); } catch (ExecutorManagerException e) { logger.warn(String.format( "Executor %s responded with exception for exec: %d", selectedExecutor, exflow.getExecutionId()), e); handleDispatchExceptionCase(reference, exflow, selectedExecutor, availableExecutors); } } else { handleNoExecutorSelectedCase(reference, exflow); } } }
Source:
<code>protected boolean checkStoragePool() { if (!super.checkStoragePool()) return false; <START> <END> if (getStoragePool().getstatus() != StoragePoolStatus.Up) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_ACTIVE); return false; } return true; }</code><technical_language>Compare condition line 133 line 117</technical_language>

Target:
protected boolean checkStoragePool() { if (!super.checkStoragePool()) return false; if (getStoragePool().getstatus() == StoragePoolStatus.Uninitialized) { return true; } if (getStoragePool().getstatus() != StoragePoolStatus.Up) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_ACTIVE); return false; } return true; }
Source:
<code>public void invoke() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); <START> NhinTargetCommunitiesType targets = new NhinTargetCommunitiesType(); <END> MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); Properties webContextProperties = new Properties(); PatientDiscoveryDeferredRequestAuditLogger auditLogger = mock(PatientDiscoveryDeferredRequestAuditLogger.class); OutboundPatientDiscoveryDeferredRequestDelegate delegate = mock(OutboundPatientDiscoveryDeferredRequestDelegate.class); OutboundPatientDiscoveryDeferredRequestOrchestratable returnedOrchestratable = mock(OutboundPatientDiscoveryDeferredRequestOrchestratable.class); when(returnedOrchestratable.getResponse()).thenReturn(expectedResponse); when(delegate.process(any(OutboundPatientDiscoveryDeferredRequestOrchestratable.class))).thenReturn( returnedOrchestratable); PassthroughOutboundPatientDiscoveryDeferredRequest passthroughPatientDiscovery = new PassthroughOutboundPatientDiscoveryDeferredRequest( auditLogger, delegate); MCCIIN000002UV01 actualResponse = passthroughPatientDiscovery.processPatientDiscoveryAsyncReq(request, assertion, targets); assertSame(expectedResponse, actualResponse); verify(auditLogger).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME)); }</code><technical_language>webContextProperties is used. Properties webContextProperties = new Properties();</technical_language>

Target:
public void invoke() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targets = new NhinTargetCommunitiesType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); PatientDiscoveryDeferredRequestAuditLogger auditLogger = mock(PatientDiscoveryDeferredRequestAuditLogger.class); OutboundPatientDiscoveryDeferredRequestDelegate delegate = mock(OutboundPatientDiscoveryDeferredRequestDelegate.class); OutboundPatientDiscoveryDeferredRequestOrchestratable returnedOrchestratable = mock(OutboundPatientDiscoveryDeferredRequestOrchestratable.class); when(returnedOrchestratable.getResponse()).thenReturn(expectedResponse); when(delegate.process(any(OutboundPatientDiscoveryDeferredRequestOrchestratable.class))).thenReturn( returnedOrchestratable); PassthroughOutboundPatientDiscoveryDeferredRequest passthroughPatientDiscovery = new PassthroughOutboundPatientDiscoveryDeferredRequest( auditLogger, delegate); MCCIIN000002UV01 actualResponse = passthroughPatientDiscovery.processPatientDiscoveryAsyncReq(request, assertion, targets); assertSame(expectedResponse, actualResponse); verify(auditLogger).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME)); }
Source:
<code><START> public static void setDisposition(int n, int num){ <END> if(factionDisposition.get(n) <= 100) factionDisposition.set(n, factionDisposition.get(n) + num); }</code><technical_language>1TBS</technical_language>

Target:
public static void setDisposition(int n, int num) { if (factionDisposition.get(n) <= 100) { factionDisposition.set(n, factionDisposition.get(n) + num); } }
Source:
<code>public AuditLogType getAuditLogTypeValue() { UserProfile existingProfile = getUserProfile(); <START> if (existingProfile != null && isSSHPublicKeyUpdate(existingProfile)) { <END> return getSucceeded() ? AuditLogType.USER_UPDATE_PROFILE : AuditLogType.USER_UPDATE_PROFILE_FAILED; } else { return getSucceeded() ? AuditLogType.USER_ADD_PROFILE : AuditLogType.USER_ADD_PROFILE_FAILED; } }</code><technical_language>this method is called validate method, check shorter in executeCommand method</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { UserProfile existingProfile = getUserProfile(); if (existingProfile != null) { return getSucceeded() ? AuditLogType.USER_UPDATE_PROFILE : AuditLogType.USER_UPDATE_PROFILE_FAILED; } else { return getSucceeded() ? AuditLogType.USER_ADD_PROFILE : AuditLogType.USER_ADD_PROFILE_FAILED; } }
Source:
<code><START> public RankedAdapterFactoryDescriptor.Registry getAdapterFactoryRegistry() { <END> RankedAdapterFactoryDescriptorRegistryImpl rankedAdapterFactoryRegistry = new RankedAdapterFactoryDescriptorRegistryImpl( ComposedAdapterFactory.Descriptor.Registry.INSTANCE, Multimaps .unmodifiableMultimap(adapterFactoryRegistry)); return rankedAdapterFactoryRegistry; }</code><technical_language>this method return instance time (meaning of "get"), store this in a field named 'adapterFactoryRegistry'</technical_language>

Target:
public RankedAdapterFactoryDescriptor.Registry getAdapterFactoryRegistry() { return rankedAdapterFactoryRegistry; }
Source:
<code>protected void fillTimeEventContextMenu(@NonNull IMenuManager menuManager) { ISelection selection = getSite().getSelectionProvider().getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection sSel = (IStructuredSelection) selection; for (Object element : sSel.toArray()) { if (element instanceof TimeEvent) { TimeEvent event = (TimeEvent) element; IContributionItem contribItem = createOpenSourceCodeAction(getPresentationProvider().getEventHoverToolTipInfo(event, getTimeGraphViewer().getSelectionBegin())); if (contribItem != null) { <START> menuManager.add(contribItem); <END> } } } } }</code><technical_language>add a break; here</technical_language>

Target:
protected void fillTimeEventContextMenu(@NonNull IMenuManager menuManager) { ISelection selection = getSite().getSelectionProvider().getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection sSel = (IStructuredSelection) selection; for (Object element : sSel.toArray()) { if (element instanceof TimeEvent) { TimeEvent event = (TimeEvent) element; IContributionItem contribItem = createOpenSourceCodeAction(getPresentationProvider().getEventHoverToolTipInfo(event, getTimeGraphViewer().getSelectionBegin())); if (contribItem != null) { menuManager.add(contribItem); break; } } } } }
Source:
<code>public void run() { LOG.debug("Creating new event pack"); EventPack pack = new EventPack(packSize); while (isRunning()) { try { FileTailerEvent event = queue.take(); pack.add(event); if (pack.isFull()) { LOG.debug("Event pack is full"); uploadEventPack(pack); LOG.debug("Saving File Tailer state"); stateProcessor.saveState(pack.getState()); LOG.debug("Cleanup event pack"); pack.clear(); } } catch (InterruptedException e) { LOG.info("Sink was interrupted"); break; } catch (IOException e) { <START> LOG.info("Exception while sending events", e); <END> break; } } LOG.info("Sink stopped."); }</code><technical_language>Logging exception info is good. warn error</technical_language>

Target:
public void run() { LOG.debug("Creating new event pack"); EventPack pack = new EventPack(packSize); List<FileTailerEvent> events = new ArrayList<FileTailerEvent>(packSize); while (isRunning()) { try { queue.drainTo(events, pack.getFreeSize()); pack.addAll(events); events.clear(); if (pack.isFull()) { LOG.debug("Event pack is full"); uploadEventPack(pack); LOG.debug("Saving File Tailer state"); stateProcessor.saveState(pack.getState()); LOG.debug("Cleanup event pack"); pack.clear(); } } catch (InterruptedException e) { LOG.info("Sink was interrupted"); break; } catch (IOException e) { LOG.warn("Exception while sending events", e); break; } } LOG.info("Sink stopped."); }
Source:
<code>public Object[] transform(InputRow inputRow) { final String originalValue = inputRow.getValue(column); if (originalValue == null) { return new String[1]; } if (lookUpEveryToken) { <START> SynonymCatalogConnection.Replacement replacement = synonymCatalogConnection.replaceInline(originalValue); <END> return new Object[] { replacement.getReplacedString(), replacement.getSynonyms(), replacement.getMasterTerms() }; } else { final String replacedValue = lookup(originalValue); return new String[] { replacedValue }; } }</code><technical_language>final :smiling_imp:</technical_language>

Target:
public Object[] transform(InputRow inputRow) { final String originalValue = inputRow.getValue(column); if (originalValue == null) { return new String[1]; } if (lookUpEveryToken) { final SynonymCatalogConnection.Replacement replacement = synonymCatalogConnection.replaceInline(originalValue); if (replacedSynonymsType == ReplacedSynonymsType.STRING) { return new Object[] { replacement.getReplacedString(), Joiner.on(' ').join(replacement.getSynonyms()), Joiner.on(' ').join(replacement.getMasterTerms()) }; } else { return new Object[] { replacement.getReplacedString(), replacement.getSynonyms(), replacement.getMasterTerms() }; } } else { final String replacedValue = lookup(originalValue); return new String[] { replacedValue }; } }
Source:
<code>public int getMonitoringLocationFiles(ZipOutputStream target, String provider, String organization, String monitoringLocation) { <START> LOG.trace("Getting file for: providers/{}/organizations/{}/monitoringLocation/{}", organization, monitoringLocation); <END> StreamingCallbackHandler handler = new StreamingCallbackHandler(target); jdbcTemplate.query("select object_name, object_content from station_object where data_source = ? and organization = ? and site_id = ? order by object_id", new Object[] {provider, organization, monitoringLocation}, handler); return handler.getRowCount(); }</code><technical_language>add provider LOG</technical_language>

Target:
public int getMonitoringLocationFiles(ZipOutputStream target, String provider, String organization, String monitoringLocation) { LOG.trace("Getting file for: providers/{}/organizations/{}/monitoringLocation/{}", provider, organization, monitoringLocation); StreamingCallbackHandler handler = new StreamingCallbackHandler(target); jdbcTemplate.query("select object_name, object_content from station_object where data_source = ? and organization = ? and site_id = ? order by object_id", new Object[] {provider, organization, monitoringLocation}, handler); return handler.getRowCount(); }
Source:
<code>@Test public void basicInjectionWithExtension() { ObjectGraph root = ObjectGraph.createWith(new TestingLoader(), new RootModule()); RealSingleton rs = root.get(RealSingleton.class); <START> assertThat(rs.ints).contains(0, 1); <END> ObjectGraph extension = root.plus(new ExtensionModule()); Main main = extension.get(Main.class); assertThat(main.ints).contains(0, 1, 2, 3); ObjectGraph extension2 = root.plus(new ExtensionModule()); Main main2 = extension2.get(Main.class); assertThat(main2.ints).contains(0, 1, 4, 5); }</code><technical_language>I want containsOnly containsExactly</technical_language>

Target:
@Test public void basicInjectionWithExtension() { ObjectGraph root = ObjectGraph.createWith(new TestingLoader(), new RootModule()); RealSingleton rs = root.get(RealSingleton.class); assertThat(rs.ints).containsOnly(0, 1); ObjectGraph extension = root.plus(new ExtensionModule()); Main main = extension.get(Main.class); assertThat(main.ints).containsOnly(0, 1, 2, 3); ObjectGraph extension2 = root.plus(new ExtensionModule()); Main main2 = extension2.get(Main.class); assertThat(main2.ints).containsOnly(0, 1, 4, 5); }
Source:
<code>public void commit(Xid xid, boolean onePhase) throws XAException { <START> log.infof("commit xid:[%s], %s one phase", xid, onePhase ? "with" : "without"); <END> checker.addCommit(); }</code><technical_language>log.trace</technical_language>

Target:
public void commit(Xid xid, boolean onePhase) throws XAException { log.tracef("commit xid:[%s], %s one phase", xid, onePhase ? "with" : "without"); checker.addCommit(); }
Source:
<code>protected List<MethodMatcher> getMethodInvocationMatchers() { return ImmutableList.of( MethodMatcher.create().name("wait"), MethodMatcher.create().name("wait").addParameter("long"), MethodMatcher.create().name("wait").addParameter("long").addParameter("int"), <START> MethodMatcher.create().typeDefinition("java.util.concurrent.locks.Condition").name(NameCriteria.startsWith("await")).withNoParameterConstraint() <END> ); }</code><technical_language>method withNoParameterConstraint is confusing. In case, implementation idea I use... I a bit modify MethodMatcher in order methods handling of parameter: - withoutParameter : method parameter - withAnyParameters: method parameters considered parameter modify method matcher in order fail if is parameter added withoutParameter withAnyParameters called</technical_language>

Target:
protected List<MethodMatcher> getMethodInvocationMatchers() { return ImmutableList.of( MethodMatcher.create().name("wait").withoutParameter(), MethodMatcher.create().name("wait").addParameter("long"), MethodMatcher.create().name("wait").addParameter("long").addParameter("int"), MethodMatcher.create().typeDefinition("java.util.concurrent.locks.Condition").name(NameCriteria.startsWith("await")).withAnyParameters() ); }
Source:
<code>private boolean isAllowed(MutableHttpServletRequest request, String paramName) { String layersParam = request.getParameterIgnoreCase(paramName); List<Layer> all = layerService.findAll(); boolean match = false; for (Layer layer : all) { if (layer.getSource() instanceof ImageWmsLayerDataSource) { ImageWmsLayerDataSource source = (ImageWmsLayerDataSource) layer.getSource(); if (source.getLayerNames().equalsIgnoreCase(layersParam) && source.getUrl().equalsIgnoreCase(request.getContextPath() + "/geoserver.action")) { <START> match = true; <END> } } } return match; }</code><technical_language>skip loop now</technical_language>

Target:
private boolean isAllowed(MutableHttpServletRequest request, String paramName) { String layersParam = request.getParameterIgnoreCase(paramName); List<Layer> all = layerService.findAll(); boolean match = false; for (Layer layer : all) { if (layer.getSource() instanceof ImageWmsLayerDataSource) { ImageWmsLayerDataSource source = (ImageWmsLayerDataSource) layer.getSource(); if (source.getLayerNames().equalsIgnoreCase(layersParam) && source.getUrl().equalsIgnoreCase(request.getContextPath() + "/geoserver.action")) { match = true; break; } } } return match; }
Source:
<code>public static void main(String[] args) { LOG.info("Application started"); File configurationFile; if (args.length == 0) { configurationFile = new File(FileTailerMain.class.getClassLoader().getResource("file-tailer.properties").getPath()); } else if (args.length == 1) { configurationFile = new File(args[0]); } else { LOG.info("Too many arguments: {}. Requirement: 0 or 1", args.length); return; } PipeManager manager = new PipeManager(configurationFile); try { <START> manager.setupPipes(); <END> } catch (IOException e) { LOG.error("Error during flows: setup", e); return; } LOG.info("Staring flows"); manager.startUp(); Runtime.getRuntime().addShutdownHook(new Thread(new PipeShutdownTask(manager))); }</code><technical_language>need call setupPipes() explicitly. part of service start</technical_language>

Target:
public static void main(String[] args) { LOG.info("Application started"); File configurationFile; if (args.length == 0) { configurationFile = new File(FileTailerMain.class.getClassLoader().getResource("file-tailer.properties").getPath()); } else if (args.length == 1) { configurationFile = new File(args[0]); } else { LOG.info("Too many arguments: {}. Requirement: 0 or 1", args.length); return; } PipeManager manager = new PipeManager(configurationFile); LOG.info("Staring pipes"); manager.startAsync(); Runtime.getRuntime().addShutdownHook(new Thread(new PipeShutdownTask(manager))); }
Source:
<code>@Override public void complete(Bitmap result, Picasso.LoadedFrom from) { if (result == null) { throw new AssertionError( String.format("Attempted to complete action with no result!\n%s", this)); } ImageView target = this.target.get(); if (target == null) { return; } <START> result.prepareToDraw(); <END> Context context = picasso.context; boolean indicatorsEnabled = picasso.indicatorsEnabled; PicassoDrawable.setBitmap(target, context, result, from, noFade, indicatorsEnabled); if (callback != null) { callback.onSuccess(); } }</code><technical_language>This pretty late call this. do posting main thread</technical_language>

Target:
@Override public void complete(Bitmap result, Picasso.LoadedFrom from) { if (result == null) { throw new AssertionError( String.format("Attempted to complete action with no result!\n%s", this)); } ImageView target = this.target.get(); if (target == null) { return; } Context context = picasso.context; boolean indicatorsEnabled = picasso.indicatorsEnabled; PicassoDrawable.setBitmap(target, context, result, from, noFade, indicatorsEnabled); if (callback != null) { callback.onSuccess(); } }
Source:
<code>private XMLGregorianCalendar getBeginDate(final Map<String, String> parameters) { if (parameters.containsKey(PlatformSmartmeteringKeys.KEY_BEGIN_DATE)) { try { <START> final Date beginDate = SDF.parse(parameters.get(PlatformSmartmeteringKeys.KEY_BEGIN_DATE)); <END> return DateConverter.createXMLGregorianCalendar(beginDate); } catch (final ParseException e) { LOGGER.debug("Error parsing begin date", e); } } LOGGER.debug("Key for begin date not found in parameters, using default value."); return DateConverter.createXMLGregorianCalendar(DEFAULT_BEGIN_DATE.toDate()); }</code><technical_language>Do need date format separately, easier reuse (with a change default value's type) is included in Helpers, like: Helpers.getDate(parameters, PlatformSmartmeteringKeys.FROM_DATE, DEFAULT_FROM).toGregorianCalendar().getTime();? (Would in format varying feature feature, necessary.)</technical_language>

Target:
private XMLGregorianCalendar getBeginDate(final Map<String, String> parameters) { final DateTime dateTime = Helpers.getDate(parameters, PlatformSmartmeteringKeys.KEY_BEGIN_DATE, DEFAULT_BEGIN_DATE); return DateConverter.createXMLGregorianCalendar(dateTime.toDate()); }
Source:
<code><START> public List<Integer> getRecoveredPartitions() { <END> if (StringUtils.isEmpty(m_recoveredPartitions)) { return Lists.newArrayList(); } List<Integer> partitions = Stream.of(m_recoveredPartitions.split(",")) .map(Integer::parseInt).sorted().collect(Collectors.toList()); return partitions; }</code><technical_language>Is this method used</technical_language>

Target:
public Set<Integer> getRecoveredPartitions() { Set<Integer> partitionSet = Sets.newHashSet(); if (StringUtils.isEmpty(m_recoveredPartitions)) { return partitionSet; } String partitions[] = m_recoveredPartitions.split(","); for (String partition : partitions) { try { partitionSet.add(Integer.valueOf(partition)); } catch (NumberFormatException e) { } } return partitionSet; }
Source:
<code>protected String retrieveAuthorizationUrl(final WebContext context) { final String authorizationUrl; <START> if (requiresStateParameter() || (stateData != null && !stateData.isEmpty())) { <END> String state = getStateParameter(context); logger.debug("State parameter: {}", state); context.setSessionAttribute(getName() + STATE_PARAMETER, state); authorizationUrl = ((StateOAuth20Service) this.service).getAuthorizationUrl(state); } else { authorizationUrl = this.service.getAuthorizationUrl(null); } logger.debug("authorizationUrl : {}", authorizationUrl); return authorizationUrl; }</code><technical_language>I fully agree here. requiresStateParameter tells if want state parameter, static (your stateData) dynamic (generated getStateParameter() method)</technical_language>

Target:
protected String retrieveAuthorizationUrl(final WebContext context) { final String authorizationUrl = this.service.getAuthorizationUrl(null); logger.debug("authorizationUrl : {}", authorizationUrl); return authorizationUrl; }
Source:
<code>public void execute(final String containerName, ListContainerOptions listOptions) { final AtomicBoolean deleteFailure = new AtomicBoolean(); final int numOutStandingRequests = 1024; <START> int retries = maxErrors; <END> final Semaphore semaphore = new Semaphore(numOutStandingRequests); final List<AtomicReference<ListenableFuture<Void>>> outstandingFutures = Collections .synchronizedList(new ArrayList<AtomicReference<ListenableFuture<Void>>>()); while (retries > 0) { deleteFailure.set(false); executeOneIteration(containerName, listOptions.clone(), semaphore, outstandingFutures, deleteFailure); try { if (!semaphore.tryAcquire(numOutStandingRequests, maxTime, TimeUnit.MILLISECONDS)) { cancelOutstandingFutures(outstandingFutures); throw new BlobRuntimeException("Timeout while deleting blobs"); } semaphore.release(numOutStandingRequests); } catch (InterruptedException e) { logger.debug("Interrupted while waiting for blobs to be deleted"); cancelOutstandingFutures(outstandingFutures); Thread.currentThread().interrupt(); } if (deleteFailure.get() && --retries > 0) { String message = getMessage(containerName, listOptions); retryHandler.imposeBackoffExponentialDelay(maxErrors - retries, message); } else { break; } } if (retries == 0) { cancelOutstandingFutures(outstandingFutures); throw new BlobRuntimeException("Exceeded maximum retry attempts"); } }</code><technical_language>large number of HTTP response fixes added, I per-operation retry suffice remove outer retry loop. address this in a subsequent commit</technical_language>

Target:
public void execute(final String containerName, ListContainerOptions listOptions) { final AtomicBoolean deleteFailure = new AtomicBoolean(); int retries = maxErrors; final Semaphore semaphore = new Semaphore(maxParallelDeletes); final Set<ListenableFuture<Void>> outstandingFutures = Collections .synchronizedSet(new HashSet<ListenableFuture<Void>>()); while (retries > 0) { deleteFailure.set(false); executeOneIteration(containerName, listOptions.clone(), semaphore, outstandingFutures, deleteFailure, false); waitForCompletion(semaphore, outstandingFutures); if (deleteFailure.get() && --retries > 0) { String message = getMessage(containerName, listOptions); retryHandler.imposeBackoffExponentialDelay(maxErrors - retries, message); } else { break; } } if (retries == 0) { cancelOutstandingFutures(outstandingFutures); throw new BlobRuntimeException("Exceeded maximum retry attempts"); } }
Source:
<code>private static List<File> search(File[] mounts, boolean isDirectChild) { List<File> candidates = new ArrayList<>(); for ( File f : mounts ) { if ( f.exists() && f.isDirectory() ) { if ( isDirectChild ) { if ( hasOdkInstancesDirectory(f) ) { candidates.add(f); } } else { <START> File[] subdirs = f.listFiles(f1 -> f1.isDirectory()); <END> for ( File s : subdirs ) { if ( hasOdkInstancesDirectory(s) ) { candidates.add(s); } } } } } return candidates; }</code><technical_language>Change lambda's arg name more expressive 'file'</technical_language>

Target:
private static List<File> search(File[] mounts, boolean isDirectChild) { List<File> candidates = new ArrayList<>(); for ( File f : mounts ) { if ( f.exists() && f.isDirectory() ) { if ( isDirectChild ) { if ( hasOdkInstancesDirectory(f) ) { candidates.add(f); } } else { File[] subdirs = f.listFiles(file -> file.isDirectory()); for ( File s : subdirs ) { if ( hasOdkInstancesDirectory(s) ) { candidates.add(s); } } } } } return candidates; }
Source:
<code>private void <START> addLldpInfo(NetworkInterfaceModel <END> nic) { insertHorizontalLine(); addRow(templates.strongTextWithColor(constants.lldpTlvs(), WHITE_TEXT_COLOR)); List<Tlv> tlvs = nic.getSetupModel().getNetworkTlvsByGuid().get(nic.getOriginalIface().getId()); if (tlvs != null) { tlvs.stream().filter(this::isTlvImportant) .forEach(tlv -> tlv.getProperties().entrySet().stream() .forEach(entry -> addRow(entry.getKey(), entry.getValue()))); } }</code><technical_language>Is this producing <LINK_0></technical_language>

Target:
private void addLldpInfo(NetworkInterfaceModel nic) { HostSetupNetworksModel model = nic.getSetupModel(); Guid id = nic.getOriginalIface().getId(); List<Tlv> tlvs = model.getNetworkTlvsByGuid(id); insertHorizontalLine(); addRow(templates.strongTextWithColor(constants.linkLayerInfo(), WHITE_TEXT_COLOR)); if (tlvs != null) { tlvs.stream().filter(this::isTlvImportant) .forEach(tlv -> tlv.getProperties().entrySet().stream() .forEach(entry -> addRow(entry.getKey(), entry.getValue()))); } else { if (model.isNetworkTlvsPresent(id)) { addRow(SafeHtmlUtils.fromSafeConstant(constants.noLldpInfoAvailable())); } else { addRow(SafeHtmlUtils.fromSafeConstant(constants.fetchingLldpInfo())); } } }
Source:
<code>public void layoutContainer(Container target) { synchronized (target.getTreeLock()) { <START> synchronized (this.oppositeAlignedItems) { <END> ParentDimensions targetDims = getTargetDimensions(target); List<Component> components = Arrays.asList(target.getComponents()); List<WrapLayoutRow> rows = getAllRows(components, true, targetDims.innerWidth); boolean ltr = target.getComponentOrientation().isLeftToRight(); boolean useBaseline = getAlignOnBaseline(); int rowY = targetDims.insets.top + getVgap(); int leftX = targetDims.insets.left + getHgap(); int rightX = targetDims.outerWidth - targetDims.insets.right - getHgap(); for (WrapLayoutRow row : rows) { int rowHeight = row.height; int curX = 0; if (row.components != null) { for (Component origComp : row.components) { curX += setComponentDims(origComp, useBaseline, ltr, rowY, rowHeight, leftX, rightX, curX) + getHgap(); } } if (row.oppositeAligned != null) { curX = 0; Collections.reverse(row.oppositeAligned); for (Component oppAlignedComp : row.oppositeAligned) { curX += setComponentDims(oppAlignedComp, useBaseline, !ltr, rowY, rowHeight, leftX, rightX, curX) + getHgap(); } } rowY += rowHeight + getVgap(); } } } }</code><technical_language>synchronizing synchronization a recipe for problems I @rcordovano weigh in this one</technical_language>

Target:
public void layoutContainer(Container target) { ParentDimensions targetDims = getTargetDimensions(target); List<Component> components = Arrays.asList(target.getComponents()); List<WrapLayoutRow> rows = getAllRows(components, true, targetDims.getInnerWidth()); boolean ltr = target.getComponentOrientation().isLeftToRight(); boolean useBaseline = isAlignOnBaseline(); int rowY = targetDims.getInsets().top + getVerticalGap(); int leftX = targetDims.getInsets().left + getHorizontalGap(); int rightX = targetDims.getOuterWidth() - targetDims.getInsets().right - getHorizontalGap(); for (WrapLayoutRow row : rows) { int rowHeight = row.getHeight(); int curX = 0; if (row.getComponents() != null) { for (Component origComp : row.getComponents()) { curX += setComponentDims(origComp, useBaseline, ltr, rowY, rowHeight, leftX, rightX, curX) + getHorizontalGap(); } } if (row.getOppositeAligned() != null) { curX = 0; Collections.reverse(row.getOppositeAligned()); for (Component oppAlignedComp : row.getOppositeAligned()) { curX += setComponentDims(oppAlignedComp, useBaseline, !ltr, rowY, rowHeight, leftX, rightX, curX) + getHorizontalGap(); } } rowY += rowHeight + getVerticalGap(); } }
Source:
<code>public void appendVerificationSubmissionState(long verificationId, VerificationState newState) { <START> if (DELETE_ATTACHMENTS_STATES.contains(newState.getState())) { <END> jdbcTemplate.update(SQL_DELETE_FILE_IDS, verificationId); } long stateId = idGenerator.generateNewId(IdType.VERIFICATION_SUBMISSION_ID); DBOVerificationState dbo = copyVerificationStateDTOtoDBO(verificationId, stateId, newState); basicDao.createNew(dbo); }</code><technical_language>update etag blob</technical_language>

Target:
public void appendVerificationSubmissionState(long verificationId, VerificationState newState) { if (DELETE_ATTACHMENTS_STATES.contains(newState.getState())) { jdbcTemplate.update(SQL_DELETE_FILE_IDS, verificationId); jdbcTemplate.update(SQL_UPDATE_SUBMISSION_ETAG, verificationId); } long stateId = idGenerator.generateNewId(IdType.VERIFICATION_SUBMISSION_ID); DBOVerificationState dbo = copyVerificationStateDTOtoDBO(verificationId, stateId, newState); basicDao.createNew(dbo); }
Source:
<code>private boolean validateCWL(String cwlFilePath) { final String[] s = { "cwltool", "--non-strict", "--validate", cwlFilePath }; try { io.cwl.avro.Utilities.executeCommand(Joiner.on(" ").join(Arrays.asList(s)), false, Optional.absent(), Optional.absent()); } catch (Exception ex) { <START> return false; <END> } return true; }</code><technical_language>completely catch exceptions. Some exceptions validation errors (for example, if cwltool installed incorrectly). cases 1) passing validation 2) failing validation 3) throw exception unknown cases</technical_language>

Target:
private boolean validateCWL(String cwlFilePath) { final String[] s = { "cwltool", "--non-strict", "--validate", cwlFilePath }; try { io.cwl.avro.Utilities.executeCommand(Joiner.on(" ").join(Arrays.asList(s)), false, Optional.absent(), Optional.absent()); return true; } catch (RuntimeException e) { return false; } catch (Exception e) { throw new RuntimeException("An unexpected exception unrelated to validation has occurred"); } }
Source:
<code>public InputStatus emitNext(DataOutput<T> output) throws Exception { <START> if (!isBlockedAvailability.isApproximatelyAvailable()) { <END> return InputStatus.NOTHING_AVAILABLE; } return operator.emitNext(output); }</code><technical_language>nit: this is a bit difficult read (maybe invert condition?)</technical_language>

Target:
public InputStatus emitNext(DataOutput<T> output) throws Exception { if (isBlockedAvailability.isApproximatelyAvailable()) { return operator.emitNext(output); } return InputStatus.NOTHING_AVAILABLE; }
Source:
<code>public static ShouldHavePeriod shouldHaveYears(Period actual, int actualYear, int expectedYear) { String metric; if (expectedYear == 1 || expectedYear == -1) { metric = "year"; } else { metric = "years"; <START> } <END> return new ShouldHavePeriod(actual, actualYear, expectedYear, metric); }</code><technical_language>ternary operator: String metric = Math.abs(expectedYear) == 1 ? "year" : "years";</technical_language>

Target:
public static ShouldHavePeriod shouldHaveYears(Period actual, int actualYear, int expectedYear) { final String metric = Math.abs(expectedYear) == 1 ? "year" : "years"; return new ShouldHavePeriod(actual, actualYear, expectedYear, metric); }
Source:
<code>protected UriBuilder createAuthorizationUrl(AuthenticationRequest request) { UriBuilder uriBuilder = super.createAuthorizationUrl(request); <START> String nonce = UUID.randomUUID().toString(); <END> request.getAuthenticationSession().setClientNote(BROKER_NONCE_PARAM, nonce); uriBuilder.queryParam(OIDCLoginProtocol.NONCE_PARAM, nonce); return uriBuilder; }</code><technical_language>UUID is more expensive generate a SecureRandom, unique, secure, need UUID. KeycloakModelUtils directly? for example generate client secrets</technical_language>

Target:
protected UriBuilder createAuthorizationUrl(AuthenticationRequest request) { UriBuilder uriBuilder = super.createAuthorizationUrl(request); String nonce = Base64Url.encode(KeycloakModelUtils.generateSecret(16)); AuthenticationSessionModel authenticationSession = request.getAuthenticationSession(); authenticationSession.setClientNote(BROKER_NONCE_PARAM, nonce); uriBuilder.queryParam(OIDCLoginProtocol.NONCE_PARAM, nonce); return uriBuilder; }
Source:
<code>private void onFinish() { <START> removeRedundantVolumesForOrphanedDisks(); <END> getSnapshotDao().updateStatus(getParameters().getSnapshot().getId(), Snapshot.SnapshotStatus.OK); setSucceeded(true); }</code><technical_language>This method removes orphaned disk commit a snapshot. This called</technical_language>

Target:
private void onFinish() { removeRedundantVolumesForOrphanedDisks(); setSucceeded(true); }
Source:
<code>public Object[][] get3PrimeSoftClipData() { return new Object[][]{ {"20M", true, 0}, {"20M", false, 0}, {"2H20M", true, 0}, {"2H20M", false, 0}, {"2S20M", false, 0}, {"2S20M", true, 2}, {"20M2S", true, 0}, {"20M2S", false, 2}, {"2S20M5S", false, 5}, {"2S20M4S", true, 2}, {"4S20M2S", true, 4}, <START> {"4S20M2S", false, 2}, <END> }; }</code><technical_language>add another edge case hard soft clips read: "2H3S10M4S5H"</technical_language>

Target:
public Object[][] get3PrimeSoftClipData() { return new Object[][]{ {"20M", true, 0}, {"20M", false, 0}, {"5H2S", true, 0}, {"5H2S", false, 0}, {"5H2S6H", false, 0}, {"5H2S6H", true, 0}, {"2H20M", true, 0}, {"2H20M", false, 0}, {"2S20M", false, 0}, {"2S20M", true, 2}, {"20M2S", true, 0}, {"20M2S", false, 2}, {"20M2S4S", false, 6}, {"20M2S4S", true, 0}, {"2S20M5S", false, 5}, {"2S20M4S", true, 2}, {"4S20M2S", true, 4}, {"4S20M2S", false, 2}, {"2H3S10M4S5H", false,4}, {"2H3S10M4S5H", true,3}, }; }
Source:
<code>private void lockEntities() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntityStatus(getSnapshot(), SnapshotStatus.OK); getSnapshotDao().updateStatus(sourceSnapshotId, SnapshotStatus.LOCKED); getCompensationContext().snapshotEntityStatus(getVm().getDynamicData(), VMStatus.Down); <START> getCompensationContext().snapshotEntityStatus(getVm().getDynamicData(), VMStatus.ImageLocked); <END> getCompensationContext().stateChanged(); return null; } }); freeLock(); }</code><technical_language>Huh</technical_language>

Target:
private void lockEntities() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntityStatus(getSnapshot(), getSnapshot().getStatus()); getSnapshotDao().updateStatus(sourceSnapshotId, SnapshotStatus.LOCKED); getCompensationContext().snapshotEntityStatus(getVm().getDynamicData(), getVm().getDynamicData().getstatus()); getVmDynamicDao().updateStatus(getVm().getId(), VMStatus.ImageLocked); getCompensationContext().stateChanged(); return null; } }); freeLock(); }
Source:
<code>private void showPopup(MouseEvent me) { if (!me.isPopupTrigger()) return; int row = financeTable.getSelectedRow(); <START> if (row < 0) return; <END> JPopupMenu popup = new JPopupMenu(); JMenu menu = new JMenu(I18N.getString("menu.gmMode")); popup.add(menu); menu.add(makeGMOnlyItem("DELETE", I18N.getString("menu.gmMode.action.delete"), (idx, tx) -> { gui.getCampaign().addReport(tx.voidTransaction()); financeModel.deleteTransaction(idx); MekHQ.triggerEvent(new TransactionVoidedEvent(tx)); })); menu.add(makeGMOnlyItem("EDIT", I18N.getString("menu.gmMode.action.edit"), (idx, tx) -> { EditTransactionDialog dialog = new EditTransactionDialog(tx, gui.getFrame(), true); dialog.setVisible(true); if (!tx.equals(dialog.getOldTransaction())) { financeModel.setTransaction(idx, tx); MekHQ.triggerEvent(new TransactionChangedEvent(dialog.getOldTransaction(), tx)); gui.getCampaign().addReport(tx.updateTransaction(dialog.getOldTransaction())); } })); popup.show(me.getComponent(), me.getX(), me.getY()); }</code><technical_language>coding standard, I believe, is curly braces prior change. So, opening brace line, closing brace subsequent line. Braces needed if a one-liner</technical_language>

Target:
private void showPopup(MouseEvent me) { if (!me.isPopupTrigger()) { return; } int row = financeTable.getSelectedRow(); if (row < 0) { return; } JPopupMenu popup = new JPopupMenu(); JMenu menu = new JMenu(I18N.getString("menu.gmMode")); popup.add(menu); menu.add(makeGMOnlyItem("DELETE", I18N.getString("menu.gmMode.action.delete"), (idx, tx) -> { gui.getCampaign().addReport(tx.voidTransaction()); financeModel.deleteTransaction(idx); MekHQ.triggerEvent(new TransactionVoidedEvent(tx)); })); menu.add(makeGMOnlyItem("EDIT", I18N.getString("menu.gmMode.action.edit"), (idx, tx) -> { EditTransactionDialog dialog = new EditTransactionDialog(tx, gui.getFrame(), true); dialog.setVisible(true); if (!tx.equals(dialog.getOldTransaction())) { financeModel.setTransaction(idx, tx); MekHQ.triggerEvent(new TransactionChangedEvent(dialog.getOldTransaction(), tx)); gui.getCampaign().addReport(tx.updateTransaction(dialog.getOldTransaction())); } })); popup.show(me.getComponent(), me.getX(), me.getY()); }
Source:
<code>public static String getSignature(String name, Class<?>[] parameterTypes) { StringBuilder signature = new StringBuilder( name.length() + 2 + parameterTypes.length * 25 ); <START> signature.append( name ).append( "(" ); <END> boolean separator = false; for ( Class<?> parameterType : parameterTypes ) { if ( separator ) { signature.append( "," ); } else { separator = true; } signature.append( parameterType.getName() ); } signature.append( ")" ); return signature.toString(); }</code><technical_language>'('</technical_language>

Target:
public static Signature getSignature(String name, Class<?>[] parameterTypes) { return new Signature( name, parameterTypes ); }
Source:
<code>public void testUpdateNode() throws Exception { final DefaultDockerClient dockerClient = new DefaultDockerClient(builder); enqueueServerApiVersion("1.28"); enqueueServerApiResponse(200, "fixtures/1.28/listNodes.json"); final List<Node> nodes = dockerClient.listNodes(); assertThat(nodes.size(), is(1)); final Node node = nodes.get(0); assertThat(node.id(), is("24ifsmvkjbyhk")); assertThat(node.version().index(), is(8L)); assertThat(node.spec().name(), is("my-node")); assertThat(node.spec().role(), is("manager")); assertThat(node.spec().availability(), is("active")); <START> assertThat(node.spec().labels(), hasKey(is("foo"))); <END> final NodeSpec updatedNodeSpec = NodeSpec.builder(node.spec()) .addLabel("foobar", "foobar") .build(); enqueueServerApiVersion("1.28"); enqueueServerApiEmptyResponse(200); dockerClient.updateNode(node.id(), node.version().index(), updatedNodeSpec); }</code><technical_language>minor: more human readable if replace is equalTo</technical_language>

Target:
public void testUpdateNode() throws Exception { final DefaultDockerClient dockerClient = new DefaultDockerClient(builder); enqueueServerApiVersion("1.28"); enqueueServerApiResponse(200, "fixtures/1.28/listNodes.json"); final List<Node> nodes = dockerClient.listNodes(); assertThat(nodes.size(), is(1)); final Node node = nodes.get(0); assertThat(node.id(), equalTo("24ifsmvkjbyhk")); assertThat(node.version().index(), equalTo(8L)); assertThat(node.spec().name(), equalTo("my-node")); assertThat(node.spec().role(), equalTo("manager")); assertThat(node.spec().availability(), equalTo("active")); assertThat(node.spec().labels(), hasKey(equalTo("foo"))); final NodeSpec updatedNodeSpec = NodeSpec.builder(node.spec()) .addLabel("foobar", "foobar") .build(); enqueueServerApiVersion("1.28"); enqueueServerApiEmptyResponse(200); dockerClient.updateNode(node.id(), node.version().index(), updatedNodeSpec); }
Source:
<code>private String getDefaultDefinition(final ColumnModel column) { if (!column.hasDefaultValue() && !column.isNotNull()) { return ""; } if (column.hasDefaultValue()) { <START> return " DEFAULT '" + column.getDefaultValue() + "'"; <END> } return " DEFAULT " + getFalseLiteralValue(); }</code><technical_language>I want @Column(defaultValue="true") in annotation this translate return of getTrueLiteralValue getFalseLiteralValue creating SQL text. check default matches "true" "false" picking text put DEFAULT statement</technical_language>

Target:
private String getDefaultDefinition(final ColumnModel column) { if (!column.hasDefaultValue() && !column.isNotNull()) { return ""; } if (column.hasDefaultValue()) { return " DEFAULT '" + (column.getDefaultValue(Boolean.class) ? getTrueLiteralValue() : getFalseLiteralValue()) + "'"; } return " DEFAULT " + getFalseLiteralValue(); }
Source:
<code><START> public Optional<Repository> getRepository(Class<? extends Message> stateClass) { <END> final RepositoryAccess repositoryAccess = repositories.get(stateClass); if (repositoryAccess == null) { throw newIllegalArgumentException( "A repository for the state class (%s) was not registered in VisibilityGuard", stateClass.getName()); } return repositoryAccess.get(); }</code><technical_language>long perform checkNotNull(...) in getEntityTypes(visibility) below, I do for stateClass well</technical_language>

Target:
public Optional<Repository> getRepository(Class<? extends Message> stateClass) { checkNotNull(stateClass); final RepositoryAccess repositoryAccess = repositories.get(stateClass); if (repositoryAccess == null) { throw newIllegalArgumentException( "A repository for the state class (%s) was not registered in VisibilityGuard", stateClass.getName()); } return repositoryAccess.get(); }
Source:
<code>public ParseSpec withTimestampSpec(TimestampSpec spec) { <START> return new JSONParseSpec(spec, getDimensionsSpec(), flattenSpec); <END> }</code><technical_language>getter</technical_language>

Target:
public ParseSpec withTimestampSpec(TimestampSpec spec) { return new JSONParseSpec(spec, getDimensionsSpec(), getFlattenSpec()); }
Source:
<code>public void setErrataDetailPanelVisibilty(boolean visible) { <START> logger.info("updateErrataDetailPanelVisibilty"); END> splitLayoutPanel.clear(); if (visible) { splitLayoutPanel.addSouth(errataDetailPanel, SOUTH_SIZE); } splitLayoutPanel.add(errataTableView); }</code><technical_language>debug/trace/remove</technical_language>

Target:
public void setErrataDetailPanelVisibilty(boolean visible) { splitLayoutPanel.clear(); if (visible) { splitLayoutPanel.addSouth(errataDetailPanel, SOUTH_SIZE); } splitLayoutPanel.add(errataTableView); }