auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { Date start = new Date(System.currentTimeMillis()); ContentCachingRequestWrapper wrappedRequest = getWrappedRequest(request); ContentCachingResponseWrapper wrappedResponse = getWrappedResponse(response); filterChain.doFilter(wrappedRequest, wrappedResponse); if (restLoggerEnabled) { Date end = new Date(System.currentTimeMillis()); String log = new StringBuilder() .append(appendLine(RestLoggerField.START_TIME, formatter.format(start))) .append(appendLine(RestLoggerField.END_TIME, formatter.format(end))) .append(appendLine(RestLoggerField.DURATION, Math.abs(end.getTime() - start.getTime()) + " ms")) .append(appendLine(RestLoggerField.HTTP_METHOD, request.getMethod())) .append(appendLine(RestLoggerField.PATH, request.getRequestURI())) .append(appendLine(RestLoggerField.QUERY_STRING, request.getQueryString())) .append(appendLine(RestLoggerField.CLIENT_IP, request.getRemoteAddr())) .append(appendLine(RestLoggerField.REQUEST, logContent(wrappedRequest.getContentAsByteArray(), request.getCharacterEncoding()))) .append(appendLine(RestLoggerField.RESPONSE_STATUS, String.valueOf(response.getStatus()))) .append(appendLine(RestLoggerField.RESPONSE, logContent(wrappedResponse.getContentAsByteArray(), request.getCharacterEncoding()))) .toString(); logger.debug(log); } wrappedResponse.copyBodyToResponse(); }

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { Date start = new Date(System.currentTimeMillis()); ContentCachingRequestWrapper wrappedRequest = getWrappedRequest(request); ContentCachingResponseWrapper wrappedResponse = getWrappedResponse(response); filterChain.doFilter(wrappedRequest, wrappedResponse); if (restLoggerEnabled) { DateFormat formatter = new SimpleDateFormat("HH:mm:ss.SSS"); formatter.setTimeZone(TimeZone.getTimeZone("UTC")); Date end = new Date(System.currentTimeMillis()); String log = new StringBuilder() .append(appendLine(RestLoggerField.START_TIME, formatter.format(start))) .append(appendLine(RestLoggerField.END_TIME, formatter.format(end))) .append(appendLine(RestLoggerField.DURATION, Math.abs(end.getTime() - start.getTime()) + " ms")) .append(appendLine(RestLoggerField.HTTP_METHOD, request.getMethod())) .append(appendLine(RestLoggerField.PATH, request.getRequestURI())) .append(appendLine(RestLoggerField.QUERY_STRING, request.getQueryString())) .append(appendLine(RestLoggerField.CLIENT_IP, request.getRemoteAddr())) .append(appendLine(RestLoggerField.REQUEST, logContent(wrappedRequest.getContentAsByteArray(), request.getCharacterEncoding()))) .append(appendLine(RestLoggerField.RESPONSE_STATUS, String.valueOf(response.getStatus()))) .append(appendLine(RestLoggerField.RESPONSE, logContent(wrappedResponse.getContentAsByteArray(), request.getCharacterEncoding()))) .toString(); LOGGER.debug(log); } wrappedResponse.copyBodyToResponse(); }
Source:
private XmlObject extractChildElement(XmlInputStream in, TypeMapper typeMapper) throws ConnectionException { XmlObject child; QName xsiType = typeMapper.getXsiType(in); if (xsiType == null) { child = new XmlObject(); } else if (xsiType.getLocalPart().equals("QueryResult") && !in.getName().equals("QueryResult")) { child = new XmlObject(); } else { Class<?> childClass = typeMapper.getJavaType(xsiType); if (childClass == null || !XMLizable.class.isAssignableFrom(childClass)) { child = new XmlObject(); } else { XMLizable xmlizable; try { xmlizable = (XMLizable)childClass.newInstance(); if (xmlizable instanceof XmlObject) { child = (XmlObject) xmlizable; } else { child = new XmlObjectWrapper(xmlizable); } } catch (InstantiationException e) { throw new ConnectionException("Failed to create object", e); } catch (IllegalAccessException e) { throw new ConnectionException("Failed to create object", e); } catch (ClassCastException e) { child = new XmlObject(); } } } return child; }

Target:
private XmlObject extractChildElement(XmlInputStream in, TypeMapper typeMapper) throws ConnectionException { XmlObject child; QName xsiType = typeMapper.getXsiType(in); if (xsiType == null) { child = new XmlObject(); } else if (xsiType.getLocalPart().equals("QueryResult") && !in.getName().equals("QueryResult")) { child = new XmlObject(); } else { Class<?> childClass = typeMapper.getJavaType(xsiType); if (childClass == null || !XMLizable.class.isAssignableFrom(childClass)) { child = new XmlObject(); } else { XMLizable xmlizable; try { xmlizable = (XMLizable)childClass.newInstance(); if (xmlizable instanceof XmlObject) { child = (XmlObject) xmlizable; } else { child = new XmlObjectWrapper(xmlizable); } } catch (InstantiationException e) { throw new ConnectionException("Failed to create object", e); } catch (IllegalAccessException e) { throw new ConnectionException("Failed to create object", e); } } } return child; }
Source:
public int getScorerPriority() { return 2; }

Target:
public int getScorerPriority() { return 50; }
Source:
public void testDataStreamNotRestoredWhenIndexRequested() throws Exception { Client client = client(); Path location = randomRepoPath(); createRepository("repo", "fs", location); DataStreamIT.createIndexTemplate("t1", "@timestamp", "ds", "other-ds"); CreateDataStreamAction.Request request = new CreateDataStreamAction.Request("ds"); AcknowledgedResponse response = client.admin().indices().createDataStream(request).get(); assertTrue(response.isAcknowledged()); CreateSnapshotResponse createSnapshotResponse = client.admin().cluster() .prepareCreateSnapshot("repo", "snap2") .setWaitForCompletion(true) .setIndices("ds") .setIncludeGlobalState(false) .get(); RestStatus status = createSnapshotResponse.getSnapshotInfo().status(); assertEquals(RestStatus.OK, status); assertTrue(client.admin().indices().deleteDataStream(new DeleteDataStreamAction.Request("ds")).get().isAcknowledged()); RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster() .prepareRestoreSnapshot("repo", "snap2") .setWaitForCompletion(true) .setIndices(".ds-ds-*") .get(); assertEquals(RestStatus.OK, restoreSnapshotResponse.status()); GetDataStreamAction.Request getRequest = new GetDataStreamAction.Request("ds"); Throwable e = expectThrows(ExecutionException.class, () -> client.admin().indices().getDataStreams(getRequest).get()).getCause(); if (e instanceof RemoteTransportException) { e = e.getCause(); } assertEquals(ResourceNotFoundException.class, e.getClass()); }

