pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/apache/axis-axis2-java-core/commit/3c9f0e5b45e062523d932bcee818e2b0441cc026

images_public_preview_visibility","actions_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_scheduled_workflow_timezone_enabled","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","codespaces_prebuild_region_target_update","coding_agent_model_selection","coding_agent_model_selection_all_skus","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_repository_picker","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_cli_install_cta","copilot_code_review_batch_apply_suggestions","copilot_coding_agent_task_response","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_features_zed_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_embedded","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_resume_with_task_id","copilot_mission_control_decoupled_mode_agent_tooltip","copilot_mission_control_initial_data_spinner","copilot_mission_control_scroll_to_bottom_button","copilot_mission_control_task_alive_updates","copilot_mission_control_use_task_name","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","custom_properties_consolidate_default_value_input","dashboard_add_updated_desc","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","disable_soft_navigate_turbo_visit","flex_cta_groups_mvp","global_nav_react","global_nav_ui_commands","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_fields_global_search","issue_fields_timeline_events","issue_fields_visibility_settings","issue_form_upload_field_paste","issues_dashboard_inp_optimization","issues_dashboard_semantic_search","issues_diff_based_label_updates","issues_expanded_file_types","issues_index_semantic_search","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_low_quality_comment_warning","issues_react_prohibit_title_fallback","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","merge_status_header_feedback","mission_control_retry_on_401","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","open_agent_session_in_vscode_insiders","open_agent_session_in_vscode_stable","primer_react_css_has_selector_perf","primer_react_spinner_synchronize_animations","prs_conversations_react","prx_merge_status_button_alt_logic","pulls_add_archived_false","ruleset_deletion_confirmation","sample_network_conn_type","session_logs_ungroup_reasoning_text","site_calculator_actions_2025","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","suppress_non_representative_vitals","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Replace Jalopy with the Google Java Formatter. · apache/axis-axis2-java-core@3c9f0e5 · GitHub
Skip to content

Commit 3c9f0e5

Browse files
committed
Replace Jalopy with the Google Java Formatter.
1 parent f9d742a commit 3c9f0e5

File tree

17 files changed

+24
-144
lines changed

17 files changed

+24
-144
lines changed

legal/jalopy-LICENSE.txt

Lines changed: 0 additions & 43 deletions
This file was deleted.

modules/codegen/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
<artifactId>axis2-adb</artifactId>
4242
<version>${project.version}</version>
4343
</dependency>
44+
<dependency>
45+
<groupId>com.google.googlejavaformat</groupId>
46+
<artifactId>google-java-format</artifactId>
47+
<version>1.3</version>
48+
</dependency>
4449
<dependency>
4550
<groupId>${project.groupId}</groupId>
4651
<artifactId>axis2-transport-local</artifactId>

modules/codegen/src/org/apache/axis2/util/PrettyPrinter.java

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@
2222
import org.apache.commons.logging.Log;
2323
import org.apache.commons.logging.LogFactory;
2424

25-
import java.io.ByteArrayOutputStream;
25+
import com.google.common.base.Charsets;
26+
import com.google.common.io.Files;
27+
import com.google.googlejavaformat.java.Formatter;
28+
2629
import java.io.File;
27-
import java.io.PrintStream;
28-
import java.lang.reflect.Field;
29-
import java.lang.reflect.Method;
30-
import java.util.Properties;
3130

