auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addNode(@Nullable Long parentId, long id, V value) { if (parentId != null && parentId.equals(id)) return; Node<V> node = new Node<V>().value(value); if (parentId == null && rootNode == null) { rootNode = node; } else { idToNode.put(id, node); idToParent.put(id, parentId); } }

Target:
public boolean addNode(@Nullable Long parentId, long id, V value) { if (parentId == null) { if (rootId != null) { if (logger.isLoggable(FINE)) { logger.fine(format( "attributing span missing parent to root: traceId=%s, rootSpanId=%s, spanId=%s", traceId, toLowerHex(rootId), toLowerHex(id))); } } else { rootId = id; } } else if (parentId == id) { if (logger.isLoggable(FINE)) { logger.fine( format("skipping circular dependency: traceId=%s, spanId=%s", traceId, toLowerHex(id))); } return false; } Node<V> node = new Node<V>().value(value); if (parentId == null && rootNode == null) { rootNode = node; rootId = id; } else { idToNode.put(id, node); idToParent.put(id, parentId); } return true; }
Source:
public FilterTreeManager(String filterString, SCIMResourceTypeSchema schema) throws IOException { this.schema = schema; input = new StreamTokenizer(new StringReader(filterString)); input.resetSyntax(); input.wordChars('a', 'z'); input.wordChars('A', 'Z'); input.wordChars(128 + 32, 255); input.whitespaceChars(0, ' '); input.commentChar('/'); input.quoteChar('"'); input.quoteChar('\''); input.wordChars('@', '@'); input.wordChars(':', ':'); input.wordChars('_', '_'); input.wordChars('0', '9'); input.wordChars('-', '-'); input.wordChars('+', '+'); input.wordChars('.', '.'); tokenList = new ArrayList<String>(); String concatenatedString = ""; while (input.nextToken() != StreamTokenizer.TT_EOF) { if (input.ttype == 40) { tokenList.add("("); } else if (input.ttype == 41) { concatenatedString = concatenatedString.trim(); tokenList.add(concatenatedString); concatenatedString = ""; tokenList.add(")"); } else if (input.ttype == StreamTokenizer.TT_WORD) { if (!(input.sval.equalsIgnoreCase(SCIMConstants.OperationalConstants.AND) || input.sval.equalsIgnoreCase(SCIMConstants.OperationalConstants.OR) || input.sval.equalsIgnoreCase(SCIMConstants.OperationalConstants.NOT))) { concatenatedString += " " + input.sval; } else { concatenatedString = concatenatedString.trim(); if (!concatenatedString.equals("")) { tokenList.add(concatenatedString); concatenatedString = ""; } tokenList.add(input.sval); } } } if (!(concatenatedString.equals(""))) { tokenList.add(concatenatedString); } }

Target:
public FilterTreeManager(String filterString, SCIMResourceTypeSchema schema) throws IOException { this.schema = schema; input = new StreamTokenizer(new StringReader(filterString)); input.resetSyntax(); input.wordChars('a', 'z'); input.wordChars('A', 'Z'); input.wordChars(128 + 32, 255); input.whitespaceChars(0, ' '); input.commentChar('/'); input.quoteChar('"'); input.quoteChar('\''); input.wordChars('@', '@'); input.wordChars(':', ':'); input.wordChars('_', '_'); input.wordChars('0', '9'); input.wordChars('-', '-'); input.wordChars('+', '+'); input.wordChars('.', '.'); input.wordChars('*', '*'); tokenList = new ArrayList<String>(); String concatenatedString = ""; while (input.nextToken() != StreamTokenizer.TT_EOF) { if (input.ttype == 40) { tokenList.add("("); } else if (input.ttype == 41) { concatenatedString = concatenatedString.trim(); tokenList.add(concatenatedString); concatenatedString = ""; tokenList.add(")"); } else if (input.ttype == StreamTokenizer.TT_WORD) { if (!(input.sval.equalsIgnoreCase(SCIMConstants.OperationalConstants.AND) || input.sval.equalsIgnoreCase(SCIMConstants.OperationalConstants.OR) || input.sval.equalsIgnoreCase(SCIMConstants.OperationalConstants.NOT))) { concatenatedString += " " + input.sval; } else { concatenatedString = concatenatedString.trim(); if (!concatenatedString.equals("")) { tokenList.add(concatenatedString); concatenatedString = ""; } tokenList.add(input.sval); } } } if (!(concatenatedString.equals(""))) { tokenList.add(concatenatedString); } }
Source:
default N setName(String name) { return setName(Name.parse(name)); }

Target:
default N setName(String name) { assertNonEmpty(name); return setName(Name.parse(name)); }
Source:
public void testMvccEnabledForClientMode() throws Exception { String attrName = "has_cache"; Object attrVal = Boolean.TRUE; final IgniteEx crd = (IgniteEx) startGrid(getTestIgniteInstanceName(0), getConfiguration()); CacheConfiguration ccfg = defaultCacheConfiguration() .setNearConfiguration(null) .setNodeFilter(new AttributeNodeFilter(attrName, attrVal)) .setBackups(0) .setAtomicityMode(TRANSACTIONAL_SNAPSHOT); final Ignite node = startGrid(getTestIgniteInstanceName(1), getConfiguration() .setCacheConfiguration(ccfg) .setUserAttributes(F.asMap(attrName, attrVal))); checkTopology(2); assertTrue(crd.context().coordinators().mvccEnabled()); }

Target:
public void testMvccEnabledForClientMode() throws Exception { String attrName = "has_cache"; Object attrVal = Boolean.TRUE; final IgniteEx crd = (IgniteEx) startGrid(getTestIgniteInstanceName(0), getConfiguration()); CacheConfiguration ccfg = defaultCacheConfiguration() .setNearConfiguration(null) .setNodeFilter(new AttributeNodeFilter(attrName, attrVal)) .setAtomicityMode(TRANSACTIONAL_SNAPSHOT); final IgniteEx node = (IgniteEx) startGrid(getTestIgniteInstanceName(1), getConfiguration() .setCacheConfiguration(ccfg) .setUserAttributes(F.asMap(attrName, attrVal))); checkTopology(2); assertTrue(crd.context().coordinators().mvccEnabled()); assertTrue(node.context().coordinators().mvccEnabled()); }
Source:
public Set<PortletCategory> getParentCategories(IPortletDefinition child) { String childKey = child.getPortletDefinitionId().getStringId(); IEntity childEntity = GroupService.getEntity(childKey, IPortletDefinition.class); Set<PortletCategory> parents = new HashSet<PortletCategory>(); Iterator<IEntityGroup> iter = childEntity.getParentGroups().iterator(); while (iter.hasNext()) { IGroupMember gm = iter.next(); if (gm.isGroup()) { String categoryId = gm.getKey(); parents.add(getPortletCategory(categoryId)); } } return parents; }