Target:
public void testDataStreamNotRestoredWhenIndexRequested() throws Exception { CreateSnapshotResponse createSnapshotResponse = client.admin().cluster() .prepareCreateSnapshot(REPO, "snap2") .setWaitForCompletion(true) .setIndices("ds") .setIncludeGlobalState(false) .get(); RestStatus status = createSnapshotResponse.getSnapshotInfo().status(); assertEquals(RestStatus.OK, status); assertTrue(client.admin().indices().deleteDataStream(new DeleteDataStreamAction.Request("ds")).get().isAcknowledged()); RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster() .prepareRestoreSnapshot(REPO, "snap2") .setWaitForCompletion(true) .setIndices(".ds-ds-*") .get(); assertEquals(RestStatus.OK, restoreSnapshotResponse.status()); GetDataStreamAction.Request getRequest = new GetDataStreamAction.Request("ds"); expectThrows(ResourceNotFoundException.class, () -> client.admin().indices().getDataStreams(getRequest).actionGet()); }
Source:
public void onDestroy() { db.close(); }

Target:
public void onDestroy() { }
Source:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar.addAction(PlaylistService.ACTION_PLAYLIST_UPDATED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { updatePlaylist(); } }) .addAction(PlaylistService.ACTION_SONG_REMOVED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { SongMetadata entry = intent.getParcelableExtra(PlaylistService.EXTRA_SONG); Toaster.iToast(getActivity(), "\"" + entry.getTitle() + "\" has been removed."); } }) .register(this.getActivity()); }

Target:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar.addAction(PlaylistService.ACTION_PLAYLIST_UPDATED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { updatePlaylist(); } }) .addAction(PlaylistService.ACTION_SONG_REMOVED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { SongMetadata entry = intent.getParcelableExtra(PlaylistService.EXTRA_SONG); Toaster.iToast(getActivity(), getString(R.string.removed_label) + "\"" + entry.getTitle() + "\""); } }) .register(this.getActivity()); }
Source:
public void zkConnectionPolicy_Standard() throws Exception { mCluster = MultiProcessCluster.newBuilder(PortCoordination.ZOOKEEPER_CONNECTION_POLICY_STANDARD) .setClusterName("ZookeeperConnectionPolicy_Standard") .setNumMasters(2) .setNumWorkers(1) .addProperty(PropertyKey.ZOOKEEPER_LEADER_CONNECTION_ERROR_POLICY, "STANDARD") .addProperty(PropertyKey.MASTER_JOURNAL_TYPE, JournalType.UFS.toString()) .build(); mCluster.start(); int leaderIdx = getPrimaryMasterIndex(); mCluster.restartZk(); int leaderIdx2 = getPrimaryMasterIndex(); assertNotEquals(leaderIdx, leaderIdx2); mCluster.notifySuccess(); }

Target:
public void zkConnectionPolicy_Standard() throws Exception { mCluster = MultiProcessCluster.newBuilder(PortCoordination.ZOOKEEPER_CONNECTION_POLICY_STANDARD) .setClusterName("ZookeeperConnectionPolicy_Standard") .setNumMasters(2) .setNumWorkers(0) .addProperty(PropertyKey.ZOOKEEPER_LEADER_CONNECTION_ERROR_POLICY, "STANDARD") .addProperty(PropertyKey.MASTER_JOURNAL_TYPE, JournalType.UFS.toString()) .build(); mCluster.start(); int leaderIdx = getPrimaryMasterIndex(); mCluster.restartZk(); int leaderIdx2 = getPrimaryMasterIndex(); assertNotEquals(leaderIdx, leaderIdx2); mCluster.notifySuccess(); }
Source:
public void putStack(@Nonnull ItemStack stack) { if (stack.isEmpty()) { return; } super.putStack(stack); if (stack.getItem() instanceof IItemEmc) { IItemEmc itemEmc = ((IItemEmc) stack.getItem()); long remainingEmc = itemEmc.getMaximumEmc(stack) - (int) Math.ceil(itemEmc.getStoredEmc(stack)); if (inv.provider.getEmc() >= remainingEmc) { itemEmc.addEmc(stack, remainingEmc); inv.removeEmc(remainingEmc); } else { itemEmc.addEmc(stack, inv.provider.getEmc()); inv.removeEmc(inv.provider.getEmc()); } } if (EMCHelper.doesItemHaveEmc(stack)) { inv.handleKnowledge(stack.copy()); } }

Target:
public void putStack(@Nonnull ItemStack stack) { if (stack.isEmpty()) { return; } super.putStack(stack); if (stack.getItem() instanceof IItemEmc) { IItemEmc itemEmc = ((IItemEmc) stack.getItem()); long remainingEmc = itemEmc.getMaximumEmc(stack) - (long) Math.ceil(itemEmc.getStoredEmc(stack)); if (inv.provider.getEmc() >= remainingEmc) { itemEmc.addEmc(stack, remainingEmc); inv.removeEmc(remainingEmc); } else { itemEmc.addEmc(stack, inv.provider.getEmc()); inv.removeEmc(inv.provider.getEmc()); } } if (EMCHelper.doesItemHaveEmc(stack)) { inv.handleKnowledge(stack.copy()); } }
Source:
public MiniSet(Collection<T> entries) { int size = entries.size(); if (size == 0) { } else if (size == 1) { holder = entries.iterator().next(); if (holder == null) throw new IllegalArgumentException(); type = Type.SINGLE; } else if (size < ARRAY_SIZE) { Object[] array = new Object[ARRAY_SIZE]; Iterator<T> iterator = entries.iterator(); for (int i = 0; i < ARRAY_SIZE && iterator.hasNext(); ++i) { T entry = iterator.next(); if (entry == null) throw new IllegalArgumentException(); array[i] = entry; } holder = array; type = Type.ARRAY; } else { Map<T, Object> map = new HashMap<>(); for (T entry : entries) { if (entry == null) throw new IllegalArgumentException(); map.put(entry, DUMMY); } holder = map; type = Type.MAP; } }

Target:
public MiniSet(Collection<T> entries) { int size = entries.size(); if (size == 0) { } else if (size == 1) { holder = entries.iterator().next(); if (holder == null) throw new IllegalArgumentException(); type = Type.SINGLE; } else if (size < ARRAY_SIZE) { holder = new Object[ARRAY_SIZE]; type = Type.ARRAY; addAll(entries); } else { Map<T, Object> map = new HashMap<>(); for (T entry : entries) { if (entry == null) throw new IllegalArgumentException(); map.put(entry, DUMMY); } holder = map; type = Type.MAP; } }
Source:
public FileText getFileText() { FileText result = null; if (fileText != null) { result = new FileText(fileText); } return result; }

Target:
public FileText getFileText() { return fileText; }
Source:
public void run() { if (!_active) { _active = true; _activityHandler.activated(); } final Runnable runnable = _queue.poll(); _pendingCount.get(); try { runnable.run(); } finally { if (_pendingCount.get() == 1) { _active = false; _activityHandler.deactivated(); } if (_pendingCount.decrementAndGet() > 0) { tryExecuteLoop(); } } }

Target:
public void run() { final Runnable runnable = _queue.poll(); try { runnable.run(); if (_pendingCount.get() == 1) { _deactivationListener.deactivated(); } } finally { if (_pendingCount.decrementAndGet() > 0) { tryExecuteLoop(); } } }
Source:
private ControlPointControlImpl.StunnerControlPointsAcceptor createStunnerControlPointsAcceptor(ControlPointControl controlPointControl) { Function<String, Edge> connectorSupplier = uuid -> uuid.equals(EDGE_UUID) ? edge : null; ; return new ControlPointControlImpl.StunnerControlPointsAcceptor(controlPointControl, connectorSupplier); }

Target:
private ControlPointControlImpl.StunnerControlPointsAcceptor createStunnerControlPointsAcceptor(ControlPointControl controlPointControl) { Function<String, Edge> connectorSupplier = uuid -> uuid.equals(EDGE_UUID) ? edge : null; return new ControlPointControlImpl.StunnerControlPointsAcceptor(controlPointControl, connectorSupplier); }
Source:
public void onSensorChanged(SensorEvent sensorEvent) { if (sensorEvent.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { accelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); accelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); accelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_LINEAR_ACCELERATION) { linAccelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); linAccelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); linAccelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_GYROSCOPE) { gyroscopeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); gyroscopeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); gyroscopeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { magneticJsonObject.addProperty(X_KEY, sensorEvent.values[0]); magneticJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); magneticJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) { attitudeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); attitudeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); attitudeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); if (sensorEvent.values.length > 3) { attitudeJsonObject.addProperty(W_KEY, sensorEvent.values[3]); } } }

Target:
public void onSensorChanged(SensorEvent sensorEvent) { switch (sensorEvent.sensor.getType()) { case Sensor.TYPE_ACCELEROMETER: accelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); accelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); accelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_LINEAR_ACCELERATION: linAccelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); linAccelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); linAccelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_GYROSCOPE: gyroscopeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); gyroscopeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); gyroscopeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_MAGNETIC_FIELD: magneticJsonObject.addProperty(X_KEY, sensorEvent.values[0]); magneticJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); magneticJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_ROTATION_VECTOR: attitudeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); attitudeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); attitudeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); if (sensorEvent.values.length > 3) { attitudeJsonObject.addProperty(W_KEY, sensorEvent.values[3]); } break; } }
Source:
public OrderedListAssert containsExactly(Object... expected) { if ( ignoringNullPosition ) { Assertions.assertThat( actual ).hasSize( expected.length ); List<Object> actualWithoutNull = removeNulls( actual ); List<Object> excpectedWithoutNull = removeNulls( Arrays.asList( expected ) ); Assertions.assertThat( actualWithoutNull ).isEqualTo( excpectedWithoutNull ); } else { super.containsExactly( expected ); } return this; }