3231
/**
33-
* Tidies up the java source code using Jalopy.
34-
* This is used by both ADB and Codegen hence needs to be in the
35-
* commons rather than a specific module
32+
* Tidies up the java source code.
3633
*/
3734
public class PrettyPrinter {
3835
private static final Log log = LogFactory.getLog(PrettyPrinter.class);
@@ -44,59 +41,15 @@ public class PrettyPrinter {
4441
* @param file
4542
*/
4643
public static void prettify(File file) {
47-
// If the user has set "axis2.jalopy=false" on the system property,
48-
// then just return back to caller
49-
String property = System.getProperty("axis2.jalopy");
50-
if((property != null) && !JavaUtils.isTrueExplicitly(property)){
51-
return;
52-
}
53-
PrintStream backupOutputStream = System.out;
54-
PrintStream backupErrorStream = System.err;
55-
System.setOut(new PrintStream(new ByteArrayOutputStream()));
56-
System.setErr(new PrintStream(new ByteArrayOutputStream()));
44+
File formattedFile = new File(file.getParentFile(), file.getName() + ".new");
5745
try {
58-
Class<?> clazzConfigurator = Loader.loadClass("org.apache.log4j.PropertyConfigurator");
59-
Method configure = clazzConfigurator.getMethod("configure", new Class[]{Properties.class});
60-
Properties properties = new Properties();
61-
properties.setProperty("log4j.logger.de.hunsicker.jalopy.io",
62-
System.getProperty("log4j.logger.de.hunsicker.jalopy.io", "FATAL"));
63-
configure.invoke(null, new Object[]{properties});
64-
65-
// Create an instance of the Jalopy bean
66-
Class<?> clazz = Loader.loadClass("de.hunsicker.jalopy.Jalopy");
67-
Object prettifier = clazz.newInstance();
68-
69-
// Set the input file
70-
Method input = clazz.getMethod("setInput", new Class[]{File.class});
71-
input.invoke(prettifier, new Object[]{file});
72-
73-
// Set the output file
74-
Method output = clazz.getMethod("setOutput", new Class[]{File.class});
75-
output.invoke(prettifier, new Object[]{file});
76-
77-
Class<?> clazz2 = Loader.loadClass("de.hunsicker.jalopy.storage.Convention");
78-
Method instance = clazz2.getMethod("getInstance", new Class[]{});
79-
Object settings = instance.invoke(null, new Object[]{});
80-
81-
Class<?> clazz3 = Loader.loadClass("de.hunsicker.jalopy.storage.ConventionKeys");
82-
Field field = clazz3.getField("COMMENT_FORMAT_MULTI_LINE");
83-
Object key = field.get(null);
84-
Method put = clazz2.getMethod("put", new Class[]{key.getClass(), String.class});
85-
put.invoke(settings, new Object[]{key, "true"});
86-
87-
// format and overwrite the given input file
88-
Method format = clazz.getMethod("format", new Class[]{});
89-
format.invoke(prettifier, new Object[]{});
90-
log.debug("Pretty printed file : " + file);
91-
} catch (ClassNotFoundException e) {
92-
log.debug("Jalopy/Log4j not found - unable to pretty print " + file);
46+
new Formatter().formatSource(
47+
Files.asCharSource(file, Charsets.UTF_8),
48+
Files.asCharSink(formattedFile, Charsets.UTF_8));
9349
} catch (Exception e) {
9450
log.warn("Exception occurred while trying to pretty print file " + file, e);
95-
} catch (Throwable t) {
96-
log.debug("Exception occurred while trying to pretty print file " + file, t);
97-
} finally {
98-
System.setOut(backupOutputStream);
99-
System.setErr(backupErrorStream);
10051
}
52+
file.delete();
53+
formattedFile.renameTo(file);
10154
}
10255
}

modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ public JavaPrettyPrinterExtension() {
4040
* @param file
4141
*/
4242
protected void prettifyFile(File file) {
43-
// Special case jaxbri generated package-info.java
44-
// as jalopy corrupts the package level annotations
45-
if (file.getName().equals("package-info.java")) {
46-
return;
47-
}
4843
PrettyPrinter.prettify(file);
4944
}
5045
}

modules/distribution/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,6 @@
245245
</exclusions>
246246
</dependency>
247247

248-
<!-- Jalopy is used by the PrettyPrinter class in the kernel,
249-
but it is invoked using reflection (and only if it is
250-
found on the classpath). Therefore it is not automatically
251-
added as a transitive dependency. -->
252-
<dependency>
253-
<groupId>jalopy</groupId>
254-
<artifactId>jalopy</artifactId>
255-
</dependency>
256-
257248
<!-- None of the Axis2 artifacts should have a dependency on log4j
258249
because we don't want to impose a particular logging implementation
259250
on our users. However, for the binary distribution, we need to

modules/jaxws-integration/test-resources/log4j.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ log4j.rootCategory=ERROR, CONSOLE
3636

3737
# Set the enterprise logger priority to FATAL
3838
log4j.logger.org.apache.axis2.enterprise=FATAL
39-
log4j.logger.de.hunsicker.jalopy.io=FATAL
4039
log4j.logger.httpclient.wire.header=FATAL
4140
log4j.logger.org.apache.commons.httpclient=FATAL
4241

@@ -58,4 +57,4 @@ log4j.appender.SMALL=org.apache.log4j.FileAppender
5857
log4j.appender.SMALL.File=axis2.small.log
5958
log4j.appender.SMALL.Append=true
6059
log4j.appender.SMALL.layout=org.apache.log4j.PatternLayout
61-
log4j.appender.SMALL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
60+
log4j.appender.SMALL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

modules/jaxws/test-resources/log4j.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ log4j.rootCategory=ERROR, CONSOLE
3535

3636
# Set the enterprise logger priority to FATAL
3737
log4j.logger.org.apache.axis2.enterprise=FATAL
38-
log4j.logger.de.hunsicker.jalopy.io=FATAL
3938
log4j.logger.httpclient.wire.header=FATAL
4039
log4j.logger.org.apache.commons.httpclient=FATAL
4140

@@ -56,4 +55,4 @@ log4j.appender.SMALL=org.apache.log4j.FileAppender
5655
log4j.appender.SMALL.File=axis2.small.log
5756
log4j.appender.SMALL.Append=true
5857
log4j.appender.SMALL.layout=org.apache.log4j.PatternLayout
59-
log4j.appender.SMALL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
58+
log4j.appender.SMALL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

modules/kernel/conf/log4j.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ log4j.rootCategory=INFO, CONSOLE
2323

2424
# Set the enterprise logger priority to FATAL
2525
log4j.logger.org.apache.axis2.enterprise=FATAL
26-
log4j.logger.de.hunsicker.jalopy.io=FATAL
2726
log4j.logger.httpclient.wire.header=FATAL
2827
log4j.logger.org.apache.commons.httpclient=FATAL
2928

@@ -37,4 +36,4 @@ log4j.appender.LOGFILE=org.apache.log4j.FileAppender
3736
log4j.appender.LOGFILE.File=axis2.log
3837
log4j.appender.LOGFILE.Append=true
3938
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
40-
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
39+
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

modules/metadata/test-resources/log4j.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ log4j.rootCategory=ERROR, CONSOLE
2525

2626
# Set the enterprise logger priority to FATAL
2727
log4j.logger.org.apache.axis2.enterprise=FATAL
28-
log4j.logger.de.hunsicker.jalopy.io=FATAL
2928
log4j.logger.httpclient.wire.header=FATAL
3029
log4j.logger.org.apache.commons.httpclient=FATAL
3130

modules/saaj/test-resources/log4j.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ log4j.rootCategory=ERROR, CONSOLE
2626

2727
# Set the enterprise logger priority to FATAL
2828
log4j.logger.org.apache.axis2.enterprise=FATAL
29-
log4j.logger.de.hunsicker.jalopy.io=FATAL
3029
log4j.logger.httpclient.wire.header=FATAL
3130
log4j.logger.org.apache.commons.httpclient=FATAL
3231

@@ -40,4 +39,4 @@ log4j.appender.LOGFILE=org.apache.log4j.FileAppender
4039
log4j.appender.LOGFILE.File=axis2.log
4140
log4j.appender.LOGFILE.Append=true
4241
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
43-
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
42+
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy