auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<Connection> addInternalLinks(EObject investigatedElement, List<String> selectedRelationshipTypes) { List<Connection> connections = new ArrayList<Connection>(); if (investigatedElement instanceof INamed) { INamed named = (INamed) investigatedElement; List<EObject> refs = named.eCrossReferences(); for (EObject ref : refs) { if (selectedRelationshipTypes.size() == 0 || selectedRelationshipTypes.contains(ref.eClass().getName())) { List<EObject> target = new ArrayList<>(); target.add(ref); connections.add(new Connection(investigatedElement, target, ref)); } } } return connections; }

Target:
public List<Connection> addInternalLinks(EObject investigatedElement, List<String> selectedRelationshipTypes) { List<Connection> connections = new ArrayList<Connection>(); if (investigatedElement instanceof INamed) { INamed named = (INamed) investigatedElement; if (!named.eCrossReferences().isEmpty()) { List<EObject> refs = named.eCrossReferences(); for (EObject ref : refs) { if (selectedRelationshipTypes.size() == 0 || selectedRelationshipTypes.contains(ref.eClass().getName())) { connections.add(new Connection(investigatedElement, Arrays.asList(ref), ref)); } } } } return connections; }
Source:
private void updateBiggestArmyOwner(GameUserBean gameUser, GameBean game) { int totalUsedKnights = gameUser.getAchievements().getTotalUsedKnights(); if (totalUsedKnights < 3) { return; } Integer biggestArmyOwnerId = game.getBiggestArmyOwner(); if (biggestArmyOwnerId != null) { for (GameUserBean currentGameUser : game.getGameUsers()) { if (!currentGameUser.getGameUserId().equals(biggestArmyOwnerId)) { continue; } if (currentGameUser.getAchievements().getTotalUsedKnights() >= totalUsedKnights) { return; } break; } } game.setBiggestArmyOwner(gameUser.getGameUserId()); }

Target:
private void updateBiggestArmyOwner(GameUserBean gameUser, GameBean game) { int totalUsedKnights = gameUser.getAchievements().getTotalUsedKnights(); if (totalUsedKnights >= 3 && gameUsersUsedKnightsIsTheBiggestArmy(totalUsedKnights, game)) { game.setBiggestArmyOwner(gameUser); } }
Source:
@Override public BufferedSink valueSink() throws IOException { if (promoteValueToName) { throw new IllegalStateException( "BufferedSink cannot be used as a map key in JSON at path " + getPath()); } writeDeferredName(); beforeValue(); pushScope(STREAMING_VALUE); return Okio.buffer(new Sink() { @Override public void write(Buffer source, long byteCount) throws IOException { sink.write(source, byteCount); } @Override public void close() { if (peekScope() != STREAMING_VALUE) { throw new AssertionError(); } stackSize--; pathIndices[stackSize - 1]++; } @Override public void flush() { } @Override public Timeout timeout() { return Timeout.NONE; } }); }

Target:
@Override public BufferedSink valueSink() throws IOException { if (promoteValueToName) { throw new IllegalStateException( "BufferedSink cannot be used as a map key in JSON at path " + getPath()); } writeDeferredName(); beforeValue(); pushScope(STREAMING_VALUE); return Okio.buffer(new Sink() { @Override public void write(Buffer source, long byteCount) throws IOException { sink.write(source, byteCount); } @Override public void close() { if (peekScope() != STREAMING_VALUE) { throw new AssertionError(); } stackSize--; pathIndices[stackSize - 1]++; } @Override public void flush() throws IOException { sink.flush(); } @Override public Timeout timeout() { return Timeout.NONE; } }); }
Source:
protected boolean changedDisplayName() { final String savedDisplayName = mAccount.getAccount().getDisplayName(); final String initialDisplayName = getArguments().getString(ARG_DISPLAY_NAME); return !TextUtils.equals(!TextUtils.isEmpty(savedDisplayName) ? savedDisplayName : initialDisplayName, mDisplayName); }

Target:
protected boolean changedDisplayName() { return !TextUtils.equals(mAccount.getAccount().getDisplayName(), mDisplayName); }
Source:
private void sendGroupStateChangedEvent(String memberName, State newState, State oldState) { if (eventPublisher != null && !oldGroupState.equals(this.state)) { eventPublisher.post( ItemEventFactory.createGroupStateChangedEvent(this.getName(), memberName, newState, oldState)); } }

Target:
private void sendGroupStateChangedEvent(String memberName, State newState, State oldState) { if (eventPublisher != null) { eventPublisher.post( ItemEventFactory.createGroupStateChangedEvent(this.getName(), memberName, newState, oldState)); } }
Source:
private ZapMenuItem getMenuItemJsonReport() { if (menuItemJsonReport == null) { menuItemJsonReport = new ZapMenuItem("menu.report.json.generate"); menuItemJsonReport.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { ReportLastScan report = new ReportLastScan(); report.generateReport(getView(), getModel(), ReportLastScan.ReportType.JSON); } }); } return menuItemMdReport; }

Target:
private ZapMenuItem getMenuItemJsonReport() { if (menuItemJsonReport == null) { menuItemJsonReport = new ZapMenuItem("menu.report.json.generate"); menuItemJsonReport.addActionListener(e -> new ReportLastScan().generateReport(getView(), getModel(), ReportLastScan.ReportType.JSON)); } return menuItemJsonReport; }
Source:
public <T> IBean<T> getRegisteredBean(Class<?> beanClazz) { m_lock.readLock().lock(); try { if (m_beanHierarchies.containsKey(beanClazz)) { return m_beanHierarchies.get(beanClazz).getExactBean(beanClazz); } return null; } finally { m_lock.readLock().unlock(); } }

Target:
public <T> IBean<T> getRegisteredBean(Class<?> beanClazz) { m_lock.readLock().lock(); try { BeanHierarchy h = m_beanHierarchies.get(beanClazz); if (h != null) { return h.getExactBean(beanClazz); } return null; } finally { m_lock.readLock().unlock(); } }
Source:
void checkCanEdit(QualityGateDto qualityGate) { checkNotBuiltInt(qualityGate); userSession.checkPermission(ADMINISTER_QUALITY_GATES, defaultOrganizationProvider.get().getUuid()); }