Target:
public OrderedListAssert containsExactly(Object... expected) { if ( ignoringNullPosition ) { Assertions.assertThat( actual ).hasSize( expected.length ); List<Object> actualWithoutNull = trimNull( actual ); List<Object> expectedWithoutNull = trimNull( Arrays.asList( expected ) ); Assertions.assertThat( actualWithoutNull ).isEqualTo( expectedWithoutNull ); if ( actual.size() > 1 && actualWithoutNull.size() > 0 ) { if ( actual.get( 0 ) == null && actual.get( actual.size() - 1 ) == null ) { throw failure( "Null order should be consistent: " + actual ); } } } else { super.containsExactly( expected ); } return this; }
Source:
private Account.Id getSubmitter(Change c) { ChangeApproval submitter = null; try { final List<ChangeApproval> approvals = schema.changeApprovals().byChange(c.getId()).toList(); final FunctionState fs = new FunctionState(c, approvals); for (ChangeApproval a : approvals) { if (a.getValue() > 0 && ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { if (submitter == null || a.getGranted().compareTo(submitter.getGranted()) > 0) { submitter = a; } } } } catch (OrmException e) { } return submitter != null ? submitter.getAccountId() : null; }

Target:
private Account.Id getSubmitter(Change c) { ChangeApproval submitter = null; try { final List<ChangeApproval> approvals = schema.changeApprovals().byChange(c.getId()).toList(); for (ChangeApproval a : approvals) { if (a.getValue() > 0 && ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { if (submitter == null || a.getGranted().compareTo(submitter.getGranted()) > 0) { submitter = a; } } } } catch (OrmException e) { } return submitter != null ? submitter.getAccountId() : null; }
Source:
public void testFileWithEmptyDirectory() throws Exception { Path tempDir = Files.createTempDirectory("dockerDirectoryEmptySubdirectory"); tempDir.toFile().deleteOnExit(); assertThat(new File(tempDir.toFile(), "emptySubDir").mkdir(), is(true)); try (CompressedDirectory dir = CompressedDirectory.create(tempDir); BufferedInputStream fileIn = new BufferedInputStream(Files.newInputStream(dir.file())); GzipCompressorInputStream gzipIn = new GzipCompressorInputStream(fileIn); TarArchiveInputStream tarIn = new TarArchiveInputStream(gzipIn)) { final List<String> names = new ArrayList<>(); TarArchiveEntry entry; while ((entry = tarIn.getNextTarEntry()) != null) { final String name = entry.getName(); names.add(name); } assertThat(names, containsInAnyOrder("emptySubDir/")); } }

Target:
public void testFileWithEmptyDirectory() throws Exception { Path tempDir = Files.createTempDirectory("dockerDirectoryEmptySubdirectory"); tempDir.toFile().deleteOnExit(); assertThat(new File(tempDir.toFile(), "emptySubDir").mkdir(), is(true)); try (CompressedDirectory dir = CompressedDirectory.create(tempDir); BufferedInputStream fileIn = new BufferedInputStream(Files.newInputStream(dir.file())); GzipCompressorInputStream gzipIn = new GzipCompressorInputStream(fileIn); TarArchiveInputStream tarIn = new TarArchiveInputStream(gzipIn)) { final List<String> names = new ArrayList<>(); TarArchiveEntry entry; while ((entry = tarIn.getNextTarEntry()) != null) { final String name = entry.getName(); names.add(name); } assertThat(names, contains("emptySubDir/")); } }
Source:
public void testCRAMRecordWriter() throws Exception { final String cramOutFileName = "/tmp/cramout.cram"; final Path out = new Path("file://" + cramOutFileName); final SamReader samReader = SamReaderFactory.makeDefault().referenceSequence(new File(reference)).open(new File(input)); final SAMFileHeader header = samReader.getFileHeader(); final KeyIgnoringCRAMOutputFormat<NullWritable> cramOut = new KeyIgnoringCRAMOutputFormat<NullWritable>(); cramOut.setWriteHeader(false); cramOut.setSAMHeader(header); RecordWriter<NullWritable, SAMRecordWritable> rw = cramOut.getRecordWriter(taskAttemptContext, out); int expectedCount = 0; for (final SAMRecord r : samReader) { final SAMRecordWritable samRW = new SAMRecordWritable(); samRW.set(r); rw.write(null, samRW); expectedCount++; } samReader.close(); rw.close(taskAttemptContext); final ReferenceSource refSource = new ReferenceSource(Paths.get(reference)); final int actualCount = verifyContainerStream(new File(cramOutFileName), header, refSource); assertEquals(expectedCount, actualCount); }

Target:
public void testCRAMRecordWriter() throws Exception { final File outFile = File.createTempFile("testCRAMWriter", ".cram"); outFile.deleteOnExit(); final Path outPath = new Path(outFile.toURI()); final KeyIgnoringCRAMOutputFormat<NullWritable> cramOut = new KeyIgnoringCRAMOutputFormat<NullWritable>(); cramOut.setWriteHeader(false); RecordWriter<NullWritable, SAMRecordWritable> rw = cramOut.getRecordWriter(taskAttemptContext, outPath); final SamReader samReader = SamReaderFactory.makeDefault() .referenceSequence(new File(testReferenceFileName)) .open(new File(testCRAMFileName)); for (final SAMRecord r : samReader) { final SAMRecordWritable samRW = new SAMRecordWritable(); samRW.set(r); rw.write(null, samRW); } samReader.close(); rw.close(taskAttemptContext); final int actualCount = verifyCRAMContainerStream( new File(outFile.getAbsolutePath()), samFileHeader, testReferenceSource); assertEquals(expectedRecordCount, actualCount); }
Source:
protected PluginConfiguration(Path location) { if(Files.exists(location)) { try { this.prefs = new PreferencesHandler(location.toString()) {}; } catch (ConfigurationException e) { throw Throwables.propagate(e); } } else { this.prefs = null; } addDefault(SystemPreference.HEAP_SIZE, DEFAULT_HEAP_SIZE_IN_BYTES); addDefault(SystemPreference.LOG_LEVEL, Level.INFO.levelStr); addDefault(SystemPreference.ALIASES, Lists.newLinkedList()); }

Target:
protected PluginConfiguration(Path location) { if(Files.exists(location)) { try { this.prefs = new PreferencesHandler(location.toString()) {}; } catch (ConfigurationException e) { throw Throwables.propagate(e); } } else { this.prefs = null; } addDefault(SystemPreference.HEAP_SIZE, DEFAULT_HEAP_SIZE_IN_BYTES); addDefault(SystemPreference.LOG_LEVEL, Level.INFO.levelStr); }
Source:
public Map<String, MetricPlotDTOs> createTaskPlots() { sessionId = getSessionIdProvider().getSessionId(); List<MetricPointEntity> metricDetails = getHibernateTemplate().find( "select m from MetricPointEntity m where m.metricDescription.taskData.sessionId=?", sessionId); if (metricDetails == null || metricDetails.isEmpty()) { return oldWay(); } else { return newWay(metricDetails); } }

Target:
private Map<String, MetricPlotDTOs> createTaskPlots() { List<MetricPointEntity> metricDetails = getHibernateTemplate().find( "select m from MetricPointEntity m where m.metricDescription.taskData.sessionId=?", sessionId); if (metricDetails == null || metricDetails.isEmpty()) { return oldWay(); } else { return newWay(metricDetails); } }
Source:
@Override void addHostData(VoltTableRow row) throws IOException { assert(row.getString("TABLE").equals(getTableName())); checkSiteConsistency(row); m_hostsWithThisTable.add((int) row.getLong("CURRENT_HOST_ID")); }

Target:
void addHostData(VoltTableRow row) throws IOException { assert(row.getString("TABLE").equals(getTableName())); checkSiteConsistency(row); m_hostsWithThisTable.add((int) row.getLong("CURRENT_HOST_ID")); }
Source:
public Response getRegistryEntryByUuid(String registryId, String entryId, MessageContext messageContext) { EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryEntry endpointRegistryEntry = null; try { endpointRegistryEntry = registryProvider.getEndpointRegistryEntryByUUID(entryId); if (endpointRegistryEntry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry entry with the id: " + entryId + " is not found", log); } } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while fetching endpoint registry entry: " + registryId, e, log); } return Response.ok().entity(EndpointRegistryMappingUtils.fromRegistryEntryToDTO(endpointRegistryEntry)) .build(); }

Target:
public Response getRegistryEntryByUuid(String registryId, String entryId, MessageContext messageContext) { EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryEntry endpointRegistryEntry = null; try { endpointRegistryEntry = registryProvider.getEndpointRegistryEntryByUUID(registryId, entryId); if (endpointRegistryEntry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry entry with the id: " + entryId + " is not found", log); } } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while fetching endpoint registry entry: " + entryId, e, log); } return Response.ok().entity(EndpointRegistryMappingUtils.fromRegistryEntryToDTO(endpointRegistryEntry)) .build(); }
Source:
public static RemoteTimelockServiceAdapter create(TimelockRpcClient rpcClient, String timelockNamespace) { return create(new NamespaceAwareTimelockRpcClient(rpcClient, timelockNamespace)); }

Target:
public static RemoteTimelockServiceAdapter create(TimelockRpcClient rpcClient, String timelockNamespace) { return create(new NamespacedTimelockRpcClient(rpcClient, timelockNamespace)); }
Source:
@Test public void testSelectNullWithInsert() { String query = "insert into " + "\"account\"(\"account_id\",\"account_parent\",\"account_type\",\"account_rollup\")" + " select 1, cast(NULL AS INT), cast(123 as varchar), cast(123 as varchar)"; final String expected = "INSERT INTO \"foodmart\".\"account\" (\"account_id\", \"account_parent\", \"account_description\", " + "\"account_type\", \"account_rollup\", \"Custom_Members\")\n" + "(SELECT 1 AS \"account_id\", CAST(NULL AS INTEGER) AS \"account_parent\", CAST(NULL AS VARCHAR(30) CHARACTER SET " + "\"ISO-8859-1\") AS \"account_description\", '123' AS \"account_type\", '123' AS \"account_rollup\", CAST(NULL AS VARCHAR" + "(255) CHARACTER SET \"ISO-8859-1\") AS \"Custom_Members\"\n" + "FROM (VALUES (0)) AS \"t\" (\"ZERO\"))"; sql(query).ok(expected); sql(expected).exec(); }

Target:
@Test public void testSelectNullWithInsert() { String query = "insert into " + "\"account\"(\"account_id\",\"account_parent\",\"account_type\",\"account_rollup\")" + " select 1, cast(NULL AS INT), cast(123 as varchar), cast(123 as varchar)"; final String expected = "INSERT INTO \"foodmart\".\"account\" (" + "\"account_id\", \"account_parent\", \"account_description\", " + "\"account_type\", \"account_rollup\", \"Custom_Members\")\n" + "(SELECT 1 AS \"account_id\", CAST(NULL AS INTEGER) AS \"account_parent\"," + " CAST(NULL AS VARCHAR(30) CHARACTER SET " + "\"ISO-8859-1\") AS \"account_description\", '123' AS \"account_type\", " + "" + "'123' AS \"account_rollup\", CAST(NULL AS VARCHAR" + "(255) CHARACTER SET \"ISO-8859-1\") AS \"Custom_Members\"\n" + "FROM (VALUES (0)) AS \"t\" (\"ZERO\"))"; sql(query).ok(expected); sql(expected).exec(); }
Source:
public Set<String> getExchangeBoundQueueNames(String exchangeName) throws JMSException { List<Map<String, Object>> mm = runQuery("_schema_id", singularMap("_class_name", "binding")); Set<String> result = new HashSet<String>(); for (Map<String, Object> res : mm) { if (extractValue(res, "_values", "exchangeRef", "_object_name") .equals("org.apache.qpid.broker:exchange:" + exchangeName)) { result.add(QpidQmf.<String>extractValue(res, "_values", "queueRef", "_object_name")); } } return result; }

Target:
private Set<String> getExchangeBoundQueueNames(String exchangeName) throws JMSException { List<Map<String, Object>> mm = runQuery("_schema_id", singularMap("_class_name", "binding")); Set<String> result = new HashSet<String>(); for (Map<String, Object> res : mm) { if (extractValue(res, "_values", "exchangeRef", "_object_name") .equals("org.apache.qpid.broker:exchange:" + exchangeName)) { result.add(QpidQmf.<String>extractValue(res, "_values", "queueRef", "_object_name")); } } return result; }
Source:
public <T> int getStart(int pStart, int pEnd, int currentRowIdx, @Nullable Comparator<T> cmp, List<T> rows) { if (pStart == currentRowIdx) { return pStart; } else { if (cmp != null) { return findFirstPreviousPeer(rows, currentRowIdx, cmp); } else { return currentRowIdx; } } }

Target:
public <T> int getStart(int pStart, int pEnd, int currentRowIdx, @Nullable Comparator<T> cmp, List<T> rows) { return pStart; }
Source:
public SeekableByteArrayInputStream(byte[] buf, int maxOffset) { Objects.requireNonNull(buf, "bug argument was null"); this.buffer = buf; this.cur = 0; this.max = maxOffset; }

Target:
public SeekableByteArrayInputStream(byte[] buf, int maxOffset) { requireNonNull(buf, "bug argument was null"); this.buffer = buf; this.cur = 0; this.max = maxOffset; }
Source:
String getValue() { return value; }

Target:
public String getValue() { return value; }
Source:
public static IDefaultLanguage getDefaultLanguage(Element context) { IDefaultLanguage language = null; try { IDefaultLanguageService service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, context); Element root = iterate(context, Element::getOwner).filter(e -> e.getOwner() == null).findFirst().get(); language = service.getActiveDefaultLanguage(root); } catch (ServiceException e) { org.eclipse.papyrusrt.umlrt.core.Activator.log.error(e); } return language; }

Target:
public static IDefaultLanguage getDefaultLanguage(Element context) { IDefaultLanguage language = null; try { IDefaultLanguageService service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, context); language = service.getActiveDefaultLanguage(context); } catch (ServiceException e) { org.eclipse.papyrusrt.umlrt.core.Activator.log.error(e); } return language; }
Source:
private EObject findSemanticRoot(final Resource res) { EObject root = res.getContents().get(0); EClass eClass = root.eClass(); ExtendedMetaData extendedMetaData = BasicExtendedMetaData.INSTANCE; if (extendedMetaData.isDocumentRoot(eClass)) { EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eClass); EReference xsiSchemaLocationFeature = extendedMetaData.getXSISchemaLocationMapFeature(eClass); EAttribute mixedFeatureFeature = extendedMetaData.getMixedFeature(eClass); for (int featureID = 0; featureID < eClass.getFeatureCount(); featureID++) { EStructuralFeature feature = eClass.getEStructuralFeature(featureID); if (feature != mixedFeatureFeature && feature != xmlnsPrefixMapFeature && feature != xsiSchemaLocationFeature) { Object obj = root.eGet(feature); if (obj instanceof EObject) { root = (EObject) obj; break; } } } } return root; }

