auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static AccessControl forName(String localName) { final AccessControl value = localName != null ? MAP.get(localName.toLowerCase()) : null; <START> return value == null ? AccessControl.valueOf(localName.toUpperCase()) : value; <END> }</code><technical_language>Is a reason removing locale? left there</technical_language>

Target:
public static AccessControl forName(String localName) { final AccessControl value = localName != null ? MAP.get(localName.toLowerCase(Locale.ENGLISH)) : null; return value == null ? AccessControl.valueOf(localName.toUpperCase(Locale.ENGLISH)) : value; }
Source:
<code>public void testKinesisClientLibConfigurationShouldGetProxyInfoFromPropertiesFile() throws Exception { <START> String PROPERTIES = <END> "executableName = randomEXE \n" + "applicationName = testApp \n" + "streamName = fakeStream \n" + "AWSCredentialsProvider = DefaultAWSCredentialsProviderChain\n" + "http.proxyHost = <LINK_0>\n" + "http.proxyPort = 1234\n" + "processingLanguage = malbolge"; ClassLoader classLoader = Mockito.mock(ClassLoader.class); Mockito.doReturn(new ByteArrayInputStream(PROPERTIES.getBytes())).when(classLoader) .getResourceAsStream(FILENAME); MultiLangDaemonConfig config = new MultiLangDaemonConfig(FILENAME, classLoader, buildMockConfigurator()); assertAgainstKclConfig(config.getKinesisClientLibConfiguration(), "<LINK_0>", 1234); }</code><technical_language>Static variables uppercase. change this PROPERTIES case properties</technical_language>

Target:
public void testKinesisClientLibConfigurationShouldGetProxyInfoFromPropertiesFile() throws Exception { String properties = "executableName = randomEXE \n" + "applicationName = testApp \n" + "streamName = fakeStream \n" + "AWSCredentialsProvider = DefaultAWSCredentialsProviderChain\n" + "http.proxyHost = <LINK_0>\n" + "http.proxyPort = 1234\n" + "processingLanguage = malbolge"; ClassLoader classLoader = Mockito.mock(ClassLoader.class); Mockito.doReturn(new ByteArrayInputStream(properties.getBytes())).when(classLoader) .getResourceAsStream(FILENAME); MultiLangDaemonConfig config = new MultiLangDaemonConfig(FILENAME, classLoader, buildMockConfigurator()); assertAgainstKclConfig(config.getKinesisClientLibConfiguration(), "<LINK_0>", 1234); }
Source:
<code>public Optional<HostLocation> get() { OkHttpClient client = new OkHttpClient.Builder() .build(); try { Response response = client.newCall(new Request.Builder() .get() .url("<LINK_0>") .build()) .execute(); <START> checkState(response.isSuccessful(), "Getting AWS host metadata was not successful"); <END> String responseString = response.body().string(); String datacentre = responseString.substring(0, responseString.length()-2); String rack = responseString.substring(responseString.length()-1); return Optional.of(HostLocation.of(datacentre, rack)); } catch (IOException e) { throw new RuntimeException("Could not communicate with AWS host metadata", e); } }</code><technical_language>Please com.palantir.logsafe.Preconditions. Granted this args, message visible in internal logging infrastructure trace class line number</technical_language>

Target:
public HostLocation get() { try { Response response = client.newCall(new Request.Builder() .get() .url("<LINK_0>") .build()) .execute(); Preconditions.checkState(response.isSuccessful(), "Getting AWS host metadata was not successful"); String responseString = response.body().string(); String datacenter = responseString.substring(0, responseString.length() - 2); String rack = responseString.substring(responseString.length() - 1); return HostLocation.of(datacenter, rack); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>protected int getScrollLimitX() { <START> return mScaledWidth - getWidth() + FloatMathHelper.scale(mExtraBorder, mScale); <END> }</code><technical_language>a good point. TBH years written oversight laziness, contributing variables easier compute fly... this library is rickety, admit (thus, V3)</technical_language>

Target:
protected int getScrollLimitX() { return mScaledWidth - getWidth() + mScaledImagePadding; }
Source:
<code>public void compute( final IterableInterval< T > input, final Img< DoubleType > output ) { final int numDimensions = input.numDimensions(); if ( input.numDimensions() != 2 ) { throw new IllegalArgumentException( "Cannot compute Hough circle transform for non-2D images. Got " + numDimensions + "D image." ); } maxRadius = Math.max( minRadius, maxRadius ); <START> minRadius = Math.min( minRadius, maxRadius ); <END> final long nRadiuses = ( maxRadius - minRadius ) / stepRadius + 1; final double sum = ops().stats().sum( input ).getRealDouble(); int progress = 0; final Cursor< T > cursor = input.localizingCursor(); while ( cursor.hasNext() ) { cursor.fwd(); if ( !cursor.get().get() ) continue; for ( int i = 0; i < nRadiuses; i++ ) { final IntervalView< DoubleType > slice = Views.hyperSlice( output, numDimensions, i ); final long r = minRadius + i * stepRadius; MidPointAlgorithm.inc( Views.extendZero( slice ), cursor, r ); } statusService.showProgress( ++progress, ( int ) sum ); } }</code><technical_language>above, temp variable required</technical_language>

Target:
public void compute(final IterableInterval<T> input, final Img<DoubleType> output) { final long maxR = Math.max(minRadius, maxRadius); final long minR = Math.min(minRadius, maxRadius); maxRadius = maxR; minRadius = minR; final long nRadiuses = (maxRadius - minRadius) / stepRadius + 1; final double sum = ops().stats().sum(input).getRealDouble(); int progress = 0; final Cursor<T> cursor = input.localizingCursor(); while (cursor.hasNext()) { cursor.fwd(); if (!cursor.get().get()) continue; for (int i = 0; i < nRadiuses; i++) { final IntervalView<DoubleType> slice = Views.hyperSlice(output, input .numDimensions(), i); final long r = minRadius + i * stepRadius; MidPointAlgorithm.inc(Views.extendZero(slice), cursor, r); } statusService.showProgress(++progress, (int) sum); } }
Source:
<code>public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key, boolean throwException) { <START> return new HashMap<>(); <END> }</code><technical_language>Minor: Collections.emptyMap();</technical_language>

Target:
public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key, boolean throwException) { return Collections.emptyMap(); }
Source:
<code>private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; <START> int heartBeat = Config.<Integer> getValue(ConfigValues.vdsHeartbeat) * 1000; <END> int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); _vdsProxy = TransportFactory.createVdsServer(_vds.getProtocol(), _vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, heartBeat); }</code><technical_language>question before, of heart beat.</technical_language>