Target:
void checkCanEdit(QualityGateDto qualityGate) { checkNotBuiltIn(qualityGate); userSession.checkPermission(ADMINISTER_QUALITY_GATES, defaultOrganizationProvider.get().getUuid()); }
Source:
public static boolean UploadPersonalNotes(final OCApiConnector connector, final Geocache cache) { Log.d("Uploading personal note for opencaching"); final Parameters notesparam = new Parameters("cache_code", cache.getGeocode(), "fields", getFullFields(connector)); final ObjectNode notesdata = request(connector, OkapiService.SERVICE_CACHE, notesparam).data; String prevnote = ""; if (notesdata != null) { prevnote = notesdata.get(CACHE_MY_NOTES).asText(); } String currentnote = ""; if (cache.getPersonalNote() != null) { currentnote = cache.getPersonalNote(); } final Parameters params = new Parameters("cache_code", cache.getGeocode(), "new_value", currentnote, "old_value", prevnote); final ObjectNode data = request(connector, OkapiService.SERVICE_UPLOAD_PERSONAL_NOTE, params).data; if (data == null) { return false; } if (data.get("replaced").asBoolean()) { Log.d("Successfully uploaded"); return true; } return false; }

Target:
public static boolean UploadPersonalNotes(final OCApiConnector connector, final Geocache cache) { Log.d("Uploading personal note for opencaching"); final Parameters notesparam = new Parameters("cache_code", cache.getGeocode(), "fields", CACHE_MY_NOTES); final ObjectNode notesdata = request(connector, OkapiService.SERVICE_CACHE, notesparam).data; String prevnote = ""; if (notesdata != null && notesdata.get(CACHE_MY_NOTES) != null) { prevnote = notesdata.get(CACHE_MY_NOTES).asText(); } String currentnote = ""; if (cache.getPersonalNote() != null) { currentnote = cache.getPersonalNote(); } final Parameters params = new Parameters("cache_code", cache.getGeocode(), "new_value", currentnote, "old_value", prevnote); final ObjectNode data = request(connector, OkapiService.SERVICE_UPLOAD_PERSONAL_NOTE, params).data; if (data == null) { return false; } if (data.get("replaced").asBoolean()) { Log.d("Successfully uploaded"); return true; } return false; }
Source:
public <T> List<T> multiGet(Query query, Class<T> clazz, IndexCoordinates index) { Assert.notNull(index, "index must not be null"); Assert.notEmpty(query.getIds(), "No Id defined for Query"); MultiGetRequestBuilder builder = requestFactory.multiGetRequestBuilder(client, query, index); DocumentCallback<T> callback = new ReadDocumentCallback<>(elasticsearchConverter, clazz, index); List<Document> documents = DocumentAdapters.from(builder.execute().actionGet()); return documents.stream().map(callback::doWith).collect(Collectors.toList()); }

Target:
public <T> List<T> multiGet(Query query, Class<T> clazz, IndexCoordinates index) { Assert.notNull(index, "index must not be null"); Assert.notEmpty(query.getIds(), "No Ids defined for Query"); MultiGetRequestBuilder builder = requestFactory.multiGetRequestBuilder(client, query, index); DocumentCallback<T> callback = new ReadDocumentCallback<>(elasticsearchConverter, clazz, index); List<Document> documents = DocumentAdapters.from(builder.execute().actionGet()); return documents.stream().map(callback::doWith).collect(Collectors.toList()); }
Source:
public static Collection<Object[]> data() { Object[][] data = new Object[][] { {"sync", (Function<Transaction, Transaction>) GetSynchronousDelegate::new}, {"async", (Function<Transaction, Transaction>) GetAsyncDelegate::new} }; return Arrays.asList(data); }

Target:
public static Collection<Object[]> data() { Object[][] data = new Object[][] { {SYNC, (UnaryOperator<Transaction>) GetSynchronousDelegate::new}, {ASYNC, (UnaryOperator<Transaction>) GetAsyncDelegate::new} }; return Arrays.asList(data); }
Source:
public Where<Message, Object> modWhere(Where<Message, Object> where) throws SQLException { DateUtils.truncate(new Date(), java.util.Calendar.DAY_OF_MONTH); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY,0); calendar.set(Calendar.MINUTE,0); calendar.set(Calendar.SECOND,0); calendar.set(Calendar.MILLISECOND, 0); where.between(Message.TIMESTAMP_FIELD,calendar.getTime().getTime(),calendar.getTime().getTime()+86400000); return where; }

Target:
public Where<Message, Object> modWhere(Where<Message, Object> where) throws SQLException { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); Date fromDate = calendar.getTime(); calendar.add(Calendar.DAY_OF_MONTH, 1); Date toDate = calendar.getTime(); where.between(Message.TIMESTAMP_FIELD, fromDate, toDate); return where; }
Source:
public void testDifferentUsedCapacities() throws StoreException { blobStore.validLogSegments = generateRandomString(2); Long[] usedCapacities = new Long[]{CAPACITY_IN_BYTES * 2 / 10, (CAPACITY_IN_BYTES * 4 / 10), CAPACITY_IN_BYTES * 5 / 10}; for (Long usedCapacity : usedCapacities) { blobStore.usedCapacity = usedCapacity; verifyCompactionDetails(null); } usedCapacities = new Long[]{ CAPACITY_IN_BYTES * 51 / 100, (CAPACITY_IN_BYTES * 6 / 10), CAPACITY_IN_BYTES * 7 / 10, CAPACITY_IN_BYTES * 9 / 10}; for (Long usedCapacity : usedCapacities) { blobStore.usedCapacity = usedCapacity; verifyCompactionDetails(new CompactionDetails(blobStore.getTime().milliseconds() - messageRetentionTimeInMs, blobStore.validLogSegments)); } }