Target:
private EObject findSemanticRoot(final Resource res) { EObject root = res.getContents().get(0); EClass eClass = root.eClass(); ExtendedMetaData extendedMetaData = ExtendedMetaData.INSTANCE; if (extendedMetaData.isDocumentRoot(eClass)) { EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eClass); EReference xsiSchemaLocationFeature = extendedMetaData.getXSISchemaLocationMapFeature(eClass); EAttribute mixedFeatureFeature = extendedMetaData.getMixedFeature(eClass); for (int featureID = 0; featureID < eClass.getFeatureCount(); featureID++) { EStructuralFeature feature = eClass.getEStructuralFeature(featureID); if (feature != mixedFeatureFeature && feature != xmlnsPrefixMapFeature && feature != xsiSchemaLocationFeature) { Object obj = root.eGet(feature); if (obj instanceof EObject) { root = (EObject) obj; break; } } } } return root; }
Source:
public List<Class> detectClasses(Object document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(document instanceof String || document instanceof ObjectNode); mapper = new StreamsJacksonMapper(Lists.newArrayList(StreamsTwitterMapper.TWITTER_FORMAT)); ObjectNode objectNode; try { if( document instanceof String ) objectNode = mapper.readValue((String)document, ObjectNode.class); else objectNode = (ObjectNode) document; } catch (IOException e) { e.printStackTrace(); return null; } List<Class> classList = Lists.newArrayList(); if( objectNode.findValue("retweeted_status") != null && objectNode.get("retweeted_status") != null) classList.add(Retweet.class); else if( objectNode.findValue("delete") != null ) classList.add(Delete.class); else if( objectNode.findValue("friends") != null || objectNode.findValue("friends_str") != null ) classList.add(FriendList.class); else if( objectNode.findValue("target_object") != null ) classList.add(UserstreamEvent.class); else if ( objectNode.findValue("location") != null && objectNode.findValue("user") == null) classList.add(User.class); else classList.add(Tweet.class); return classList; }

Target:
public List<Class> detectClasses(Object document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(document instanceof String || document instanceof ObjectNode); mapper = new StreamsJacksonMapper(Lists.newArrayList(StreamsTwitterMapper.TWITTER_FORMAT)); ObjectNode objectNode; try { if( document instanceof String ) objectNode = mapper.readValue((String)document, ObjectNode.class); else if( document instanceof ObjectNode ) objectNode = (ObjectNode) document; else return Lists.newArrayList(); } catch (IOException e) { return Lists.newArrayList(); } List<Class> classList = Lists.newArrayList(); if( objectNode.findValue("retweeted_status") != null && objectNode.get("retweeted_status") != null) classList.add(Retweet.class); else if( objectNode.findValue("delete") != null ) classList.add(Delete.class); else if( objectNode.findValue("friends") != null || objectNode.findValue("friends_str") != null ) classList.add(FriendList.class); else if( objectNode.findValue("target_object") != null ) classList.add(UserstreamEvent.class); else if ( objectNode.findValue("location") != null && objectNode.findValue("user") == null) classList.add(User.class); else classList.add(Tweet.class); return classList; }
Source:
public final void addOp(Operation op) { try { if (!authLatch.await(1, TimeUnit.SECONDS)) { op.cancel("auth has taken more than one second to complete"); getLogger().warn( "Operation canceled because authentication " + "or reconnection and authentication has " + "taken more than one second to complete."); getLogger().debug("Canceled operation %s", op.toString()); return; } if(!inputQueue.offer(op, opQueueMaxBlockTime, TimeUnit.MILLISECONDS)) { throw new IllegalStateException("Timed out waiting to add " + op + "(max wait=" + opQueueMaxBlockTime + "ms)"); } addOpCount += 1; } catch(InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("Interrupted while waiting to add " + op); } }

Target:
public final void addOp(Operation op) { try { if (!authLatch.await(1, TimeUnit.SECONDS)) { op.cancel("authentication timeout"); getLogger().warn( "Operation canceled because authentication " + "or reconnection and authentication has " + "taken more than one second to complete."); getLogger().debug("Canceled operation %s", op.toString()); return; } if(!inputQueue.offer(op, opQueueMaxBlockTime, TimeUnit.MILLISECONDS)) { throw new IllegalStateException("Timed out waiting to add " + op + "(max wait=" + opQueueMaxBlockTime + "ms)"); } addOpCount += 1; } catch(InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("Interrupted while waiting to add " + op); } }
Source:
private List<String> getMatchedDCAgainstRegex(List<String> scopes, String regex) { Set<String> DC = new HashSet<String>(); Matcher m; for(String currentScope: scopes) { m = Pattern.compile(regex).matcher(currentScope); while (m.find()) DC.add(m.group().substring(1, m.group().length() - 1).toUpperCase()); } if (DC.size() > 0) return new ArrayList<>(DC); else return null; }

Target:
private List<String> getMatchedDCAgainstRegex(List<String> scopes, String regex) { Set<String> DC = new HashSet<String>(); Matcher m; for(String currentScope: scopes) { m = Pattern.compile(regex).matcher(currentScope); while (m.find()) DC.add(m.group().substring(1, m.group().length() - 1).toUpperCase()); } return new ArrayList<>(DC); }
Source:
public void execute(TmfView view) { ITmfZoomToSelectionProvider provider = view.getAdapter(ITmfZoomToSelectionProvider.class); if (provider != null) { TmfTraceManager manager = TmfTraceManager.getInstance(); TmfTimeRange selection = manager.getCurrentTraceContext().getSelectionRange(); ITmfTrace activeTrace = manager.getActiveTrace(); if (activeTrace != null && !selection.getEndTime().equals(selection.getStartTime())) { activeTrace.broadcast(new TmfWindowRangeUpdatedSignal(this, selection)); } } }

Target:
public void execute(TmfView view) { ITmfZoomToSelectionProvider provider = view.getAdapter(ITmfZoomToSelectionProvider.class); if (provider != null) { provider.zoomToSelection(); } }
Source:
public void onEvent(BrokerEvent event) { if (!workspaceId.equals(event.getWorkspaceId())) { return; } switch (event.getStatus()) { case DONE: finishFuture.complete(event.getTooling()); break; case FAILED: InfrastructureException ex = new InfrastructureException("Broker process failed with error: " + event.getError()); startFuture.completeExceptionally(ex); finishFuture.completeExceptionally(ex); break; case STARTED: startFuture.complete(null); break; default: } }

Target:
public void onEvent(BrokerEvent event) { if (!workspaceId.equals(event.getWorkspaceId())) { return; } switch (event.getStatus()) { case DONE: List<ChePlugin> tooling = event.getTooling(); if (tooling != null) { finishFuture.complete(tooling); } else { finishFuture.completeExceptionally( new InternalInfrastructureException( format( "Plugin brokering process for workspace `%s` is finished but plugins list is missing", workspaceId))); } break; case FAILED: finishFuture.completeExceptionally( new InfrastructureException( format( "Plugin broking process for workspace %s failed with error: %s", workspaceId, event.getError()))); break; case STARTED: default: } }
Source:
public File gitPrefix() { Holder<File> p = gitPrefix; if (p == null) { String overrideGitPrefio = System.getProperty("jgit.gitprefix"); if (overrideGitPrefio != null) p = new Holder<File>(new File(overrideGitPrefio)); else p = new Holder<File>(discoverGitPrefix()); gitPrefix = p; } return p.value; }

Target:
public File gitPrefix() { Holder<File> p = gitPrefix; if (p == null) { String overrideGitPrefix = System.getProperty("jgit.gitprefix"); if (overrideGitPrefix != null) p = new Holder<File>(new File(overrideGitPrefix)); else p = new Holder<File>(discoverGitPrefix()); gitPrefix = p; } return p.value; }
Source:
private void scrollToTop_feedbackEditPage_scrolledCorrectly() { String duration = "400"; JavascriptExecutor javascriptExecutor = (JavascriptExecutor) browser.driver; javascriptExecutor.executeScript(SCROLL_TO_POSITION_SCRIPT, 0, duration); ThreadHelper.waitFor(400); assertEquals((long) 0, javascriptExecutor.executeScript(VERTICAL_SCROLL_VALUE)); }

Target:
private void scrollToTop_feedbackEditPage_scrolledCorrectly() { int scrollPos = 0; String duration = "400"; JavascriptExecutor javascriptExecutor = (JavascriptExecutor) browser.driver; javascriptExecutor.executeScript(SCROLL_TO_POSITION_SCRIPT, scrollPos, duration); ThreadHelper.waitFor(400); assertEquals((long) 0, javascriptExecutor.executeScript(VERTICAL_SCROLL_VALUE)); }
Source:
public void addInstructions(CodeWriter code) throws CodegenException { if (mth.contains(AType.JADX_ERROR) || mth.contains(AFlag.INCONSISTENT_CODE) || mth.getRegion() == null) { code.startLine(" "); code.startLine("throw new UnsupportedOperationException(\"Method not decompiled: ") .add(mth.getParentClass().getPackage()) .add(".") .add(mth.getAlias()) .add("(") .add(Utils.listToString(mth.getMethodInfo().getArgumentsTypes())) .add("):") .add(mth.getMethodInfo().getReturnType().toString()) .add("\");"); } else { RegionGen regionGen = new RegionGen(this); regionGen.makeRegion(code, mth.getRegion()); } }

Target:
public void addInstructions(CodeWriter code) throws CodegenException { if (mth.contains(AType.JADX_ERROR) || mth.contains(AFlag.INCONSISTENT_CODE) || mth.getRegion() == null) { code.startLine(" "); ClassInfo clsAlias = mth.getParentClass().getAlias(); code.startLine("throw new UnsupportedOperationException(\"Method not decompiled: ") .add(clsAlias.makeFullClsName(clsAlias.getShortName(), true)) .add(".") .add(mth.getAlias()) .add("(") .add(Utils.listToString(mth.getMethodInfo().getArgumentsTypes())) .add("):") .add(mth.getMethodInfo().getReturnType().toString()) .add("\");"); } else { RegionGen regionGen = new RegionGen(this); regionGen.makeRegion(code, mth.getRegion()); } }
Source:
protected CacheEntry<K, C> getNextFromIterator() { CacheEntry<K, V> returnedEntry = null; CacheEntry<K, V> entry; while (returnedEntry == null && !contextEntries.isEmpty() && (entry = contextEntries.remove(0)) != null) { seenContextKeys.add(entry.getKey()); if (!ctx.isEntryRemovedInContext(entry.getKey()) && !entry.isNull()) { returnedEntry = filterEntry(entry); } } if (returnedEntry == null) { while (realIterator.hasNext()) { CacheEntry<K, V> iteratedEntry = realIterator.next(); CacheEntry contextEntry; if ((contextEntry = ctx.lookupEntry(iteratedEntry.getKey())) != null) { if (seenContextKeys.add(contextEntry.getKey()) && !contextEntry.isRemoved() && (returnedEntry = filterEntry(contextEntry)) != null) { break; } } else { return (CacheEntry<K, C>) iteratedEntry; } } } if (returnedEntry == null) { for (CacheEntry lookedUpEntry : ctx.getLookedUpEntries().values()) { if (seenContextKeys.add(lookedUpEntry.getKey()) && !lookedUpEntry.isRemoved() && !lookedUpEntry.isNull()) { if (returnedEntry == null) { returnedEntry = lookedUpEntry; } else { contextEntries.add(lookedUpEntry); } } } } if (returnedEntry != null && converter != null) { C newValue = converter.convert(returnedEntry.getKey(), returnedEntry.getValue(), returnedEntry.getMetadata()); returnedEntry = entryFactory.create(returnedEntry); returnedEntry.setValue((V) newValue); } return (CacheEntry<K, C>) returnedEntry; }

Target:
protected CacheEntry<K, C> getNextFromIterator() { CacheEntry<K, V> returnedEntry = null; CacheEntry<K, V> entry; while (returnedEntry == null && !contextEntries.isEmpty() && (entry = contextEntries.remove(0)) != null) { seenContextKeys.add(entry.getKey()); if (!ctx.isEntryRemovedInContext(entry.getKey()) && !entry.isNull()) { returnedEntry = filterEntry(entry); } } if (returnedEntry == null) { while (realIterator.hasNext()) { CacheEntry<K, V> iteratedEntry = realIterator.next(); CacheEntry contextEntry; if ((contextEntry = ctx.lookupEntry(iteratedEntry.getKey())) != null) { if (seenContextKeys.add(contextEntry.getKey()) && !contextEntry.isRemoved() && !contextEntry.isNull() && (returnedEntry = filterEntry(contextEntry)) != null) { break; } } else { return (CacheEntry<K, C>) iteratedEntry; } } } if (returnedEntry == null) { for (CacheEntry lookedUpEntry : ctx.getLookedUpEntries().values()) { if (seenContextKeys.add(lookedUpEntry.getKey()) && !lookedUpEntry.isRemoved() && !lookedUpEntry.isNull()) { if (returnedEntry == null) { returnedEntry = lookedUpEntry; } else { contextEntries.add(lookedUpEntry); } } } } if (returnedEntry != null && converter != null) { C newValue = converter.convert(returnedEntry.getKey(), returnedEntry.getValue(), returnedEntry.getMetadata()); returnedEntry = entryFactory.create(returnedEntry); returnedEntry.setValue((V) newValue); } return (CacheEntry<K, C>) returnedEntry; }
Source:
private Resource handleFileProtocol(String fileURL) { File file; if (fileURL.startsWith(FileSystem.FILE_PROTOCOL_AND_CONF)) { file = new File(directoryProvider.getConfDirectory() + "/" + fileURL.substring(FileSystem.FILE_PROTOCOL_AND_CONF.length())); } else if (fileURL.startsWith(FileSystem.FILE_PROTOCOL_AND_VAR)) { file = new File(directoryProvider.getVarDirectory() + "/" + fileURL.substring(FileSystem.FILE_PROTOCOL_AND_VAR.length())); } else if (fileURL.startsWith(FileSystem.FILE_PROTOCOL_ABSOLUTE)) { file = new File(directoryProvider.getAbsoluteDirectory() + fileURL.substring(FileSystem.FILE_PROTOCOL_ABSOLUTE.length())); } else { file = new File(directoryProvider.getRootDirectory() + "/" + fileURL.substring(FileSystem.FILE_PROTOCOL.length())); } return new FileSystemResource(file); }

Target:
private Resource handleFileProtocol(String fileURL) { File file = interpretPath(fileURL); return new FileSystemResource(file); }
Source:
public int getId(String value) { if (value == null) { return -1; } final Integer id = falseIds.get(value); return id == null ? -1 : id; }

Target:
public int getId(String value) { if (value == null) { value = ""; } final Integer id = falseIds.get(value); return id == null ? -1 : id; }
Source:
public GoGoDuck(Catalog catalog, String profile, String subset, String outputFile, String format, GoGoDuckConfig goGoDuckConfig) { this.profile = profile; this.subset = subset; this.outputFile = new File(outputFile).toPath(); this.format = format; this.limit = goGoDuckConfig.getFileLimit(); this.baseTmpDir = new File(System.getProperty("java.io.tmpdir")).toPath(); this.userLog = new UserLog(); this.indexReader = new FeatureSourceIndexReader(this.userLog, catalog); this.goGoDuckConfig = goGoDuckConfig; Map<String, String> urlMangling = new HashMap<>(); urlMangling.put(goGoDuckConfig.getUrlSubstitutionKey(), goGoDuckConfig.getUrlSubstitutionValue()); this.urlMangler = new URLMangler(urlMangling); }

Target:
public GoGoDuck(Catalog catalog, String profile, String subset, String outputFile, String format, GoGoDuckConfig goGoDuckConfig) { this.profile = profile; this.subset = subset; this.outputFile = new File(outputFile).toPath(); this.format = format; this.limit = goGoDuckConfig.getFileLimit(); this.baseTmpDir = new File(System.getProperty("java.io.tmpdir")).toPath(); this.userLog = new UserLog(); this.indexReader = new FeatureSourceIndexReader(this.userLog, catalog); this.goGoDuckConfig = goGoDuckConfig; setUrlMangler(profile, goGoDuckConfig); }
Source:
public void afterMethod() throws Exception { for (String db : _allDBs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); } _allDBs.clear(); Thread.sleep(100); ZkHelixClusterVerifier _clusterVerifier = new StrictMatchExternalViewVerifier.Builder(CLUSTER_NAME).setZkAddr(ZK_ADDR) .setDeactivatedNodeAwareness(true).setResources(_allDBs) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); try { Assert.assertTrue(_clusterVerifier.verifyByPolling()); } finally { _clusterVerifier.close(); } Assert.assertEquals( _gSetupTool.getClusterManagementTool().getResourcesInCluster(CLUSTER_NAME).size(), 0); Assert.assertTrue(_assignmentMetadataStore.getBestPossibleAssignment().isEmpty()); Assert.assertTrue(_assignmentMetadataStore.getBaseline().isEmpty()); }

Target:
public void afterMethod() throws Exception { for (String db : _allDBs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); } _allDBs.clear(); ZkHelixClusterVerifier _clusterVerifier = new StrictMatchExternalViewVerifier.Builder(CLUSTER_NAME).setZkAddr(ZK_ADDR) .setDeactivatedNodeAwareness(true).setResources(_allDBs) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); try { Assert.assertTrue(_clusterVerifier.verifyByPolling()); } finally { _clusterVerifier.close(); } Assert.assertEquals( _gSetupTool.getClusterManagementTool().getResourcesInCluster(CLUSTER_NAME).size(), 0); Assert.assertTrue(_assignmentMetadataStore.getBestPossibleAssignment().isEmpty()); Assert.assertTrue(_assignmentMetadataStore.getBaseline().isEmpty()); }
Source:
protected void configureModule() { add( StatusAction.class, ApplyLicenseAction.class, PreviewAction.class, EditionsWs.class, UninstallAction.class); }

Target:
protected void configureModule() { add( StatusAction.class, ApplyLicenseAction.class, PreviewAction.class, FormDataAction.class, UninstallAction.class, EditionsWs.class); }