Target:
public Set<PortletCategory> getParentCategories(IPortletDefinition child) { String childKey = child.getPortletDefinitionId().getStringId(); IEntity childEntity = GroupService.getEntity(childKey, IPortletDefinition.class); Set<PortletCategory> parents = new HashSet<PortletCategory>(); for (IGroupMember gm : childEntity.getParentGroups()) { if (gm.isGroup()) { String categoryId = gm.getKey(); parents.add(getPortletCategory(categoryId)); } } return parents; }
Source:
public void selectArchetype(String catalog, final String archetype, final String groupId){ new DefaultCombo(0).setSelection(catalog); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); new WaitUntil(new TableHasRows(new DefaultTable()),TimePeriod.LONG); DefaultTable table = new DefaultTable(); @SuppressWarnings("unchecked") List<TableItem> items = table.getItems(new Matcher<TableItem>() { @Override public void describeTo(Description arg0) @Override public void _dont_implement_Matcher___instead_extend_BaseMatcher_() @Override public void describeMismatch(Object arg0, Description arg1) @Override public boolean matches(Object arg0) { DefaultTableItem ti = (DefaultTableItem)arg0; return ((groupId != null && ti.getText(0).matches(".*"+groupId+".*")) || groupId == null) && ti.getText(1).matches(".*"+archetype+".*"); }}); items.get(0).select(); }

Target:
public void selectArchetype(String catalog, final String archetype, final String groupId){ new DefaultCombo(0).setSelection(catalog); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); new WaitUntil(new TableHasRows(new DefaultTable()),TimePeriod.LONG); DefaultTable table = new DefaultTable(); @SuppressWarnings("unchecked") List<TableItem> items = table.getItems(new ArtifactIdAndGroupIdMatcher(groupId, archetype)); items.get(0).select(); }
Source:
public void testIllegalCombinationsForCredentialReference() throws Exception { final ModelNodeResult bridgePassword = operations.readAttribute(BRIDGE_ADDRESS, PASSWORD); try { undefineBridgePassword(); navigateToBridgeTab(); page.switchToCredentialReference(); new ElytronIntegrationChecker.Builder(client) .address(BRIDGE_ADDRESS) .configFragment(page.getConfigFragment()) .build() .testIllegalCombinationCredentialReferenceAttributes(); } finally { operations.writeAttribute(BRIDGE_ADDRESS, PASSWORD, bridgePassword.value()); } }

Target:
public void testIllegalCombinationsForCredentialReference() throws Exception { final ModelNodeResult bridgePassword = operations.readAttribute(BRIDGE_ADDRESS, PASSWORD, ReadAttributeOption.NOT_INCLUDE_DEFAULTS); try { undefineBridgePassword(); navigateToBridgeTab(); page.switchToCredentialReference(); new ElytronIntegrationChecker.Builder(client) .address(BRIDGE_ADDRESS) .configFragment(page.getConfigFragment()) .build() .testIllegalCombinationCredentialReferenceAttributes(); } finally { operations.writeAttribute(BRIDGE_ADDRESS, PASSWORD, bridgePassword.value()); } }
Source:
Person ingestPerson(org.atlasapi.remotesite.pa.profiles.bindings.Person paPerson) { Person person = new Person(); person.setCanonicalUri(PERSON_URI_PREFIX + paPerson.getId()); Name name = paPerson.getName(); person.withName(name.getFirstname() + " " + name.getLastname()); person.setGivenName(name.getFirstname()); person.setFamilyName(name.getLastname()); person.setGender(paPerson.getGender()); if (paPerson.getBorn() != null) { person.setBirthDate(dateTimeFormatter.parseDateTime(paPerson.getBorn())); } if (paPerson.getBornIn() != null) { person.setBirthPlace(paPerson.getBornIn()); } person.setDescription(paPerson.getEarlyLife() + "\n\n" + paPerson.getCareer()); person.addQuote(paPerson.getQuote()); person.setPublisher(Publisher.PA_PEOPLE); return person; }

Target:
Person ingestPerson(org.atlasapi.remotesite.pa.profiles.bindings.Person paPerson) { Person person = new Person(); person.setCanonicalUri(PERSON_URI_PREFIX + paPerson.getId()); Name name = paPerson.getName(); person.withName(name.getFirstname() + " " + name.getLastname()); person.setGivenName(name.getFirstname()); person.setFamilyName(name.getLastname()); person.setGender(paPerson.getGender()); if (paPerson.getBorn() != null) { person.setBirthDate(dateTimeFormatter.parseDateTime(paPerson.getBorn())); } person.setBirthPlace(paPerson.getBornIn()); person.setDescription(paPerson.getEarlyLife() + "\n\n" + paPerson.getCareer()); person.addQuote(paPerson.getQuote()); person.setPublisher(Publisher.PA_PEOPLE); return person; }
Source:
public SubPeer(SocketAddress remoteAddress, @NotNull SubChannel subChannel) { if (subChannel == null) { throw new NullPointerException("`subChannel` cannot be null"); } this.remoteAddress = remoteAddress; this.peerManager = subChannel.getPeerManager(); this.direction = subChannel.getPreferredDirection(); }

Target:
public SubPeer(SocketAddress remoteAddress, @NotNull SubChannel subChannel) { this.remoteAddress = remoteAddress; this.peerManager = subChannel.getPeerManager(); this.direction = subChannel.getPreferredDirection(); }
Source:
public TimeLockServices createTimeLockServices( String client, Supplier<ManagedTimestampService> rawTimestampServiceSupplier, Supplier<LockService> rawLockServiceSupplier) { log.info("Creating async timelock services for client {}", SafeArg.of("client", client)); AsyncOrLegacyTimelockService asyncOrLegacyTimelockService; AsyncTimelockService asyncTimelockService = instrumentInLeadershipProxy( metricsManager.getTaggedRegistry(), AsyncTimelockService.class, () -> createRawAsyncTimelockService(client, rawTimestampServiceSupplier), client); asyncOrLegacyTimelockService = AsyncOrLegacyTimelockService.createFromAsyncTimelock( new AsyncTimelockResource(lockLog, asyncTimelockService)); LockService lockService = instrumentInLeadershipProxy( metricsManager.getTaggedRegistry(), LockService.class, asyncLockConfiguration.disableLegacySafetyChecksWarningPotentialDataCorruption() ? rawLockServiceSupplier : JavaSuppliers.compose(NonTransactionalLockService::new, rawLockServiceSupplier), client); leadershipCreator.executeWhenLostLeadership(this::deregisterLeaderMetrics); return TimeLockServices.create( asyncTimelockService, lockService, asyncOrLegacyTimelockService, asyncTimelockService); }

Target:
public TimeLockServices createTimeLockServices( String client, Supplier<ManagedTimestampService> rawTimestampServiceSupplier, Supplier<LockService> rawLockServiceSupplier) { log.info("Creating async timelock services for client {}", SafeArg.of("client", client)); AsyncOrLegacyTimelockService asyncOrLegacyTimelockService; AsyncTimelockService asyncTimelockService = instrumentInLeadershipProxy( metricsManager.getTaggedRegistry(), AsyncTimelockService.class, () -> createRawAsyncTimelockService(client, rawTimestampServiceSupplier), client); asyncOrLegacyTimelockService = AsyncOrLegacyTimelockService.createFromAsyncTimelock( new AsyncTimelockResource(lockLog, asyncTimelockService)); LockService lockService = instrumentInLeadershipProxy( metricsManager.getTaggedRegistry(), LockService.class, asyncLockConfiguration.disableLegacySafetyChecksWarningPotentialDataCorruption() ? rawLockServiceSupplier : JavaSuppliers.compose(NonTransactionalLockService::new, rawLockServiceSupplier), client); leadershipCreator.executeWhenLostLeadership(() -> metricsManager.deregisterTaggedMetrics(withTagIsCurrentSuspectedLeader(true))); leadershipCreator.executeWhenGainedLeadership(() -> metricsManager.deregisterTaggedMetrics(withTagIsCurrentSuspectedLeader(false))); return TimeLockServices.create( asyncTimelockService, lockService, asyncOrLegacyTimelockService, asyncTimelockService); }
Source:
private void providerList(final Date date, FetchListener listener) { fetchListener = listener; HashMap<String, String> params = new HashMap<>(); if (date != null) { params.put(SEConstants.KEY_FROM_DATE, SEDateTools.parseDateToShortString(date)); } if (providerArray == null || providerArray.isEmpty()) { providerArray = new ArrayList<>(); } sendGETRequest(SEConstants.PROVIDERS_URL.concat(nextPageId), params, "", new SEHTTPResponseHandler(new SEHTTPResponseHandler.RestAPIListener() { @Override public void onFailureResponse(int statusCode, JSONObject errorResponse) { onFail(errorResponse); } @Override public void onSuccessResponse(int statusCode, JSONObject response) { Gson gson = new Gson(); String providerArrayString = SEJSONTools.getArray(response, SEConstants.KEY_DATA).toString(); for (SEProvider entry : gson.fromJson(providerArrayString, SEProvider[].class)) { providerArray.add(entry); } nextPageId = paginationAvailable(response); if (nextPageId.isEmpty()) { providerArray.clear(); onSuccess(providerArray); } else { providerList(date, fetchListener); } } })); }

Target:
private void providerList(final Date date, FetchListener listener) { fetchListener = listener; HashMap<String, String> params = new HashMap<>(); if (date != null) { params.put(SEConstants.KEY_FROM_DATE, SEDateTools.parseDateToShortString(date)); } if (providerArray == null || nextPageId.isEmpty()) { providerArray = new ArrayList<>(); } sendGETRequest(SEConstants.PROVIDERS_URL.concat(nextPageId), params, "", new SEHTTPResponseHandler(new SEHTTPResponseHandler.RestAPIListener() { @Override public void onFailureResponse(int statusCode, JSONObject errorResponse) { onFail(errorResponse); } @Override public void onSuccessResponse(int statusCode, JSONObject response) { Gson gson = new Gson(); String providerArrayString = SEJSONTools.getArray(response, SEConstants.KEY_DATA).toString(); providerArray.addAll(Arrays.asList(gson.fromJson(providerArrayString, SEProvider[].class))); String pageId = getNextPageId(response); nextPageId = pageId.equals(nextPageId) ? "" : pageId; if (nextPageId.isEmpty()) { onSuccess(providerArray); } else { providerList(date, fetchListener); } } })); }
Source:
public void stop() { if (isRunning()) { LOGGER.info("Kill interpreter process for interpreter group: " + getInterpreterGroupId()); try { callRemoteFunction(new RemoteFunction<Void>() { @Override public Void call(RemoteInterpreterService.Client client) throws Exception { client.shutdown(); return null; } }); } catch (Exception e) { LOGGER.warn("ignore the exception when shutting down", e); } shutdown(); this.interpreterProcessLauncher.stop(); this.interpreterProcessLauncher = null; LOGGER.info("Remote process of interpreter group: " + getInterpreterGroupId() + " is terminated"); } }

Target:
public void stop() { if (isRunning()) { LOGGER.info("Kill interpreter process for interpreter group: {}", getInterpreterGroupId()); try { callRemoteFunction(new RemoteFunction<Void>() { @Override public Void call(RemoteInterpreterService.Client client) throws Exception { client.shutdown(); return null; } }); } catch (Exception e) { LOGGER.warn("ignore the exception when shutting down", e); } shutdown(); this.interpreterProcessLauncher.stop(); this.interpreterProcessLauncher = null; LOGGER.info("Remote process of interpreter group: is terminated", getInterpreterGroupId()); } }
Source:
protected boolean canReplaceBiome(int biomeId) { Biome biome = Biome.getBiomeForId(biomeId); if (biome == null) { if (BCLib.DEV) BCLog.logger.warn("Couldn't find a biome with an ID of " + biomeId); return false; } return BiomeDictionary.getTypes(biome).containsAll(REQUIRED_TYPES); }