Target:
public void testDifferentUsedCapacities() throws StoreException { blobStore.validLogSegments = generateRandomStrings(2); Long[] usedCapacities = new Long[]{ CAPACITY_IN_BYTES * 2 / 10, (CAPACITY_IN_BYTES * 4 / 10), CAPACITY_IN_BYTES * 5 / 10, CAPACITY_IN_BYTES * 51 / 100, (CAPACITY_IN_BYTES * 6 / 10), CAPACITY_IN_BYTES * 7 / 10, CAPACITY_IN_BYTES * 9 / 10}; for (Long usedCapacity : usedCapacities) { blobStore.usedCapacity = usedCapacity; if (blobStore.usedCapacity < (config.storeMinUsedCapacityToTriggerCompactionInPercentage / 100.0 * blobStore.capacityInBytes)) { verifyCompactionDetails(null); } else { verifyCompactionDetails( new CompactionDetails(time.milliseconds() - messageRetentionTimeInMs, blobStore.validLogSegments)); } } }
Source:
protected void internalGenerateCpuQuota(long elapsedSeconds) { checkState(Thread.holdsLock(root), "Must hold lock to generate cpu quota"); synchronized (root) { long newQuota = saturatedMultiply(elapsedSeconds, cpuQuotaGenerationMillisPerSecond); long oldUsageMillis = cachedResourceUsage.getCpuUsageMillis(); long newCpuUsageMillis = saturatedSubtract(oldUsageMillis, newQuota); if (newCpuUsageMillis < 0 || newCpuUsageMillis == Long.MAX_VALUE) { newCpuUsageMillis = 0; } cachedResourceUsage = new ResourceUsage(newCpuUsageMillis, cachedResourceUsage.getMemoryUsageBytes()); if ((newCpuUsageMillis < hardCpuLimitMillis && oldUsageMillis >= hardCpuLimitMillis) || (newCpuUsageMillis < softCpuLimitMillis && oldUsageMillis >= softCpuLimitMillis)) { updateEligibility(); } for (InternalResourceGroup group : subGroups.values()) { group.internalGenerateCpuQuota(elapsedSeconds); } } }

Target:
protected void internalGenerateCpuQuota(long elapsedSeconds) { checkState(Thread.holdsLock(root), "Must hold lock to generate cpu quota"); synchronized (root) { long newQuota = saturatedMultiply(elapsedSeconds, cpuQuotaGenerationMillisPerSecond); long oldCpuUsageMillis = cachedResourceUsage.getCpuUsageMillis(); long newCpuUsageMillis = saturatedSubtract(oldCpuUsageMillis, newQuota); if (newCpuUsageMillis < 0 || newCpuUsageMillis == Long.MAX_VALUE) { newCpuUsageMillis = 0; } cachedResourceUsage = new ResourceUsage(newCpuUsageMillis, cachedResourceUsage.getMemoryUsageBytes()); if ((newCpuUsageMillis < hardCpuLimitMillis && oldCpuUsageMillis >= hardCpuLimitMillis) || (newCpuUsageMillis < softCpuLimitMillis && oldCpuUsageMillis >= softCpuLimitMillis)) { updateEligibility(); } for (InternalResourceGroup group : subGroups.values()) { group.internalGenerateCpuQuota(elapsedSeconds); } } }
Source:
public void shouldUploadIdentifiersFromSource() throws Exception { String uploadIdentifiers = "{\"batchSizeToUpload\": \"10\"," + "\"sourceUuid\": \""+POOL_SOURCE_UUID+"\"}"; MockHttpServletRequest getRequest = newGetRequest(getURI() + "/" + POOL_SOURCE_UUID); getRequest.addParameter("v", "custom:(identifiers)"); SimpleObject initialIdentifiers = deserialize(handle(getRequest)); assertEquals(initialIdentifiers.get("identifiers").toString(), "[]"); newPostRequest(getURI() + "/" + POOL_SOURCE_UUID, uploadIdentifiers); MockHttpServletRequest getRequestAfterPost = newGetRequest(getURI() + "/" + POOL_SOURCE_UUID); getRequestAfterPost.addParameter("v", "custom:(identifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterPost)); assertTrue(identifiersAfterUpload.get("identifiers").toString().length() > 2); }

Target:
public void shouldUploadIdentifiersFromSource() throws Exception { String uploadIdentifiers = "{\"batchSize\": \"2\"," + "\"operation\": \"uploadFromSource\"}"; MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + POOL_SOURCE_UUID, uploadIdentifiers); SimpleObject uploadResult = deserialize(handle(postRequest)); assertThat( uploadResult.toString(), containsString(POOL_SOURCE_UUID) ); MockHttpServletRequest getRequestAfterUpload = newGetRequest(getURI() + "/" + POOL_SOURCE_UUID); getRequestAfterUpload.addParameter("v", "custom:(identifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterUpload)); assertThat( identifiersAfterUpload.get("identifiers").toString(), allOf( containsString("Test Identifier Pool: G-0"), containsString("Test Identifier Pool: H-8") )); }
Source:
private List<JobID> tryExecuteJobs(final DispatcherGateway dispatcherGateway, final PackagedProgram program, final Configuration configuration) { checkState(!configuration.get(DeploymentOptions.ATTACHED)); final List<JobID> applicationJobIds = new ArrayList<>(); final PipelineExecutorServiceLoader executorServiceLoader = new EmbeddedExecutorServiceLoader(applicationJobIds, dispatcherGateway); try { ClientUtils.executeProgram(executorServiceLoader, configuration, program); } catch (ProgramInvocationException e) { LOG.warn("Could not execute application: ", e); throw new CompletionException("Could not execute application.", e); } return applicationJobIds; }

Target:
private List<JobID> tryExecuteJobs(final DispatcherGateway dispatcherGateway, final PackagedProgram program, final Configuration configuration) { configuration.set(DeploymentOptions.ATTACHED, false); final List<JobID> applicationJobIds = new ArrayList<>(); final PipelineExecutorServiceLoader executorServiceLoader = new EmbeddedExecutorServiceLoader(applicationJobIds, dispatcherGateway); try { ClientUtils.executeProgram(executorServiceLoader, configuration, program, enforceSingleJobExecution, forbidBlockingJobClient); } catch (ProgramInvocationException e) { LOG.warn("Could not execute application: ", e); throw new FlinkRuntimeException("Could not execute application.", e); } return applicationJobIds; }
Source:
public MockitoSession startMocking() { List<Object> effectiveTestClassInstances; String effectiveName; if (testClassInstances.isEmpty()) { effectiveTestClassInstances = emptyList(); effectiveName = this.name == null ? UUID.randomUUID().toString() : this.name; } else { effectiveTestClassInstances = new ArrayList<Object>(testClassInstances); Object lastTestClassInstance = testClassInstances.get(testClassInstances.size() - 1); effectiveName = this.name == null ? lastTestClassInstance.getClass().getName() : this.name; } Strictness effectiveStrictness = this.strictness == null ? Strictness.STRICT_STUBS : this.strictness; MockitoLogger logger = this.logger == null ? new ConsoleMockitoLogger() : new MockitoLoggerAdapter(this.logger); return new DefaultMockitoSession(effectiveTestClassInstances, effectiveName, effectiveStrictness, logger); }

Target:
public MockitoSession startMocking() { List<Object> effectiveTestClassInstances; String effectiveName; if (testClassInstances.isEmpty()) { effectiveTestClassInstances = emptyList(); effectiveName = this.name == null ? "<Unnamed Session>" : this.name; } else { effectiveTestClassInstances = new ArrayList<Object>(testClassInstances); Object lastTestClassInstance = testClassInstances.get(testClassInstances.size() - 1); effectiveName = this.name == null ? lastTestClassInstance.getClass().getName() : this.name; } Strictness effectiveStrictness = this.strictness == null ? Strictness.STRICT_STUBS : this.strictness; MockitoLogger logger = this.logger == null ? new ConsoleMockitoLogger() : new MockitoLoggerAdapter(this.logger); return new DefaultMockitoSession(effectiveTestClassInstances, effectiveName, effectiveStrictness, logger); }
Source:
public static Container full() { return new RunContainer(1, new short[]{0, -1, 0, 0, 0, 0, 0, 0}); }

Target:
public static Container full() { return new RunContainer(1, new short[]{0, -1}); }
Source:
protected void entryRetrieved(long entryAddress) { lruLock.lock(); try { if (trace) { log.tracef("Moving node 0x%016x to the end", entryAddress); } moveToEnd(entryAddress); super.entryRetrieved(entryAddress); } finally { lruLock.unlock(); } }

Target:
protected void entryRetrieved(long entryAddress) { lruLock.lock(); try { if (trace) { log.tracef("Moving entry 0x%016x to the end of the LRU list", entryAddress); } moveToEnd(entryAddress); super.entryRetrieved(entryAddress); } finally { lruLock.unlock(); } }
Source:
private ComponentMetric extractMetric(String componentName, Map<String, ?> componentMap) { Long inputRecords = 0L; Long outputRecords = 0L; Double processedTime = 0.0d; if (componentMap.containsKey("executed")) { Number executed = (Number) componentMap.get("executed"); inputRecords = executed.longValue(); } if (componentMap.containsKey("emitted")) { Number emitted = (Number) componentMap.get("emitted"); outputRecords = emitted.longValue(); } if (componentMap.containsKey("processLatency")) { String processLatencyStr = (String) componentMap.get("processLatency"); try { processedTime = Double.parseDouble(processLatencyStr); } catch (NumberFormatException e) { } } return new ComponentMetric(componentName, inputRecords, outputRecords, processedTime); }

Target:
private ComponentMetric extractMetric(String componentName, Map<String, ?> componentMap) { Long inputRecords = 0L; Long outputRecords = 0L; Double processedTime = 0.0d; Long failedRecords = 0L; if (componentMap.containsKey(StormMetricsConstant.COMPONENT_EXECUTED_TUPLES)) { Number executed = (Number) componentMap.get(StormMetricsConstant.COMPONENT_EXECUTED_TUPLES); inputRecords = executed.longValue(); } if (componentMap.containsKey(StormMetricsConstant.COMPONENT_EMITTED_TUPLES)) { Number emitted = (Number) componentMap.get(StormMetricsConstant.COMPONENT_EMITTED_TUPLES); outputRecords = emitted.longValue(); } if (componentMap.containsKey(StormMetricsConstant.COMPONENT_PROCESS_LATENCY)) { String processLatencyStr = (String) componentMap.get(StormMetricsConstant.COMPONENT_PROCESS_LATENCY); try { processedTime = Double.parseDouble(processLatencyStr); } catch (NumberFormatException e) { } } if (componentMap.containsKey(StormMetricsConstant.COMPONENT_FAILED_TUPLES)) { Number failed = (Number) componentMap.get(StormMetricsConstant.COMPONENT_FAILED_TUPLES); failedRecords = failed.longValue(); } return new ComponentMetric(componentName, inputRecords, outputRecords, failedRecords, processedTime); }
Source:
public boolean isSortedSelectFacet() { return facet.getType().equals(SORTED_SELECT); }

Target:
public boolean isSortedSelectFacet() { return isFacetType(SORTED_SELECT); }
Source:
protected Object doTransform(Message<?> message) { Assert.state(message.getPayload() instanceof SpecificRecordBase, "Payload must be a subclass of 'SpecificRecordBase'"); SpecificRecord specific = (SpecificRecord) message.getPayload(); ByteArrayOutputStream out = new ByteArrayOutputStream(); BinaryEncoder encoder = this.encoderFactory.directBinaryEncoder(out, null); DatumWriter<Object> writer = new SpecificDatumWriter<>(specific.getSchema()); try { writer.write(specific, encoder); encoder.flush(); } catch (IOException e) { throw new UncheckedIOException(e); } return out.toByteArray(); }

Target:
protected Object doTransform(Message<?> message) { Assert.state(message.getPayload() instanceof SpecificRecord, "Payload must be an implementation of 'SpecificRecord'"); SpecificRecord specific = (SpecificRecord) message.getPayload(); ByteArrayOutputStream out = new ByteArrayOutputStream(); BinaryEncoder encoder = this.encoderFactory.directBinaryEncoder(out, null); DatumWriter<Object> writer = new SpecificDatumWriter<>(specific.getSchema()); try { writer.write(specific, encoder); encoder.flush(); } catch (IOException e) { throw new UncheckedIOException(e); } return getMessageBuilderFactory().withPayload(out.toByteArray()) .copyHeaders(message.getHeaders()) .setHeader(AvroHeaders.TYPE, specific.getClass()) .build(); }
Source:
public Response getPayment(@ApiParam(value = "accountId", hidden = true) @Auth Account account, @PathParam("paymentId") String paymentId) { logger.info("Payment request - paymentId={}", paymentId); String url = account.getPaymentType().equals(DIRECT_DEBIT) ? connectorDDUrl : connectorUrl; UriBuilder builder = UriBuilder .fromPath(url) .path(format("/v1/api/accounts/%s/charges/%s", account.getAccountId(), paymentId)); Collections.<Pair<String, String>>emptyList().stream().forEach(pair -> { if (isNotBlank(pair.getRight())) { builder.queryParam(pair.getKey(), pair.getValue()); } }); Response connectorResponse = client .target(builder.toString()) .request() .get(); if (connectorResponse.getStatus() == SC_OK) { ChargeFromResponse chargeFromResponse = connectorResponse.readEntity(ChargeFromResponse.class); URI paymentURI = publicApiUriGenerator.getPaymentURI(baseUrl, chargeFromResponse.getChargeId()); PaymentWithAllLinks payment = PaymentWithAllLinks.getPaymentWithLinks( account.getPaymentType(), chargeFromResponse, paymentURI, publicApiUriGenerator.getPaymentEventsURI(baseUrl, chargeFromResponse.getChargeId()), publicApiUriGenerator.getPaymentCancelURI(baseUrl, chargeFromResponse.getChargeId()), publicApiUriGenerator.getPaymentRefundsURI(baseUrl, chargeFromResponse.getChargeId())); logger.info("Payment returned - [ ]", payment); return Response.ok(payment).build(); } throw new GetChargeException(connectorResponse); }

Target:
public Response getPayment(@ApiParam(value = "accountId", hidden = true) @Auth Account account, @PathParam("paymentId") String paymentId) { logger.info("Payment request - paymentId={}", paymentId); Response connectorResponse = client .target(connectorUriGenerator.chargeURI(account, paymentId)) .request() .get(); if (connectorResponse.getStatus() == SC_OK) { ChargeFromResponse chargeFromResponse = connectorResponse.readEntity(ChargeFromResponse.class); URI paymentURI = publicApiUriGenerator.getPaymentURI(chargeFromResponse.getChargeId()); PaymentWithAllLinks payment = PaymentWithAllLinks.getPaymentWithLinks( account.getPaymentType(), chargeFromResponse, paymentURI, publicApiUriGenerator.getPaymentEventsURI(chargeFromResponse.getChargeId()), publicApiUriGenerator.getPaymentCancelURI(chargeFromResponse.getChargeId()), publicApiUriGenerator.getPaymentRefundsURI(chargeFromResponse.getChargeId())); logger.info("Payment returned - [ ]", payment); return Response.ok(payment).build(); } throw new GetChargeException(connectorResponse); }
Source:
public Object resolveArtifact(EObject artifact) { ArtifactWrapper wrapper = (ArtifactWrapper) artifact; String uri = wrapper.getUri(); CapraOfficeObject object = new CapraOfficeObject(); object.setUri(uri); return object; }

Target:
public Object resolveArtifact(EObject artifact) { if (artifact instanceof ArtifactWrapper) { ArtifactWrapper wrapper = (ArtifactWrapper) artifact; String uri = wrapper.getUri(); CapraOfficeObject object = new CapraOfficeObject(); object.setUri(uri); return object; } else return null; }
Source:
public Map<String, Collection<String>> credentialTypeToParameterNames() { Map<String, Collection<String>> options = new LinkedHashMap<String, Collection<String>>(); options.put("clientCertificate", Arrays.asList("keystore", "password")); return options; }

Target:
public Map<String, Collection<String>> credentialTypeToParameterNames() { Map<String, Collection<String>> options = new LinkedHashMap<String, Collection<String>>(); options.put("clientCertificate", Arrays.asList("certificatePem", "keyPem")); return options; }
Source:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); LOG.info("Logged in " + username + " successfully!"); }

Target:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); System.out.println("Logged in " + username + " successfully!"); }
Source:
public void testCreateTableOnExistingCache() throws Exception { client().getOrCreateCache("new"); try { doTestCustomNames("new", null, null); GridTestUtils.assertThrows(null, new Callable<Object>() { @Override public Object call() throws Exception { doTestCustomNames("new", null, null); return null; } }, IgniteSQLException.class, "Table already exists: NameTest"); } finally { client().destroyCache("new"); } }

