auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void logTaskExecutorConfiguration(TaskExecutorProcessSpec spec) { TaskExecutorFlinkMemory flinkMemory = spec.getFlinkMemory(); MemorySize totalOffHeapMemory = flinkMemory.getManaged().add(flinkMemory.getJvmDirectMemorySize()); LOG.info("Final TaskExecutor Memory configuration:"); LOG.info(" Total Process Memory: {}", spec.getTotalProcessMemorySize().toHumanReadableString()); LOG.info(" Total Flink Memory: {}", flinkMemory.getTotalFlinkMemorySize().toHumanReadableString()); LOG.info(" Total Heap Memory: {}", flinkMemory.getJvmHeapMemorySize().toHumanReadableString()); LOG.info(" Framework: {}", flinkMemory.getFrameworkHeap().toHumanReadableString()); LOG.info(" Task: {}", flinkMemory.getTaskHeap().toHumanReadableString()); LOG.info(" Total Off-heap Memory: {}", totalOffHeapMemory.toHumanReadableString()); LOG.info(" Managed: {}", flinkMemory.getManaged().toHumanReadableString()); LOG.info(" Total Direct Memory: {}", flinkMemory.getJvmDirectMemorySize().toHumanReadableString()); LOG.info(" Framework: {}", flinkMemory.getFrameworkOffHeap().toHumanReadableString()); LOG.info(" Task: {}", flinkMemory.getTaskOffHeap().toHumanReadableString()); LOG.info(" Network: {}", flinkMemory.getNetwork().toHumanReadableString()); LOG.info(" JVM Metaspace: {}", spec.getJvmMetaspaceSize().toHumanReadableString()); LOG.info(" JVM Overhead: {}", spec.getJvmOverheadSize().toHumanReadableString()); }

Target:
private static void logTaskExecutorConfiguration(TaskExecutorProcessSpec spec) { TaskExecutorFlinkMemory flinkMemory = spec.getFlinkMemory(); MemorySize totalOffHeapMemory = flinkMemory.getManaged().add(flinkMemory.getJvmDirectMemorySize()); LOG.info("Final TaskExecutor Memory configuration:"); LOG.info(" Total Process Memory: {}", spec.getTotalProcessMemorySize().toHumanReadableString()); LOG.info(" Total Flink Memory: {}", flinkMemory.getTotalFlinkMemorySize().toHumanReadableString()); LOG.info(" Total JVM Heap Memory: {}", flinkMemory.getJvmHeapMemorySize().toHumanReadableString()); LOG.info(" Framework: {}", flinkMemory.getFrameworkHeap().toHumanReadableString()); LOG.info(" Task: {}", flinkMemory.getTaskHeap().toHumanReadableString()); LOG.info(" Total Off-heap Memory: {}", totalOffHeapMemory.toHumanReadableString()); LOG.info(" Managed: {}", flinkMemory.getManaged().toHumanReadableString()); LOG.info(" Total JVM Direct Memory: {}", flinkMemory.getJvmDirectMemorySize().toHumanReadableString()); LOG.info(" Framework: {}", flinkMemory.getFrameworkOffHeap().toHumanReadableString()); LOG.info(" Task: {}", flinkMemory.getTaskOffHeap().toHumanReadableString()); LOG.info(" Network: {}", flinkMemory.getNetwork().toHumanReadableString()); LOG.info(" JVM Metaspace: {}", spec.getJvmMetaspaceSize().toHumanReadableString()); LOG.info(" JVM Overhead: {}", spec.getJvmOverheadSize().toHumanReadableString()); }
Source:
@Override public void loginLogoutClick() { new AlertDialog.Builder(MainActivity.this) .setMessage(R.string.logout_prompt) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(R.string.preference_title_logout, (dialog, which) -> { if (AccountUtil.isLoggedIn()) { WikipediaApp.getInstance().logOut(); FeedbackUtil.showMessage(MainActivity.this, R.string.toast_logout_complete); if (Prefs.isReadingListSyncEnabled() && !ReadingListDbHelper.instance().isEmpty()) { ReadingListSyncBehaviorDialogs.removeExistingListsOnLogoutDialog(MainActivity.this); } Prefs.setReadingListsLastSyncTime(null); Prefs.setReadingListSyncEnabled(false); } else { getFragment().onLoginRequested(); } closeMainDrawer(); }).show(); }

Target:
@Override public void loginLogoutClick() { if (AccountUtil.isLoggedIn()) { new AlertDialog.Builder(MainActivity.this) .setMessage(R.string.logout_prompt) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(R.string.preference_title_logout, (dialog, which) -> { WikipediaApp.getInstance().logOut(); FeedbackUtil.showMessage(MainActivity.this, R.string.toast_logout_complete); if (Prefs.isReadingListSyncEnabled() && !ReadingListDbHelper.instance().isEmpty()) { ReadingListSyncBehaviorDialogs.removeExistingListsOnLogoutDialog(MainActivity.this); } Prefs.setReadingListsLastSyncTime(null); Prefs.setReadingListSyncEnabled(false); }).show(); } else { getFragment().onLoginRequested(); } closeMainDrawer(); }
Source:
public void shouldRegisterWithKubernetesDeserializer() throws IOException { new CustomResourceOperationsImpl<>(context); JsonFactory factory = new MappingJsonFactory(); JsonParser parser = factory.createParser("{\n" + " \"apiVersion\": \"custom.group/v1alpha1\",\n" + " \"kind\": \"MyCustomResource\"\n" + "}"); KubernetesDeserializer deserializer = new KubernetesDeserializer(); KubernetesResource resource = deserializer.deserialize(parser, null); assertThat(resource, instanceOf(MyCustomResource.class)); }

Target:
public void shouldRegisterWithKubernetesDeserializer() throws IOException { new CustomResourceOperationsImpl<>(context); JsonFactory factory = new MappingJsonFactory(); JsonParser parser = factory.createParser("{\n" + " \"apiVersion\": \"custom.group/v1alpha1\",\n" + " \"kind\": \"MyCustomResource\"\n" + "}"); KubernetesDeserializer deserializer = new KubernetesDeserializer(); KubernetesResource resource = deserializer.deserialize(parser, null); assertThat(resource, instanceOf(MyCustomResource.class)); assertEquals("custom.group/v1alpha1", ((MyCustomResource) resource).getApiVersion()); }
Source:
void testAnyNull() { assertTrue(ObjectUtils.anyNull((Object) null)); assertTrue(ObjectUtils.anyNull(null, null, null)); assertFalse(ObjectUtils.anyNull()); assertFalse(ObjectUtils.anyNull((Object[]) null)); assertFalse(ObjectUtils.anyNull(FOO)); assertFalse(ObjectUtils.anyNull(null, FOO, null)); assertFalse(ObjectUtils.anyNull(null, null, null, null, FOO, BAR)); }

Target:
void testAnyNull() { assertTrue(ObjectUtils.anyNull((Object) null)); assertTrue(ObjectUtils.anyNull(null, null, null)); assertTrue(ObjectUtils.anyNull(null, null, null, null, FOO, BAR)); assertTrue(ObjectUtils.anyNull(null, FOO, null)); assertFalse(ObjectUtils.anyNull()); assertFalse(ObjectUtils.anyNull((Object[]) null)); assertFalse(ObjectUtils.anyNull(FOO)); assertFalse(ObjectUtils.anyNull(FOO, BAR)); }
Source:
private static void buildContext(final XContentBuilder b, Series series, boolean indexResourceIdentifiers) throws IOException { b.field(KEY, series.getKey()); b.startArray(TAGS); for (final Map.Entry<String, String> entry : series.getTags().entrySet()) { b.value(entry.getKey() + TAG_DELIMITER + entry.getValue()); } if(indexResourceIdentifiers) { for (final Map.Entry<String, String> entry : series.getResource().entrySet()) { b.value(entry.getKey() + TAG_DELIMITER + entry.getValue()); } } b.endArray(); b.startArray(TAG_KEYS); for (final Map.Entry<String, String> entry : series.getTags().entrySet()) { b.value(entry.getKey()); } if(indexResourceIdentifiers) { for (final Map.Entry<String, String> entry : series.getResource().entrySet()) { b.value(entry.getKey() + TAG_DELIMITER + entry.getValue()); } } b.endArray(); b.field(HASH_FIELD, series.hash()); }

Target:
private static void buildContext( final XContentBuilder b, Series series, boolean indexResourceIdentifiers ) throws IOException { b.field(KEY, series.getKey()); appendData(b, series.getTags(), TAGS, TAG_DELIMITER); b.startArray(TAG_KEYS); for (final Map.Entry<String, String> entry : series.getTags().entrySet()) { b.value(entry.getKey()); } b.endArray(); if (indexResourceIdentifiers) { appendData(b, series.getResource(), RESOURCE, TAG_DELIMITER); } b.field(HASH_FIELD, series.hash()); }
Source:
public static SecurityMode fromCode(int code) { switch (code) { case 0: return PSK; case 1: return RPK; case 2: return X509; case 3: return NO_SEC; default: throw new IllegalArgumentException(String.format("Unsupported security code : %d", code)); } }

Target:
public static SecurityMode fromCode(int code) { for (SecurityMode sm : SecurityMode.values()) { if (sm.code == code) { return sm; } } throw new IllegalArgumentException(String.format("Unsupported security code : %d", code)); }
Source:
private void collectOverriddenMethodsInInterfaces(ExecutableElement overridingMethod, TypeElement currentTypeElement, MethodInheritanceTree.Builder methodInheritanceTreeBuilder) { for ( TypeMirror implementedInterface : currentTypeElement.getInterfaces() ) { TypeElement interfaceTypeElement = (TypeElement) typeUtils.asElement( implementedInterface ); ExecutableElement overriddenMethod = getOverriddenMethod( overridingMethod, interfaceTypeElement ); if ( overriddenMethod != null ) { methodInheritanceTreeBuilder.addOverriddenMethod( overridingMethod, overriddenMethod ); collectOverriddenMethodsInInterfaces( overriddenMethod, interfaceTypeElement, methodInheritanceTreeBuilder ); } else { collectOverriddenMethodsInInterfaces( overridingMethod, interfaceTypeElement, methodInheritanceTreeBuilder ); } } }

Target:
private void collectOverriddenMethodsInInterfaces(ExecutableElement overridingMethod, TypeElement currentTypeElement, MethodInheritanceTree.Builder methodInheritanceTreeBuilder) { for ( TypeMirror implementedInterface : currentTypeElement.getInterfaces() ) { TypeElement interfaceTypeElement = (TypeElement) typeUtils.asElement( implementedInterface ); ExecutableElement overriddenMethod = getOverriddenMethod( overridingMethod, interfaceTypeElement ); ExecutableElement newOverridingMethod; if ( overriddenMethod != null ) { methodInheritanceTreeBuilder.addOverriddenMethod( overridingMethod, overriddenMethod ); newOverridingMethod = overriddenMethod; } else { newOverridingMethod = overridingMethod; } collectOverriddenMethodsInInterfaces( newOverridingMethod, interfaceTypeElement, methodInheritanceTreeBuilder ); } }
Source:
public void normal() { final TestSubscriber<Integer> ts = new TestSubscriber<Integer>(); Flowable.range(1, 5).mergeWith( Maybe.just(100) ) .subscribe(ts); ts.assertResult(1, 2, 3, 4, 5, 100); }

Target:
public void normal() { Flowable.range(1, 5) .mergeWith(Maybe.just(100)) .test() .assertResult(1, 2, 3, 4, 5, 100); }
Source:
public static void setSplitFile(Job job, String file) { URI uri = new Path(file).toUri(); DistributedCacheHelper.addCacheFile(uri, job.getConfiguration()); job.getConfiguration().set(CUTFILE_KEY, uri.getPath()); }

Target:
public static void setSplitFile(Job job, String file) { URI uri = new Path(file).toUri(); job.addCacheFile(uri); job.getConfiguration().set(CUTFILE_KEY, uri.getPath()); }
Source:
private void sendMessage(final Message message, final EmailConfiguration emailConfiguration) throws MessagingException { try (Transport transport = createSession(emailConfiguration).getTransport()) { transport.connect(); transport.sendMessage(message, message.getAllRecipients()); } }

Target:
private void sendMessage(final Message message, final EmailConfiguration emailConfiguration) throws MessagingException { try (Transport transport = Optional.ofNullable(session).orElseGet(() -> createSession(emailConfiguration)).getTransport()) { transport.connect(); transport.sendMessage(message, message.getAllRecipients()); } }
Source:
private static boolean isSingleLineSwitchMember(DetailAST statement) { final boolean isInSwitchRule = statement.getParent().getType() == TokenTypes.SWITCH_RULE; final boolean result; if (isInSwitchRule) { result = isSingleLineSwitchRule(statement); } else { result = isSingleLineCaseGroup(statement); } return result; }

Target:
private static boolean isSingleLineSwitchMember(DetailAST statement) { final boolean result; if (isInSwitchRule(statement)) { result = isSingleLineSwitchRule(statement); } else { result = isSingleLineCaseGroup(statement); } return result; }
Source:
public void define(WebService.NewController controller) { controller.createAction(ARRAY_UPGRADES) .setDescription("Lists available upgrades for the SonarQube instance (if any) and for each one, " + "lists incompatible plugins and plugins requiring upgrade." + "<br/>" + "Plugin information is retrieved from Update Center. Date and time at which Update Center was last refreshed " + "is provided in the response.") .setSince("5.2") .setHandler(this) .setResponseExample(Resources.getResource(this.getClass(), "example-upgrades_plugins.json")); }

Target:
public void define(WebService.NewController controller) { controller.createAction("upgrades") .setDescription("Lists available upgrades for the SonarQube instance (if any) and for each one, " + "lists incompatible plugins and plugins requiring upgrade." + "<br/>" + "Plugin information is retrieved from Update Center. Date and time at which Update Center was last refreshed " + "is provided in the response.") .setSince("5.2") .setHandler(this) .setResponseExample(Resources.getResource(this.getClass(), "example-upgrades_plugins.json")); }
Source:
public void validateMemberInGroup(PerunSession sess, Member member, Group group) throws InternalErrorException { if (group == null) { throw new InternalErrorException("Group can not be null."); } if (VosManager.MEMBERS_GROUP.equals(group.getName())) { throw new InternalErrorException("Can not expire member in members group."); } if (member == null) { throw new InternalErrorException("Member to expire can not be null"); } MemberGroupStatus previousStatus = getDirectMemberGroupStatus(sess, member, group); if (MemberGroupStatus.VALID.equals(previousStatus)) { log.warn("Validating member in group where is already validated. Member: {}, Group: {}", member, group); } groupsManagerImpl.setDirectGroupStatus(sess, member, group, MemberGroupStatus.VALID); recalculateMemberGroupStatusRecursively(sess, member, group); }

Target:
public void validateMemberInGroup(PerunSession sess, Member member, Group group) throws InternalErrorException { if (group == null) { throw new InternalErrorException("Group can not be null."); } if (VosManager.MEMBERS_GROUP.equals(group.getName())) { throw new InternalErrorException("Can not validate member in members group."); } if (member == null) { throw new InternalErrorException("Member to validate can not be null"); } MemberGroupStatus previousStatus = getDirectMemberGroupStatus(sess, member, group); if (MemberGroupStatus.VALID.equals(previousStatus)) { log.warn("Validating member in group where is already validated. Member: {}, Group: {}", member, group); } groupsManagerImpl.setDirectGroupStatus(sess, member, group, MemberGroupStatus.VALID); recalculateMemberGroupStatusRecursively(sess, member, group); }
Source:
public void onComplete() { subscribers.dispose(); synchronized (this) { Map<Long, C> bufs = buffers; if (bufs == null) { return; } for (C b : bufs.values()) { queue.offer(b); } bufs = null; } done = true; drain(); }

Target:
public void onComplete() { subscribers.dispose(); synchronized (this) { Map<Long, C> bufs = buffers; if (bufs == null) { return; } for (C b : bufs.values()) { queue.offer(b); } buffers = null; } done = true; drain(); }
Source:
public SingleStringInputCachingExpressionColumnValueSelector( final DimensionSelector selector, final Expr expression ) { if (Parser.findRequiredBindings(expression).size() != 1) { throw new ISE("WTF?! Expected expression with just one binding"); } this.selector = Preconditions.checkNotNull(selector, "selector"); this.expression = Preconditions.checkNotNull(expression, "expression"); if (selector.getValueCardinality() == DimensionSelector.CARDINALITY_UNKNOWN) { throw new ISE("Selector must have a dictionary"); } final Supplier<Object> inputSupplier = ExpressionSelectors.supplierFromDimensionSelector(selector); this.bindings = name -> inputSupplier.get(); if (selector.getValueCardinality() <= CACHE_SIZE) { arrayEvalCache = new ExprEval[selector.getValueCardinality()]; lruEvalCache = null; } else { arrayEvalCache = null; lruEvalCache = new LruEvalCache(expression, bindings); } }

Target:
public SingleStringInputCachingExpressionColumnValueSelector( final DimensionSelector selector, final Expr expression ) { if (Parser.findRequiredBindings(expression).size() != 1) { throw new ISE("WTF?! Expected expression with just one binding"); } this.selector = Preconditions.checkNotNull(selector, "selector"); this.expression = Preconditions.checkNotNull(expression, "expression"); final Supplier<Object> inputSupplier = ExpressionSelectors.supplierFromDimensionSelector(selector); this.bindings = name -> inputSupplier.get(); if (selector.getValueCardinality() == DimensionSelector.CARDINALITY_UNKNOWN) { throw new ISE("Selector must have a dictionary"); } else if (selector.getValueCardinality() <= CACHE_SIZE) { arrayEvalCache = new ExprEval[selector.getValueCardinality()]; lruEvalCache = null; } else { arrayEvalCache = null; lruEvalCache = new LruEvalCache(expression, bindings); } }
Source:
public static EObject getEObjectValue(View view, String property, EObject defaultValue) { EObject value = defaultValue; EClass eObjectValueStyle = NotationPackage.eINSTANCE.getEObjectValueStyle(); NamedStyle style; if (eObjectValueStyle != null) { style = view.getNamedStyle(eObjectValueStyle, property); if (style instanceof EObjectValueStyle) { value = ((EObjectValueStyle) style).getEObjectValue(); } } return value; }

Target:
public static EObject getEObjectValue(View view, String property, EObject defaultValue) { EObject value = defaultValue; EClass eObjectValueStyle = NotationPackage.eINSTANCE.getEObjectValueStyle(); if (eObjectValueStyle != null) { NamedStyle style = view.getNamedStyle(eObjectValueStyle, property); if (style instanceof EObjectValueStyle) { value = ((EObjectValueStyle) style).getEObjectValue(); } } return value; }
Source:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; ensureSessionHasToken(httpRequest.getSession(false)); switch (httpRequest.getMethod().toUpperCase()) { case "POST": case "PUT": case "DELETE": { if (CSRFTokenCheck.INSTANCE.isInsecure(httpRequest, log)) { CSRFTokenCheck.INSTANCE.prepareResponse(httpRequest, (HttpServletResponse) response, log); return; } } case "GET": { final HttpServletResponse responseWrapper = noCache(getCharResponseWrapper((HttpServletResponse) response)); chain.doFilter(httpRequest, responseWrapper); final HttpSession session = httpRequest.getSession(false); final byte[] bytes; final String output; final String responseContentType = responseWrapper.getContentType(); if (session != null && responseContentType != null && responseContentType.toLowerCase().startsWith("text/html")) { CSRFTokenCheck.INSTANCE.prepareSession(session, log); final Document document = Jsoup.parse(responseWrapper.toString()); String injectedScript = "<script>var " + ERRAI_CSRF_TOKEN_VAR + " = '" + CSRFTokenCheck.getToken(session) + "';</script>"; document.head().prepend(injectedScript); output = document.html(); bytes = output.getBytes("UTF-8"); } else { output = responseWrapper.toString(); bytes = output.getBytes("UTF-8"); } response.setContentLength(bytes.length); if (isOuputStream) { response.getOutputStream().write(bytes); } else { response.getWriter().print(output); } return; } } chain.doFilter(request, response); }

Target:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; ensureSessionHasToken(httpRequest.getSession(false)); switch (httpRequest.getMethod().toUpperCase()) { case "POST": case "PUT": case "DELETE": { if (CSRFTokenCheck.INSTANCE.isInsecure(httpRequest, log)) { CSRFTokenCheck.INSTANCE.prepareResponse(httpRequest, (HttpServletResponse) response, log); return; } } case "GET": { final HttpServletResponse responseWrapper = noCache(getCharResponseWrapper((HttpServletResponse) response)); chain.doFilter(httpRequest, responseWrapper); final HttpSession session = httpRequest.getSession(false); final byte[] bytes; final String output; final String responseContentType = responseWrapper.getContentType(); if (session != null && responseContentType != null && responseContentType.toLowerCase().startsWith("text/html")) { CSRFTokenCheck.INSTANCE.prepareSession(session, log); final Document document = Jsoup.parse(responseWrapper.toString()); String injectedScript = "<script>var " + ERRAI_CSRF_TOKEN_VAR + " = '" + CSRFTokenCheck.getToken(session) + "';</script>"; document.head().prepend(injectedScript); output = document.html(); } else { output = responseWrapper.toString(); } bytes = output.getBytes("UTF-8"); response.setContentLength(bytes.length); response.getWriter().print(output); return; } } chain.doFilter(request, response); }
Source:
public void copyRuntimeResources() { try { getLocation().execCommands("create run directory", ImmutableList.of("mkdir -p " + getRunDir())); Map<String, String> runtimeFiles = entity.getConfig(SoftwareProcess.RUNTIME_FILES); if (runtimeFiles != null && runtimeFiles.size() > 0) { for (String source : runtimeFiles.keySet()) { String target = runtimeFiles.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getRunDir(), target); copyResource(source, destination, true); } } Map<String, String> runtimeTemplates = entity.getConfig(SoftwareProcess.RUNTIME_TEMPLATES); if (runtimeTemplates != null && runtimeTemplates.size() > 0) { for (String source : runtimeTemplates.keySet()) { String target = runtimeTemplates.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getRunDir(), target); copyTemplate(source, destination, true, MutableMap.<String, Object>of()); } } } catch (Exception e) { Exceptions.propagateIfFatal(e); } }

Target:
public void copyRuntimeResources() { try { execute("mkdir -p " + getRunDir(), "create run directory"); Map<String, String> runtimeFiles = entity.getConfig(SoftwareProcess.RUNTIME_FILES); if (runtimeFiles != null && runtimeFiles.size() > 0) { for (String source : runtimeFiles.keySet()) { String target = runtimeFiles.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getRunDir(), target); copyResource(source, destination, true); } } Map<String, String> runtimeTemplates = entity.getConfig(SoftwareProcess.RUNTIME_TEMPLATES); if (runtimeTemplates != null && runtimeTemplates.size() > 0) { for (String source : runtimeTemplates.keySet()) { String target = runtimeTemplates.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getRunDir(), target); copyTemplate(source, destination, true, MutableMap.<String, Object>of()); } } } catch (Exception e) { log.warn("Error copying runtime resources", e); throw Exceptions.propagate(e); } }
Source:
public void update(Session session) { TagDAO tags = new TagDAO(session); int maxRecentTags = Integer.parseInt(env.get("max_recent_tags")); this.recentTagsUsage = tags.getRecentTagsSince(new DateTime().minusMonths(3), maxRecentTags); }

Target:
public void update(Session session) { TagDAO tags = new TagDAO(session); int maxRecentTags = env.has("max_recent_tags") ? Integer.parseInt(env.get("max_recent_tags")) : 10; this.recentTagsUsage = tags.getRecentTagsSince(new DateTime().minusMonths(3), maxRecentTags); }
Source:
private void addProjectListener() { model.addFieldListener(model.getProject(), new FieldListener() { @Override public void modelChanged(FieldEvent event) { addChildrenListener(); } @Override public boolean listenToField(String fieldName) { return EditScene.NAME.equals(fieldName); } }); }

Target:
private void addProjectListener() { model.addFieldListener(model.getProject(), new FieldListener() { @Override public void modelChanged(FieldEvent event) { addChildrenListener(); } @Override public boolean listenToField(String fieldName) { return "editScene".equals(fieldName); } }); }
Source:
public Set<Player> getViewers() { return ImmutableSet.copyOf((Set) playerList); }

Target:
public Set<Player> getViewers() { return ImmutableSet.copyOf((Set) this.playerList); }
Source:
public void initForViewByQuestion(InstructorAttributes instructor, String selectedSection, String showStats, String groupByTeam) { this.viewType = ViewType.QUESTION; this.sortType = ViewType.QUESTION.toString(); initCommonVariables(instructor, selectedSection, showStats, groupByTeam); Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> questionToResponseMap = bundle.getQuestionResponseMap(); questionPanels = new ArrayList<InstructorFeedbackResultsQuestionTable>(); boolean isLoadingStructureOnly = questionToResponseMap.size() > 1; for (Map.Entry<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> entry : questionToResponseMap.entrySet()) { FeedbackQuestionAttributes question = entry.getKey(); List<FeedbackResponseAttributes> responses = entry.getValue(); InstructorFeedbackResultsQuestionTable questionPanel = buildQuestionTableAndResponseRows(question, responses, ""); if (isLoadingStructureOnly) { questionPanel.setQuestionHasResponses(false); } questionPanels.add(questionPanel); } }

Target:
public void initForViewByQuestion(InstructorAttributes instructor, String selectedSection, String showStats, String groupByTeam) { this.viewType = ViewType.QUESTION; this.sortType = ViewType.QUESTION.toString(); initCommonVariables(instructor, selectedSection, showStats, groupByTeam); Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> questionToResponseMap = bundle.getQuestionResponseMap(); questionPanels = new ArrayList<InstructorFeedbackResultsQuestionTable>(); boolean isLoadingStructureOnly = questionToResponseMap.size() > 1; for (Map.Entry<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> entry : questionToResponseMap.entrySet()) { FeedbackQuestionAttributes question = entry.getKey(); List<FeedbackResponseAttributes> responses = entry.getValue(); InstructorFeedbackResultsQuestionTable questionPanel; if (isLoadingStructureOnly) { questionPanel = buildQuestionTableWithoutResponseRows(question, responses, ""); questionPanel.setHasResponses(false); } else { questionPanel = buildQuestionTableAndResponseRows(question, responses, ""); } questionPanels.add(questionPanel); } }
Source:
public void run() { try (SweepLocks locks = createSweepLocks()) { waitUntilSpecificTableSweeperIsInitialized(); Thread.sleep(getBackoffTimeWhenSweepHasNotRun()); log.info("Starting background sweeper."); while (true) { SweepOutcome outcome = checkConfigAndRunSweep(locks); log.info("Sweep iteration finished with outcome: {}", SafeArg.of("sweepOutcome", outcome)); updateBatchSize(outcome); updateMetrics(outcome); sleepUntilNextRun(outcome); } } catch (InterruptedException e) { log.warn("Shutting down background sweeper. Please restart the service to rerun background sweep."); sweepOutcomeMetrics.shutdown(); } catch (Throwable t) { log.error("BackgroundSweeper failed fatally and will not rerun until restarted: {}", UnsafeArg.of("message", t.getMessage()), t); sweepOutcomeMetrics.fatal(); } }

Target:
public void run() { try (SweepLocks locks = createSweepLocks()) { waitUntilSpecificTableSweeperIsInitialized(); Thread.sleep(getBackoffTimeWhenSweepHasNotRun()); log.info("Starting background sweeper."); while (true) { SweepOutcome outcome = checkConfigAndRunSweep(locks); log.info("Sweep iteration finished with outcome: {}", SafeArg.of("sweepOutcome", outcome)); updateBatchSize(outcome); updateMetrics(outcome); sleepUntilNextRun(outcome); } } catch (InterruptedException e) { log.warn("Shutting down background sweeper. Please restart the service to rerun background sweep."); sweepOutcomeMetrics.registerOccurrenceOf(SweepOutcome.SHUTDOWN); } catch (Throwable t) { log.error("BackgroundSweeper failed fatally and will not rerun until restarted: {}", UnsafeArg.of("message", t.getMessage()), t); sweepOutcomeMetrics.registerOccurrenceOf(SweepOutcome.FATAL); } }
Source:
public void serialize(OutputArchive oa) throws IOException { Map<Long, List<ACL>> clonedLongKeyMap; synchronized (this) { clonedLongKeyMap = new HashMap<Long, List<ACL>>(longKeyMap); } oa.writeInt(clonedLongKeyMap.size(), "map"); for (Map.Entry<Long, List<ACL>> val : clonedLongKeyMap.entrySet()) { oa.writeLong(val.getKey(), "long"); List<ACL> aclList = val.getValue(); oa.startVector(aclList, "acls"); for (ACL acl : aclList) { acl.serialize(oa, "acl"); } oa.endVector(aclList, "acls"); } }

Target:
public void serialize(OutputArchive oa) throws IOException { Map<Long, List<ACL>> clonedLongKeyMap; synchronized (this) { clonedLongKeyMap = new HashMap<>(longKeyMap); } oa.writeInt(clonedLongKeyMap.size(), "map"); for (Map.Entry<Long, List<ACL>> val : clonedLongKeyMap.entrySet()) { oa.writeLong(val.getKey(), "long"); List<ACL> aclList = val.getValue(); oa.startVector(aclList, "acls"); for (ACL acl : aclList) { acl.serialize(oa, "acl"); } oa.endVector(aclList, "acls"); } }
Source:
public void handleMessage(Message msg) { switch(msg.what) { case MSG_SHOW_NO_UPSTREAM: final Resources res = getResourcesForSubId(mContext, mActiveDataSubId); final String title = res.getString(R.string.no_upstream_notification_title); final String message = res.getString(R.string.no_upstream_notification_message); final String disableButton = res.getString(R.string.no_upstream_notification_disable_button); final PendingIntent pi = PendingIntent.getBroadcast( mContext.createContextAsUser(UserHandle.CURRENT, 0), 0 , new Intent(ACTION_DISABLE_TETHERING), 0 ); final Action action = new Action.Builder(NO_ICON_ID, disableButton, pi).build(); showNotification(R.drawable.stat_sys_tether_general, title, message, NO_UPSTREAM_NOTIFICATION_ID, null , action); break; } }

Target:
public void handleMessage(Message msg) { switch(msg.what) { case EVENT_SHOW_NO_UPSTREAM: notifyTetheringNoUpstream(); break; } }
Source:
public E save(final E entity) { if (entity.getId() == null) { entityManager.persist(entity); return entity; } else { return entityManager.merge(entity); } }

Target:
public E save(final E entity) { Assert.requireNonNull(entity , "entity"); if (entity.getId() == null) { entityManager.persist(entity); return entity; } else { return entityManager.merge(entity); } }
Source:
public void setAscent (int ascent) { checkLayout(); if (ascent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.ascent == ascent) return; freeRuns(); this.ascent = ascent; }

Target:
public void setAscent (int ascent) { checkLayout(); if (ascent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); ascent = DPIUtil.autoScaleUp(ascent); if (this.ascentInPixels == ascent) return; freeRuns(); this.ascentInPixels = ascent; }
Source:
public static Response<AssetReportGetResponse> waitTillReady( PlaidClient client, String assetReportToken) throws Exception { int NUM_RETRIES = 20; int INTER_REQUEST_SLEEP = 1000; int attempt = 0; Response<AssetReportGetResponse> response; do { boolean includeInsights = false; AssetReportGetRequest assetReportGet = new AssetReportGetRequest(assetReportToken) .withIncludeInsights(includeInsights); response = client.service().assetReportGet(assetReportGet).execute(); attempt++; Thread.sleep(INTER_REQUEST_SLEEP); } while ( !response.isSuccessful() && response.errorBody() != null && client.parseError(response).getErrorCode().equals(PRODUCT_NOT_READY) && attempt < NUM_RETRIES ); if (!response.isSuccessful()) { throw new Exception( String.format("Could not get asset report. Failed with %s", client.parseError(response).getErrorMessage() )); } return response; }

Target:
public static Response<AssetReportGetResponse> waitTillReady( PlaidClient client, String assetReportToken) throws Exception { int NUM_RETRIES = 20; int INTER_REQUEST_SLEEP = 1000; int attempt = 0; Response<AssetReportGetResponse> response; do { AssetReportGetRequest assetReportGet = new AssetReportGetRequest(assetReportToken); response = client.service().assetReportGet(assetReportGet).execute(); attempt++; Thread.sleep(INTER_REQUEST_SLEEP); } while ( !response.isSuccessful() && response.errorBody() != null && client.parseError(response).getErrorCode().equals(PRODUCT_NOT_READY) && attempt < NUM_RETRIES ); if (!response.isSuccessful()) { throw new Exception( String.format("Could not get asset report. Failed with %s", client.parseError(response).getErrorMessage() )); } return response; }
Source:
public static String HEX(String s) throws UnsupportedEncodingException { if (s == null) return null; else { byte[] b = s.getBytes("UTF-8"); return StringUtil.toHexString(b, 0, b.length).toUpperCase(); } }

Target:
public static String HEX(String s) throws UnsupportedEncodingException { if (s == null) return null; else { byte[] b = s.getBytes(Bytes.UTF8_CHARSET); return StringUtil.toHexString(b, 0, b.length).toUpperCase(); } }
Source:
public double predict(Double[] input) { LeapFrameBuilder builder = new LeapFrameBuilder(); List<StructField> structFields = new ArrayList<>(); for (String fieldName : schema) structFields.add(new StructField(fieldName, ScalarType.Double())); StructType schema = builder.createSchema(structFields); List<Row> rows = new ArrayList<>(); rows.add(builder.createRowFromIterable(Arrays.asList(input))); DefaultLeapFrame inputFrame = builder.createFrame(schema, rows); return predict(inputFrame); }

Target:
public double predict(Double[] input) { if (input.length != schema.size()) throw new IllegalArgumentException("Input size is not equal to schema size"); Map<String, Double> vec = IntStream.range(0, input.length) .boxed() .collect(Collectors.toMap(schema::get, i -> input[i])); return predict(new HashMap<>(vec)); }
Source:
public void setupSelectComponent(final DataTypeSelect typeSelect) { type.innerHTML = ""; HTMLElement element = typeSelect.getElement(); if (element instanceof HTMLDivElement) { new MenuInitializer((HTMLDivElement) element, ".btn-group").init(); } type.appendChild(typeSelect.getElement()); }

Target:
public void setupSelectComponent(final DataTypeSelect typeSelect) { type.innerHTML = ""; final HTMLElement element = typeSelect.getElement(); new MenuInitializer(element, ".btn-group").init(); type.appendChild(element); }
Source:
public void migrate() { String connectionUrl = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_URL); String connectionUsername = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_USERNAME); String connectionPassword = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_PASSWORD); String locations = ninjaProperties.get(NinjaConstant.NINJA_MIGRATION_LOCATIONS); String schemas = this.ninjaProperties.get(NinjaConstant.NINJA_MIGRATION_SCHEMAS); Flyway flyway = new Flyway(); flyway.setDataSource(connectionUrl, connectionUsername, connectionPassword); if (locations != null) flyway.setLocations(locations); if (schemas != null) flyway.setSchemas(schemas); if (ninjaProperties.getBooleanWithDefault(NinjaConstant.NINJA_MIGRATION_DROP_SCHEMA, ninjaProperties.isTest() ? true : false )) { flyway.clean(); } flyway.migrate(); }

Target:
public void migrate() { String connectionUrl = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_URL); String connectionUsername = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_USERNAME); String connectionPassword = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_PASSWORD); String locations = ninjaProperties.get(NinjaConstant.NINJA_MIGRATION_LOCATIONS); String schemas = ninjaProperties.get(NinjaConstant.NINJA_MIGRATION_SCHEMAS); Flyway flyway = flywayProvider.get(); flyway.setDataSource(connectionUrl, connectionUsername, connectionPassword); if (locations != null) { flyway.setLocations(locations); } if (schemas != null) { flyway.setSchemas(schemas); } if (ninjaProperties.getBooleanWithDefault(NinjaConstant.NINJA_MIGRATION_DROP_SCHEMA, ninjaProperties.isTest() ? true : false )) { flyway.clean(); } flyway.migrate(); }
Source:
@Override Expression implementSafe(RexToLixTranslator translator, RexCall call, List<Expression> argValueList) { final Expression argValue = argValueList.get(0); final Expression e; if (expressionType == ExpressionType.Negate && argValue.type == BigDecimal.class) { e = Expressions.call(BuiltInMethod.DECIMAL_NEGATE.method, argValue); } else { e = Expressions.makeUnary(expressionType, argValue); } if (e.type.equals(argValue.type)) { return e; } return Expressions.convert_(e, argValue.type); }

Target:
@Override Expression implementSafe(RexToLixTranslator translator, RexCall call, List<Expression> argValueList) { final Expression argValue = argValueList.get(0); final Expression e; if (expressionType == ExpressionType.Negate && argValue.type == BigDecimal.class && null != backupMethodName) { e = Expressions.call(argValue, backupMethodName); } else { e = Expressions.makeUnary(expressionType, argValue); } if (e.type.equals(argValue.type)) { return e; } return Expressions.convert_(e, argValue.type); }
Source:
public Object readBlocksWithoutJni(BenchmarkData data) throws Throwable { OrcBatchRecordReader recordReader = data.createRecordReader(false); List<Block> blocks = new ArrayList<>(); while (recordReader.nextBatch() > 0) { Block block = recordReader.readBlock(data.type, 0); blocks.add(block); } return blocks; }

Target:
public Object readBlocksWithoutJni(BenchmarkData data) throws Throwable { OrcBatchRecordReader recordReader = data.createRecordReader(false); ImmutableList.Builder<Block> blocks = new ImmutableList.Builder<>(); while (recordReader.nextBatch() > 0) { Block block = recordReader.readBlock(0); blocks.add(block); } return blocks.build(); }
Source:
public Map<String, Metric> getMetrics() { return metrics; }

Target:
public Map<String, Metric> getMetrics() { return Collections.unmodifiableMap(metrics); }
Source:
public synchronized void dispose() { ReactContext reactContext = (ReactContext) mContext; reactContext.removeLifecycleEventListener(mLifeCycleListener); if(mLocationLayer != null){ mLocationLayer.onStop(); } mLocationManger.dispose(); final RCTMGLMapView mapView = this; reactContext.runOnUiQueueThread(new Runnable() { @Override public void run() { mapView.onDestroy(); } }); }

Target:
public synchronized void dispose() { if (mDestroyed) { return; } ReactContext reactContext = (ReactContext) mContext; reactContext.removeLifecycleEventListener(mLifeCycleListener); if(mLocationLayer != null){ mLocationLayer.onStop(); } mLocationManger.dispose(); if (!mPaused) { onPause(); } onStop(); onDestroy(); }
Source:
public DescriptorImpl getDescriptor() { return (DescriptorImpl) Jenkins.getInstance().getDescriptor(RoleBasedProjectNamingStrategy.class); }

Target:
public DescriptorImpl getDescriptor() { return (DescriptorImpl) Jenkins.getActiveInstance().getDescriptor(RoleBasedProjectNamingStrategy.class); }
Source:
private String getShortDescription(final String extensionName) throws FalconException { AbstractExtension extension = ExtensionFactory.getExtensionType(extensionName); return extension.getDescription(); }

Target:
private String getShortDescription(final String extensionName) throws FalconException { String content = getResource(extensionName, extensionName.toLowerCase() + EXTENSION_PROPERTY_JSON_SUFFIX); String description; try { JSONObject jsonObject = new JSONObject(content); description = (String) jsonObject.get(SHORT_DESCRIPTION); } catch (JSONException e) { throw new FalconException(e); } return description; }
Source:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final Page.Content page = get().get(select(req)); final CurrentUser user = currentUser.get(); final StringWriter w = new StringWriter(); if (user instanceof IdentifiedUser) { w.write(HPD_ID + ".account="); json(((IdentifiedUser) user).getAccount(), w); w.write(";"); w.write(HPD_ID + ".xsrfToken="); json(session.get().getToken(), w); w.write(";"); w.write(HPD_ID + ".accountDiffPref="); json(((IdentifiedUser) user).getAccountDiffPreference(), w); w.write(";"); w.write(HPD_ID + ".theme="); json(signedInTheme, w); w.write(";"); } else { w.write(HPD_ID + ".theme="); json(signedOutTheme, w); w.write(";"); } w.write(HPD_ID + ".plugnisUrls="); json(getPluginUrls(), w); w.write(";"); final byte[] userData = w.toString().getBytes("UTF-8"); final byte[] raw = concat(page.part1, userData, page.part2); final byte[] tosend; if (RPCServletUtils.acceptsGzipEncoding(req)) { rsp.setHeader("Content-Encoding", "gzip"); tosend = HtmlDomUtil.compress(raw); } else { tosend = raw; } rsp.setHeader("Expires", "Fri, 01 Jan 1980 00:00:00 GMT"); rsp.setHeader("Pragma", "no-cache"); rsp.setHeader("Cache-Control", "no-cache, must-revalidate"); rsp.setContentType("text/html"); rsp.setCharacterEncoding(HtmlDomUtil.ENC); rsp.setContentLength(tosend.length); final OutputStream out = rsp.getOutputStream(); try { out.write(tosend); } finally { out.close(); } }

Target:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final Page.Content page = get().get(select(req)); final CurrentUser user = currentUser.get(); final StringWriter w = new StringWriter(); if (user instanceof IdentifiedUser) { w.write(HPD_ID + ".account="); json(((IdentifiedUser) user).getAccount(), w); w.write(";"); w.write(HPD_ID + ".xsrfToken="); json(session.get().getToken(), w); w.write(";"); w.write(HPD_ID + ".accountDiffPref="); json(((IdentifiedUser) user).getAccountDiffPreference(), w); w.write(";"); w.write(HPD_ID + ".theme="); json(signedInTheme, w); w.write(";"); } else { w.write(HPD_ID + ".theme="); json(signedOutTheme, w); w.write(";"); } w.write(HPD_ID + ".pluginUrls="); json(getPluginUrls(), w); w.write(";"); final byte[] userData = w.toString().getBytes("UTF-8"); final byte[] raw = concat(page.part1, userData, page.part2); final byte[] tosend; if (RPCServletUtils.acceptsGzipEncoding(req)) { rsp.setHeader("Content-Encoding", "gzip"); tosend = HtmlDomUtil.compress(raw); } else { tosend = raw; } rsp.setHeader("Expires", "Fri, 01 Jan 1980 00:00:00 GMT"); rsp.setHeader("Pragma", "no-cache"); rsp.setHeader("Cache-Control", "no-cache, must-revalidate"); rsp.setContentType("text/html"); rsp.setCharacterEncoding(HtmlDomUtil.ENC); rsp.setContentLength(tosend.length); final OutputStream out = rsp.getOutputStream(); try { out.write(tosend); } finally { out.close(); } }
Source:
public PinotQueryGeneratorContext visitMarkDistinct(MarkDistinctNode node, PinotQueryGeneratorContext context) { context = node.getSource().accept(this, context); requireNonNull(context, "context is null"); return context; }

Target:
public PinotQueryGeneratorContext visitMarkDistinct(MarkDistinctNode node, PinotQueryGeneratorContext context) { requireNonNull(context, "context is null"); return node.getSource().accept(this, context); }
Source:
public void controller(FragmentModel model, @FragmentParam(required = true, value = "conceptId") Concept concept) throws Exception { Collection<Map<String, String>> collection = new ArrayList<Map<String, String>>(); if(concept == null){ model.put("conceptAnswers", collection); } else{ Map<String, String> conceptMap; Locale locale = Context.getLocale(); Collection<ConceptAnswer> conceptAnswers = concept.getAnswers(); String fullname = null; for (ConceptAnswer conceptAnswer : conceptAnswers) { conceptMap = new HashMap<String, String>(); fullname = conceptAnswer.getAnswerConcept().getFullySpecifiedName(locale).getName(); conceptMap.put("label", fullname); conceptMap.put("value", fullname); collection.add(conceptMap); } model.put("conceptAnswers", collection); } }

Target:
public void controller(FragmentModel model, @FragmentParam(required = true, value = "conceptId") Concept concept) throws Exception { Collection<Map<String, String>> collection = new ArrayList<Map<String, String>>(); if(concept == null){ model.put("conceptAnswers", collection); } else{ Map<String, String> conceptMap; Locale locale = Context.getLocale(); Collection<ConceptAnswer> conceptAnswers = concept.getAnswers(); String fullname = null; for (ConceptAnswer conceptAnswer : conceptAnswers) { conceptMap = new HashMap<String, String>(); fullname = conceptAnswer.getAnswerConcept().getName().getName(); conceptMap.put("label", fullname); conceptMap.put("value", fullname); collection.add(conceptMap); } model.put("conceptAnswers", collection); } }
Source:
private static Map<String, String> getHiveVarMap(String[] args) { if (args == null) { return Collections.emptyMap(); } Map<String, String> hiveVarMap = new HashMap<String, String>(); for (int index = 0; index < args.length; index++) { if ("-hivevar".equals(args[index])) { String hiveVarParam = stripSingleDoubleQuote(args[++index]); int gap = hiveVarParam.indexOf("="); if (gap == -1) { logger.warn("Invalid hivevar: " + hiveVarParam); continue; } String name = hiveVarParam.substring(0, gap); String value = hiveVarParam.substring(gap + 1); logger.info("Setting hivevar: " + name + "=" + value); hiveVarMap.put(name, value); } } return hiveVarMap; }

Target:
static Map<String, String> getHiveVarMap(String[] args) { if (args == null) { return Collections.emptyMap(); } Map<String, String> hiveVarMap = new HashMap<String, String>(); for (int index = 0; index < args.length; index++) { if ("-hivevar".equals(args[index])) { String hiveVarParam = stripSingleDoubleQuote(args[++index]); int gap = hiveVarParam.indexOf("="); if (gap == -1) { logger.warn("Invalid hivevar: " + hiveVarParam); continue; } String name = hiveVarParam.substring(0, gap); String value = hiveVarParam.substring(gap + 1); logger.info("Setting hivevar: " + name + "=" + value); hiveVarMap.put(name, value); } } return hiveVarMap; }
Source:
private static IType getDeclType(ICPPASTSimpleDeclSpecifier spec) { IASTExpression expr = spec.getDeclTypeExpression(); if (expr == null) { return null; } int specifierType = spec.getType(); if (specifierType == IASTSimpleDeclSpecifier.t_decltype || specifierType == IASTSimpleDeclSpecifier.t_decltype_auto) { return getDeclType(expr); } return expr.getExpressionType(); }

Target:
private static IType getDeclType(ICPPASTSimpleDeclSpecifier spec) { IASTExpression expr = spec.getDeclTypeExpression(); if (expr == null) { return null; } int specifierType = spec.getType(); if (specifierType == IASTSimpleDeclSpecifier.t_decltype) { return getDeclType(expr); } return expr.getExpressionType(); }
Source:
public static FileReftableDatabase convertFrom(FileRepository repo, File refstackName, boolean writeLogs) throws IOException { FileReftableDatabase newDb = null; try { File reftableDir = new File(repo.getDirectory(), Constants.REFTABLE); if (!reftableDir.isDirectory()) { reftableDir.mkdir(); } try (FileReftableStack stack = new FileReftableStack(refstackName, reftableDir, null, () -> repo.getConfig())) { stack.addReftable(rw -> writeConvertTable(repo, rw, writeLogs)); } } catch (Exception e) { refstackName.delete(); throw e; } return newDb; }

Target:
public static FileReftableDatabase convertFrom(FileRepository repo, File refstackName, boolean writeLogs) throws IOException { FileReftableDatabase newDb = null; try { File reftableDir = new File(repo.getDirectory(), Constants.REFTABLE); if (!reftableDir.isDirectory()) { reftableDir.mkdir(); } try (FileReftableStack stack = new FileReftableStack(refstackName, reftableDir, null, () -> repo.getConfig())) { stack.addReftable(rw -> writeConvertTable(repo, rw, writeLogs)); } refstackName = null; } finally { if (refstackName != null) { refstackName.delete(); } } return newDb; }
Source:
public static String sanitizeForJs(String str){ if(str == null) return null; return Sanitizer.sanitizeForHtml( str.replace("\\", "\\\\") .replace("\"", "\\\"") .replace("'", "\\'") .replace("#", "\\#")); }

Target:
public static String sanitizeForJs(String str) { if (str == null) { return null; } return Sanitizer.sanitizeForHtml( str.replace("\\", "\\\\") .replace("\"", "\\\"") .replace("'", "\\'") .replace("#", "\\#")); }
Source:
protected void onCellDoubleClick(final int row, int column) { if (row == 0) { if (column == 1 || column == A) { createCommentEditor(row + 1, A, 0, (short) 0); } else if (column == B || column == 4) { createCommentEditor(row + 1, B, 0, (short) 1); } } else if ((column > 0 && getRowItem(row) instanceof PatchLine)) { final PatchLine line = (PatchLine) getRowItem(row); if (column == 1 || column == A) { createCommentEditor(row + 1, A, line.getLineA(), (short) 0); } else if (column == B || column == 4) { createCommentEditor(row + 1, B, line.getLineB(), (short) 1); } } }

Target:
protected void onCellDoubleClick(final int row, int column) { if (column > 0) { if (row == FILE_COMMENT_ROW) { createCommentEditor(row + 1, column == A ? A : B, 0, column == A ? (short) 0 : (short) 1); return; } if (getRowItem(row) instanceof PatchLine) { final PatchLine line = (PatchLine) getRowItem(row); if (column == 1 || column == A) { createCommentEditor(row + 1, A, line.getLineA(), (short) 0); } else if (column == B || column == 4) { createCommentEditor(row + 1, B, line.getLineB(), (short) 1); } } } }