Target:
protected boolean canReplaceBiome(int biomeId) { Biome biome = Biome.getBiomeForId(biomeId); if (biome == null) { return false; } return BiomeDictionary.getTypes(biome).containsAll(REQUIRED_TYPES); }
Source:
@Test public void responseConverterFactorySkippedNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory1 = new NonMatchingConverterFactory(); NonMatchingConverterFactory nonMatchingFactory2 = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory1) .addConverterFactory(nonMatchingFactory2) .build(); try { retrofit.nextResponseBodyConverter(nonMatchingFactory1, type, annotations); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate ResponseBody converter for class java.lang.String.\n" + " Skipped:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory\n" + " Tried:\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory1.called).isFalse(); assertThat(nonMatchingFactory2.called).isTrue(); }

Target:
@Test public void responseConverterFactorySkippedNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory1 = new NonMatchingConverterFactory(); NonMatchingConverterFactory nonMatchingFactory2 = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory1) .addConverterFactory(nonMatchingFactory2) .build(); try { retrofit.nextResponseBodyConverter(nonMatchingFactory1, type, annotations); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate ResponseBody converter for class java.lang.String.\n" + " Skipped:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory\n" + " Tried:\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory1.called).isFalse(); assertThat(nonMatchingFactory2.called).isTrue(); }
Source:
public void joinWithSelfThrowsException() throws Exception { StreamApplication app = new StreamApplication() { @Override public void init(StreamGraph graph, Config config) { IntegerSerde integerSerde = new IntegerSerde(); KVSerde<Integer, Integer> kvSerde = KVSerde.of(integerSerde, integerSerde); MessageStream<KV<Integer, Integer>> inStream = graph.getInputStream("instream", kvSerde); SystemStream outputSystemStream = new SystemStream("outputSystem", "outputStream"); inStream .join(inStream, new TestJoinFunction(), integerSerde, kvSerde, kvSerde, JOIN_TTL, "join") .sink((m, mc, tc) -> mc.send(new OutgoingMessageEnvelope(outputSystemStream, m))); } }; createStreamOperatorTask(new SystemClock(), app); }

Target:
public void joinWithSelfThrowsException() throws Exception { StreamApplication app = new StreamApplication() { @Override public void init(StreamGraph graph, Config config) { IntegerSerde integerSerde = new IntegerSerde(); KVSerde<Integer, Integer> kvSerde = KVSerde.of(integerSerde, integerSerde); MessageStream<KV<Integer, Integer>> inStream = graph.getInputStream("instream", kvSerde); inStream.join(inStream, new TestJoinFunction(), integerSerde, kvSerde, kvSerde, JOIN_TTL, "join"); } }; createStreamOperatorTask(new SystemClock(), app); }
Source:
public void call() { if (that.isDone()) { handleDone(subscriber); return; } long currentTime = Schedulers.computation().now(); if (expireAfter > 0 && currentTime > expireAfter) { handleTimeout(subscriber); return; } long delayBy = Math.min(Math.max(INITIAL_DELAY_MICRO_SEC, (currentTime - startTime) * 1000), MAX_DELAY_MICRO_SEC); worker.schedule(this, delayBy, TimeUnit.MICROSECONDS); }

Target:
public void call() { if (that.isDone()) { handleDone(subscriber); return; } long currentTime = scheduler.now(); if (expireAfter > 0 && currentTime > expireAfter) { handleTimeout(subscriber); return; } long delayBy = Math.min(Math.max(INITIAL_DELAY_MICRO_SEC, (currentTime - startTime) * 1000), MAX_DELAY_MICRO_SEC); Subscription newSubscription = worker.schedule(this, delayBy, TimeUnit.MICROSECONDS); taskSubscription.set(newSubscription); }
Source:
protected void onMessage(final Intent intent) { if (intent == null) { SwrveLogger.e(TAG, "Unexpected null intent"); return; } final Bundle extras = intent.getExtras(); if (extras != null && !extras.isEmpty()) { SwrveLogger.i(TAG, "Received ADM notification: " + extras.toString()); processRemoteNotification(extras); } }

Target:
protected void onMessage(final Intent intent) { if (intent == null) { SwrveLogger.e(TAG, "ADM messaging runtimes have called onMessage() with unexpected null intent."); return; } final Bundle extras = intent.getExtras(); if (extras != null && !extras.isEmpty()) { SwrveLogger.i(TAG, "Received ADM notification: " + extras.toString()); processRemoteNotification(extras); } }
Source:
public File getExternalFilesDir(String type) { return ShadowEnvironment.getExternalStoragePublicDirectory(type); }

Target:
public File getExternalFilesDir(String type) { return Environment.getExternalStoragePublicDirectory(type); }
Source:
public static void saveBooleanPreference(String key, boolean value, Context context) { SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit(); appPreferences.putBoolean(key, value); appPreferences.apply(); }

Target:
private static void saveBooleanPreference(String key, boolean value, Context context) { SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit(); appPreferences.putBoolean(key, value); appPreferences.apply(); }
Source:
public void initialize(Configuration conf, Properties tbl) throws SerDeException { try { String className = tbl .getProperty(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_CLASS); protobufClass = conf.getClassByName(className).asSubclass(Message.class); protobufConverter = ProtobufConverter.newInstance(new TypeRef<Message>(protobufClass){}); } catch (Exception e) { throw new SerDeException(e); } }