Target:
public void testCreateTableOnExistingCache() { String cacheName = "new"; try { client().getOrCreateCache(cacheName); doTestCustomNames("new", null, null); String createTemplate = "CREATE TABLE \"%s\" (id int primary key, x varchar) WITH " + "\"wrap_key,wrap_value,cache_name=%s\""; GridTestUtils.assertThrows(null, () -> { execute(client(), String.format(createTemplate, "NameTest", cacheName)); return null; }, IgniteSQLException.class, "Table already exists: NameTest"); GridTestUtils.assertThrows(null, () -> { execute(client(), String.format(createTemplate, "NameTest1", cacheName)); return null; }, IgniteSQLException.class, "Cache is already indexed: " + cacheName); } finally { client().destroyCache("new"); } }
Source:
private String wrapValueWithTypeInformation(Object object, String valueToHash) { return object.getClass().getCanonicalName() + TYPE_VALUE_DELIMITER + NESTED_HASHABLE_START + valueToHash + NESTED_HASHABLE_END; }

Target:
private String wrapValueWithTypeInformation(Object object, String valueToHash) { return String.format( CLASS_TYPE_VALUE_FORMAT_STRING, object.getClass().getCanonicalName(), valueToHash ); }
Source:
protected static void configureFhirRequest(String resourceFormat, HttpRequest request) { request.addHeader("User-Agent", "Java FHIR Client for FHIR"); LOG.info("Resource format: " + resourceFormat + ", Feed Format: " + FeedFormat.FEED_XML.getHeader()); request.addHeader("Accept", resourceFormat); request.addHeader("Accept", FeedFormat.FEED_XML.getHeader()); request.addHeader("Content-Type", ResourceFormat.RESOURCE_XML.getHeader() + ";charset=" + DEFAULT_CHARSET); request.addHeader("Accept-Charset", DEFAULT_CHARSET); }

Target:
protected static void configureFhirRequest(String resourceFormat, HttpRequest request) { request.addHeader("User-Agent", "Java FHIR Client for FHIR"); LOG.info("Resource format: " + resourceFormat + ", Feed Format: " + FeedFormat.FEED_XML.getHeader()); request.addHeader("Accept", resourceFormat + ", " + FeedFormat.FEED_XML.getHeader()); request.addHeader("Content-Type", ResourceFormat.RESOURCE_XML.getHeader() + ";charset=" + DEFAULT_CHARSET); request.addHeader("Accept-Charset", DEFAULT_CHARSET); }
Source:
public void updateEventSourceGlobally(final Map<String, String> attributes) { clearEventSourceAttributes(); for (final Map.Entry<String, String> entry : attributes.entrySet()) { if (entry.getValue() != null) { addGlobalAttribute(entry.getKey(), entry.getValue()); } } this.eventSourceAttributes = attributes; }

Target:
public void updateEventSourceGlobally(final Map<String, String> attributes) { clearEventSourceAttributes(); for (final Map.Entry<String, String> entry : attributes.entrySet()) { if (entry.getValue() != null) { addGlobalAttribute(entry.getKey(), entry.getValue()); } } eventSourceAttributes.putAll(attributes); }
Source:
public void testReplicationFailure() throws Exception { controlledRpcManager.failFor(VersionedPrepareCommand.class); try { TransactionManager tm = cache(0).getAdvancedCache().getTransactionManager(); tm.begin(); cache(0).put("k0", "v"); try { tm.commit(); AssertJUnit.fail(); } catch (RollbackException e) { } } finally { controlledRpcManager.stopFailing(); } }

Target:
public void testReplicationFailure() throws Exception { controlledRpcManager.failFor(VersionedPrepareCommand.class); try { TransactionManager tm = cache(0).getAdvancedCache().getTransactionManager(); tm.begin(); cache(0).put("k0", "v"); Exceptions.expectException(RollbackException.class, tm::commit); } finally { controlledRpcManager.stopFailing(); } }
Source:
static String from(final ServerError serverError) { final String message = serverError.getMessage(); if (message != null && message.matches(AUTH_ERROR_PATTERN)) { final int code = Integer.parseInt(message.substring(CODE_START_POSITION)); if (code < 1 || code > AUTH_MESSAGES.length) { return message; } return AUTH_MESSAGES[code - 1]; } return message; }

Target:
static String from(final ServerError serverError) { final String message = serverError.getMessage(); return StringUtils.defaultString(AUTH_DICT.get(message), message); }
Source:
protected boolean isWsAgentRequest(String url) { WorkspaceImpl currentWorkspace = appContext.getWorkspace(); if (currentWorkspace == null || !isWsAgentStarted(currentWorkspace)) { return false; } final boolean contains = url.contains(nullToEmpty(appContext.getWsAgentServerApiEndpoint())); return contains; }

Target:
protected boolean isWsAgentRequest(String url) { WorkspaceImpl currentWorkspace = appContext.getWorkspace(); if (currentWorkspace == null || !isWsAgentStarted(currentWorkspace)) { return false; } return url.contains(nullToEmpty(appContext.getWsAgentServerApiEndpoint())); }
Source:
private ThresholdingSession getSessionForAgent(CollectionAgent agent, RrdRepository repository) throws ThresholdInitializationException { if (thresholdingService == null) { isThresholdingEnabled = false; throw new ThresholdInitializationException("No ThresholdingService available. No future Threshholding will be done"); } int nodeId = agent.getNodeId(); String hostAddress = agent.getHostAddress(); String serviceName = adapterConfig.getName(); String sessionKey = getSessionKey(nodeId, hostAddress, serviceName); ThresholdingSession session = agentThresholdingSessions.asMap().get(sessionKey); if (session == null) { session = thresholdingService.createSession(nodeId, hostAddress, serviceName, repository, EMPTY_SERVICE_PARAMETERS); agentThresholdingSessions.put(sessionKey, session); } return session; }

Target:
private ThresholdingSession getSessionForAgent(CollectionAgent agent, RrdRepository repository) throws ThresholdInitializationException { if (thresholdingService == null) { isThresholdingEnabled.set(false); throw new ThresholdInitializationException("No ThresholdingService available. No future Threshholding will be done"); } int nodeId = agent.getNodeId(); String hostAddress = agent.getHostAddress(); String serviceName = adapterConfig.getName(); String sessionKey = getSessionKey(nodeId, hostAddress, serviceName); ThresholdingSession session = agentThresholdingSessions.getIfPresent(sessionKey); if (session == null) { session = thresholdingService.createSession(nodeId, hostAddress, serviceName, repository, EMPTY_SERVICE_PARAMETERS); agentThresholdingSessions.put(sessionKey, session); } return session; }
Source:
private void setXsrfCookie(String cookieName) throws GerritLoginException { Optional<Cookie> cookie = Arrays.stream(httpClient.getState().getCookies()) .filter(c -> cookieName.equals(c.getName())) .findFirst(); cookie.ifPresent(this::setXsrfCookie); cookie.orElseThrow(() -> new GerritLoginException()); }

Target:
private void setXsrfCookie(String cookieName) throws GerritLoginException { Optional<Cookie> cookie = findCookieWithName(cookieName, httpClient); cookie.ifPresent(this::setXsrfCookie); cookie.orElseThrow(() -> new GerritLoginException()); }
Source:
public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(LIT, (meta >> 3) == 1); }

Target:
public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(LIT, (meta == 1)); }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if (!(obj instanceof CompactConfig)) { return false; } CompactConfig that = (CompactConfig) obj; return mInputPartitionInfo.equals(that.mInputPartitionInfo) && mInput.equals(that.mInput) && mOutput.equals(that.mOutput) && mMaxNumFiles == that.mMaxNumFiles && mMinFileSize == that.mMinFileSize; }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if (!(obj instanceof CompactConfig)) { return false; } CompactConfig that = (CompactConfig) obj; return mInputPartitionInfo.equals(that.mInputPartitionInfo) && mOutputPartitionInfo.equals(that.mOutputPartitionInfo) && mInput.equals(that.mInput) && mOutput.equals(that.mOutput) && mMaxNumFiles == that.mMaxNumFiles && mMinFileSize == that.mMinFileSize; }
Source:
void release() { if (mSurface == null && mSurfaceTexture == null) { return; } Resource resource; synchronized (mLock) { resource = mResourceMap.get(mSurfaceTexture); } if (resource != null) { releaseResourceWhenDetached(resource); } mSurfaceTexture = null; mSurface = null; if (!mSurfaceToReleaseList.isEmpty()) { for (Surface surface : mSurfaceToReleaseList) { surface.release(); } mSurfaceToReleaseList.clear(); } }

Target:
void release() { if (mSurface == null && mSurfaceTexture == null) { return; } Resource resource; synchronized (mLock) { resource = mResourceMap.get(mSurfaceTexture); } if (resource != null) { releaseResourceWhenDetached(resource); } mSurfaceTexture = null; mSurface = null; for (Surface surface : mSurfaceToReleaseList) { surface.release(); } mSurfaceToReleaseList.clear(); }
Source:
public Entry(@JsonProperty("message") String message, @JsonProperty("nanos") long nanos, @JsonProperty("threadName") String threadName) { this.message = message; this.nanos = nanos; this.threadName = threadName; }

Target:
public Entry(@JsonProperty("message") String message, @JsonProperty("nanos") long nanos, @JsonProperty("threadName") String threadName) { this.message = requireNonNull(message, "messsage is null"); this.nanos = nanos; this.threadName = threadName; }
Source:
public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() { Map<NamespaceAndUseCase, SequenceBounds> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap(); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences); List<HistoryQuery> historyQueries = getHistoryQueryListForRemoteServers(lastVerifiedSequences); List<PaxosHistoryOnRemote> rawHistoryFromAllRemotes = getHistoriesFromRemoteServers(historyQueries); List<ConsolidatedPaxosHistoryOnSingleNode> historyFromAllRemotes = buildHistoryFromRemoteResponses(rawHistoryFromAllRemotes); List<CompletePaxosHistoryForNamespaceAndUseCase> completeHistoryList = consolidateAndGetHistoriesAcrossAllNodes( lastVerifiedSequences, localPaxosHistory, historyFromAllRemotes); progressTracker.updateProgressState(lastVerifiedSequences); return completeHistoryList; }

Target:
public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() { Map<NamespaceAndUseCase, HistoryQuerySequenceBounds> namespaceAndUseCaseWiseSequenceRangeToBeVerified = getNamespaceAndUseCaseToHistoryQuerySeqBoundsMap(); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(namespaceAndUseCaseWiseSequenceRangeToBeVerified); List<HistoryQuery> historyQueries = getHistoryQueryListForRemoteServers(namespaceAndUseCaseWiseSequenceRangeToBeVerified); List<PaxosHistoryOnRemote> rawHistoryFromAllRemotes = getHistoriesFromRemoteServers(historyQueries); List<ConsolidatedPaxosHistoryOnSingleNode> historyFromAllRemotes = buildHistoryFromRemoteResponses(rawHistoryFromAllRemotes); List<CompletePaxosHistoryForNamespaceAndUseCase> completeHistoryList = consolidateAndGetHistoriesAcrossAllNodes( namespaceAndUseCaseWiseSequenceRangeToBeVerified, localPaxosHistory, historyFromAllRemotes); progressTracker.updateProgressState(namespaceAndUseCaseWiseSequenceRangeToBeVerified); return completeHistoryList; }
Source:
LeaseCoordinator(ILeaseManager<T> leaseManager, String workerIdentifier, long leaseDurationMillis, long epsilonMillis, int maxLeasesForWorker, int maxLeasesToStealAtOneTime, int maxLeaseRenewerThreadCount, IMetricsFactory metricsFactory) { this(leaseManager, getDefaultLeaseSelector(), workerIdentifier, leaseDurationMillis, epsilonMillis, maxLeasesForWorker, maxLeasesToStealAtOneTime, maxLeaseRenewerThreadCount, metricsFactory); }

Target:
public LeaseCoordinator(ILeaseManager<T> leaseManager, String workerIdentifier, long leaseDurationMillis, long epsilonMillis, int maxLeasesForWorker, int maxLeasesToStealAtOneTime, int maxLeaseRenewerThreadCount, IMetricsFactory metricsFactory) { this(leaseManager, getDefaultLeaseSelector(), workerIdentifier, leaseDurationMillis, epsilonMillis, maxLeasesForWorker, maxLeasesToStealAtOneTime, maxLeaseRenewerThreadCount, metricsFactory); }
Source:
public void addInformation(@Nonnull ItemStack stack, @Nonnull EntityPlayer playerIn, @Nonnull List<String> tooltip, boolean advanced) { super.addInformation(stack, playerIn, tooltip, advanced); if(!stack.hasTagCompound()) { return; } NBTTagCompound tag = stack.getTagCompound().getCompoundTag(TileTable.FEET_TAG); ItemStack legs = ItemStack.loadItemStackFromNBT(tag); if(legs != null && legs.getItem() != null) { tooltip.add(legs.getDisplayName()); } if(stack.getTagCompound().hasKey("inventory")) { NBTTagCompound inventory = stack.getTagCompound().getCompoundTag("inventory"); if (!inventory.hasKey("Items")) { return; } NBTTagList items = inventory.getTagList("Items", 10); if (BlockToolTable.TableTypes.fromMeta(stack.getItemDamage()) == BlockToolTable.TableTypes.PatternChest) { boolean holdsCasts = false; for (int i = 0; i < items.tagCount(); ++i) { Item item = ItemStack.loadItemStackFromNBT(items.getCompoundTagAt(i)).getItem(); if (item instanceof ICast || item instanceof IPattern) { holdsCasts = (item instanceof ICast); break; } } if (holdsCasts) { tooltip.addAll(LocUtils.getTooltips(Util.translateFormatted("tooltip.patternchest.holds_casts", items.tagCount()))); } else { tooltip.addAll(LocUtils.getTooltips(Util.translateFormatted("tooltip.patternchest.holds_patterns", items.tagCount()))); } } else { tooltip.addAll(LocUtils.getTooltips(Util.translateFormatted("tooltip.chest.has_items", items.tagCount()))); } } }

Target:
public void addInformation(@Nonnull ItemStack stack, @Nonnull EntityPlayer playerIn, @Nonnull List<String> tooltip, boolean advanced) { super.addInformation(stack, playerIn, tooltip, advanced); if(!stack.hasTagCompound()) { return; } NBTTagCompound tag = stack.getTagCompound().getCompoundTag(TileTable.FEET_TAG); ItemStack legs = ItemStack.loadItemStackFromNBT(tag); if(legs != null && legs.getItem() != null) { tooltip.add(legs.getDisplayName()); } if(stack.getTagCompound().hasKey("inventory")) { this.addInventoryInformation(stack, playerIn, tooltip, advanced); } }
Source:
private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { Map<TmfEventTableColumn , String> itemStrings = new HashMap<>(); for (TableColumn viewColumn : fTable.getColumns()) { TmfEventTableColumn column = columns.get((int) viewColumn.getData(Key.INDEX)); ITmfEvent passedEvent = event; if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) { passedEvent = ((CachedEvent) event).event; } if (passedEvent == null || (!viewColumn.getResizable() && viewColumn.getWidth() == 0)) { itemStrings.put(column ,EMPTY_STRING); } else { itemStrings.put(column ,column.getItemString(passedEvent)); } } String[] displayStrings = new String[columns.size()]; int i = 0; for (TmfEventTableColumn column : columns) { displayStrings[i] = itemStrings.get(column); i++; } return displayStrings; } }