Target:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int heartbeat = Config.<Integer> getValue(ConfigValues.vdsHeartbeatInSeconds) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); _vdsProxy = TransportFactory.createVdsServer(_vds.getProtocol(), _vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, heartbeat); }
Source:
<code>public void save(LUNs lun) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("LUN_id", lun.getLUN_id()) .addValue("physical_volume_id", lun.getphysical_volume_id()) .addValue("volume_group_id", lun.getvolume_group_id()) .addValue("serial", lun.getSerial()) .addValue("lun_mapping", lun.getLunMapping()) .addValue("vendor_id", lun.getVendorId()) .addValue("product_id", lun.getProductId()) <START> .addValue("device_size", lun.getDeviceSize()) <END> .addValue("disk_id", lun.getDiskId()) .addValue("disk_alias", lun.getDiskAlias()) .addValue("storage_id", lun.getStorageDomainId()) .addValue("storage_name", lun.getStorageDomainName()); getCallsHandler().executeModification("InsertLUNs", parameterSource); }</code><technical_language>need save values view</technical_language>

Target:
public void save(LUNs lun) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("LUN_id", lun.getLUN_id()) .addValue("physical_volume_id", lun.getphysical_volume_id()) .addValue("volume_group_id", lun.getvolume_group_id()) .addValue("serial", lun.getSerial()) .addValue("lun_mapping", lun.getLunMapping()) .addValue("vendor_id", lun.getVendorId()) .addValue("product_id", lun.getProductId()) .addValue("device_size", lun.getDeviceSize()); getCallsHandler().executeModification("InsertLUNs", parameterSource); }
Source:
<code>private void getPreAuthToken(ProgressIndicator indicator) { getPreAuthToken(result_, result_.getServerInfo(), indicator, new OperationWithInput<NewRSConnectAccountResult>() { @Override public void execute(NewRSConnectAccountResult input) { result_ = input; contents_.setClaimLink(result_.getServerInfo().getName(), result_.getPreAuthToken().getClaimUrl()); waitingForAuth_.setValue(true, true); contents_.showWaiting(); <START> if (canSpawnAuthenticationWindow()) <END> { NewWindowOptions options = new NewWindowOptions(); options.setName(AUTH_WINDOW_NAME); options.setAllowExternalNavigation(true); options.setShowDesktopToolbar(false); display_.openWebMinimalWindow( result_.getPreAuthToken().getClaimUrl(), false, 700, 800, options); } pollForAuthCompleted(); } }); }</code><technical_language>this is false? (i.e. do end launching Firefox instead?)</technical_language>

Target:
private void getPreAuthToken(ProgressIndicator indicator) { getPreAuthToken(result_, result_.getServerInfo(), indicator, new OperationWithInput<NewRSConnectAccountResult>() { @Override public void execute(NewRSConnectAccountResult input) { result_ = input; contents_.setClaimLink(result_.getServerInfo().getName(), result_.getPreAuthToken().getClaimUrl()); waitingForAuth_.setValue(true, true); contents_.showWaiting(); if (canSpawnAuthenticationWindow()) { NewWindowOptions options = new NewWindowOptions(); options.setName(AUTH_WINDOW_NAME); options.setAllowExternalNavigation(true); options.setShowDesktopToolbar(false); display_.openWebMinimalWindow( result_.getPreAuthToken().getClaimUrl(), false, 700, 800, options); } else { Desktop.getFrame().browseUrl(result_.getPreAuthToken().getClaimUrl()); } pollForAuthCompleted(); } }); }
Source:
<code>protected boolean shouldExpire(long threshold, long timestamp) { if (threshold > -1) { long currentTime = currentTimeMillis(); <START> if (timestamp > currentTime || currentTime - timestamp > threshold) <END> return true; } return false; }</code><technical_language>this (currentTime > timestamp && currentTime - timestamp > threshold) current check expires timestamp currentTimeMillis() in iterator. assuming times synced perfectly server wrote a mutation this iterator is running scan/compaction</technical_language>

Target:
public static boolean shouldExpire(long threshold, long timestamp) { if (threshold > -1 && timestamp > -1) { long currentTime = currentTimeMillis(); if (currentTime - timestamp > threshold) return true; } return false; }
Source:
<code>synchronized boolean containsWatcher(String path, Watcher watcher) { PathIterator pathIterator = new PathIterator(path); <START> while (pathIterator.hasNext()) { <END> String localPath = pathIterator.next(); Map<Watcher, Type> watchers = watchTable.get(localPath); Type watcherType = (watchers != null) ? watchers.get(watcher) : null; if ((watcherType == Type.STANDARD) && !pathIterator.atParentPath()) { return true; } if (watcherType == Type.PERSISTENT) { return true; } } return false; }</code><technical_language>here: for (String localPath : pathIterator) {</technical_language>

Target:
synchronized boolean containsWatcher(String path, Watcher watcher) { PathParentIterator pathParentIterator = getPathParentIterator(path); for (String localPath : pathParentIterator.asIterable()) { Map<Watcher, Type> watchers = watchTable.get(localPath); Type watcherType = (watchers != null) ? watchers.get(watcher) : null; if ( !pathParentIterator.atParentPath() ) { if ( watcherType != null ) { return true; } } if (watcherType == Type.PERSISTENT_RECURSIVE) { return true; } } return false; }
Source:
<code>public void testSampleExtremeCoverageVarianceWithoutRejectionFile(final List<SampleCoverageStats> sampleStats, final double min, final double max) throws IOException { final File samplesFile = createSampleStatsFile(sampleStats); final List<SampleCoverageStats> leftInSamples = sampleStats.stream() .filter(stats -> stats.variance >= min && stats.variance <= max) .collect(Collectors.toList()); final File outputFile = createTempFile("output", ".tab"); runCommandLine(new String[] { "-" + StandardArgumentDefinitions.INPUT_SHORT_NAME, samplesFile.getPath(), "-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME, outputFile.getPath(), "-" + FilterSamples.MINIMUM_COVERAGE_VARIANCE_SHORT_NAME, String.valueOf(min), "-" + FilterSamples.MAXIMUM_COVERAGE_VARIANCE_SHORT_NAME, String.valueOf(max), }); <START> checkLeftInTargets(leftInSamples, outputFile); <END> }</code><technical_language>Samples</technical_language>

Target:
public void testSampleExtremeCoverageVarianceWithoutRejectionFile(final List<SampleCoverageStats> sampleStats, final double min, final double max) throws IOException { final File samplesFile = createSampleStatsFile(sampleStats); final List<SampleCoverageStats> leftInSamples = sampleStats.stream() .filter(stats -> stats.variance >= min && stats.variance <= max) .collect(Collectors.toList()); final File outputFile = createTempFile("output", ".tab"); runCommandLine(new String[] { "-" + StandardArgumentDefinitions.INPUT_SHORT_NAME, samplesFile.getPath(), "-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME, outputFile.getPath(), "-" + FilterSamples.MINIMUM_COVERAGE_VARIANCE_SHORT_NAME, String.valueOf(min), "-" + FilterSamples.MAXIMUM_COVERAGE_VARIANCE_SHORT_NAME, String.valueOf(max), }); checkLeftInSamples(leftInSamples, outputFile); }
Source:
<code>public boolean execute(VeluxBridge bridge, int sceneNo) { logger.trace("execute({}) called.", sceneNo); RunScene bcp = bridge.bridgeAPI().runScene(); bcp.setSceneId(sceneNo); <START> if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { <END> logger.debug("execute() finished successfully."); return true; } else { logger.trace("execute() finished with failure."); return false; } }</code><technical_language>redundant parentheses</technical_language>

Target:
public boolean execute(VeluxBridge bridge, int sceneNo) { logger.trace("execute({}) called.", sceneNo); RunScene bcp = bridge.bridgeAPI().runScene(); bcp.setSceneId(sceneNo); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { logger.debug("execute() finished successfully."); return true; } else { logger.trace("execute() finished with failure."); return false; } }
Source:
<code>public void addressesInHeadersAddedWithoutSlashes() throws IOException { final Socket socket = BkBasicTest.createMockSocket(); final AtomicReference<Request> ref = new AtomicReference<Request>(); new BkBasic( new Take() { @Override @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes") public Response act(final Request req) { try { new RqPrint(req).printBody(); } catch (final IOException exc) { <START> throw new RuntimeException(exc); <END> } ref.set(req); return new RsEmpty(); } } ).accept(socket); final Request request = ref.get(); final RqHeaders.Smart smart = new RqHeaders.Smart( new RqHeaders.Base(request) ); MatcherAssert.assertThat( smart.single( "X-Takes-LocalAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( smart.single( "X-Takes-RemoteAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( new RqSocket(request).getLocalAddress(), Matchers.notNullValue() ); MatcherAssert.assertThat( new RqSocket(request).getRemoteAddress(), Matchers.notNullValue() ); }</code><technical_language>@exper0 again, IllegalStateException remove suppress</technical_language>

Target:
public void addressesInHeadersAddedWithoutSlashes() throws IOException { final Socket socket = BkBasicTest.createMockSocket(); final AtomicReference<Request> ref = new AtomicReference<Request>(); new BkBasic( new Take() { @Override public Response act(final Request req) { try { new RqPrint(req).printBody(); } catch (final IOException exc) { throw new IllegalStateException(exc); } ref.set(req); return new RsEmpty(); } } ).accept(socket); final Request request = ref.get(); final RqHeaders.Smart smart = new RqHeaders.Smart( new RqHeaders.Base(request) ); MatcherAssert.assertThat( smart.single( "X-Takes-LocalAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( smart.single( "X-Takes-RemoteAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( new RqSocket(request).getLocalAddress(), Matchers.notNullValue() ); MatcherAssert.assertThat( new RqSocket(request).getRemoteAddress(), Matchers.notNullValue() ); }
Source:
<code>private void restoreDialog() { IDialogSettings dialogSettings = getDialogSettings(); if (dialogSettings != null) { try { dialogHeight = dialogSettings.getInt(DIALOG_HEIGHT); dialogWidth = dialogSettings.getInt(DIALOG_WIDTH); } catch (NumberFormatException e) { dialogHeight = -1; dialogWidth = -1; } String[] orderedProviders = dialogSettings.getArray(ORDERED_PROVIDERS); previousPicksList.addAll(Arrays.asList(new QuickAccessElement[orderedProviders.length])); isLoadingPreviousElements = true; refreshQuickAccessContents = new UIJob("Finish restoring quick access elements") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { boolean restoreUiElements = true; restoreDialogEntries(dialogSettings, restoreUiElements, monitor); quickAccessContents.refresh(quickAccessContents.filterText.getText()); List<QuickAccessElement> previousPicks = getLoadedPreviousPicks(); previousPicksList.clear(); previousPicksList.addAll(previousPicks); return Status.OK_STATUS; } }; refreshQuickAccessContents.setSystem(true); restoreDialogEntriesJob = Job.createSystem("Restore quick access elements", (IProgressMonitor monitor) -> { try { boolean restoreUiElements = false; restoreDialogEntries(dialogSettings, restoreUiElements, monitor); return Status.OK_STATUS; } catch (OperationCanceledException e) { return Status.CANCEL_STATUS; } finally { <START> isLoadingPreviousElements = false; <END> refreshQuickAccessContents.schedule(); } }); restoreDialogEntriesJob.schedule(); } }</code><technical_language>yep</technical_language>

Target:
private void restoreDialog() { IDialogSettings dialogSettings = getDialogSettings(); if (dialogSettings != null) { try { dialogHeight = dialogSettings.getInt(DIALOG_HEIGHT); dialogWidth = dialogSettings.getInt(DIALOG_WIDTH); } catch (NumberFormatException e) { dialogHeight = -1; dialogWidth = -1; } String[] orderedProviders = dialogSettings.getArray(ORDERED_PROVIDERS); previousPicksList.addAll(Arrays.asList(new QuickAccessElement[orderedProviders.length])); isLoadingPreviousElements = true; refreshQuickAccessContents = new UIJob("Finish restoring quick access elements") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { restoreDialogEntries(dialogSettings, true, monitor); quickAccessContents.refresh(quickAccessContents.filterText.getText()); List<QuickAccessElement> previousPicks = getLoadedPreviousPicks(); previousPicksList.clear(); previousPicksList.addAll(previousPicks); } finally { isLoadingPreviousElements = false; } return Status.OK_STATUS; } }; refreshQuickAccessContents.setSystem(true); restoreDialogEntriesJob = Job.createSystem("Restore quick access elements", (IProgressMonitor monitor) -> { try { restoreDialogEntries(dialogSettings, false, monitor); return Status.OK_STATUS; } catch (OperationCanceledException e) { return Status.CANCEL_STATUS; } finally { refreshQuickAccessContents.schedule(); } }); restoreDialogEntriesJob.schedule(); } }
Source:
<code>public String toString() { return "CachedDataRecordWithStats{" + "cachedValue=" + cachedValue <START> + "} " + super.toString(); <END> }</code><technical_language>minor: add super.toString() output { } brackets, is clearer is part of object? (same apply other toString() impls) Current version this: CachedDataRecordWithStats{cachedValue=null} DataRecordWithStats{value=null} AbstractRecordWithStats{lastStoredTime=-1, expirationTime=-1} AbstractRecord{key=null, ttl=0, maxIdle=0, version=0, hits=0, lastAccessTime=-1, lastUpdateTime=-1, creationTime=-1, metadata=null} suggestion + ", super=" + super.toString() + "}";</technical_language>

Target:
public String toString() { return "CachedDataRecordWithStats{" + "cachedValue=" + cachedValue + ", " + super.toString() + "} "; }
Source:
<code>public void setMockMode_shouldNotRegisterDuplicateListeners() throws Exception { TestLocationListener listener = new TestLocationListener(); LocationRequest request = LocationRequest.create().setPriority(PRIORITY_HIGH_ACCURACY); api.setMockMode(true); api.requestLocationUpdates(request, listener); api.setMockMode(false); api.requestLocationUpdates(request, listener); <START> assertThat(shadowLocationManager.getRequestLocationUpdateListeners()).hasSize(4); <END> }</code><technical_language>shadowLocationManager.getRequestLocationUpdateListeners() return 2 if original listeners properly removed. listener for GPS provider for network provider. I stepped this test debugger. happening is time requestLocationUpdates(...) is called listeners registered b/c mock mode is true. mock mode is set false toggleAllEngines() registers listeners (GPS + network) LocationManager. requestLocationUpdates(...) is called for time listeners registered LocationManager again. implications of registering listener LocationManager. matter. set a flag engine registered LocationManager ensure engine get registered more once</technical_language>

Target:
public void setMockMode_shouldNotRegisterDuplicateListeners() throws Exception { TestLocationListener listener = new TestLocationListener(); LocationRequest request = LocationRequest.create().setPriority(PRIORITY_HIGH_ACCURACY); api.setMockMode(true); api.requestLocationUpdates(request, listener); api.setMockMode(false); api.requestLocationUpdates(request, listener); assertThat(shadowLocationManager.getRequestLocationUpdateListeners()).hasSize(2); }
Source:
<code>public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException { boolean authenticated = false; String authenticationScheme = null; String username = null; String password; List<String> authentication = request.getHttpHeaders().getRequestHeader("Authorization"); if (authentication != null && authentication.size() > 0) { for (String auth : authentication) { if (!auth.startsWith("Basic")) { continue; } String hash = auth.substring(6); try { byte[] decoded = Base64.decode(hash); String usernamePassword = new String(decoded); int colon = usernamePassword.indexOf(':'); if (colon > 0) { username = usernamePassword.substring(0, colon); password = usernamePassword.substring(colon + 1, usernamePassword.length()); authenticated = providerService.authenticate(username, password); authenticationScheme = SecurityContext.BASIC_AUTH; break; } } catch (IOException e) { log.log(Level.SEVERE, "Cannot encode authentication realm", e); } } } if (!authenticated) { MultivaluedMap<String, String> queryParams = request.getUri().getQueryParameters(); if (queryParams != null) { username = queryParams.getFirst("provider"); password = queryParams.getFirst("pwd"); if (username != null && !username.isEmpty() && password != null && !password.isEmpty()) { authenticated = providerService.authenticate(username, password); authenticationScheme = "CUSTOM"; } } } <START> <END> if (authenticated) { Principal principal = new SimplePrincipal(username); ResteasyProviderFactory.pushContext(SecurityContext.class, new CustomSecurityContext(principal, providerService.isSuperProvider(username), true, authenticationScheme)); log.log(Level.FINE, "Request authenticated. Username: {0}", username); } return null; }</code><technical_language>dropped URL based authentication in this commit? <LINK_0></technical_language>

Target:
public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException { boolean authenticated = false; String authenticationScheme = null; String username = null; String password; List<String> authentication = request.getHttpHeaders().getRequestHeader("Authorization"); if (authentication != null && authentication.size() > 0) { for (String auth : authentication) { if (!auth.startsWith("Basic")) { continue; } String hash = auth.substring(6); try { byte[] decoded = Base64.decode(hash); String usernamePassword = new String(decoded); int colon = usernamePassword.indexOf(':'); if (colon > 0) { username = usernamePassword.substring(0, colon); password = usernamePassword.substring(colon + 1, usernamePassword.length()); authenticated = providerService.authenticate(username, password); authenticationScheme = SecurityContext.BASIC_AUTH; break; } } catch (IOException e) { log.log(Level.SEVERE, "Cannot encode authentication realm", e); } } } if (authenticated) { Principal principal = new SimplePrincipal(username); ResteasyProviderFactory.pushContext(SecurityContext.class, new CustomSecurityContext(principal, providerService.isSuperProvider(username), true, authenticationScheme)); log.log(Level.FINE, "Request authenticated. Username: {0}", username); } return null; }
Source:
<code>public void verifyShortWriteRequest() throws Exception { AbfsClient client = mock(AbfsClient.class); AbfsRestOperation op = mock(AbfsRestOperation.class); AbfsConfiguration abfsConf; final Configuration conf = new Configuration(); conf.set(accountKey1, accountValue1); abfsConf = new AbfsConfiguration(conf, accountName1); AbfsPerfTracker tracker = new AbfsPerfTracker("test", accountName1, abfsConf); when(client.getAbfsPerfTracker()).thenReturn(tracker); when(client.append(anyString(), any(byte[].class), any(AppendRequestParameters.class), any())).thenReturn(op); when(client.flush(anyString(), anyLong(), anyBoolean(), anyBoolean(), any())).thenReturn(op); AbfsOutputStream out = new AbfsOutputStream(client, null, PATH, 0, populateAbfsOutputStreamContext(BUFFER_SIZE, true, false, false)); final byte[] b = new byte[WRITE_SIZE]; new Random().nextBytes(b); out.write(b); out.hsync(); final byte[] b1 = new byte[2*WRITE_SIZE]; new Random().nextBytes(b1); out.write(b1); out.flush(); out.hflush(); out.hsync(); AppendRequestParameters firstReqParameters = new AppendRequestParameters( 0, 0, WRITE_SIZE, APPEND_MODE, false); AppendRequestParameters secondReqParameters = new AppendRequestParameters( WRITE_SIZE, 0, 2 * WRITE_SIZE, APPEND_MODE, false); verify(client, times(1)).append( eq(PATH), any(byte[].class), refEq(firstReqParameters), any()); verify(client, times(1)).append( <START> eq(PATH), any(byte[].class), refEq(secondReqParameters), any()); <END> }</code><technical_language>ensure number of calls append is correct</technical_language>

Target:
public void verifyShortWriteRequest() throws Exception { AbfsClient client = mock(AbfsClient.class); AbfsRestOperation op = mock(AbfsRestOperation.class); AbfsConfiguration abfsConf; final Configuration conf = new Configuration(); conf.set(accountKey1, accountValue1); abfsConf = new AbfsConfiguration(conf, accountName1); AbfsPerfTracker tracker = new AbfsPerfTracker("test", accountName1, abfsConf); when(client.getAbfsPerfTracker()).thenReturn(tracker); when(client.append(anyString(), any(byte[].class), any(AppendRequestParameters.class), any())).thenReturn(op); when(client.flush(anyString(), anyLong(), anyBoolean(), anyBoolean(), any())).thenReturn(op); AbfsOutputStream out = new AbfsOutputStream(client, null, PATH, 0, populateAbfsOutputStreamContext(BUFFER_SIZE, true, false, false)); final byte[] b = new byte[WRITE_SIZE]; new Random().nextBytes(b); out.write(b); out.hsync(); final byte[] b1 = new byte[2*WRITE_SIZE]; new Random().nextBytes(b1); out.write(b1); out.flush(); out.hflush(); out.hsync(); AppendRequestParameters firstReqParameters = new AppendRequestParameters( 0, 0, WRITE_SIZE, APPEND_MODE, false); AppendRequestParameters secondReqParameters = new AppendRequestParameters( WRITE_SIZE, 0, 2 * WRITE_SIZE, APPEND_MODE, false); verify(client, times(1)).append( eq(PATH), any(byte[].class), refEq(firstReqParameters), any()); verify(client, times(1)).append( eq(PATH), any(byte[].class), refEq(secondReqParameters), any()); verify(client, times(2)).append( eq(PATH), any(byte[].class), any(), any()); }
Source:
<code>public static String generateStringOfLength(int length, char character) { Assumption.assertTrue(length >= 0); char[] chars = new char[length]; Arrays.fill(chars, character); <START> return new String(chars); <END> }</code><technical_language>this is a String, Collections.nCopies</technical_language>

Target:
public static String generateStringOfLength(int length, char character) { Assumption.assertTrue(length >= 0); return String.join("", Collections.nCopies(length, String.valueOf(character))); }
Source:
<code>public static Stage getInjectorStage(final Stage defaultStage) { <START> return Stage.valueOf(System.getProperty("stage", defaultStage.name()).toUpperCase()); <END> }</code><technical_language>this more Guice specific? E.g. guice.stage inject.stage similar. Guice is a stage</technical_language>

Target:
public static Stage getInjectorStage(final Stage defaultStage) { return Stage.valueOf(System.getProperty("guice.stage", defaultStage.name()).toUpperCase()); }
Source:
<code>private List<Image> generateImages(AmazonUnboxItem item) { <START> if (item.getLargeImageUrl() == null) { <END> return ImmutableList.of(); } Image image = new Image(item.getLargeImageUrl()); image.setType(ImageType.PRIMARY); image.setWidth(320); image.setHeight(240); image.setAspectRatio(ImageAspectRatio.FOUR_BY_THREE); image.setColor(ImageColor.COLOR); image.setMimeType(MimeType.IMAGE_JPG); return ImmutableList.of(image); }</code><technical_language>Strings.isNullOrEmpty(item.getLargeImageUrl())</technical_language>

Target:
private List<Image> generateImages(AmazonUnboxItem item) { if (Strings.isNullOrEmpty(item.getLargeImageUrl())) { return ImmutableList.of(); } Image image = new Image(item.getLargeImageUrl()); image.setType(ImageType.PRIMARY); image.setWidth(320); image.setHeight(240); image.setAspectRatio(ImageAspectRatio.FOUR_BY_THREE); image.setColor(ImageColor.COLOR); image.setMimeType(MimeType.IMAGE_JPG); return ImmutableList.of(image); }
Source:
<code>private void testEditWithEmptyQuestionTextThenDeleteQuestionAction(int qnNumber) throws MaximumRetriesExceededException { ______TS("qn " + qnNumber + " edit the question with invalid input then delete question"); feedbackEditPage.clickEditQuestionButton(qnNumber); feedbackEditPage.fillQuestionTextBox("", qnNumber); feedbackEditPage.clickSaveExistingQuestionButton(qnNumber); String expectedString = "Please enter a valid question. The question text cannot be empty."; <START> feedbackEditPage.verifyStatus(expectedString); <END> feedbackEditPage.clickDeleteQuestionLink(qnNumber); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); assertNull(getFeedbackQuestion(courseId, feedbackSessionName, qnNumber)); }</code><technical_language>Const.StatusMessages#FEEDBACK_QUESTION_TEXTINVALID? rename underscores? Optionally, move constant test page is in tests</technical_language>

Target:
private void testEditWithEmptyQuestionTextThenDeleteQuestionAction(int qnNumber) throws MaximumRetriesExceededException { ______TS("qn " + qnNumber + " edit the question with invalid input then delete question"); feedbackEditPage.clickEditQuestionButton(qnNumber); feedbackEditPage.fillQuestionTextBox("", qnNumber); feedbackEditPage.clickSaveExistingQuestionButton(qnNumber); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); feedbackEditPage.clickDeleteQuestionLink(qnNumber); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); assertNull(getFeedbackQuestion(courseId, feedbackSessionName, qnNumber)); }
Source:
<code>static public void generateParameterValueSet(ExpressionClassBuilder acb, int numberOfParameters, Vector parameterList) throws StandardException { <START> if (numberOfParameters >= 0) <END> { MethodBuilder constructor = acb.getConstructor(); boolean hasReturnParam = numberOfParameters > 0 ? ((ParameterNode)parameterList.get(0)).isReturnOutputParam() : false; constructor.pushThis(); constructor.push(numberOfParameters); constructor.push(hasReturnParam); constructor.callMethod(VMOpcode.INVOKEVIRTUAL, ClassName.BaseActivation, "setParameterValueSet", "void", 2); MethodBuilder executeMethod = acb.getExecuteMethod(); executeMethod.pushThis(); executeMethod.callMethod(VMOpcode.INVOKEVIRTUAL, ClassName.BaseActivation, "throwIfMissingParms", "void", 0); } }</code><technical_language>Similarly, this true. is weird here, want remove if add assert numberOfParameters >= 0</technical_language>

Target:
static public void generateParameterValueSet(ExpressionClassBuilder acb, int numberOfParameters, Vector parameterList) throws StandardException { assert numberOfParameters >= 0; MethodBuilder constructor = acb.getConstructor(); boolean hasReturnParam = numberOfParameters > 0 && ((ParameterNode)parameterList.get(0)).isReturnOutputParam(); constructor.pushThis(); constructor.push(numberOfParameters); constructor.push(hasReturnParam); constructor.callMethod(VMOpcode.INVOKEVIRTUAL, ClassName.BaseActivation, "setParameterValueSet", "void", 2); MethodBuilder executeMethod = acb.getExecuteMethod(); executeMethod.pushThis(); executeMethod.callMethod(VMOpcode.INVOKEVIRTUAL, ClassName.BaseActivation, "throwIfMissingParms", "void", 0); }
Source:
<code>public Image getImage(Object element) { <START> if (element instanceof OpenShiftProjectUIModel) { <END> return OpenShiftImages.PROJECT_IMG; } else if (element instanceof Deployment) { return OpenShiftImages.SERVICE_IMG; } else if (element instanceof IResource || element instanceof IResourceUIModel) { IResource resource = element instanceof IResourceUIModel ? ((IResourceUIModel)element).getResource() : (IResource) element; switch (resource.getKind()) { case ResourceKind.BUILD: return OpenShiftImages.BUILD_IMG; case ResourceKind.BUILD_CONFIG: return OpenShiftImages.BUILDCONFIG_IMG; case ResourceKind.IMAGE_STREAM: return OpenShiftImages.IMAGE_IMG; case ResourceKind.POD: return OpenShiftImages.BLOCKS_IMG; case ResourceKind.PROJECT: return OpenShiftImages.PROJECT_IMG; case ResourceKind.ROUTE: return OpenShiftImages.ROUTE_IMG; case ResourceKind.SERVICE: return OpenShiftImages.SERVICE_IMG; default: return OpenShiftCommonImages.FILE; } } else { return super.getImage(element); } }</code><technical_language>This ProjectAdapter interface this model implements instead of concrete class</technical_language>

Target:
public Image getImage(Object element) { if (element instanceof IProjectAdapter) { return OpenShiftImages.PROJECT_IMG; } else if (element instanceof Deployment) { return OpenShiftImages.SERVICE_IMG; } else if(element instanceof NewProjectLinkNode) { return OpenShiftImages.PROJECT_NEW_IMG; } else if (element instanceof IResource || element instanceof IResourceUIModel) { IResource resource = element instanceof IResourceUIModel ? ((IResourceUIModel)element).getResource() : (IResource) element; switch (resource.getKind()) { case ResourceKind.BUILD: return OpenShiftImages.BUILD_IMG; case ResourceKind.BUILD_CONFIG: return OpenShiftImages.BUILDCONFIG_IMG; case ResourceKind.IMAGE_STREAM: return OpenShiftImages.IMAGE_IMG; case ResourceKind.POD: return OpenShiftImages.BLOCKS_IMG; case ResourceKind.PROJECT: return OpenShiftImages.PROJECT_IMG; case ResourceKind.ROUTE: return OpenShiftImages.ROUTE_IMG; case ResourceKind.SERVICE: return OpenShiftImages.SERVICE_IMG; default: return OpenShiftCommonImages.FILE; } } else { return super.getImage(element); } }
Source:
<code><START> public static String collectionToCommaDelimitedString(Collection<String> list) { <END> if (list == null || list.isEmpty()) { return ""; } StringBuilder sb = new StringBuilder(); final Iterator<String> it = list.iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(", "); } } return sb.toString(); }</code><technical_language>delegate Spring's StringUtils</technical_language>

Target:
public static String collectionToCommaDelimitedString(Collection<String> list) { return StringUtils.collectionToCommaDelimitedString(list); }
Source:
<code><START> public void writeExternal( ObjectOutput out ) throws IOException <END> { out.writeUTF( filePath ); out.writeObject( createdDate ); out.writeObject( lastModifiedDate ); out.writeObject( firstBlock ); out.writeObject( metadataMap ); out.writeObject( lockMap ); }</code><technical_language>include blockSize a field read/write in serde methods. If write a bunch of data change block size, want render blocks unreadable</technical_language>

Target:
public void writeExternal( ObjectOutput out ) throws IOException { out.writeUTF( filePath ); out.writeBoolean( directory ); out.writeObject( createdDate ); out.writeObject( lastModifiedDate ); out.writeInt( blockSize ); out.writeObject( metadataMap ); out.writeObject( lockMap ); out.writeObject( firstBlock ); }
Source:
<code>public void canFormat() { final GenieDateFormat format = new GenieDateFormat(); final Date zero = new Date(0); final StringBuffer buffer = new StringBuffer(); final FieldPosition pos = Mockito.mock(FieldPosition.class); <START> Assert.assertThat(format.format(zero, buffer, pos).toString(), Matchers.is("1970-01-01T00:00:00.000+0000")); <END> }</code><technical_language>pretty this is a breaking change. libraries Kragle I UI expect dates in previous format Z end</technical_language>

Target:
public void canFormat() { final GenieDateFormat format = new GenieDateFormat(); final Date zero = new Date(0); final StringBuffer buffer = new StringBuffer(); final FieldPosition pos = Mockito.mock(FieldPosition.class); Assert.assertThat(format.format(zero, buffer, pos).toString(), Matchers.is("1970-01-01T00:00:00.000Z")); }
Source:
<code>public final Driver newInstance( URI uri, AuthToken authToken, RoutingSettings routingSettings, RetrySettings retrySettings, Config config ) { authToken = authToken == null ? AuthTokens.none() : authToken; BoltServerAddress address = new BoltServerAddress( uri ); RoutingSettings newRoutingSettings = routingSettings.withRoutingContext( new RoutingContext( uri ) ); SecurityPlan securityPlan = createSecurityPlan( address, config ); InternalLoggerFactory.setDefaultFactory( new NettyLogging( config.logging() ) ); Bootstrap bootstrap = createBootstrap(); EventExecutorGroup eventExecutorGroup = bootstrap.config().group(); RetryLogic retryLogic = createRetryLogic( retrySettings, eventExecutorGroup, config.logging() ); InternalAbstractDriverMetrics metrics = createDriverMetrics( config ); ConnectionPool connectionPool = createConnectionPool( authToken, securityPlan, bootstrap, metrics, config ); InternalDriver driver = createDriver( uri, address, connectionPool, config, newRoutingSettings, eventExecutorGroup, securityPlan, retryLogic ); <START> driver.driverMetrics( metrics ); <END> verifyConnectivity( driver, connectionPool, config ); return driver; }</code><technical_language>nice pass metrics driver constructor avoid this setter</technical_language>

Target:
public final Driver newInstance( URI uri, AuthToken authToken, RoutingSettings routingSettings, RetrySettings retrySettings, Config config ) { authToken = authToken == null ? AuthTokens.none() : authToken; BoltServerAddress address = new BoltServerAddress( uri ); RoutingSettings newRoutingSettings = routingSettings.withRoutingContext( new RoutingContext( uri ) ); SecurityPlan securityPlan = createSecurityPlan( address, config ); InternalLoggerFactory.setDefaultFactory( new NettyLogging( config.logging() ) ); Bootstrap bootstrap = createBootstrap(); EventExecutorGroup eventExecutorGroup = bootstrap.config().group(); RetryLogic retryLogic = createRetryLogic( retrySettings, eventExecutorGroup, config.logging() ); InternalAbstractMetrics metrics = createDriverMetrics( config ); ConnectionPool connectionPool = createConnectionPool( authToken, securityPlan, bootstrap, metrics, config ); InternalDriver driver = createDriver( uri, securityPlan, address, connectionPool, eventExecutorGroup, newRoutingSettings, retryLogic, metrics, config ); verifyConnectivity( driver, connectionPool, config ); return driver; }
Source:
<code>private void getDoubleBufferGraphics( final Display display, GC gc, int minWidth, int minHeight ) { IPreferenceStore store = UiPlugin.getDefault().getPreferenceStore(); boolean useAdvancedGraphics = store.getBoolean(org.locationtech.udig.ui.preferences.PreferenceConstants.P_ADVANCED_GRAPHICS); AffineTransform viewportTrsf = this.renderManager.getMapInternal().getViewportModel().worldToScreenTransform(); if (viewportTrsf.equals(this.backBufferTrsf)) { viewportTrsf = new AffineTransform(); } else { try { viewportTrsf.concatenate(this.backBufferTrsf.createInverse()); } catch (NoninvertibleTransformException ex) { <START> System.out.println(ex); <END> viewportTrsf = new AffineTransform(); } } if ((getStyle()&SWT.DOUBLE_BUFFERED)==0){ if (buffer == null) { buffer = new Image(display, displaySize.width, displaySize.height); } ViewportGraphics swtGraphics = null; if (useAdvancedGraphics) { swtGraphics = new SWTGraphics(buffer, display); } else { swtGraphics = new NonAdvancedSWTGraphics(buffer, display); } painter.paint(swtGraphics, swtImage, viewportTrsf, minWidth, minHeight); swtGraphics.dispose(); gc.drawImage(buffer, 0, 0); }else{ ViewportGraphics swtGraphics = null; if (useAdvancedGraphics) { swtGraphics = new SWTGraphics(gc, display); } else { swtGraphics = new NonAdvancedSWTGraphics(gc, display, null); } painter.paint(swtGraphics, swtImage, viewportTrsf, minWidth, minHeight); swtGraphics.dispose(); } }</code><technical_language>Plugin.getLog().log system.out right here</technical_language>

Target:
private void getDoubleBufferGraphics( final Display display, GC gc, int minWidth, int minHeight ) { IPreferenceStore store = UiPlugin.getDefault().getPreferenceStore(); boolean useAdvancedGraphics = store.getBoolean(org.locationtech.udig.ui.preferences.PreferenceConstants.P_ADVANCED_GRAPHICS); AffineTransform viewportTrsf = getSwtImageToViewportTransform(); if ((getStyle()&SWT.DOUBLE_BUFFERED)==0){ if (buffer == null) { buffer = new Image(display, displaySize.width, displaySize.height); } ViewportGraphics swtGraphics = null; if (useAdvancedGraphics) { swtGraphics = new SWTGraphics(buffer, display); } else { swtGraphics = new NonAdvancedSWTGraphics(buffer, display); } painter.paint(swtGraphics, swtImage, viewportTrsf, minWidth, minHeight); swtGraphics.dispose(); gc.drawImage(buffer, 0, 0); }else{ ViewportGraphics swtGraphics = null; if (useAdvancedGraphics) { swtGraphics = new SWTGraphics(gc, display); } else { swtGraphics = new NonAdvancedSWTGraphics(gc, display, null); } painter.paint(swtGraphics, swtImage, viewportTrsf, minWidth, minHeight); swtGraphics.dispose(); } }
Source:
<code>public TerminalSession getTerminalAtIndex(int i) { Widget widget = terminalSessionsPanel_.getWidget(i); if (widget != null) { <START> return (TerminalSession)widget; <END> } return null; }</code><technical_language>for resiliency, consider checking instanceof dealing a TerminalSession (otherwise this throw)</technical_language>

Target:
public TerminalSession getTerminalAtIndex(int i) { Widget widget = terminalSessionsPanel_.getWidget(i); if (widget instanceof TerminalSession) { return (TerminalSession)widget; } return null; }
Source:
<code>public void setProperty(String name, String value) { <START> if (name != null && value != null) { <END> this.properties.put(name, value); } }</code><technical_language>StringUtils.isNoneBlank() is in this place, this code add keys and/or values " "</technical_language>

Target:
public void setProperty(String name, String value) { if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) { this.properties.put(name, value); } }
Source:
<code>public void onPartialResult(String text) { result = text; <START> AfterGettingText(result); <END> }</code><technical_language>While I thought this pretty cool label updated I spoke, a bit concerned apps programmed correctly for logic of AfterGettingText called multiple times call GetText. I conferred team consensus is continue AfterGettingText, add a new parameter called partial true if call is in response onPartialResult false if is called onResult. This allow developers determine app user finished speaking</technical_language>

Target:
public void onPartialResult(String text) { result = text; AfterGettingText(result, true); }
Source:
<code>public synchronized boolean record(final SAMRecord rec) { if (null == rec.getHeader() || rec.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) { <START> return record(null, 0); <END> } else { return record(rec.getReferenceName(), rec.getAlignmentStart()); } }</code><technical_language>Recommend changing this method reference name exclusively. Eg., if ( SAMRecord.NO_ALIGNMENT_REFERENCE_NAME.equals(rec.getReferenceName()) ) { return record(null, 0); } else { return record(rec.getReferenceName(), rec.getAlignmentStart()); }</technical_language>

Target:
public synchronized boolean record(final SAMRecord rec) { if (SAMRecord.NO_ALIGNMENT_REFERENCE_NAME.equals(rec.getReferenceName())) { return record(null, 0); } else { return record(rec.getReferenceName(), rec.getAlignmentStart()); } }
Source:
<code>private JobDescriptor parseJobDescriptor() { JobDescriptor jd = null; if (tokens.peek(0, TokenKind.IDENTIFIER)) { <START> if (tokens.peek(1, TokenKind.IDENTIFIER)) { <END> jd = parseJobDefinition(); } else if (tokens.peek(1, TokenKind.DOUBLE_MINUS)) { tokens.raiseException(tokens.peek(1).startpos, JobDSLMessage.MISSING_JOB_NAME_IN_INLINEJOBDEF); } else { jd = new JobReference(tokens.eat(TokenKind.IDENTIFIER)); } } if (tokens.peek(TokenKind.PIPE)) { List<Transition> transitions = parseTransitions(); jd.setTransitions(transitions); } return jd; }</code><technical_language>curious this one. Is this case 2 identifiers back. this a case enumerated identifier:jobname. If need update tokenizer support ':'</technical_language>

Target:
private JobDescriptor parseJobDescriptor() { JobDescriptor jd = null; if (tokens.peek(0, TokenKind.IDENTIFIER)) { if (tokens.peek(1, TokenKind.IDENTIFIER)) { jd = parseJobDefinition(); } else if (tokens.peek(1, TokenKind.DOUBLE_MINUS)) { tokens.raiseException(tokens.peek(1).startpos, JobDSLMessage.MISSING_JOB_NAME_IN_INLINEJOBDEF); } else { jd = new JobReference(tokens.eat(TokenKind.IDENTIFIER)); } } if (jd == null) { Token t = tokens.peek(); tokens.raiseException(t == null ? 0 : t.startpos, JobDSLMessage.EXPECTED_JOB_REF_OR_DEF); } if (tokens.peek(TokenKind.PIPE)) { List<Transition> transitions = parseTransitions(); jd.setTransitions(transitions); } return jd; }
Source:
<code>void readSha1() { <START> rev.Sha1 = bufferContents(); <END> }</code><technical_language>This breaks dumps Wikia (customized MediaWiki 1.19), add a <sha1> element in <page> in <revision>. check if in a rev ignore if in page</technical_language>

Target:
void readSha1() { String sha1 = bufferContents(); if (rev != null) { rev.Sha1 = sha1; } else if (page != null) { } else { throw new IllegalArgumentException("Unexpected <id> outside a <revision>"); } }