Target:
public void initialize(Configuration conf, Properties tbl) throws SerDeException { try { String className = tbl.getProperty(Constants.SERIALIZATION_CLASS); protobufClass = conf.getClassByName(className).asSubclass(Message.class); protobufConverter = ProtobufConverter.newInstance(protobufClass); } catch (Exception e) { throw new SerDeException(e); } }
Source:
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws InterruptedException { while (!queue.isEmpty()) { RedisCommand<K, V, ?> command = queue.peek(); if (debugEnabled) { logger.debug("{} Queue contains: commands", logPrefix(), queue.size()); } WithLatency withLatency = getWithLatency(command); try { if (!rsm.decode(buffer, command, command.getOutput())) { return; } } catch (Exception e) { rsm.reset(); recordLatency(withLatency, command.getType()); queue.poll(); if (buffer.refCnt() > 0) { buffer.clear(); } try { command.completeExceptionally(e); } catch (Exception ex) { logger.warn("{} Unexpected exception during command completion exceptionally: {}", logPrefix, ex.toString(), ex); } throw e; } recordLatency(withLatency, command.getType()); queue.poll(); try { command.complete(); } catch (Exception e) { logger.warn("{} Unexpected exception during command completion: {}", logPrefix, e.toString(), e); } if (buffer.refCnt() != 0) { buffer.discardReadBytes(); } } }

Target:
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws InterruptedException { while (!queue.isEmpty()) { RedisCommand<K, V, ?> command = queue.peek(); if (debugEnabled) { logger.debug("{} Queue contains: commands", logPrefix(), queue.size()); } WithLatency withLatency = getWithLatency(command); try { if (!rsm.decode(buffer, command, command.getOutput())) { return; } } catch (Exception e) { recordLatency(withLatency, command.getType()); queue.poll(); try { command.completeExceptionally(e); } catch (Exception ex) { logger.warn("{} Unexpected exception during command completion exceptionally: {}", logPrefix, ex.toString(), ex); } ctx.close(); throw e; } recordLatency(withLatency, command.getType()); queue.poll(); try { command.complete(); } catch (Exception e) { logger.warn("{} Unexpected exception during command completion: {}", logPrefix, e.toString(), e); } if (buffer.refCnt() != 0) { buffer.discardReadBytes(); } } }
Source:
private void editAnalysis() { String selection = createXmlFileString(fAnalysesList.getSelection()[0]); @Nullable File file = XmlUtils.listFiles().get(selection); if (file == null) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); return; } try { IDE.openEditorOnFileStore(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), EFS.getStore(file.toURI())); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), e.getMessage()); } }

Target:
private void editAnalysis() { String selection = createXmlFileString(fAnalysesList.getSelection()[0]); @Nullable File file = XmlUtils.listFiles().get(selection); if (file == null) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); return; } try { IEditorPart editorPart = IDE.openEditorOnFileStore(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), EFS.getStore(file.toURI())); editorPart.addPropertyListener(new IPropertyListener() { @Override public void propertyChanged(Object source, int propId) { if (ISaveablePart.PROP_DIRTY == propId) { if (!editorPart.isDirty()) { loadXmlFile(file, false); } } } }); close(); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), e.getMessage()); } }
Source:
public void incrementUsage( long pageRef ) { long address = offFilePageId( pageRef ); long v = UnsafeUtil.getLongVolatile( address ); long usage = v & 0x07; if ( usage < 4 ) { usage++; UnsafeUtil.compareAndSwapLong( null, address, v, (v & 0xFFFFFFFF_FFFFFFF8L) + usage ); } }

Target:
public void incrementUsage( long pageRef ) { long address = offFilePageId( pageRef ); long v = UnsafeUtil.getLongVolatile( address ); long usage = v & MASK_USAGE_COUNT; if ( usage < 4 ) { usage++; UnsafeUtil.compareAndSwapLong( null, address, v, (v & MASK_NOT_USAGE_COUNT) + usage ); } }
Source:
public Collection<Consumer> getConsumers(Collection<String> consumerIds) { Set<Consumer> consumers = new HashSet<>(); javax.persistence.Query query = this.getEntityManager() .createQuery("SELECT c FROM Consumer c WHERE c.id IN (:cids)"); if (consumerIds != null && !consumerIds.isEmpty()) { for (List<String> block : this.partition(consumerIds)) { query.setParameter("cids", block); consumers.addAll(query.getResultList()); } } return consumers; }

Target:
public Collection<Consumer> getConsumers(Collection<String> consumerIds) { if (consumerIds != null && !consumerIds.isEmpty()) { List<String> cids; if (consumerIds instanceof List) { cids = (List<String>) consumerIds; } else { cids = new ArrayList(consumerIds); } return this.currentSession() .byMultipleIds(this.entityType()) .enableSessionCheck(true) .enableOrderedReturn(false) .multiLoad(cids); } return Collections.emptyList(); }
Source:
String getVersionAsDotX( String version ) { Matcher matcher = Pattern .compile("(\\d+\\.\\d+\\.)") .matcher(version); if ( matcher.find()) { return matcher.group( 1 ) + LOWER_CASE_X; } throw new IllegalArgumentException( String.format("version string '%s' does not match 'major.minor.' pattern", version ) ); }

Target:
String getVersionAsDotX(String version) { Matcher matcher = MAJOR_MINOR_PATTERN.matcher(version); if (matcher.find()) { return matcher.group(1) + LOWER_CASE_X; } throw new IllegalArgumentException( String.format("version string '%s' does not match 'major.minor.' pattern", version)); }
Source:
protected ProductContent initSourceObject() { Content content = new Content(); content.setUuid("test_value"); content.setId("test_value"); content.setType("test_value"); content.setLabel("test_value"); content.setName("test_value"); content.setVendor("test_value"); content.setContentUrl("test_value"); content.setRequiredTags("test_value"); content.setReleaseVersion("test_value"); content.setGpgUrl("test_value"); content.setMetadataExpiration(1234L); content.setModifiedProductIds(Arrays.asList("1", "2", "3")); content.setArches("test_value"); content.setLocked(Boolean.TRUE); ProductContent source = new ProductContent(); source.setContent(content); source.setEnabled(true); return source; }

Target:
protected ProductContent initSourceObject() { Content content = this.contentTranslatorTest.initSourceObject(); ProductContent source = new ProductContent(); source.setContent(content); source.setEnabled(true); return source; }
Source:
public boolean submit(final RequestContext requestContext, final Credential credential) { final String username = credential.getId(); final CouchDbProfileDocument profile = couchDb.findByUsername(username); boolean success = false; if (profile == null) { couchDb.add(new CouchDbProfileDocument(username, null, CollectionUtils.wrap(aupAttributeName, true))); success = true; } else { profile.setAttribute(aupAttributeName, true); UpdateConflictException exception = null; for (int retries = 0; retries < conflictRetries; retries++) { try { exception = null; couchDb.update(profile); success = true; } catch (final UpdateConflictException e) { exception = e; } if (success) { LOGGER.debug("Successfully deleted service [{}].", profile.getUsername()); break; } } if (exception != null) { LOGGER.debug("Could not delete service {}", username, exception.getMessage()); } } return success; }

Target:
public boolean submit(final RequestContext requestContext, final Credential credential) { val username = credential.getId(); val profile = couchDb.findByUsername(username); if (profile == null) { couchDb.add(new CouchDbProfileDocument(username, null, CollectionUtils.wrap(aupAttributeName, Boolean.TRUE))); return true; } else { var success = false; profile.setAttribute(aupAttributeName, Boolean.TRUE); UpdateConflictException exception = null; for (int retries = 0; retries < conflictRetries; retries++) { try { exception = null; couchDb.update(profile); success = true; } catch (final UpdateConflictException e) { exception = e; } if (success) { LOGGER.debug("Successfully updated AUP for [{}].", profile.getUsername()); break; } } if (exception != null) { LOGGER.debug("Could not update AUP acceptance for [{}].\n{}", username, exception.getMessage()); } return success; } }
Source:
public void testSignalStartDynamic() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SignalStart.bpmn2"); ksession = createKnowledgeSession(kbase); KieServices ks = KieServices.Factory.get(); KieRepository kr = ks.getRepository(); KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId()); kContainer.getKieBase(); final List<Long> list = new ArrayList<Long>(); ksession.addEventListener(new DefaultProcessEventListener() { public void beforeProcessStarted(ProcessStartedEvent event) { logger.info("{}", event.getProcessInstance().getId()); list.add(event.getProcessInstance().getId()); } }); ksession.signalEvent("MySignal", "NewValue"); Assertions.assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); kbase.removeProcess("Minimal"); try { ksession.signalEvent("MySignal", "NewValue"); } catch (IllegalArgumentException e) { Assertions.assertThat(e.getMessage()).isEqualTo("Unknown process ID: Minimal"); } Assertions.assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); }

Target:
public void testSignalStartDynamic() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SignalStart.bpmn2"); ksession = createKnowledgeSession(kbase); KieServices ks = KieServices.Factory.get(); KieRepository kr = ks.getRepository(); KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId()); kContainer.getKieBase(); final List<Long> list = new ArrayList<Long>(); ksession.addEventListener(new DefaultProcessEventListener() { public void beforeProcessStarted(ProcessStartedEvent event) { logger.info("{}", event.getProcessInstance().getId()); list.add(event.getProcessInstance().getId()); } }); ksession.signalEvent("MySignal", "NewValue"); Assertions.assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); kbase.removeProcess("Minimal"); Assertions.assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { ksession.signalEvent("MySignal", "NewValue"); }) .withMessageContaining("Unknown process ID: Minimal"); Assertions.assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); }
Source:
public static Optional<MeterRegistry> getInstance() { return meterRegistry; }

Target:
public static synchronized Optional<MeterRegistry> getInstance() { return meterRegistry; }
Source:
private static List<String> separateChallenges(final String challenges) { String[] splitOnUnquotedCommas = challenges.split(REGEX_SPLIT_UNQUOTED_COMMA, -1); sanitizeWhitespace(splitOnUnquotedCommas); List<String> tokensContainingScheme = extractTokensContainingScheme(splitOnUnquotedCommas); String[] outStrings = new String[tokensContainingScheme.size()]; for (int ii = 0; ii < outStrings.length; ii++) { outStrings[ii] = ""; } writeParsedChallenges(splitOnUnquotedCommas, tokensContainingScheme, outStrings); sanitizeParsedSuffixes(outStrings); return Arrays.asList(outStrings); }

Target:
private static List<String> separateChallenges(final String challenges) throws ResourceAuthenticationChallengeException { final String methodName = ":separateChallenges"; if (StringExtensions.isNullOrBlank(challenges)) { Logger.w(TAG + methodName, "Input String was null"); throw new ResourceAuthenticationChallengeException(AUTH_HEADER_INVALID_FORMAT); } Logger.i(TAG + methodName, "Splitting input String on unquoted commas", "input[" + challenges + "]"); String[] splitOnUnquotedCommas = challenges.split(REGEX_SPLIT_UNQUOTED_COMMA, -1); Logger.i(TAG + methodName, "Splitting input String on unquoted commas", "output[" + Arrays.toString(splitOnUnquotedCommas) + "]"); sanitizeWhitespace(splitOnUnquotedCommas); List<String> tokensContainingScheme = extractTokensContainingScheme(splitOnUnquotedCommas); String[] outStrings = new String[tokensContainingScheme.size()]; for (int ii = 0; ii < outStrings.length; ii++) { outStrings[ii] = ""; } writeParsedChallenges(splitOnUnquotedCommas, tokensContainingScheme, outStrings); sanitizeParsedSuffixes(outStrings); return Arrays.asList(outStrings); }
Source:
public void testRecoveryMonitorWithFailure() throws Exception { RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean(); ArrayList<String> rcvClassNames = new ArrayList<>(); rcvClassNames.add(XATestResourceXARecovery.class.getName()); jtaPropertyManager.getJTAEnvironmentBean().setXaResourceRecoveryClassNames(rcvClassNames); XATestResourceXARecovery.setUseFaultyResources(true); TransactionImple tx = new TransactionImple(0); assertTrue(tx.enlistResource(new XATestResource(XATestResource.OK_JNDI_NAME, false))); assertTrue(tx.enlistResource(new XATestResource(XATestResource.FAULTY_JNDI_NAME, true))); tx.commit(); recoveryEnvironmentBean.setRecoveryBackoffPeriod(1); recoveryEnvironmentBean.setRecoveryListener(true); RecoveryManager manager = RecoveryManager.manager(RecoveryManager.DIRECT_MANAGEMENT); XARecoveryModule xaRecoveryModule = new XARecoveryModule(); manager.addModule(xaRecoveryModule); try { manager.startRecoveryManagerThread(); String host = recoveryEnvironmentBean.getRecoveryAddress(); String rcPort = String.valueOf(recoveryEnvironmentBean.getRecoveryPort()); RecoveryMonitor.main(new String[] {"-verbose", "-port", rcPort, "-host", host}); assertEquals("ERROR", RecoveryMonitor.getResponse()); assertEquals("ERROR", RecoveryMonitor.getSystemOutput()); assertTrue(!xaRecoveryModule.isPeriodicWorkSuccessful()); } finally { manager.terminate(); } }