Target:
private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { Map<TmfEventTableColumn, String> itemStrings = new HashMap<>(); for (TableColumn viewColumn : fTable.getColumns()) { TmfEventTableColumn column = fColumns.get((int) viewColumn.getData(Key.INDEX)); ITmfEvent passedEvent = event; if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) { passedEvent = ((CachedEvent) event).event; } if (passedEvent == null || (!viewColumn.getResizable() && viewColumn.getWidth() == 0)) { itemStrings.put(column, EMPTY_STRING); } else { itemStrings.put(column, column.getItemString(passedEvent)); } } String[] displayStrings = new String[columns.size()]; int i = 0; for (TmfEventTableColumn column : columns) { displayStrings[i] = itemStrings.get(column); i++; } return displayStrings; } }
Source:
protected void initImportClonedTemplateDisks() { for (DiskImage image : getImages()) { if (Guid.isNullOrEmpty(image.getStoragePoolId())) { image.setStoragePoolId(getStoragePoolId()); } List<StorageDomain> storageDomainList = storageDomainDao.getAllStorageDomainsByImageId(image.getImageId()); getParameters().setSourceDomainId(storageDomainList.get(0).getId()); updateDiskSizeByQcowImageInfo(image); if (getParameters().isImportAsNewEntity()) { generateNewDiskId(image); updateManagedDeviceMap(image, getVmTemplate().getManagedDeviceMap()); } else { originalDiskIdMap.put(image.getId(), image.getId()); originalDiskImageIdMap.put(image.getId(), image.getImageId()); } } }

Target:
protected void initImportClonedTemplateDisks() { for (DiskImage image : getImages()) { if (Guid.isNullOrEmpty(image.getStoragePoolId())) { image.setStoragePoolId(getStoragePoolId()); } List<StorageDomain> storageDomainList = storageDomainDao.getAllStorageDomainsByImageId(image.getImageId()); if (!validateSourceStorageDomainPerImage(storageDomainList)) { getParameters().setSourceDomainId(storageDomainList.get(0).getId()); } updateDiskSizeByQcowImageInfo(image); if (getParameters().isImportAsNewEntity()) { generateNewDiskId(image); updateManagedDeviceMap(image, getVmTemplate().getManagedDeviceMap()); } else { originalDiskIdMap.put(image.getId(), image.getId()); originalDiskImageIdMap.put(image.getId(), image.getImageId()); } } }
Source:
protected boolean mergeImpl() throws IOException { boolean implicitDirCache = false; if (dircache == null) { dircache = getRepository().lockDirCache(); implicitDirCache = true; } try { builder = dircache.builder(); DirCacheBuildIterator buildIt = new DirCacheBuildIterator(builder); tw = new NameConflictTreeWalk(db); tw.reset(); tw.addTree(mergeBase()); tw.addTree(sourceTrees[0]); tw.addTree(sourceTrees[1]); tw.addTree(buildIt); if (workingTreeIt != null) tw.addTree(workingTreeIt); while (tw.next()) { if (!processEntry( tw.getTree(T_BASE, CanonicalTreeParser.class), tw.getTree(T_OURS, CanonicalTreeParser.class), tw.getTree(T_THEIRS, CanonicalTreeParser.class), tw.getTree(T_INDEX, DirCacheBuildIterator.class), (workingTreeIt == null) ? null : tw.getTree(T_FILE, WorkingTreeIterator.class))) { if (!inCore) cleanUp(); return false; } if (tw.isSubtree() && enterSubtree) tw.enterSubtree(); } if (!inCore) { if (!builder.commit()) { cleanUp(); throw new IndexWriteException(); } builder = null; checkout(); } else { builder.finish(); builder = null; } if (getUnmergedPathes().isEmpty()) { resultTree = dircache.writeTree(oi); return true; } else { resultTree = null; return false; } } finally { if (implicitDirCache) dircache.unlock(); } }

Target:
protected boolean mergeImpl() throws IOException { boolean implicitDirCache = false; if (dircache == null) { dircache = getRepository().lockDirCache(); implicitDirCache = true; } try { builder = dircache.builder(); DirCacheBuildIterator buildIt = new DirCacheBuildIterator(builder); tw = new NameConflictTreeWalk(db); tw.reset(); tw.addTree(mergeBase()); tw.addTree(sourceTrees[0]); tw.addTree(sourceTrees[1]); tw.addTree(buildIt); if (workingTreeIt != null) tw.addTree(workingTreeIt); while (tw.next()) { if (!processEntry( tw.getTree(T_BASE, CanonicalTreeParser.class), tw.getTree(T_OURS, CanonicalTreeParser.class), tw.getTree(T_THEIRS, CanonicalTreeParser.class), tw.getTree(T_INDEX, DirCacheBuildIterator.class), (workingTreeIt == null) ? null : tw.getTree(T_FILE, WorkingTreeIterator.class))) { cleanUp(); return false; } if (tw.isSubtree() && enterSubtree) tw.enterSubtree(); } if (!inCore) { if (!builder.commit()) { cleanUp(); throw new IndexWriteException(); } builder = null; checkout(); } else { builder.finish(); builder = null; } if (getUnmergedPathes().isEmpty()) { resultTree = dircache.writeTree(oi); return true; } else { resultTree = null; return false; } } finally { if (implicitDirCache) dircache.unlock(); } }
Source:
public static boolean isSupportedMimetype(String mimetype) { boolean supported = true; if ("audio/L24".equalsIgnoreCase(mimetype) || "video/vnd.dlna.mpeg-tts".equalsIgnoreCase(mimetype) || "video/mpeg2".equalsIgnoreCase(mimetype) || "audio/vnd.dlna.adts".equals(mimetype) ) supported = false; return supported; }

Target:
public static boolean isSupportedMimetype(String mimetype) { boolean supported = true; if ("audio/L24".equalsIgnoreCase(mimetype) || "video/vnd.dlna.mpeg-tts".equalsIgnoreCase(mimetype) || "video/mpeg2".equalsIgnoreCase(mimetype) || "audio/vnd.dlna.adts".equalsIgnoreCase(mimetype) ) supported = false; return supported; }