Target:
public void testRecoveryMonitorWithFailure() throws Exception { RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean(); ArrayList<String> rcvClassNames = new ArrayList<>(); rcvClassNames.add(XATestResourceXARecovery.class.getName()); jtaPropertyManager.getJTAEnvironmentBean().setXaResourceRecoveryClassNames(rcvClassNames); XATestResourceXARecovery.setUseFaultyResources(true); TransactionImple tx = new TransactionImple(0); assertTrue(tx.enlistResource(new XATestResource(XATestResource.OK_JNDI_NAME, false))); assertTrue(tx.enlistResource(new XATestResource(XATestResource.FAULTY_JNDI_NAME, true))); tx.commit(); recoveryEnvironmentBean.setRecoveryBackoffPeriod(1); recoveryEnvironmentBean.setRecoveryListener(true); RecoveryManager manager = RecoveryManager.manager(RecoveryManager.DIRECT_MANAGEMENT); XARecoveryModule xaRecoveryModule = new XARecoveryModule(); manager.addModule(xaRecoveryModule); try { manager.startRecoveryManagerThread(); String host = recoveryEnvironmentBean.getRecoveryAddress(); String rcPort = String.valueOf(recoveryEnvironmentBean.getRecoveryPort()); RecoveryMonitor.main(new String[] {"-verbose", "-port", rcPort, "-host", host}); assertEquals("ERROR", RecoveryMonitor.getResponse()); assertEquals("ERROR", RecoveryMonitor.getSystemOutput()); assertFalse(xaRecoveryModule.isPeriodicWorkSuccessful()); } finally { manager.terminate(); } }
Source:
private static boolean isRequiredBinding(Element element) { return !hasAnnotationWithNames(element, NULLABLE_ANNOTATION_NAME, OPTIONAL_ANNOTATION_NAME); }

Target:
private static boolean isRequiredBinding(Element element) { return !hasAnnotationWithName(element, NULLABLE_ANNOTATION_NAME); }
Source:
private void setupKeyEvents() { setOnKeyPressed(e -> { if (e.isControlDown()) { return; } if (e.getCode() == KeyCode.ENTER) { e.consume(); if (selectedIndex.isPresent()) { logger.info("Enter key selection on item " + selectedIndex.get()); onItemSelected.accept(selectedIndex.get(), SHOULD_LOAD_BVIEW_ISSUE); } } if (e.getCode() == KeyCode.UP || e.getCode() == KeyCode.DOWN || KeyboardShortcuts.upIssue.match(e) || KeyboardShortcuts.downIssue.match(e)) { e.consume(); handleUpDownKeys(e.getCode() == KeyCode.DOWN || KeyboardShortcuts.downIssue.match(e)); assert selectedIndex.isPresent() : "handleUpDownKeys doesn't set selectedIndex!"; if (!e.isShiftDown()) { logger.info("Enter key selection on item index " + selectedIndex.get()); onItemSelected.accept(selectedIndex.get(), SHOULD_LOAD_BVIEW_ISSUE); } } if (FIRST_ISSUE.match(e)) { e.consume(); selectNthItem(1); } if (LAST_ISSUE.match(e)) { e.consume(); selectNthItem(getItems().size()); } }); }

Target:
private void setupKeyEvents() { setOnKeyPressed(e -> { if (e.isControlDown()) { return; } if (e.getCode() == KeyCode.ENTER) { e.consume(); if (selectedIndex.isPresent()) { logger.info("Enter key selection on item " + selectedIndex.get()); onItemSelected.accept(selectedIndex.get()); } } if (e.getCode() == KeyCode.UP || e.getCode() == KeyCode.DOWN || KeyboardShortcuts.upIssue.match(e) || KeyboardShortcuts.downIssue.match(e)) { e.consume(); handleUpDownKeys(e.getCode() == KeyCode.DOWN || KeyboardShortcuts.downIssue.match(e)); assert selectedIndex.isPresent() : "handleUpDownKeys doesn't set selectedIndex!"; if (!e.isShiftDown()) { logger.info("Enter key selection on item index " + selectedIndex.get()); onItemSelected.accept(selectedIndex.get()); } } if (FIRST_ISSUE.match(e)) { e.consume(); selectNthItem(1); } if (LAST_ISSUE.match(e)) { e.consume(); selectNthItem(getItems().size()); } }); }
Source:
@Override public void active(boolean active) { if (active) activate(); else deactivate(false); }

Target:
@Override public void active(boolean active) { cluster().active(active); }
Source:
private void recurseAddFiles(Element fdNode, File f1, String requestNumber, String directoryName, Session sess) throws Exception{ String files[] = f1.list(); String fullPath = f1.getAbsolutePath() + File.separator; if(f1.list() == null || f1.list().length == 0){ return; } if(includeUploadStagingDir.equals("N") && f1.getName().equals(Constants.UPLOAD_STAGING_DIR)){ return; } if(f1.isDirectory()){ if(!directoryName.equals("")){ directoryName += "/" + f1.getName(); } else{ directoryName = f1.getName(); } } for(int i = 0; i < files.length; i++){ File f = new File(fullPath + files[i]); FileDescriptor fd = new FileDescriptor(requestNumber, f.getName(), f, f.getName()); fd.setDirectoryName(directoryName); fd.excludeMethodFromXML("getChildren"); Element fileNode = fd.toXMLDocument(null, fd.DATE_OUTPUT_ALTIO).getRootElement(); fileNode.setAttribute("isSelected", "N"); fileNode.setAttribute("state", "unchecked"); fileNode.setAttribute("canDelete", "Y"); fileNode.setAttribute("canRename", "Y"); StringBuffer fname = new StringBuffer(); fname.append(fullPath.substring(fullPath.indexOf(Request.getBaseRequestNumber(fd.getNumber()))).replace("\\","/")); fname.append(f.getName()); fileNode.setAttribute("linkedSampleNumber", getLinkedSampleNumber(sess, fname.toString())); fileNode.setAttribute("viewURL", fd.getViewURL(viewType)); if(f.isDirectory()) { fileNode.setAttribute("type", "dir"); recurseAddFiles(fileNode, f, requestNumber, directoryName, sess); } fdNode.addContent(fileNode); } }

Target:
private void recurseAddFiles(Element fdNode, File f1, String requestNumber, String directoryName, Session sess) throws Exception{ String files[] = f1.list(); String fullPath = f1.getAbsolutePath() + File.separator; if(f1.list() == null || f1.list().length == 0){ return; } if(includeUploadStagingDir.equals("N") && f1.getName().equals(Constants.UPLOAD_STAGING_DIR)){ return; } if(f1.isDirectory()){ if(!directoryName.equals("")){ directoryName += "/" + f1.getName(); } else{ directoryName = f1.getName(); } } for(int i = 0; i < files.length; i++){ File f = new File(fullPath + files[i]); String fName = this.getPathForZipFileName(f, requestNumber); FileDescriptor fd = new FileDescriptor(requestNumber, f.getName(), f, fName); fd.setDirectoryName(directoryName); fd.excludeMethodFromXML("getChildren"); Element fileNode = fd.toXMLDocument(null, fd.DATE_OUTPUT_ALTIO).getRootElement(); fileNode.setAttribute("isSelected", "N"); fileNode.setAttribute("state", "unchecked"); fileNode.setAttribute("canDelete", "Y"); fileNode.setAttribute("canRename", "Y"); fileNode.setAttribute("linkedSampleNumber", getLinkedSampleNumber(sess, fd.getZipEntryName())); fileNode.setAttribute("viewURL", fd.getViewURL(viewType)); if(f.isDirectory()) { fileNode.setAttribute("type", "dir"); recurseAddFiles(fileNode, f, requestNumber, directoryName, sess); } fdNode.addContent(fileNode); } }
Source:
public void tearDown() { try { fResource.getProject().delete(true, null); } catch (CoreException e) { e.printStackTrace(); } }

Target:
public void tearDown() throws CoreException { if (fResource != null && fResource.exists()) { fResource.getProject().delete(true, null); } }
Source:
public static List<String> getAuthenticatedUserRoles(IdentityProvider identityProvider) { List<String> roles = identityProvider.getRoles(); if (roles == null || roles.isEmpty()) { roles = new ArrayList<>(); roles.add(""); } return roles; }

Target:
public static List<String> getAuthenticatedUserRoles(IdentityProvider identityProvider) { List<String> roles = identityProvider != null ? identityProvider.getRoles() : new ArrayList<>(); if (roles == null || roles.isEmpty()) { roles = new ArrayList<>(); roles.add(""); } return roles; }
Source:
public KafkaForkliftProducer(String topic, KafkaProducer<?, ?> kafkaProducer) { this.kafkaProducer = kafkaProducer; this.topic = topic; Schema.Parser parser = new Schema.Parser(); this.forkliftSchema = parser.parse( "{\"type\":\"record\",\"name\":\"ForkliftMessage\"," + " \"doc\":\"Non-Avro messages sent through forklift use this schema.\",\"fields\":" + "[{\"name\":\"forkliftValue\",\"type\":\"string\",\"default\":\"\", \"doc\":\"The forklift message. " + "3 formats are supported. 1: string value, 2: Json object," + "3: Map represented by key,value entries delimited with newline\"}," + "{\"name\":\"forkliftProperties\",\"type\":\"string\",\"default\":\"\"," + "\"doc\":\"Properties added to support forklift interfaces. Format is key,value entries delimited with new lines\"}]}"); }

Target:
public KafkaForkliftProducer(String topic, KafkaProducer<?, ?> kafkaProducer) { this.kafkaProducer = kafkaProducer; this.topic = topic; }
Source:
public boolean isSet(final String name) { return isMapped(name) && getHeaderMapRaw().get(name) < values.length; }

Target:
public boolean isSet(final String name) { return isMapped(name) && getHeaderMapRaw().get(name).intValue() < values.length; }
Source:
private String updateIconUri(MPart part) { MPartDescriptor desc = modelService.getPartDescriptor(part.getElementId()); String iconURI = desc != null && desc.getIconURI() != null ? desc.getIconURI() : part.getIconURI(); part.getTransientData().put(ICON_URI_FOR_PART, iconURI); return iconURI; }

Target:
private String updateIconUri(MPart part) { MPartDescriptor desc = modelService.getPartDescriptor(part.getElementId()); String iconURI = part.getIconURI(); if (iconURI == null && desc != null) { iconURI = desc.getIconURI(); } part.getTransientData().put(ICON_URI_FOR_PART, iconURI); return iconURI; }
Source:
public void testCreate() throws StripeException { Map<String, Object> item = new HashMap<String, Object>(); item.put("plan", "silver-plan_123-898"); List<Object> items = new LinkedList<Object>(); items.add(item); Map<String, Object> params = new HashMap<String, Object>(); params.put("customer", "cus_123"); params.put("items", items); Subscription subscription = Subscription.create(params); assertNotNull(subscription); verifyRequest( APIResource.RequestMethod.POST, "/v1/subscriptions", params ); }

Target:
public void testCreate() throws StripeException { final Map<String, Object> item = new HashMap<String, Object>(); item.put("plan", "silver-plan_123-898"); final List<Object> items = new LinkedList<Object>(); items.add(item); final Map<String, Object> params = new HashMap<String, Object>(); params.put("customer", "cus_123"); params.put("items", items); final Subscription subscription = Subscription.create(params); assertNotNull(subscription); verifyRequest( APIResource.RequestMethod.POST, "/v1/subscriptions", params ); }